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)
Esempio n. 2
0
    def __init__(self):
        super(Sketch_CommandBSpline, self).__init__("BSplineCurve.")
        self.IndexCounter = 1
        self.myDegree = SKETCH_DEGREE
        self.tempPnt2d = gp.Origin2d()
        self.myFirstgp_Pnt = gp.Origin()
        self.tempPnt = gp.Origin()
        self.curEdge = TopoDS_Edge()

        self.myBSplineCurveAction = BSplineCurveAction.Nothing
        self.Poles2d = [gp.Origin2d()] * 2
        self.Poles = [gp.Origin()] * 2
        self.Multi, self.Knots = setQuasiUniformKnots(len(self.Poles),
                                                      self.myDegree)

        curgp_Array1CurvePoles2d = point_list_to_TColgp_Array1OfPnt2d(
            self.Poles2d)
        curgp_Array1CurveMulti = int_list_to_TColStd_Array1OfInteger(
            self.Multi)
        curgp_Array1CurveKnots = float_list_to_TColStd_Array1OfReal(self.Knots)
        self.myGeom2d_BSplineCurve = Geom2d_BSplineCurve(
            curgp_Array1CurvePoles2d, curgp_Array1CurveKnots,
            curgp_Array1CurveMulti, self.myDegree)

        curgp_Array1CurvePoles = point_list_to_TColgp_Array1OfPnt(self.Poles)
        self.myGeom_BSplineCurve = Geom_BSplineCurve(curgp_Array1CurvePoles,
                                                     curgp_Array1CurveKnots,
                                                     curgp_Array1CurveMulti,
                                                     self.myDegree)

        self.myRubberAIS_Shape = AIS_Shape(self.curEdge)
    def __init__(self):
        super(Sketch_CommandBezierCurve, self).__init__("BezierCurve.")
        self.IndexCounter = 1
        self.tempPnt2d = gp.Origin2d()
        self.myFirstgp_Pnt = gp.Origin()
        self.tempPnt = gp.Origin()
        self.curEdge = TopoDS_Edge()

        self.myBezierCurveAction = BezierCurveAction.Nothing
        curgp_Array1CurvePoles2d = TColgp_Array1OfPnt2d(1, 2)
        curgp_Array1CurvePoles2d.SetValue(1, gp.Origin2d())
        curgp_Array1CurvePoles2d.SetValue(2, gp.Origin2d())
        self.myGeom2d_BezierCurve = Geom2d_BezierCurve(
            curgp_Array1CurvePoles2d)

        curgp_Array1CurvePoles = TColgp_Array1OfPnt(1, 2)
        curgp_Array1CurvePoles.SetValue(1, gp.Origin())
        curgp_Array1CurvePoles.SetValue(2, gp.Origin())
        self.myGeom_BezierCurve = Geom_BezierCurve(curgp_Array1CurvePoles)

        self.myRubberAIS_Shape = AIS_Shape(self.curEdge)
Esempio n. 4
0
 def prop_edge(self, edge=TopoDS_Edge()):
     edge_adaptor = BRepAdaptor_Curve(edge)
     edge_line = edge_adaptor.Line()
     return edge_line