sketch.setEqual(top.result(), bottom.result())
sketch.setEqual(h1.result(), h2.result())
- sketch.setLength(top.result(), "P")
- sketch.setLength(right.result(), 16)
- sketch.setLength(v1.result(), 16)
- sketch.setLength(h2.result(), 20)
-
sketch.setCoincident(arc.center(), v1.result())
sketch.setCoincident(arc.startPoint(), h2.endPoint())
sketch.setCoincident(arc.endPoint(), h1.startPoint())
model.do() #!!!
+ # Dimensions
+ sketch.setLength(v1.result(), 16)
+ sketch.setLength(h2.result(), 20)
+ sketch.setLength(right.result(), 16)
+ sketch.setLength(top.result(), "P")
+ model.do()
+
# Create extrusion
body = model.addExtrusion(part, sketch.selectFace(), "-E")
aDocument.removeFeature(aConstraint)
aSession.finishOperation()
aSession.startOperation()
-aLineStartPoint.setValue(50., 0.)
+aLineStartPoint.setValue(70., 0.)
aSession.finishOperation()
assert (anArcEndPoint.x() != aLineStartPoint.x() or anArcEndPoint.y() != aLineStartPoint.y())
# Auxiliary functions
#=========================================================================
def checkMirror(theListInit, theListMirr, theMirrorLine):
+ TOL = 1.e-8
aListSize = theListInit.size()
aLineStartPoint = geomDataAPI_Point2D(theMirrorLine.attribute("StartPoint"))
aDirX = aPointC.x() - aPointB.x()
aDirY = aPointC.y() - aPointB.y()
aDot = aLineDirX * aDirX + aLineDirY * aDirY
- assert(math.fabs(aDot) < 1.e-10)
+ assert math.fabs(aDot) < TOL, "aDot = {0}".format(aDot)
aDirX = aLineEndPoint.x() - 0.5 * (aPointB.x() + aPointC.x())
aDirY = aLineEndPoint.y() - 0.5 * (aPointB.y() + aPointC.y())
aCross = aLineDirX * aDirY - aLineDirY * aDirX
- assert(math.fabs(aCross) < 1.e-10)
+ assert math.fabs(aCross) < TOL, "aCross = {0}".format(aCross)
#=========================================================================