mxcad_3d API 文档 / Mx3dGePlane
Class: Mx3dGePlane 
表示3D几何中的平面。 平面对象可通过坐标系、点、方向向量等多种方式定义,并提供了多种几何变换和操作方法。
Hierarchy 
- ↳ - Mx3dGePlane
Table of contents 
Constructors 
Methods 
- Axis
- Contains
- Direct
- DistanceToPlane
- DistanceToPoint
- Location
- MirrorByAxis
- MirrorByCSYSR
- MirrorByPoint
- MirroredByAxis
- MirroredByCSYSR
- MirroredByPoint
- Position
- Rotate
- Rotated
- Scale
- Scaled
- SetAxis
- SetLocation
- SetPosition
- Shape
- SquareDistanceToPlane
- SquareDistanceToPoint
- Transform
- Transformed
- TranslateBy2Points
- TranslateByVec
- TranslatedBy2Points
- TranslatedByVec
- UReverse
- VReverse
- XAxis
- YAxis
Constructors 
constructor 
• new Mx3dGePlane()
默认构造函数,创建一个平面。
Overrides 
Mx3dGeObject.constructor
• new Mx3dGePlane(theA3)
构造函数,使用指定坐标系初始化平面。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA3 | Mx3dGeCSYS | 用于初始化平面的坐标系(CSYS)对象。 | 
Overrides 
Mx3dGeObject.constructor
• new Mx3dGePlane(theP, theV)
构造函数,使用指定点和向量初始化平面。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 平面上的点。 | 
| theV | Mx3dGeDir | 与平面垂直的向量,用于定义平面的方向。 | 
Overrides 
Mx3dGeObject.constructor
• new Mx3dGePlane(theA, theB, theC, theD)
构造函数,使用平面方程的系数初始化平面。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA | number | 平面方程中的系数A。 | 
| theB | number | 平面方程中的系数B。 | 
| theC | number | 平面方程中的系数C。 | 
| theD | number | 平面方程中的系数D。 | 
Overrides 
Mx3dGeObject.constructor
Methods 
Axis 
▸ Axis(): Mx3dGeAxis
获取平面的法向轴向。
Returns 
平面的法向轴向对象。
Contains 
▸ Contains(theP, theLinearTolerance): boolean
检查点是否在平面上。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 需要检查的点。 | 
| theLinearTolerance | number | 线性容差,用于判定点是否在平面上。 | 
Returns 
boolean
如果点在平面上,则返回true;否则返回false。
Direct 
▸ Direct(): boolean
检查平面是否是右手坐标系。
Returns 
boolean
如果平面是右手坐标系,则返回true;否则返回false。
DistanceToPlane 
▸ DistanceToPlane(theOther): number
计算两个平面之间的距离。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theOther | Mx3dGePlane | 另一个平面对象。 | 
Returns 
number
两个平面之间的距离值。
DistanceToPoint 
▸ DistanceToPoint(theP): number
计算点到平面的距离。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 需要计算距离的点。 | 
Returns 
number
点到平面的距离值。
Location 
▸ Location(): Mx3dGePoint
获取平面上的位置点。
Returns 
平面上的点对象。
MirrorByAxis 
▸ MirrorByAxis(theA1): void
将平面通过指定轴进行镜像。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA1 | Mx3dGeAxis | 镜像轴向。 | 
Returns 
void
MirrorByCSYSR 
▸ MirrorByCSYSR(theA2): void
将平面通过指定坐标系进行镜像。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA2 | Mx3dGeCSYSR | 镜像坐标系。 | 
Returns 
void
MirrorByPoint 
▸ MirrorByPoint(theP): void
将平面通过指定点进行镜像。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 镜像点。 | 
Returns 
void
MirroredByAxis 
▸ MirroredByAxis(theA1): Mx3dGePlane
返回镜像平面对象(通过指定轴)。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA1 | Mx3dGeAxis | 镜像轴向。 | 
Returns 
镜像后的平面对象。
MirroredByCSYSR 
▸ MirroredByCSYSR(theA2): Mx3dGePlane
返回镜像平面对象(通过指定坐标系)。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA2 | Mx3dGeCSYSR | 镜像坐标系。 | 
Returns 
镜像后的平面对象。
MirroredByPoint 
▸ MirroredByPoint(theP): Mx3dGePlane
返回镜像平面对象(通过指定点)。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 镜像点。 | 
Returns 
镜像后的平面对象。
Position 
▸ Position(): Mx3dGeCSYS
获取平面的坐标系位置。
Returns 
平面的坐标系对象。
Rotate 
▸ Rotate(theA1, theAng): void
将平面绕指定轴旋转。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA1 | Mx3dGeAxis | 旋转轴向。 | 
| theAng | number | 旋转角度。 | 
Returns 
void
Rotated 
▸ Rotated(theA1, theAng): Mx3dGePlane
返回旋转后的平面对象。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA1 | Mx3dGeAxis | 旋转轴向。 | 
| theAng | number | 旋转角度。 | 
Returns 
旋转后的平面对象。
Scale 
▸ Scale(theP, theS): void
将平面缩放到指定点和比例。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 缩放点。 | 
| theS | number | 缩放比例。 | 
Returns 
void
Scaled 
▸ Scaled(theP, theS): Mx3dGePlane
返回缩放后的平面对象。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 缩放点。 | 
| theS | number | 缩放比例。 | 
Returns 
缩放后的平面对象。
SetAxis 
▸ SetAxis(theA1): void
设置平面的轴向。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA1 | Mx3dGeAxis | 平面轴向对象。 | 
Returns 
void
SetLocation 
▸ SetLocation(theLoc): void
设置平面的位置。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theLoc | Mx3dGePoint | 平面上的一个点,用于定义平面的具体位置。 | 
Returns 
void
SetPosition 
▸ SetPosition(theA3): void
设置平面的位置和方向。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theA3 | Mx3dGeCSYS | 用于设置平面位置和方向的坐标系。 | 
Returns 
void
Shape 
▸ Shape(): Mx3dShapeObject
获取平面的拓扑形状。
Returns 
平面形状对象。
▸ Shape(UMin, UMax, VMin, VMax): Mx3dShapeObject
获取平面在指定范围内的拓扑形状。
Parameters 
| Name | Type | Description | 
|---|---|---|
| UMin | number | U方向的最小值。 | 
| UMax | number | U方向的最大值。 | 
| VMin | number | V方向的最小值。 | 
| VMax | number | V方向的最大值。 | 
Returns 
平面形状对象。
SquareDistanceToPlane 
▸ SquareDistanceToPlane(theOther): number
计算两个平面之间的平方距离。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theOther | Mx3dGePlane | 另一个平面对象。 | 
Returns 
number
两个平面之间的平方距离值。
SquareDistanceToPoint 
▸ SquareDistanceToPoint(theP): number
计算点到平面的平方距离。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP | Mx3dGePoint | 需要计算平方距离的点。 | 
Returns 
number
点到平面的平方距离值。
Transform 
▸ Transform(theT): void
对平面应用变换。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theT | Mx3dGeTrsf | 变换矩阵。 | 
Returns 
void
Transformed 
▸ Transformed(theT): Mx3dGePlane
返回变换后的平面对象。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theT | Mx3dGeTrsf | 变换矩阵。 | 
Returns 
变换后的平面对象。
TranslateBy2Points 
▸ TranslateBy2Points(theP1, theP2): void
将平面通过两点平移。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP1 | Mx3dGePoint | 第一个点。 | 
| theP2 | Mx3dGePoint | 第二个点。 | 
Returns 
void
TranslateByVec 
▸ TranslateByVec(theV): void
将平面沿指定向量平移。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theV | Mx3dGeVec | 平移向量。 | 
Returns 
void
TranslatedBy2Points 
▸ TranslatedBy2Points(theP1, theP2): Mx3dGePlane
返回通过两点平移后的平面对象。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theP1 | Mx3dGePoint | 第一个点。 | 
| theP2 | Mx3dGePoint | 第二个点。 | 
Returns 
平移后的平面对象。
TranslatedByVec 
▸ TranslatedByVec(theV): Mx3dGePlane
返回平移后的平面对象。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theV | Mx3dGeVec | 平移向量。 | 
Returns 
平移后的平面对象。
UReverse 
▸ UReverse(): void
反转U方向。
Returns 
void
VReverse 
▸ VReverse(): void
反转V方向。
Returns 
void
XAxis 
▸ XAxis(): Mx3dGeAxis
获取平面X轴的方向。
Returns 
平面X轴的轴向对象。
YAxis 
▸ YAxis(): Mx3dGeAxis
获取平面Y轴的方向。
Returns 
平面Y轴的轴向对象。