2 Test case for Symmetry feature.
8 from salome.shaper import model
11 aSession = ModelAPI_Session.get()
14 aDocument = aSession.activeDocument()
15 aSession.startOperation()
16 model.addPart(aDocument)
17 aDocument = aSession.activeDocument()
18 aSession.finishOperation()
21 aSession.startOperation()
22 aBox1 = model.addBox(aDocument, 10, 10, 10)
23 aBox2 = model.addBox(aDocument, 10, 10, 10)
24 aBox3 = model.addBox(aDocument, 10, 10, 10)
25 aSession.finishOperation()
27 # Perform a symmetry by a point
28 aSession.startOperation()
29 aPoint = model.addPoint(aDocument, 0, 0, 0).result()
30 aSymmetry1 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_1_1")], aPoint).result()
31 aSession.finishOperation()
32 assert (aSymmetry1 is not None)
34 # Perform a symmetry by an axis
35 aSession.startOperation()
36 anAxis = model.addAxis(aDocument, 10, 0, 0).result()
37 aSymmetry2 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_2_1")], anAxis).result()
38 aSession.finishOperation()
39 assert (aSymmetry2 is not None)
41 # Perform a symmetry by a plane
42 aSession.startOperation()
43 aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
44 aPoint2 = model.addPoint(aDocument, 10, 10, 0).result()
45 aSymmetry3 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_3_1")], model.selection("FACE", "Box_3_1/Top")).result()
46 aSession.finishOperation()
47 assert (aSymmetry3 is not None)