Salome HOME
c88ff1eb502c577e6c9094332d6f6c2155d70dbc
[plugins/canrecplugin.git] / doc / salome / examples / canrecplugindemo.py
1 # Canonical Recognition
2 import os
3 import salome
4 salome.salome_init()
5 from salome.geom import geomBuilder
6 import GEOM
7 geompy = geomBuilder.New( salome.myStudy )
8
9 # Import Shape
10 path = os.path.join(os.getenv("DATA_DIR"), "Shapes/Iges/geom.igs")
11 shape_igs = geompy.ImportIGES(path)
12
13 # Build Canonical Recognition
14 shape_cr = geompy.MakeCanonicalRecognition(shape_igs, True, True, 0.01)
15
16 # Publish in the study
17 geompy.addToStudy( shape_igs, 'Import from IGS' )
18 geompy.addToStudy( shape_cr, 'Canonical Recognition' )
19
20 # Print what is information
21 print "========================================================="
22 print "Information about original shape:"
23 print geompy.WhatIs(shape_igs)
24 print "========================================================="
25 print "Information about converted shape:"
26 print geompy.WhatIs(shape_cr)