(self, wire)
return comp_curve
Private method that takes a TopoDS_Wire and transforms it into a
        Bspline_Curve.

        :param TopoDS_Wire wire: the TopoDS_Face to be converted
        :rtype: Geom_BSplineSurface
Private method that takes a TopoDS_Wire and transforms it into a
        Bspline_Curve.
Private method that takes a TopoDS_Wire and transforms it into a Bspline_Curve .
def _bspline_curve_from_wire(self, wire):
        """
        Private method that takes a TopoDS_Wire and transforms it into a
        Bspline_Curve.

        :param TopoDS_Wire wire: the TopoDS_Face to be converted
        :rtype: Geom_BSplineSurface
        """
        if not isinstance(wire, TopoDS_Wire):
            raise TypeError("wire must be a TopoDS_Wire")

        # joining all the wire edges in a single curve here
        # composite curve builder (can only join Bspline curves)
        composite_curve_builder = GeomConvert_CompCurveToBSplineCurve()

        # iterator to edges in the TopoDS_Wire
        edge_explorer = TopExp_Explorer(wire, TopAbs_EDGE)
        while edge_explorer.More():
            # getting the edge from the iterator
            edge = topods_Edge(edge_explorer.Current())

            # edge can be joined only if it is not degenerated (zero length)
            if BRep_Tool.Degenerated(edge):
                edge_explorer.Next()
                continue

            # the edge must be converted to Nurbs edge
            nurbs_converter = BRepBuilderAPI_NurbsConvert(edge)
            nurbs_converter.Perform(edge)
            nurbs_edge = topods_Edge(nurbs_converter.Shape())

            # here we extract the underlying curve from the Nurbs edge
            nurbs_curve = BRep_Tool_Curve(nurbs_edge)[0]

            # we convert the Nurbs curve to Bspline curve
            bspline_curve = geomconvert_CurveToBSplineCurve(nurbs_curve)

            # we can now add the Bspline curve to the composite wire curve
            composite_curve_builder.Add(bspline_curve, self.tolerance)
            edge_explorer.Next()

        # GeomCurve obtained by the builder after edges are joined
        comp_curve = composite_curve_builder.BSplineCurve()
        return comp_curve
def _bspline_curve_from_wire ( self , wire ) : if not isinstance ( wire , TopoDS_Wire ) : raise TypeError ( "wire must be a TopoDS_Wire" ) # joining all the wire edges in a single curve here # composite curve builder (can only join Bspline curves) composite_curve_builder = GeomConvert_CompCurveToBSplineCurve ( ) # iterator to edges in the TopoDS_Wire edge_explorer = TopExp_Explorer ( wire , TopAbs_EDGE ) while edge_explorer . More ( ) : # getting the edge from the iterator edge = topods_Edge ( edge_explorer . Current ( ) ) # edge can be joined only if it is not degenerated (zero length) if BRep_Tool . Degenerated ( edge ) : edge_explorer . Next ( ) continue # the edge must be converted to Nurbs edge nurbs_converter = BRepBuilderAPI_NurbsConvert ( edge ) nurbs_converter . Perform ( edge ) nurbs_edge = topods_Edge ( nurbs_converter . Shape ( ) ) # here we extract the underlying curve from the Nurbs edge nurbs_curve = BRep_Tool_Curve ( nurbs_edge ) [ 0 ] # we convert the Nurbs curve to Bspline curve bspline_curve = geomconvert_CurveToBSplineCurve ( nurbs_curve ) # we can now add the Bspline curve to the composite wire curve composite_curve_builder . Add ( bspline_curve , self . tolerance ) edge_explorer . Next ( ) # GeomCurve obtained by the builder after edges are joined comp_curve = composite_curve_builder . BSplineCurve ( ) return comp_curve