Demonstrates how to compute minimum and maximum wall thickness of a 3D model and print the result in a console.
This example demonstrates how to compute minimum and maximum wall thickness of a 3D model using wall thickness analysis tool (WallThickness_Analyzer). For this purpose, used a console application that imports a model. Wall thickness analysis will be performed for each unique ModelData.Part , but only for the scope of accepted geometries.
Application needs 1 or 2 input arguments to run:
For more information about wall thickness visit Wall Thickness Calculation page.
To explore the model and process ModelData.Part , it's need to create an inheritor from the ModelData.ModelElementVoidVisitor and override the part processing method void operator() (const ModelData::Part& thePart). For this purpose, the SolidProcessor and PartProcessor classes were created. In operator() method a ModelData.Part is examined for the presence of ModelData.Solid shapes in it.
ProcessSolid method is used to run wall thickness analysis for given entities.
PrintWTData method is used to retrieve minimum and maximum thickness from computed WallThickness_Data and print these values to console.
To traverse only unique parts of the imported model, the ModelData.ModelElementUniqueVisitor class is used.
Below is the example output for model from ./examples/models/barrel.stp and resolution set to 1000.
| Model | Example output |
|---|---|
| Model: barrel
Part #0 ["barrel"] - solid #0 has:
Min thickness = 4.526479 mm
Max thickness = 10.036917 mm
|