4 ### This file is generated automatically by SALOME v9.4.0 with dump python functionality
15 from salome.shaper import model
18 partSet = model.moduleDocument()
19 Part_1 = model.addPart(partSet)
20 Part_1_doc = Part_1.document()
21 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
22 Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Box_1_1/Top")])
27 ### SHAPERSTUDY component
34 anExportFeature = Part_1_doc.addFeature("PublishToStudy")
38 face = salome.myStudy.FindObjectByPath("/ShaperResults/Face_1_1").GetObject()
40 shaper = face.GetGen()
41 print(shaper.ComponentDataType())
44 shaper = shaperBuilder.New()
46 from salome.smesh import smeshBuilder
47 smesh = smeshBuilder.New(instanceGeom=shaper)
49 vv = shaper.ExtractShapes( face, shaper.ShapeType["VERTEX"])
51 assert vv[0].GetShapeType() == GEOM.VERTEX
52 ee = shaper.ExtractShapes( face, shaper.ShapeType["EDGE"])
54 assert ee[0].GetShapeType() == GEOM.EDGE
56 eGroup = shaper.CreateGroup( face, shaper.ShapeType["EDGE"])
57 eGroup.SetEntry("eGroup") # enable adding to study
58 shaper.addToStudyInFather( face, eGroup, "eGroup" )
59 shaper.UnionList( eGroup, ee )
61 meshOnFace = smesh.Mesh( face )
62 meshOnEdge = smesh.Mesh( ee[0] )
64 ind = shaper.GetSubShapeID( face, vv[0] )
67 d = shaper.MinDistance( vv[0], vv[1] )
72 axis = smesh.GetAxisStruct( face )
76 s = shaper.GetSubShape( face, [2] )
77 print (s.GetShapeType())
78 assert s.GetShapeType() == GEOM.WIRE
79 name = meshOnFace.GetSubShapeName( 2 )
84 dim = meshOnFace.MeshDimension()
86 dim = meshOnEdge.MeshDimension()
90 smeshBuilder.AssureGeomPublished( meshOnFace, ee[0] )
94 algo = meshOnFace.Segment()
95 l = algo.ReversedEdgeIndices([(ee[0],vv[0])])
98 ### unnecessary methods that can be accidentally called from any module
100 face.GetTopologyType()
101 face.GetMinShapeType()
102 face.GetMaxShapeType()
103 face.GetSubShapeName(1)
104 face.SetColor(SALOMEDS.Color( 0,0,0 ))
108 face.SetMarkerStd(GEOM.MT_NONE, GEOM.MS_NONE)
109 face.SetMarkerTexture(0)
112 face.GetMarkerTexture()
115 if salome.sg.hasDesktop():
116 salome.sg.updateObjBrowser()