Skip to content

[mxcad_3d API Document](../README. md)/Mx3dGeomBizierCurve

Class: Mx3dGeomBezierCurve

Mx3dGeomBezierCurve represents the Bezier curve and provides a series of methods to manipulate and query the properties of the Bezier curve.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Mx3dGeomBezierCurve(CurvePoles, PoleWeights?)

Constructor, create a Bezier curve.

Parameters

NameTypeDescription
CurveHoles[Mx3dGePoint] (Mx3dGePoint. md) []Control point array
PoleWeights?Number []Control point weight array (optional)

Overrides

Mx3dGeomBoundedCurve.constructor

Methods

Continuity

Continuity(): MxGAShapeEnum

Obtain the continuity type of the curve.

Returns

MxGAShapeEnum

The continuity type of the curve.


Copy

Copy(): Mx3dGeomObject

Copy the curve object.

Returns

Mx3dGeomObject

The copied curve object.


D0

D0(U, P): void

Calculate the point of the curve at the specified parameter value.

Parameters

NameTypeDescription
The parameter value of 'U''number'
P[Mx3dGePoint] (Mx3dGePoint. md)Calculated point

Returns

void


D1

D1(U, P, V1): void

Calculate the point and its first derivative of the curve at the specified parameter value.

Parameters

NameTypeDescription
The parameter value of 'U''number'
P[Mx3dGePoint] (Mx3dGePoint. md)Calculated point
V1[Mx3dGeVec] (Mx3dGeVec. md)Calculated first derivative

Returns

void


D2

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

Calculate the points and their first and second derivatives of the curve at the specified parameter values.

Parameters

NameTypeDescription
The parameter value of 'U''number'
P[Mx3dGePoint] (Mx3dGePoint. md)Calculated point
V1[Mx3dGeVec] (Mx3dGeVec. md)Calculated first derivative
V2[Mx3dGeVec] (Mx3dGeVec. md)Calculated second derivative

Returns

void


D3

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

Calculate the points and their first, second, and third derivatives of the curve at the specified parameter values.

Parameters

NameTypeDescription
The parameter value of 'U''number'
P[Mx3dGePoint] (Mx3dGePoint. md)Calculated point
V1[Mx3dGeVec] (Mx3dGeVec. md)Calculated first derivative
V2[Mx3dGeVec] (Mx3dGeVec. md)Calculated second derivative
V3[Mx3dGeVec] (Mx3dGeVec. md)Calculated third derivative

Returns

void


DN

DN(U, N): Mx3dGeVec

Calculate the Nth derivative of the curve at the specified parameter values.

Parameters

NameTypeDescription
The parameter value of 'U''number'
NnumberThe order of the derivative

Returns

Mx3dGeVec

Calculate the 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

Create an edge.

Parameters

NameTypeDescription
P1NumberThe starting parameter of the edge
P2numberEnd parameter of edge

Returns

Mx3dShapeEdge

The created edge object.


EndPoint

EndPoint(): Mx3dGePoint

Obtain the endpoint of the curve.

Returns

Mx3dGePoint

The endpoint of the curve.


FirstParameter

FirstParameter(): number

Obtain the first parameter value of the curve.

Returns

number

The first parameter value of the curve.


Increase

Increase(Degree): void

Increase the order of Bezier curves.

Parameters

NameTypeDescription
DegreenumberNew order

Returns

void


InsertPoleAfter

InsertPoleAfter(Index, P, Weight?): void

Insert a control point after specifying the index.

Parameters

NameTypeDescription
IndexNumberThe index of the insertion point
P[Mx3dGePoint] (Mx3dGePoint. md)New control point
Weight?NumberThe weight of the new control point (optional)

Returns

void


InsertPoleBefore

InsertPoleBefore(Index, P, Weight?): void

Insert a control point before specifying the index.

Parameters

NameTypeDescription
IndexNumberThe index of the insertion point
P[Mx3dGePoint] (Mx3dGePoint. md)New control point
Weight?NumberThe weight of the new control point (optional)

Returns

void


IsCN

IsCN(N): boolean

Check the continuity of the curve.

Parameters

NameTypeDescription
NnumberThe order of continuity

Returns

boolean

Does the curve have continuity of a specified order.


IsClosed

IsClosed(): boolean

Check if the curve is closed.

Returns

boolean

Is the curve closed.


IsPeriodic

IsPeriodic(): boolean

Check if the parameterization of the curve is periodic.

Returns

boolean

Is the curve periodic.


IsRational

IsRational(): boolean

Check if the curve is a rational Bezier curve.

Returns

boolean

Is the curve reasonable.


LastParameter

LastParameter(): number

Obtain the last parameter value of the curve.

Returns

number

The last parameter value of the curve.


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): Mx3dGeomBezierCurve

Return the new geometric object transformed through axis mirroring.

Parameters

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

Returns

Mx3dGeomBezierCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.MirroredByAxis


MirroredByCSYSR

MirroredByCSYSR(A2): Mx3dGeomBezierCurve

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

Mx3dGeomBezierCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.MirroredByCSYSR


MirroredByPoint

MirroredByPoint(P): Mx3dGeomBezierCurve

Return the new geometric object after point mirror transformation.

Parameters

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

Returns

Mx3dGeomBezierCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.MirroredByPoint


NbPoles

NbPoles(): number

Obtain the number of control points for the curve.

Returns

number

The number of control points on the curve.


OffsetCurve

OffsetCurve(Offset, V, isNotCheckC0): Mx3dShapeEdge

Create an offset curve.

Parameters

NameTypeDescription
OffsetNumberOffset
The offset direction is perpendicular to the offset direction
IsNotCheckC0booleanCheck for C0 continuity

Returns

Mx3dShapeEdge

The created offset curve.


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 of the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point

Returns

Mx3dGePoint

Designated control points.


Poles

Poles(): Mx3dGePoint[]

Obtain all control points.

Returns

Mx3dGePoint[]

An array of all control points.


RemovePole

RemovePole(Index): void

Delete the control point of the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point to be deleted

Returns

void


Reverse

Reverse(): void

Reverse the parameter direction of Bezier curve.

Returns

void


Reversed

Reversed(): Mx3dGeomBezierCurve

Return the new geometric curve object in reverse.

Returns

Mx3dGeomBezierCurve

New geometric curve object.

Inherited from

Mx3dGeomBoundedCurve.Reversed


ReversedParameter

ReversedParameter(U): number

Retrieve the inverted parameter values.

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): Mx3dGeomBezierCurve

Return the rotated new geometric object.

Parameters

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

Returns

Mx3dGeomBezierCurve

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): Mx3dGeomBezierCurve

Return the scaled new geometric object.

Parameters

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

Returns

Mx3dGeomBezierCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.Scaled


Segment

Segment(U1, U2): void

Extract a portion of the Bezier curve.

Parameters

NameTypeDescription
U1numberStarting parameter value
U2numberEnd parameter value

Returns

void


SetPole

SetPole(Index, P, Weight?): void

Set the control point for the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point to be set
P[Mx3dGePoint] (Mx3dGePoint. md)New control point
Weight?NumberThe weight of the new control point (optional)

Returns

void


SetWeight

SetWeight(Index, Weight): void

Set the control point weights for the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point to be set
WeightnumberNew weight values

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 transformations to curves.

Parameters

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

Returns

void


Transformed

Transformed(T): Mx3dGeomBezierCurve

Return the transformed new geometric object.

Parameters

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

Returns

Mx3dGeomBezierCurve

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): Mx3dGeomBezierCurve

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

Mx3dGeomBezierCurve

New geometric objects.

Inherited from

Mx3dGeomBoundedCurve.TranslatedBy2Points


TranslatedByVec

TranslatedByVec(V): Mx3dGeomBezierCurve

Return the new geometric object after vector translation.

Parameters

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

Returns

Mx3dGeomBezierCurve

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 control point weights for the specified index.

Parameters

NameTypeDescription
IndexNumberThe index of the control point

Returns

number

Designated control point weights.


Weights

Weights(): number[]

Obtain the weights of all control points.

Returns

number[]

An array of all control point weights.


Wire

Wire(): Mx3dShapeWire

Create a line.

Returns

Mx3dShapeWire

The created line object.


DownCast

Static DownCast(theObject): Mx3dGeomBezierCurve

Convert parent class object to Mx3dGeomBizierCurve class object

Parameters

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

Returns

Mx3dGeomBezierCurve

Mx3dGeomBizierCurve class object