def __init__(self): self.data = [] self.curHilightedObj = None self.ProjectOnCurve = Geom2dAPI_ProjectPointOnCurve() self.curCoordinateSystem = gp_Ax3(gp.XOY()) self.FirstEdge = TopoDS_Edge() self.SecondEdge = TopoDS_Edge() self.curPnt2d = gp.Origin2d() self.objectPnt2d = gp.Origin2d() self.bestPnt2d = gp.Origin2d() self.findbestPnt2d = False self.firstDisplay = True self.myGeom_Point = Geom_CartesianPoint(gp.Origin()) self.myAIS_Point = AIS_Point(self.myGeom_Point) self.myAIS_Point.SetColor(Quantity_Color(Quantity_NOC_YELLOW)) self.myAIS_Point.SetWidth(5.0) self.myAIS_Point.SetMarker(Aspect_TOM_O_POINT) self.minimumSnapDistance = MINIMUMSNAP self.minDistance = 0 self.curDistance = 0 self.curGeom2d_Point = Geom2d_CartesianPoint(self.curPnt2d) self.myPlane = Geom_Plane(self.curCoordinateSystem)
def __init__(self, name): self.data = [] self.rootNode: Node = None self.objectName = name self.objectCounter = 0 self.curCoordinateSystem = gp_Ax3(gp.XOY()) self.myType = Sketch_ObjectType.MainSketchType self.myColor = Quantity_Color(Quantity_NOC_YELLOW) self.myStyle = Aspect_TOL_SOLID self.myWidth = 1.0 self.myPrs3dAspect = Prs3d_LineAspect(self.myColor, self.myStyle, self.myWidth) self.myPolylineMode = False self.curPnt2d = gp.Origin2d() self.myFirstgp_Pnt2d = gp.Origin2d() self.mySecondgp_Pn2d = gp.Origin2d() self.myFirstPoint: Geom_CartesianPoint = Geom_CartesianPoint( gp.Origin()) self.mySecondPoint: Geom_CartesianPoint = Geom_CartesianPoint( gp.Origin()) self.myRubberLine = AIS_Line(self.myFirstPoint, self.mySecondPoint) self.myRubberLine.SetColor(Quantity_Color(Quantity_NOC_LIGHTPINK1))
def _ellipse(r1, r2) -> Curve: return Curve(Geom_Ellipse(gp.XOY(), r1, r2))
def _circle(radius) -> Curve: return Curve(Geom_Circle(gp.XOY(), radius))