6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
12 sphere = geompy.MakeSphereR(100)
14 tmpdir = tempfile.mkdtemp()
17 f_brep = os.path.join(tmpdir,
"sphere.brep")
18 geompy.ExportBREP(sphere, f_brep)
21 f_iges = os.path.join(tmpdir,
"sphere.iges")
22 geompy.ExportIGES(sphere, f_iges,
"5.3")
25 f_step = os.path.join(tmpdir,
"sphere.step")
26 geompy.ExportSTEP(sphere, f_step, GEOM.LU_MILLIMETER)
29 f_stl1 = os.path.join(tmpdir,
"sphere1.stl")
30 geompy.ExportSTL(sphere, f_stl1,
False)
33 f_stl2 = os.path.join(tmpdir,
"sphere2.stl")
34 geompy.ExportSTL(sphere, f_stl2,
True, 0.1)
37 f_vtk1 = os.path.join(tmpdir,
"sphere1.vtk")
38 geompy.ExportVTK(sphere, f_vtk1)
41 f_vtk2 = os.path.join(tmpdir,
"sphere2.vtk")
42 geompy.ExportVTK(sphere, f_vtk2, 0.1)
45 f_xao = os.path.join(tmpdir,
"sphere.xao")
46 geompy.ExportXAO(sphere, [], [],
"author", f_xao)
49 sphere_brep = geompy.ImportBREP(f_brep)
52 sphere_iges = geompy.ImportIGES(f_iges)
55 sphere_step1 = geompy.ImportSTEP(f_step)
58 sphere_step2 = geompy.ImportSTEP(f_step,
True)
61 sphere_stl1 = geompy.ImportSTL(f_stl1)
62 sphere_stl2 = geompy.ImportSTL(f_stl2)
65 ok, sphere_xao, sub_shapes, groups, fields = geompy.ImportXAO(f_xao)
68 for f
in f_brep, f_iges, f_step, f_stl1, f_stl2, f_vtk1, f_vtk2, f_xao: