[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
↳
Mx3dGeomBezierCurve
Table of contents
Constructors
Methods
- Continuity
- Copy
- D0
- D1
- D2
- D3
- DN
- Degree
- DynamicType
- Edge
- EndPoint
- FirstParameter
- Increase
- InsertPoleAfter
- InsertPoleBefore
- IsCN
- IsClosed
- IsPeriodic
- IsRational
- LastParameter
- MirrorByAxis
- MirrorByCSYSR
- MirrorByPoint
- MirroredByAxis
- MirroredByCSYSR
- MirroredByPoint
- NbPoles
- OffsetCurve
- Period
- Pole
- Poles
- RemovePole
- Reverse
- Reversed
- ReversedParameter
- Rotate
- Rotated
- Scale
- Scaled
- Segment
- SetPole
- SetWeight
- StartPoint
- Transform
- Transformed
- TranslateBy2Points
- TranslateByVec
- TranslatedBy2Points
- TranslatedByVec
- Value
- Weight
- Weights
- Wire
- DownCast
Constructors
constructor
• new Mx3dGeomBezierCurve(CurvePoles, PoleWeights?)
Constructor, create a Bezier curve.
Parameters
| Name | Type | Description |
|---|---|---|
| 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
The continuity type of the curve.
Copy
▸ Copy(): Mx3dGeomObject
Copy the curve object.
Returns
The copied curve object.
D0
▸ D0(U, P): void
Calculate the point of the curve at the specified parameter value.
Parameters
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| The parameter value of 'U' | 'number' | |
| N | number | The order of the derivative |
Returns
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
| Name | Type | Description |
|---|---|---|
| P1 | Number | The starting parameter of the edge |
| P2 | number | End parameter of edge |
Returns
The created edge object.
EndPoint
▸ EndPoint(): Mx3dGePoint
Obtain the endpoint of the curve.
Returns
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
| Name | Type | Description |
|---|---|---|
| Degree | number | New order |
Returns
void
InsertPoleAfter
▸ InsertPoleAfter(Index, P, Weight?): void
Insert a control point after specifying the index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The index of the insertion point |
| P | [Mx3dGePoint] (Mx3dGePoint. md) | New control point |
Weight? | Number | The weight of the new control point (optional) |
Returns
void
InsertPoleBefore
▸ InsertPoleBefore(Index, P, Weight?): void
Insert a control point before specifying the index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The index of the insertion point |
| P | [Mx3dGePoint] (Mx3dGePoint. md) | New control point |
Weight? | Number | The weight of the new control point (optional) |
Returns
void
IsCN
▸ IsCN(N): boolean
Check the continuity of the curve.
Parameters
| Name | Type | Description |
|---|---|---|
| N | number | The 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| A1 | [Mx3dGeAxis] (Mx3dGeAxis. md) | Axis object |
Returns
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
| Name | Type | Description |
|---|---|---|
| A2 | [Mx3dGeCSYSR] (Mx3dGeCSYSR. md) | Right hand coordinate system object |
Returns
New geometric objects.
Inherited from
Mx3dGeomBoundedCurve.MirroredByCSYSR
MirroredByPoint
▸ MirroredByPoint(P): Mx3dGeomBezierCurve
Return the new geometric object after point mirror transformation.
Parameters
| Name | Type | Description |
|---|---|---|
| P | [Mx3dGePoint] (Mx3dGePoint. md) | Point object |
Returns
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
| Name | Type | Description |
|---|---|---|
| Offset | Number | Offset |
| The offset direction is perpendicular to the offset direction | ||
| IsNotCheckC0 | boolean | Check for C0 continuity |
Returns
The created offset curve.
Period
▸ Period(): number
Return the period of the curve.
Returns
number
The period of the curve.
Inherited from
Pole
▸ Pole(Index): Mx3dGePoint
Retrieve the control point of the specified index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The index of the control point |
Returns
Designated control points.
Poles
▸ Poles(): Mx3dGePoint[]
Obtain all control points.
Returns
An array of all control points.
RemovePole
▸ RemovePole(Index): void
Delete the control point of the specified index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The 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
New geometric curve object.
Inherited from
ReversedParameter
▸ ReversedParameter(U): number
Retrieve the inverted parameter values.
Parameters
| Name | Type | Description |
|---|---|---|
| U | number | Original parameter value |
Returns
number
Inverted parameter values.
Rotate
▸ Rotate(A1, Ang): void
Rotate geometric objects.
Parameters
| Name | Type | Description |
|---|---|---|
| A1 | [Mx3dGeAxis] (Mx3dGeAxis. md) | Axis object |
| Ang | number | Rotation angle |
Returns
void
Inherited from
Rotated
▸ Rotated(A1, Ang): Mx3dGeomBezierCurve
Return the rotated new geometric object.
Parameters
| Name | Type | Description |
|---|---|---|
| A1 | [Mx3dGeAxis] (Mx3dGeAxis. md) | Axis object |
| Ang | number | Rotation angle |
Returns
New geometric objects.
Inherited from
Scale
▸ Scale(P, S): void
Scale geometric objects.
Parameters
| Name | Type | Description |
|---|---|---|
| P | [Mx3dGePoint] (Mx3dGePoint. md) | Point object |
| S | number | scaling ratio |
Returns
void
Inherited from
Scaled
▸ Scaled(P, S): Mx3dGeomBezierCurve
Return the scaled new geometric object.
Parameters
| Name | Type | Description |
|---|---|---|
| P | [Mx3dGePoint] (Mx3dGePoint. md) | Point object |
| S | number | scaling ratio |
Returns
New geometric objects.
Inherited from
Segment
▸ Segment(U1, U2): void
Extract a portion of the Bezier curve.
Parameters
| Name | Type | Description |
|---|---|---|
| U1 | number | Starting parameter value |
| U2 | number | End parameter value |
Returns
void
SetPole
▸ SetPole(Index, P, Weight?): void
Set the control point for the specified index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The index of the control point to be set |
| P | [Mx3dGePoint] (Mx3dGePoint. md) | New control point |
Weight? | Number | The weight of the new control point (optional) |
Returns
void
SetWeight
▸ SetWeight(Index, Weight): void
Set the control point weights for the specified index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The index of the control point to be set |
| Weight | number | New weight values |
Returns
void
StartPoint
▸ StartPoint(): Mx3dGePoint
Obtain the starting point of the curve.
Returns
The starting point of the curve.
Transform
▸ Transform(T): void
Apply transformations to curves.
Parameters
| Name | Type | Description |
|---|---|---|
| T | [Mx3dGetStrf] (Mx3dGetStrf. md) | Transform matrix |
Returns
void
Transformed
▸ Transformed(T): Mx3dGeomBezierCurve
Return the transformed new geometric object.
Parameters
| Name | Type | Description |
|---|---|---|
| T | [Mx3dGetStrf] (Mx3dGetStrf. md) | Transform the object |
Returns
New geometric objects.
Inherited from
Mx3dGeomBoundedCurve.Transformed
TranslateBy2Points
▸ TranslateBy2Points(P1, P2): void
Translate geometric objects through two points.
Parameters
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| P1 | [Mx3dGePoint] (Mx3dGePoint. md) | Starting point object |
| P2 | [Mx3dGePoint] (Mx3dGePoint. md) | End point object |
Returns
New geometric objects.
Inherited from
Mx3dGeomBoundedCurve.TranslatedBy2Points
TranslatedByVec
▸ TranslatedByVec(V): Mx3dGeomBezierCurve
Return the new geometric object after vector translation.
Parameters
| Name | Type | Description |
|---|---|---|
| V | [Mx3dGeVec] (Mx3dGeVec. md) | Vector object |
Returns
New geometric objects.
Inherited from
Mx3dGeomBoundedCurve.TranslatedByVec
Value
▸ Value(U): Mx3dGePoint
Return the point at the given parameter U.
Parameters
| Name | Type | Description |
|---|---|---|
| The parameter value of 'U' | 'number' |
Returns
The point object at the given parameter.
Inherited from
Weight
▸ Weight(Index): number
Retrieve the control point weights for the specified index.
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Number | The 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
The created line object.
DownCast
▸ Static DownCast(theObject): Mx3dGeomBezierCurve
Convert parent class object to Mx3dGeomBizierCurve class object
Parameters
| Name | Type | Description |
|---|---|---|
| TheObject | [Mx3dGeomObject] (Mx3dGeomObject. md) | Parent class object |
Returns
Mx3dGeomBizierCurve class object