Demonstrates how to perform recognition of sheet metal features on a 3D model and print information about found features and their parameters in a console.
In this example demonstrates how to perform recognition of sheet metal features on a 3D model using sheet metal feature recognition tool (SheetMetal_FeatureRecognizer). For this purpose, used a console application that imports a model, traverses through unique ModelData::Part , creates and runs SheetMetal_FeatureRecognizer, groups and prints information about found features and their parameters into console. Sheet metal feature recognition will be performed for each unique ModelData::Part , but only for the scope of accepted geometries.
Application needs 1 input argument to run:
For more information about feature recognition visit Sheet Metal page.
PartProcessor
class is inherited from ShapeProcessor
and overrides ProcessSolid
and ProcessShell
methods that are used to run SheetMetal_FeatureRecognizer on given shapes. Then PrintFeatures
method is used to print information about found features and their parameters in a console.
Visit Model Explore Helper Implementation page for more information about base ShapeProcessor
class implementation.
To traverse only unique parts of the imported model, the ModelData::ModelElementUniqueVisitor class is used.
After performing feature recognition, the object of FeatureGroupManager
class is used to group and sort found sheet metal features. For this purpose, there is a traverse through all found features and add each of them to FeatureGroupManager
with a specified name.
After adding all found features to FeatureGroupManager
, a Print
method of the manager is used to print information about found features and their parameters in a console. PrintFeatureParameters
is created to explore and print MTK feature parameters. It uses as an input parameter of Print
method.
Visit Feature Group Helper Implementation page for more information about FeatureGroupManager
class implementation.
Below is the example output for model from ./examples/models/Power_box_Chasis.stp
.
Model | Example output |
---|---|
![]() | Model: Power_box_Chasis Part #0 ["power box sheetmetal"] - solid #0 has: Bend(s): 8 2 Bend(s) with radius: 0.7366 mm angle: 90 deg length: 1.15705 mm width: 60 mm 2 Bend(s) with radius: 0.7366 mm angle: 90 deg length: 1.15705 mm width: 137.327 mm 4 Bend(s) with radius: 0.7366 mm angle: 90 deg length: 1.15705 mm width: 148 mm ... Total features: 76 |