2 Test case for Construction Plane feature. Written on High API.
10 aSession = ModelAPI_Session.get()
13 aDocument = aSession.activeDocument()
14 aSession.startOperation()
15 model.addPart(aDocument)
16 aDocument = aSession.activeDocument()
17 aSession.finishOperation()
19 # Test a plane by general equation
20 aSession.startOperation()
21 aPlane = model.addPlane(aDocument, 1, 1, 1, 0)
22 aSession.finishOperation()
23 assert (len(aPlane.result()) > 0)
26 aSession.startOperation()
27 aPoint1 = model.addPoint(aDocument, 0, 0, 0)
28 aSession.finishOperation()
31 aSession.startOperation()
32 aPoint2 = model.addPoint(aDocument, 100, 0, 0)
33 aSession.finishOperation()
36 aSession.startOperation()
37 aPoint3 = model.addPoint(aDocument, 50, 50, 50)
38 aSession.finishOperation()
40 # Test a plane by three points
41 aSession.startOperation()
42 aPlane = model.addPlane(aDocument, aPoint1.result()[0], aPoint2.result()[0], aPoint3.result()[0])
43 aSession.finishOperation()
44 assert (len(aPlane.result()) > 0)
47 aSession.startOperation()
48 anAxis = model.addAxis(aDocument, 0, 0, 100)
49 aSession.finishOperation()
51 # Test a plane by line and point
52 aSession.startOperation()
53 aPlane = model.addPlane(aDocument, anAxis.result()[0], aPoint3.result()[0], True)
54 aSession.finishOperation()
55 assert (len(aPlane.result()) > 0)
57 # Test a plane by distance from other
58 aSession.startOperation()
59 aPlane = model.addPlane(aDocument, aPlane.result()[0], 50, False)
60 aSession.finishOperation()
61 assert (len(aPlane.result()) > 0)
63 # Test a plane by coincidence to point
64 aSession.startOperation()
65 aCoincidentPlane = model.addPlane(aDocument, aPlane.result()[0], aPoint2.result()[0])
66 aSession.finishOperation()
67 assert (len(aCoincidentPlane.result()) > 0)
70 aSession.startOperation()
71 anAxis = model.addAxis(aDocument, 100, 0, 0)
72 aSession.finishOperation()
74 # Test a plane by rotation
75 aSession.startOperation()
76 aRotatedPlane = model.addPlane(aDocument, aCoincidentPlane.result()[0], anAxis.result()[0], 45)
77 aSession.finishOperation()
78 assert (len(aRotatedPlane.result()) > 0)
80 # Test plane by two parallel planes
81 aSession.startOperation()
82 aPlane = model.addPlane(aDocument, aCoincidentPlane.result()[0], aPlane.result()[0])
83 aSession.finishOperation()
84 assert (len(aPlane.result()) > 0)
87 assert(model.checkPythonDump())