Start a conversation

Volume Computation Python Script

This program illustrates how to compute the reference and deformed volume between two surfaces given as two separate AOIs in the data file. The data set must contain two AOIs corresponding to the two surfaces. The script is intended for working with front and back views of, e.g., tensile specimens.

The correspondence between points is based on the X/Y coordinates.

Using the Script

To begin, the attached .py files should be placed in the same folder as the data files for convenience (or, you can place the .py files elsewhere and specify the full path when running.)

The folder should contain a set of data files which each contain the front and back data for the specimen - typically, this data would have been combined using the Combine data files function in Vic-3D.

Run the script by specifying the output prefix to prepend to the file name (for the new modified files) as the first argument, and the input mask (for the existing OUT files) as the second:

> python compute_volume.py volume_ stage*.out

This command will find all .OUT files starting with "stage", and prepend "volume_" so that the output files start with "volume_stage_".

The script will begin processing the files and displaying the progress:

When complete, there will be a new set of files in the folder containing variables for thickness and cubic volume for each node. These can be viewed in Vic-3D by selecting Project... Data files from the main menu and adding the files.

compute_volume.zip

  1. 10 KB
  2. View
  3. Download
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Micah Simonsen

  2. Posted
  3. Updated

Comments