[mxcad_3d API documentation](../README. md)/Mx3dShapeObject
Class: Mx3dShapeObject
Represents the base class for three-dimensional shape objects.
Hierarchy
↳
Mx3dShapeObject
Table of contents
Constructors
Methods
- Centroid
- Explore
- MirrorByAxis
- MirrorByCSYSR
- MirrorByPoint
- MirroredByAxis
- MirroredByCSYSR
- MirroredByPoint
- Orientation
- Quantities
- Rotate
- Rotated
- Scale
- Scaled
- ShapeType
- Transform
- Transformed
- TranslateBy2Points
- TranslateByVec
- TranslatedBy2Points
- TranslatedByVec
- clone
- common
- cut
- fuse
- getBndBox
- move
- moved
- reverse
- reversed
- section
- spliter
Constructors
constructor
• new Mx3dShapeObject(p?
)
Create a shape object and choose to pass in an object parameter.
Parameters
Name | Type | Description |
---|---|---|
p? | Object | Optional object parameters |
Overrides
Mx3dBaseObject.constructor
Methods
Centroid
▸ Centroid(theAspect
): Mx3dGePoint
Obtain the centroid of the shape.
Parameters
Name | Type | Description |
---|---|---|
The centroid type that needs to be set based on the shape type is MxQuantAspect (../ennus/MdGe. MxQuantAspect. md) |
Returns
Center of mass point.
Explore
▸ Explore(ToFind
): Mx3dShapeObject
[]
Traverse shape objects.
Parameters
Name | Type | Description |
---|---|---|
ToFind | [MxShapeenum] (../enums/MdGe. MxShapeenum. md) | The type of shape to search for |
Returns
Shape object array.
MirrorByAxis
▸ MirrorByAxis(axis
): void
Mirror the current shape object based on an axis.
Parameters
Name | Type | Description |
---|---|---|
Axis | [Mx3dGeAxis] (Mx3dGeAxis. md) | Mirror axis |
Returns
void
MirrorByCSYSR
▸ MirrorByCSYSR(csysr
): void
Mirror the current shape object based on a coordinate system.
Parameters
Name | Type | Description |
---|---|---|
Csysr | [Mx3dGeCSYSR] (Mx3dGeCSYSR. md) | Mirror coordinate system |
Returns
void
MirrorByPoint
▸ MirrorByPoint(theP
): void
Mirror the current shape object based on a point.
Parameters
Name | Type | Description |
---|---|---|
TheP | [Mx3dGePoint] (Mx3dGePoint. md) | Mirror point |
Returns
void
MirroredByAxis
▸ MirroredByAxis(axis
): Mx3dShapeObject
Return the shape object mirrored based on an axis.
Parameters
Name | Type | Description |
---|---|---|
Axis | [Mx3dGeAxis] (Mx3dGeAxis. md) | Mirror axis |
Returns
The mirrored shape object.
MirroredByCSYSR
▸ MirroredByCSYSR(csysr
): Mx3dShapeObject
Return the shape object mirrored based on a coordinate system.
Parameters
Name | Type | Description |
---|---|---|
Csysr | [Mx3dGeCSYSR] (Mx3dGeCSYSR. md) | Mirror coordinate system |
Returns
The mirrored shape object.
MirroredByPoint
▸ MirroredByPoint(theP
): Mx3dShapeObject
Returns a shape object that has been mirrored based on a point.
Parameters
Name | Type | Description |
---|---|---|
TheP | [Mx3dGePoint] (Mx3dGePoint. md) | Mirror point |
Returns
The mirrored shape object.
Orientation
▸ Orientation(): MxOrientation
Obtain the orientation of the shape
Returns
orientation
Quantities
▸ Quantities(theAspect
): number
Obtain the length, area, volume, etc. of the shape.
Parameters
Name | Type | Description |
---|---|---|
The Aspect | [MxQuantAspect] (../ennus/MdGe. MxQuantAspect. md) | Set whether to obtain length, area, or volume |
Returns
number
Quantity value.
Rotate
▸ Rotate(axis
, ang
): void
Rotate the current shape object.
Parameters
Name | Type | Description |
---|---|---|
Axis | [Mx3dGeAxis] (Mx3dGeAxis. md) | Rotation axis |
'ang' | 'number' | Rotation angle |
Returns
void
Rotated
▸ Rotated(axis
, ang
): Mx3dShapeObject
Return the rotated shape object.
Parameters
Name | Type | Description |
---|---|---|
Axis | [Mx3dGeAxis] (Mx3dGeAxis. md) | Rotation axis |
'ang' | 'number' | Rotation angle |
Returns
The rotated shape object.
Scale
▸ Scale(point
, s
): void
Scale the current shape object.
Parameters
Name | Type | Description |
---|---|---|
Point | [Mx3dGePoint] (Mx3dGePoint. md) | Zoom center point |
S | number | scaling ratio |
Returns
void
Scaled
▸ Scaled(point
, s
): Mx3dShapeObject
Return the scaled shape object.
Parameters
Name | Type | Description |
---|---|---|
Point | [Mx3dGePoint] (Mx3dGePoint. md) | Zoom center point |
S | number | scaling ratio |
Returns
The scaled shape object.
ShapeType
▸ ShapeType(): MxShapeEnum
Get the shape type.
Returns
Shape type.
Transform
▸ Transform(trsf
): void
Transform the current shape object based on the transformation matrix.
Parameters
Name | Type | Description |
---|---|---|
Trsf | [Mx3dGetTrsf] (Mx3dGetTrsf. md) | Transform matrix |
Returns
void
Transformed
▸ Transformed(trsf
): Mx3dShapeObject
Return the shape object transformed according to the transformation matrix.
Parameters
Name | Type | Description |
---|---|---|
Trsf | [Mx3dGetTrsf] (Mx3dGetTrsf. md) | Transform matrix |
Returns
The transformed shape object.
TranslateBy2Points
▸ TranslateBy2Points(point1
, point2
): void
Translate the current shape object based on two points.
Parameters
Name | Type | Description |
---|---|---|
Point1 | [Mx3dGePoint] (Mx3dGePoint. md) | Starting point |
Point2 | [Mx3dGePoint] (Mx3dGePoint. md) | Endpoint |
Returns
void
TranslateByVec
▸ TranslateByVec(vec
): void
Translate the current shape object based on the vector.
Parameters
Name | Type | Description |
---|---|---|
Vec | [Mx3dGeVec] (Mx3dGeVec. md) | Translation vector |
Returns
void
▸ TranslateByVec(theX
, theY
, theZ
): void
Translate the current shape object based on its coordinates.
Parameters
Name | Type | Description |
---|---|---|
TheX | number | X coordinate |
TheY | Number | Y coordinate |
TheZ | Number | Z coordinate |
Returns
void
TranslatedBy2Points
▸ TranslatedBy2Points(point1
, point2
): Mx3dShapeObject
Return the shape object that has been translated based on two points.
Parameters
Name | Type | Description |
---|---|---|
Point1 | [Mx3dGePoint] (Mx3dGePoint. md) | Starting point |
Point2 | [Mx3dGePoint] (Mx3dGePoint. md) | Endpoint |
Returns
The shape object after translation.
TranslatedByVec
▸ TranslatedByVec(vec
): Mx3dShapeObject
Return the shape object translated based on the vector.
Parameters
Name | Type | Description |
---|---|---|
Vec | [Mx3dGeVec] (Mx3dGeVec. md) | Translation vector |
Returns
The shape object after translation.
▸ TranslatedByVec(theX
, theY
, theZ
): Mx3dShapeObject
Return the shape object after coordinate translation.
Parameters
Name | Type | Description |
---|---|---|
TheX | number | X coordinate |
TheY | Number | Y coordinate |
TheZ | Number | Z coordinate |
Returns
The shape object after translation.
clone
▸ clone(): Mx3dShapeObject
Clone the current shape object.
Returns
The cloned shape object.
common
▸ common(theOther
): Mx3dShapeObject
Return the common part between the current shape object and another shape object.
Parameters
Name | Type | Description |
---|---|---|
theOther | [Mx3dShapeObject ] (Mx3dShapeObject. md) | Another shape object |
Returns
The shape object of the public part.
cut
▸ cut(theOther
): Mx3dShapeObject
Subtract another shape object from the current shape object.
Parameters
Name | Type | Description |
---|---|---|
theOther | [Mx3dShapeObject ] (Mx3dShapeObject. md) | Another shape object |
Returns
The reduced shape object.
fuse
▸ fuse(theOther
): Mx3dShapeObject
Merge with another shape object.
Parameters
Name | Type | Description |
---|---|---|
theOther | [Mx3dShapeObject ] (Mx3dShapeObject. md) | Another shape object |
Returns
The fused shape object.
getBndBox
▸ getBndBox(): Mx3dGeBndBox
Get the bounding box of the shape object.
Returns
Boundary box object.
move
▸ move(theLocation
): void
Move the shape object to the specified position.
Parameters
Name | Type | Description |
---|---|---|
TheLocation | [Mx3dGeLocation. md] | The location of the movement |
Returns
void
moved
▸ moved(theLocation
): Mx3dShapeObject
Return the shape object after movement.
Parameters
Name | Type | Description |
---|---|---|
TheLocation | [Mx3dGeLocation. md] | The location of the movement |
Returns
The shape object after movement.
reverse
▸ reverse(): void
Shape reversed
Returns
void
reversed
▸ reversed(): Mx3dShapeObject
Obtain the new shape after reversing
Returns
New shape after reversal
section
▸ section(theOther
): Mx3dShapeObject
Returns the intersecting contour between the current shape object and another shape object.
Parameters
Name | Type | Description |
---|---|---|
theOther | [Mx3dShapeObject ] (Mx3dShapeObject. md) | Another shape object |
Returns
Shape objects with intersecting contours.
spliter
▸ spliter(theTools
): Mx3dShapeObject
[]
Use the tool shape object to segment the current shape object.
Parameters
Name | Type | Description |
---|---|---|
TheTools | [Mx3dShapeObject] (Mx3dShapeObject. md) [] | Tool Shape Object Array |
Returns
The segmented array of shape objects.