1 # Canonical Recognition
5 from salome.geom import geomBuilder
7 geompy = geomBuilder.New( salome.myStudy )
10 path = os.path.join(os.getenv("DATA_DIR"), "Shapes/Iges/geom.igs")
11 shape_igs = geompy.ImportIGES(path)
13 # Build Canonical Recognition
14 shape_cr = geompy.MakeCanonicalRecognition(shape_igs, True, True, 0.01)
16 # Get the number of canonical faces
17 init_nb_f = geompy.GetNbCanonicalFaces(shape_igs)
18 res_nb_f = geompy.GetNbCanonicalFaces(shape_cr)
20 print "Number of canonical faces in the initial shape: %s" % init_nb_f
21 print "Number of canonical faces in the result shape: %s" % res_nb_f
23 # Publish in the study
24 geompy.addToStudy( shape_igs, 'Import from IGS' )
25 geompy.addToStudy( shape_cr, 'Canonical Recognition' )
27 # Print what is information
28 print "========================================================="
29 print "Information about original shape:"
30 print geompy.WhatIs(shape_igs)
31 print "========================================================="
32 print "Information about converted shape:"
33 print geompy.WhatIs(shape_cr)