Skip to content

[mxcad_3d API documentation](../README. md)/Mx3dShapeObject

Class: Mx3dShapeObject

Represents the base class for three-dimensional shape objects.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Mx3dShapeObject(p?)

Create a shape object and choose to pass in an object parameter.

Parameters

NameTypeDescription
p?ObjectOptional object parameters

Overrides

Mx3dBaseObject.constructor

Methods

Centroid

Centroid(theAspect): Mx3dGePoint

Obtain the centroid of the shape.

Parameters

NameTypeDescription
The centroid type that needs to be set based on the shape type is MxQuantAspect (../ennus/MdGe. MxQuantAspect. md)

Returns

Mx3dGePoint

Center of mass point.


Explore

Explore(ToFind): Mx3dShapeObject[]

Traverse shape objects.

Parameters

NameTypeDescription
ToFind[MxShapeenum] (../enums/MdGe. MxShapeenum. md)The type of shape to search for

Returns

Mx3dShapeObject[]

Shape object array.


MirrorByAxis

MirrorByAxis(axis): void

Mirror the current shape object based on an axis.

Parameters

NameTypeDescription
Axis[Mx3dGeAxis] (Mx3dGeAxis. md)Mirror axis

Returns

void


MirrorByCSYSR

MirrorByCSYSR(csysr): void

Mirror the current shape object based on a coordinate system.

Parameters

NameTypeDescription
Csysr[Mx3dGeCSYSR] (Mx3dGeCSYSR. md)Mirror coordinate system

Returns

void


MirrorByPoint

MirrorByPoint(theP): void

Mirror the current shape object based on a point.

Parameters

NameTypeDescription
TheP[Mx3dGePoint] (Mx3dGePoint. md)Mirror point

Returns

void


MirroredByAxis

MirroredByAxis(axis): Mx3dShapeObject

Return the shape object mirrored based on an axis.

Parameters

NameTypeDescription
Axis[Mx3dGeAxis] (Mx3dGeAxis. md)Mirror axis

Returns

Mx3dShapeObject

The mirrored shape object.


MirroredByCSYSR

MirroredByCSYSR(csysr): Mx3dShapeObject

Return the shape object mirrored based on a coordinate system.

Parameters

NameTypeDescription
Csysr[Mx3dGeCSYSR] (Mx3dGeCSYSR. md)Mirror coordinate system

Returns

Mx3dShapeObject

The mirrored shape object.


MirroredByPoint

MirroredByPoint(theP): Mx3dShapeObject

Returns a shape object that has been mirrored based on a point.

Parameters

NameTypeDescription
TheP[Mx3dGePoint] (Mx3dGePoint. md)Mirror point

Returns

Mx3dShapeObject

The mirrored shape object.


Orientation

Orientation(): MxOrientation

Obtain the orientation of the shape

Returns

MxOrientation

orientation


Quantities

Quantities(theAspect): number

Obtain the length, area, volume, etc. of the shape.

Parameters

NameTypeDescription
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

NameTypeDescription
Axis[Mx3dGeAxis] (Mx3dGeAxis. md)Rotation axis
'ang''number'Rotation angle

Returns

void


Rotated

Rotated(axis, ang): Mx3dShapeObject

Return the rotated shape object.

Parameters

NameTypeDescription
Axis[Mx3dGeAxis] (Mx3dGeAxis. md)Rotation axis
'ang''number'Rotation angle

Returns

Mx3dShapeObject

The rotated shape object.


Scale

Scale(point, s): void

Scale the current shape object.

Parameters

NameTypeDescription
Point[Mx3dGePoint] (Mx3dGePoint. md)Zoom center point
Snumberscaling ratio

Returns

void


Scaled

Scaled(point, s): Mx3dShapeObject

Return the scaled shape object.

Parameters

NameTypeDescription
Point[Mx3dGePoint] (Mx3dGePoint. md)Zoom center point
Snumberscaling ratio

Returns

Mx3dShapeObject

The scaled shape object.


ShapeType

ShapeType(): MxShapeEnum

Get the shape type.

Returns

MxShapeEnum

Shape type.


Transform

Transform(trsf): void

Transform the current shape object based on the transformation matrix.

Parameters

NameTypeDescription
Trsf[Mx3dGetTrsf] (Mx3dGetTrsf. md)Transform matrix

Returns

void


Transformed

Transformed(trsf): Mx3dShapeObject

Return the shape object transformed according to the transformation matrix.

Parameters

NameTypeDescription
Trsf[Mx3dGetTrsf] (Mx3dGetTrsf. md)Transform matrix

Returns

Mx3dShapeObject

The transformed shape object.


TranslateBy2Points

TranslateBy2Points(point1, point2): void

Translate the current shape object based on two points.

Parameters

NameTypeDescription
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

NameTypeDescription
Vec[Mx3dGeVec] (Mx3dGeVec. md)Translation vector

Returns

void

TranslateByVec(theX, theY, theZ): void

Translate the current shape object based on its coordinates.

Parameters

NameTypeDescription
TheXnumberX coordinate
TheYNumberY coordinate
TheZNumberZ coordinate

Returns

void


TranslatedBy2Points

TranslatedBy2Points(point1, point2): Mx3dShapeObject

Return the shape object that has been translated based on two points.

Parameters

NameTypeDescription
Point1[Mx3dGePoint] (Mx3dGePoint. md)Starting point
Point2[Mx3dGePoint] (Mx3dGePoint. md)Endpoint

Returns

Mx3dShapeObject

The shape object after translation.


TranslatedByVec

TranslatedByVec(vec): Mx3dShapeObject

Return the shape object translated based on the vector.

Parameters

NameTypeDescription
Vec[Mx3dGeVec] (Mx3dGeVec. md)Translation vector

Returns

Mx3dShapeObject

The shape object after translation.

TranslatedByVec(theX, theY, theZ): Mx3dShapeObject

Return the shape object after coordinate translation.

Parameters

NameTypeDescription
TheXnumberX coordinate
TheYNumberY coordinate
TheZNumberZ coordinate

Returns

Mx3dShapeObject

The shape object after translation.


clone

clone(): Mx3dShapeObject

Clone the current shape object.

Returns

Mx3dShapeObject

The cloned shape object.


common

common(theOther): Mx3dShapeObject

Return the common part between the current shape object and another shape object.

Parameters

NameTypeDescription
theOther[Mx3dShapeObject] (Mx3dShapeObject. md)Another shape object

Returns

Mx3dShapeObject

The shape object of the public part.


cut

cut(theOther): Mx3dShapeObject

Subtract another shape object from the current shape object.

Parameters

NameTypeDescription
theOther[Mx3dShapeObject] (Mx3dShapeObject. md)Another shape object

Returns

Mx3dShapeObject

The reduced shape object.


fuse

fuse(theOther): Mx3dShapeObject

Merge with another shape object.

Parameters

NameTypeDescription
theOther[Mx3dShapeObject] (Mx3dShapeObject. md)Another shape object

Returns

Mx3dShapeObject

The fused shape object.


getBndBox

getBndBox(): Mx3dGeBndBox

Get the bounding box of the shape object.

Returns

Mx3dGeBndBox

Boundary box object.


move

move(theLocation): void

Move the shape object to the specified position.

Parameters

NameTypeDescription
TheLocation[Mx3dGeLocation. md]The location of the movement

Returns

void


moved

moved(theLocation): Mx3dShapeObject

Return the shape object after movement.

Parameters

NameTypeDescription
TheLocation[Mx3dGeLocation. md]The location of the movement

Returns

Mx3dShapeObject

The shape object after movement.


reverse

reverse(): void

Shape reversed

Returns

void


reversed

reversed(): Mx3dShapeObject

Obtain the new shape after reversing

Returns

Mx3dShapeObject

New shape after reversal


section

section(theOther): Mx3dShapeObject

Returns the intersecting contour between the current shape object and another shape object.

Parameters

NameTypeDescription
theOther[Mx3dShapeObject] (Mx3dShapeObject. md)Another shape object

Returns

Mx3dShapeObject

Shape objects with intersecting contours.


spliter

spliter(theTools): Mx3dShapeObject[]

Use the tool shape object to segment the current shape object.

Parameters

NameTypeDescription
TheTools[Mx3dShapeObject] (Mx3dShapeObject. md) []Tool Shape Object Array

Returns

Mx3dShapeObject[]

The segmented array of shape objects.