Demonstrates how to perform recognition of machining 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 machining features on a 3D model using machining feature recognition tool (Machining_FeatureRecognizer). For this purpose, used a console application that imports a model, traverses through unique ModelData::Part , creates and runs Machining_FeatureRecognizer, groups and prints information about found features and their parameters into console. Machining feature recognition will be performed for each unique ModelData::Part , but only for the scope of accepted geometries.
Application needs 2 input arguments to run:
For more information about feature recognition visit Overview page.
PartProcessor
class is inherited from SolidProcessor
and overrides ProcessSolid
method that are used to run Machining_FeatureRecognizer on given shape. The Machining_FeatureRecognizerParameters.SetOperation() method of the tool parameters is used to set the type of operation (Milling or LatheMilling). The operation type will be taking into account during recognition process and the recognition result will be different depending on it. 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 SolidProcessor
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 machining 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 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/Fresamento_CAM1_v3.stp
and operation set to Milling
.
The model | Example output |
---|---|
![]() | Model: Fresamento_CAM1_v3.stp Part #0 ["Fresamento_CAM1"] - solid #0 has: Concave Fillet Edge Milling Face(s): 14 14 Turning Face(s) with radius: 5 mm Convex Profile Edge Milling Face(s): 7 4 Turning Face(s) with radius: 10 mm 3 Turning Face(s) with radius: 15 mm Curved Milled Face(s): 5 Flat Face Milled Face(s): 3 Flat Side Milled Face(s): 3 Countersink(s): 4 4 Countersink(s) with radius: 7.5 mm depth: 4.57781 mm axis: (0.00, 1.00, 0.00) Through Hole(s): 1 1 Hole(s) with radius: 12.5 mm depth: 25 mm axis: (0.00, -1.00, 0.00) Flat Bottom Hole(s): 3 3 Hole(s) with radius: 7.5 mm depth: 8 mm axis: (0.00, -1.00, 0.00) Blind Hole(s): 7 4 Hole(s) with radius: 4.263 mm depth: 31.3245 mm axis: (0.00, -1.00, 0.00) 3 Hole(s) with radius: 5 mm depth: 25.0043 mm axis: (0.00, -1.00, 0.00) Pocket(s): 4 1 Pocket(s) with length: 61.7043 mm width: 49.2432 mm depth: 20.132 mm axis: (0.00, 1.00, 0.00) 1 Pocket(s) with length: 100 mm width: 65.3716 mm depth: 21.2428 mm axis: (0.00, 1.00, 0.00) 1 Pocket(s) with length: 133.792 mm width: 106.223 mm depth: 25.7205 mm axis: (0.00, 1.00, 0.00) 1 Pocket(s) with length: 145.925 mm width: 98.3509 mm depth: 10.5556 mm axis: (0.00, 1.00, 0.00) Total features: 51 |
Another example below is an output for model from ./examples/models/senthi.step
and operation set to Lathe+Milling
.
The model | Example output |
---|---|
![]() | Model: senthi.step Part #0 ["drawing no 1"] - solid #0 has: Bore Face(s): 2 1 Turning Face(s) with radius: 62.5 mm 1 Turning Face(s) with radius: 65 mm Turn Diameter Face(s): 7 1 Turning Face(s) with radius: 50 mm 1 Turning Face(s) with radius: 75 mm 1 Turning Face(s) with radius: 80 mm 1 Turning Face(s) with radius: 86 mm 1 Turning Face(s) with radius: 90 mm 1 Turning Face(s) with radius: 96.4288 mm 1 Turning Face(s) with radius: 155 mm Turn Face Face(s): 7 1 Turning Face(s) with radius: 62.5 mm 1 Turning Face(s) with radius: 70 mm 1 Turning Face(s) with radius: 80 mm 1 Turning Face(s) with radius: 82 mm 1 Turning Face(s) with radius: 90 mm 2 Turning Face(s) with radius: 155 mm Turn Form Face(s): 3 1 Turning Face(s) with radius: 55.3169 mm 1 Turning Face(s) with radius: 72.5 mm 1 Turning Face(s) with radius: 82.5 mm Total features: 19 |