BSpline2D
Canonical path: NemAll_Python_Geometry.BSpline2D
Bases: PolyPoints2D
class for 2D (non uniform, rational) B-spline geometry
Methods:
-
Clear–Clear data, getting invalid state
-
CreateLine2D–Create BSpline2D from Line2D
-
Get–Return type: tuple(list(Point2D), list(float), list(float), int, bool)
-
GetDegree–Gets spline degree
-
GetKnots–Get knot vector
-
GetWeights–Get control points weights
-
IsClosed–Check if spline is closed ( first/last points are equal )
-
IsRational–Check if the spline is rational
-
IsValid–Check spline validity
-
Reverse–Reverse of current spline
-
Set–Get/Set functions
-
SetDegree–Set spline degree
-
SetKnots–Set knot vector
-
SetPeriodic–Set the periodic flag
-
SetWeights–Set weights for control points
-
__eq__–Comparison of bsplines without tolerance.
-
__init__–Overloaded function. See individual overloads.
-
__repr__–Convert to string
Attributes:
-
Degree(int) –Gets spline degree
-
IsPeriodic(bool) –Check if the spline is periodic
-
Knots(VecDoubleList) –Get knot vector
-
Weights(VecDoubleList) –Get control points weights
CreateLine2D
staticmethod
Get
Return type: tuple(list(Point2D), list(float), list(float), int, bool)
GetKnots
GetKnots() -> VecDoubleList
GetWeights
GetWeights() -> VecDoubleList
IsClosed
Check if spline is closed ( first/last points are equal )
Returns:
-
bool–closed spline true/false
IsRational
Check if the spline is rational
Returns:
-
bool–bool true = rational
Reverse
Reverse of current spline
Method reverse Spline using reverse from PolyPoints and swapping tangents.
Set
Set(
points: Point2DList,
weights: VecDoubleList,
knots: VecDoubleList,
degree: int,
isPeriodic: bool,
)
Get/Set functions
SetKnots
SetKnots(knots: VecDoubleList)
SetPeriodic
Set the periodic flag
Parameters:
-
flag–True if BSpline is periodic
SetWeights
SetWeights(weights: VecDoubleList)
__eq__
__eq__(bspline: BSpline2D) -> object
Comparison of bsplines without tolerance.
Be careful, this method work without tolerance!
Parameters:
-
bspline(BSpline2D) –Compared bspline.
Returns:
-
object–True when bsplines are equal, otherwise false.
__init__
overloaded
Initialize
__init__(
points: Point2DList,
weights: VecDoubleList,
knots: VecDoubleList,
degree: int,
isPeriodic: bool,
)
Constructor from b-spline data. Creates b-spline using provided data.
Parameters:
-
points(Point2DList) –control points of b-spline.
-
weights(VecDoubleList) –weights of b-spline.
-
knots(VecDoubleList) –knots of b-spline.
-
degree(int) –degree of b-spline.
-
isPeriodic(bool) –flag of periodicity of b-spline.
__init__(spline: BSpline2D)