示例#1
0
def test_normalize_knots_if_needed():
    s = BSpline(
        control_points=DEFPOINTS,
        knots=[2, 2, 2, 2, 3, 6, 6, 6, 6],
        order=4,
    )
    k = s.knots()
    assert k[0] == 0.0
示例#2
0
    def apply_construction_tool(self, s: BSpline) -> None:
        """
        Set SPLINE data from construction tool :class:`ezdxf.math.BSpline`.

        .. versionadded:: 0.13

        """
        self.dxf.degree = s.degree
        self.control_points = s.control_points
        self.fit_points = []  # remove fit points
        self.knots = s.knots()
        self.weights = s.weights()
        self.set_flag_state(Spline.RATIONAL, state=bool(len(self.weights)))