Skip to content

[mxcad_3d API Document](../README. md)/Mx3dGeomBSpline Curve

Class: Mx3dGeomBSplineCurve

Represents a B-spline curve. This class inherits from Mx3dGeomBoundedCurve and encapsulates the operations and properties of B-spline curves.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Mx3dGeomBSplineCurve(Poles, Knots, Multiplicities, Degree)

The constructor is used to create a B-spline curve.

Parameters

NameTypeDescription
Poles[Mx3dGePoint] (Mx3dGePoint. md) []Array of control points
Knotsnumber []Array of node sequences
MultiplicityNumber []The multiplicity of nodes
DegreenumberThe order of the curve

Overrides

Mx3dGeomBoundedCurve.constructor

new Mx3dGeomBSplineCurve(Poles, Weights, Knots, Multiplicities, Degree)

The constructor is used to create a weighted B-spline curve.

Parameters

NameTypeDescription
Poles[Mx3dGePoint] (Mx3dGePoint. md) []Array of control points
Weightsnumber []Weight array of control points
Knotsnumber []Array of node sequences
MultiplicityNumber []The multiplicity of nodes
DegreenumberThe order of the curve

Overrides

Mx3dGeomBoundedCurve.constructor

Methods

Continuity

Continuity(): MxGAShapeEnum

Obtain the continuity of the curve.

Returns

MxGAShapeEnum

The continuity of the curve.


Copy

Copy(): Mx3dGeomObject

Create a copy of the current B-spline curve.

Returns

Mx3dGeomObject

Return a new B-spline curve object.


D0

D0(U, P): void

Calculate the points of the curve at the given parameters.

Parameters

NameTypeDescription
The 'U''number'parameter
P[Mx3dGePoint] (Mx3dGePoint. md)Result point

Returns

void


D1

D1(U, P, V1): void

Calculate the points and first derivative of the curve at the given parameters.

Parameters

NameTypeDescription
The 'U''number'parameter
P[Mx3dGePoint] (Mx3dGePoint. md)Result point
V1[Mx3dGeVec] (Mx3dGeVec. md)First derivative

Returns

void


D2

D2(U, P, V1, V2): void

Calculate the points, first derivative, and second derivative of the curve at the given parameters.

Parameters

NameTypeDescription
The 'U''number'parameter
P[Mx3dGePoint] (Mx3dGePoint. md)Result point
V1[Mx3dGeVec] (Mx3dGeVec. md)First derivative
V2[Mx3dGeVec] (Mx3dGeVec. md)Second derivative

Returns

void


D3

D3(U, P, V1, V2, V3): void

Calculate the points, first derivative, second derivative, and third derivative of the curve at the given parameters.

Parameters

NameTypeDescription
The 'U''number'parameter
P[Mx3dGePoint] (Mx3dGePoint. md)Result point
V1[Mx3dGeVec] (Mx3dGeVec. md)First derivative
V2[Mx3dGeVec] (Mx3dGeVec. md)Second derivative
V3[Mx3dGeVec] (Mx3dGeVec. md)Third derivative

Returns

void


DN

DN(U, N): Mx3dGeVec

Calculate the Nth derivative of the curve at the given parameters.

Parameters

NameTypeDescription
The 'U''number'parameter
Nnumberorder

Returns

Mx3dGeVec

Nth derivative.


Degree

Degree(): number

Obtain the order of the curve.

Returns

number

The order of the curve.


DynamicType

DynamicType(): string

Return the dynamic type of the object.

Returns

string

A dynamically typed string.

Overrides

Mx3dGeomBoundedCurve.DynamicType


Edge

Edge(p1, p2): Mx3dShapeEdge

Obtain the edges of the curve.

Parameters

NameTypeDescription
P1NumberThe starting point parameter of the edge
P2numberEnd point parameter of the edge

Returns

Mx3dShapeEdge

Return the curve edges within the specified parameter range.


EndPoint

EndPoint(): Mx3dGePoint

Obtain the endpoint of the curve.

Returns

Mx3dGePoint

The endpoint of the curve.


FirstParameter

FirstParameter(): number

Return the first parameter value of the curve. Usually used to determine the starting point of a curve.

Returns

number

The first parameter value.


FirstUKnotIndex

FirstUKnotIndex(): number

Retrieve the first node index of the curve.

Returns

number

The first node index.


IncreaseDegree

IncreaseDegree(Degree): void

Increase the order of the curve.

Parameters

NameTypeDescription
DegreenumberNew order

Returns

void


IncreaseMultiplicity

IncreaseMultiplicity(Index, M): void

Improve the node multiplicity at the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of a node
MnumberNew multiplicity

Returns

void

IncreaseMultiplicity(I1, I2, M): void

Increase the multiplicity of nodes within the specified range.

Parameters

NameTypeDescription
I1numberrange starting index
I2numberEnd of range index
MnumberNew multiplicity

Returns

void


IncrementMultiplicity

IncrementMultiplicity(I1, I2, M): void

Incremental increase in node multiplicity within a specified range.

Parameters

NameTypeDescription
I1numberStarting index
I2numberEnd index
The increased multiplicity value of 'M''number'

Returns

void


InsertKnot

InsertKnot(U, M?, ParametricTolerance?, Add?): void

Insert a new node.

Parameters

NameTypeDescription
UnumberThe location of the new node
M?NumberThe multiplicity of new nodes (optional)
ParametricTolerance?NumberParameter tolerance (optional)
Add?` BooleanWhether to add nodes instead of replacing them (optional)

Returns

void


InsertKnots

InsertKnots(Knots, Mults, ParametricTolerance?, Add?): void

Insert multiple new nodes.

Parameters

NameTypeDescription
Knotsnumber []Array of new node positions
Multsnumber []Multiplicity array of new nodes
ParametricTolerance?NumberParameter tolerance (optional)
Add?` BooleanWhether to add nodes instead of replacing them (optional)

Returns

void


IsCN

IsCN(N): boolean

Check if the curve is continuous at the specified order.

Parameters

NameTypeDescription
Nnumberorder

Returns

boolean

If the curve is continuous at a specified order, return true; Otherwise, return false.


IsClosed

IsClosed(): boolean

Check if the curve is closed.

Returns

boolean

If the curve is closed, return true; Otherwise, return false.


IsEqual

IsEqual(theOther, thePreci): boolean

Compare the equality between the current curve and another curve.

Parameters

NameTypeDescription
theOther[Mx3dGeomBSpline Curve] (Mx3dGeomBSpline Curve. md)Another B-spline curve object
ThePreciNumberCompare accuracy

Returns

boolean

If two curves are equal at the specified precision, return true; Otherwise, return false.


IsG1

IsG1(theTf, theTl, theAngTol): boolean

Check if the curve meets G1 continuity within the specified range.

Parameters

NameTypeDescription
The Tfnumberstarting parameter
TheTlNumberEnd parameter
TheAngTolNumberAngle tolerance

Returns

boolean

If the curve satisfies G1 continuity within the specified range, return true; Otherwise, return false.


IsPeriodic

IsPeriodic(): boolean

Check if the curve is periodic.

Returns

boolean

If the curve is periodic, return true; Otherwise, return false.


IsRational

IsRational(): boolean

Check if the curve is reasonable.

Returns

boolean

If the curve is rational, return true; Otherwise, return false.


Knot

Knot(Index): number

Retrieve the nodes of the curve at the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of a node

Returns

number

Nodes.


Knots

Knots(): number[]

Obtain the node sequence of the curve.

Returns

number[]

An array of node sequences.


LastParameter

LastParameter(): number

Return the last parameter value of the curve. Usually used to determine the endpoint of a curve.

Returns

number

The last parameter value.


LastUKnotIndex

LastUKnotIndex(): number

Retrieve the index of the last node of the curve.

Returns

number

The last node index.


LocalD0

LocalD0(U, FromK1, ToK2, P): void

Calculate the points of local parameters within the specified range.

Parameters

NameTypeDescription
The 'U''number'parameter
FromK1numberStarting node index
ToK2numberEnd node index
P[Mx3dGePoint] (Mx3dGePoint. md)Result point

Returns

void


LocalD1

LocalD1(U, FromK1, ToK2, P, V1): void

Calculate the points and first derivative of local parameters within the specified range.

Parameters

NameTypeDescription
The 'U''number'parameter
FromK1numberStarting node index
ToK2numberEnd node index
P[Mx3dGePoint] (Mx3dGePoint. md)Result point
V1[Mx3dGeVec] (Mx3dGeVec. md)First derivative

Returns

void


LocalD2

LocalD2(U, FromK1, ToK2, P, V1, V2): void

Calculate the points, first derivative, and second derivative of local parameters within the specified range.

Parameters

NameTypeDescription
The 'U''number'parameter
FromK1numberStarting node index
ToK2numberEnd node index
P[Mx3dGePoint] (Mx3dGePoint. md)Result point
V1[Mx3dGeVec] (Mx3dGeVec. md)First derivative
V2[Mx3dGeVec] (Mx3dGeVec. md)Second derivative

Returns

void


LocalD3

LocalD3(U, FromK1, ToK2, P, V1, V2, V3): void

Calculate the points, first derivative, second derivative, and third derivative of local parameters within the specified range.

Parameters

NameTypeDescription
The 'U''number'parameter
FromK1numberStarting node index
ToK2numberEnd node index
P[Mx3dGePoint] (Mx3dGePoint. md)Result point
V1[Mx3dGeVec] (Mx3dGeVec. md)First derivative
V2[Mx3dGeVec] (Mx3dGeVec. md)Second derivative
V3[Mx3dGeVec] (Mx3dGeVec. md)Third derivative

Returns

void


LocalDN

LocalDN(U, FromK1, ToK2, N): Mx3dGeVec

Calculate the Nth derivative of local parameters within the specified range.

Parameters

NameTypeDescription
The 'U''number'parameter
FromK1numberStarting node index
ToK2numberEnd node index
Nnumberorder

Returns

Mx3dGeVec

Nth derivative.


LocalValue

LocalValue(U, FromK1, ToK2): Mx3dGePoint

Calculate the points of local parameters within the specified range.

Parameters

NameTypeDescription
The 'U''number'parameter
FromK1numberStarting node index
ToK2numberEnd node index

Returns

Mx3dGePoint

Points of local parameters.


MirrorByAxis

MirrorByAxis(A1): void

Mirror transform geometric objects through axes.

Parameters

NameTypeDescription
A1[Mx3dGeAxis] (Mx3dGeAxis. md)Axis object

Returns

void

Inherited from

Mx3dGeomBoundedCurve.MirrorByAxis


MirrorByCSYSR

MirrorByCSYSR(A2): void

Mirror transform geometric objects using a right-handed coordinate system.

Parameters

NameTypeDescription
A2[Mx3dGeCSYSR] (Mx3dGeCSYSR. md)Right hand coordinate system object

Returns

void

Inherited from

Mx3dGeomBoundedCurve.MirrorByCSYSR


MirrorByPoint

MirrorByPoint(P): void

Mirror transform geometric objects through points.

Parameters

NameTypeDescription
P[Mx3dGePoint] (Mx3dGePoint. md)Point object

Returns

void

Inherited from

Mx3dGeomBoundedCurve.MirrorByPoint


MirroredByAxis

MirroredByAxis(A1): Mx3dGeomBSplineCurve

Return the new geometric object transformed through axis mirroring.

Parameters

NameTypeDescription
A1[Mx3dGeAxis] (Mx3dGeAxis. md)Axis object

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.MirroredByAxis


MirroredByCSYSR

MirroredByCSYSR(A2): Mx3dGeomBSplineCurve

Return the new geometric object after mirror transformation through the right-handed coordinate system.

Parameters

NameTypeDescription
A2[Mx3dGeCSYSR] (Mx3dGeCSYSR. md)Right hand coordinate system object

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.MirroredByCSYSR


MirroredByPoint

MirroredByPoint(P): Mx3dGeomBSplineCurve

Return the new geometric object after point mirror transformation.

Parameters

NameTypeDescription
P[Mx3dGePoint] (Mx3dGePoint. md)Point object

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.MirroredByPoint


Multiplicities

Multiplicities(): number[]

Return the multiplicity values of all nodes on the curve. Node multiplicity is used to define the degree of repetition of a curve at specific parameter values.

Returns

number[]

An array of node multiplicity values.


Multiplicity

Multiplicity(Index): number

Retrieve the node multiplicity at the specified index. Node multiplicity is used to define the degree of repetition of a curve at specific parameter values.

Parameters

NameTypeDescription
IndexNumberNode Index

Returns

number

The multiplicity value of nodes.


NbKnots

NbKnots(): number

Obtain the number of nodes on the curve.

Returns

number

Number of nodes.


NbPoles

NbPoles(): number

Obtain the number of control points for the curve.

Returns

number

Control the number of points.


OffsetCurve

OffsetCurve(Offset, V, isNotCheckC0): Mx3dShapeEdge

Create an offset copy of the curve.

Parameters

NameTypeDescription
OffsetNumberOffset
The offset direction is perpendicular to the offset direction
IsNotCheckC0booleanDo not check C0 continuity

Returns

Mx3dShapeEdge

Return the offset curve edge object.


Period

Period(): number

Return the period of the curve.

Returns

number

The period of the curve.

Inherited from

Mx3dGeomBoundedCurve.Period


Pole

Pole(Index): Mx3dGePoint

Retrieve the control point at the specified index. The control points define the shape and position of the curve.

Parameters

NameTypeDescription
IndexNumberThe index of the control point

Returns

Mx3dGePoint

Specify the control point object at the index.


Poles

Poles(): Mx3dGePoint[]

Obtain the sequence of control points for the curve.

Returns

Mx3dGePoint[]

An array of control point sequences.


RemoveKnot

RemoveKnot(Index, M, Tolerance): boolean

Remove a node.

Parameters

NameTypeDescription
IndexNumberThe index of a node
The multiplicity of Mnumbernodes
TolerancenumberTolerance

Returns

boolean

Whether the node has been successfully removed.


Reverse

Reverse(): void

Reverse the curve.

Returns

void


Reversed

Reversed(): Mx3dGeomBSplineCurve

Return the new geometric curve object in reverse.

Returns

Mx3dGeomBSplineCurve

New geometric curve object.

Inherited from

Mx3dGeomBoundedCurve.Reversed


ReversedParameter

ReversedParameter(U): number

Get the reverse parameter value.

Parameters

NameTypeDescription
UnumberOriginal parameter value

Returns

number

Inverted parameter values.


Rotate

Rotate(A1, Ang): void

Rotate geometric objects.

Parameters

NameTypeDescription
A1[Mx3dGeAxis] (Mx3dGeAxis. md)Axis object
AngnumberRotation angle

Returns

void

Inherited from

Mx3dGeomBoundedCurve.Rotate


Rotated

Rotated(A1, Ang): Mx3dGeomBSplineCurve

Return the rotated new geometric object.

Parameters

NameTypeDescription
A1[Mx3dGeAxis] (Mx3dGeAxis. md)Axis object
AngnumberRotation angle

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.Rotated


Scale

Scale(P, S): void

Scale geometric objects.

Parameters

NameTypeDescription
P[Mx3dGePoint] (Mx3dGePoint. md)Point object
Snumberscaling ratio

Returns

void

Inherited from

Mx3dGeomBoundedCurve.Scale


Scaled

Scaled(P, S): Mx3dGeomBSplineCurve

Return the scaled new geometric object.

Parameters

NameTypeDescription
P[Mx3dGePoint] (Mx3dGePoint. md)Point object
Snumberscaling ratio

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.Scaled


Segment

Segment(U1, U2): void

Cut a segment of the curve.

Parameters

NameTypeDescription
The starting parameter value of the U1numbersegment
The end parameter value of the U2numbersegment

Returns

void


SetKnot

SetKnot(Index, K): void

Set up nodes.

Parameters

NameTypeDescription
IndexNumberNode Index
KnumberNew node value

Returns

void

SetKnot(Index, K, M): void

Set nodes and specify their multiplicity.

Parameters

NameTypeDescription
IndexNumberNode Index
KnumberNew node value
The multiplicity of Mnumbernodes

Returns

void


SetKnots

SetKnots(dK): void

Set up all nodes.

Parameters

NameTypeDescription
DKnumber []Node value array

Returns

void


SetNotPeriodic

SetNotPeriodic(): void

Set the curve to non periodic.

Returns

void


SetOrigin

SetOrigin(Index): void

Set the origin point.

Parameters

NameTypeDescription
IndexNumberOrigin Index

Returns

void

SetOrigin(U, Tol): void

Set the origin and specify the tolerance.

Parameters

NameTypeDescription
UnumberOrigin parameter value
Tolnumbertolerance

Returns

void


SetPeriodic

SetPeriodic(): void

Set the curve to be periodic.

Returns

void


SetPole

SetPole(Index, P): void

Set the control point at the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point
PUniPointControl point

Returns

void

SetPole(Index, P, Weight): void

Set control points and weights at the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point
PUniPointControl point
WeightNumberWeight

Returns

void


SetWeight

SetWeight(Index, Weight): void

Set the weight at the specified index.

Parameters

NameTypeDescription
IndexNumberIndex of weights
WeightNumberWeight

Returns

void


StartPoint

StartPoint(): Mx3dGePoint

Obtain the starting point of the curve.

Returns

Mx3dGePoint

The starting point of the curve.


Transform

Transform(T): void

Apply the given transformation matrix to transform the curve.

Parameters

NameTypeDescription
T[Mx3dGetStrf] (Mx3dGetStrf. md)Transform matrix

Returns

void


Transformed

Transformed(T): Mx3dGeomBSplineCurve

Return the transformed new geometric object.

Parameters

NameTypeDescription
T[Mx3dGetStrf] (Mx3dGetStrf. md)Transform the object

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.Transformed


TranslateBy2Points

TranslateBy2Points(P1, P2): void

Translate geometric objects through two points.

Parameters

NameTypeDescription
P1[Mx3dGePoint] (Mx3dGePoint. md)Starting point object
P2[Mx3dGePoint] (Mx3dGePoint. md)End point object

Returns

void

Inherited from

Mx3dGeomBoundedCurve.TranslateBy2Points


TranslateByVec

TranslateByVec(V): void

Translate geometric objects through vectors.

Parameters

NameTypeDescription
V[Mx3dGeVec] (Mx3dGeVec. md)Vector object

Returns

void

Inherited from

Mx3dGeomBoundedCurve.TranslateByVec


TranslatedBy2Points

TranslatedBy2Points(P1, P2): Mx3dGeomBSplineCurve

Return the new geometric object after translating through two points.

Parameters

NameTypeDescription
P1[Mx3dGePoint] (Mx3dGePoint. md)Starting point object
P2[Mx3dGePoint] (Mx3dGePoint. md)End point object

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.TranslatedBy2Points


TranslatedByVec

TranslatedByVec(V): Mx3dGeomBSplineCurve

Return the new geometric object after vector translation.

Parameters

NameTypeDescription
V[Mx3dGeVec] (Mx3dGeVec. md)Vector object

Returns

Mx3dGeomBSplineCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.TranslatedByVec


Value

Value(U): Mx3dGePoint

Return the point at the given parameter U.

Parameters

NameTypeDescription
The parameter value of 'U''number'

Returns

Mx3dGePoint

The point object at the given parameter.

Inherited from

Mx3dGeomBoundedCurve.Value


Weight

Weight(Index): number

Retrieve the weight value at the specified index. Weight values are used to define the local shape and importance of B-spline curves.

Parameters

NameTypeDescription
IndexNumberIndex of weight values

Returns

number

Specify the weight value at the index.


Weights

Weights(): number[]

Obtain the weight sequence of the curve.

Returns

number[]

An array of weight sequences.


Wire

Wire(): Mx3dShapeWire

Obtain the wire of the curve.

Returns

Mx3dShapeWire

Return the Wire object representing the curve.


DownCast

Static DownCast(theObject): Mx3dGeomBSplineCurve

Convert parent object to Mx3dGeomBSpline Curve object

Parameters

NameTypeDescription
TheObject[Mx3dGeomObject] (Mx3dGeomObject. md)Parent class object

Returns

Mx3dGeomBSplineCurve

Mx3dGeomBSpline Curve class object