Salome HOME
Adjust unit tests
[modules/shaper.git] / src / PythonAPI / examples / MakeBrick2.py
index 0d44f9a1a9bfdc715e14de2b310f3884d9d418c8..1be7e05fde0aad6cf8db3afeb863997ede6693a9 100644 (file)
@@ -22,9 +22,9 @@ mypart = model.addPart(mypartset).document()
 mybase = model.addSketch(mypart, model.defaultPlane("XOY"))
 
 p1 = geom.Pnt2d(0, 0)
-p2 = geom.Pnt2d(0, 1)
-p3 = geom.Pnt2d(1, 1)
-p4 = geom.Pnt2d(1, 0)
+p2 = geom.Pnt2d(0, 25)
+p3 = geom.Pnt2d(25, 25)
+p4 = geom.Pnt2d(25, 0)
 
 line = model.addPolygon(mybase, p1, p2, p3, p4)
 
@@ -32,13 +32,17 @@ mybase.setParallel(line[0], line[2])
 mybase.setParallel(line[1], line[3])
 mybase.setPerpendicular(line[0], line[3])
 
+mybase.setVertical(line[0])
+mybase.setFixed(line[0].startPoint())
+
 mywidth = mybase.setLength(line[0], 50)
 mylength = mybase.setDistance(line[0].startPoint(), line[2], 50)
-
+model.do()
 
 # Creating the extrusion
 
 mybox = model.addExtrusion(mypart, mybase.selectFace(), 50)
+model.do()
 
 
 # Creating a cylinder on a face of the box
@@ -51,9 +55,10 @@ mystand = model.addSketch(mypart, thisface)
 circle = mystand.addCircle(0, 25, 5)
 mystand.setDistance(circle.center(), mystand.addLine(thisxmin), 10)
 mystand.setDistance(circle.center(), mystand.addLine(thiszmax), 10)
+model.do()
 
 myboss = model.addExtrusion(mypart, mystand.selectFace(), -5)
-
+model.do()
 
 # Subtracting the cylinder to the box
 
@@ -65,7 +70,8 @@ model.end()
 
 model.begin()
 mybase.setValue(mylength, 100)
-mybox.setSize(20)
+model.do()
+mybox.setSize(40)
 model.end()
 
-assert(model.checkPythonDump())
\ No newline at end of file
+assert(model.checkPythonDump())