AnyCAD Rapid API 2026
Help you to create a better world!
载入中...
搜索中...
未找到
AnyCAD.Foundation.AAx2类 参考

三维右手坐标系模板类 更多...

类 AnyCAD.Foundation.AAx2 继承关系图:

Public 成员函数

 AAx2 (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
void Dispose ()
 AAx2 ()
 默认构造函数
 AAx2 (AAx2 rhs)
 拷贝构造函数
 AAx2 (Vector3d theLocation, Vector3d theDirection)
 通过原点和主方向构造坐标系
 AAx2 (Vector3d theLocation, Vector3d theDirection, Vector3d theXDirection)
 通过原点、主方向和X方向构造坐标系
void setAxis (Vector3d theLocation, Vector3d theDirection)
 设置坐标系的主轴(原点和主方向)
void setDirection (Vector3d theDirection)
 设置主方向(Z轴方向)
void setDirectionAuto (Vector3d theDirection)
 自动设置主方向并计算X和Y方向
void setLocation (Vector3d theLocation)
 设置原点位置
void setXDirection (Vector3d theXDirection)
 设置X轴方向
void setYDirection (Vector3d theYDirection)
 设置Y轴方向
void setDirections (Vector3d theDirection, Vector3d theXDirection)
 同时设置主方向和X方向
double angle (AAx2 theOther)
 计算两个坐标系主方向之间的夹角
Vector3d getDirection ()
 获取主方向(Z轴方向)
Vector3d getLocation ()
 获取原点位置
Vector3d getXDirection ()
 获取X轴方向
Vector3d getYDirection ()
 获取Y轴方向
bool isCoplanar (AAx2 theOther, double linearTolerance, double angularTolerance)
 判断两个坐标系是否共面
bool isCoplanar (AAx2 theOther, double linearTolerance)
 判断两个坐标系是否共面
bool isCoplanar (AAx2 theOther)
 判断两个坐标系是否共面
void mirror (Vector3d thePoint)
 关于点进行对称变换(镜像)
AAx2 mirrored (Vector3d thePoint)
 关于点进行对称变换并返回新坐标系
void mirror (Vector3d theAxisLocation, Vector3d theAxisDirection)
 关于轴进行对称变换(镜像)
AAx2 mirrored (Vector3d theAxisLocation, Vector3d theAxisDirection)
 关于轴进行对称变换并返回新坐标系
void rotate (Vector3d theAxisLocation, Vector3d theAxisDirection, double theAngle)
 绕轴旋转
AAx2 rotated (Vector3d theAxisLocation, Vector3d theAxisDirection, double theAngle)
 绕轴旋转并返回新坐标系
void scale (Vector3d theCenter, double theScale)
 缩放变换
AAx2 scaled (Vector3d theCenter, double theScale)
 缩放变换并返回新坐标系
void transform (Matrix4d theMatrix)
 应用4x4变换矩阵
AAx2 transformed (Matrix4d theMatrix)
 应用4x4变换矩阵并返回新坐标系
void translate (Vector3d theVector)
 平移变换
AAx2 translated (Vector3d theVector)
 平移变换并返回新坐标系
void translate (Vector3d theFrom, Vector3d theTo)
 从一点平移到另一点
AAx2 translated (Vector3d theFrom, Vector3d theTo)
 从一点平移到另一点并返回新坐标系
Matrix4d transformationTo (AAx2 targetCoord)
 计算从当前坐标系到目标坐标系的变换矩阵
Matrix4d toWorld ()
 转换为世界坐标系

静态 Public 成员函数

static Matrix4d transformationFrom (AAx2 sourceCoord, AAx2 targetCoord)
 计算从源坐标系到当前坐标系的变换矩阵

详细描述

三维右手坐标系模板类

在 3D 空间中,坐标系由以下要素定义: - 原点(Location point) - 三个正交单位向量:X方向、Y方向和主方向(Z方向/Direction)

主方向(Direction)也称为 Z 方向,是坐标系的"主轴"。 当修改主方向时,X方向和Y方向会重新计算;但修改X或Y方向时,主方向保持不变。 由于是右手坐标系,主方向始终等于 X方向 × Y方向 的叉积。 (要定义左手坐标系,需要使用其他类) 坐标系用于:

  • 描述几何实体的位置和方向
  • 定义几何变换

构造及析构函数说明

◆ AAx2() [1/4]

AnyCAD.Foundation.AAx2.AAx2 ( )

默认构造函数

初始化为标准坐标系(OXYZ),原点在(0,0,0), X轴为(1,0,0),Y轴为(0,1,0),Z轴为(0,0,1)

◆ AAx2() [2/4]

AnyCAD.Foundation.AAx2.AAx2 ( AAx2 rhs)

拷贝构造函数

参数
rhs源坐标系对象

◆ AAx2() [3/4]

AnyCAD.Foundation.AAx2.AAx2 ( Vector3d theLocation,
Vector3d theDirection )

通过原点和主方向构造坐标系

X方向和Y方向会自动计算

参数
theLocation坐标系原点
theDirection主方向(Z轴方向)

会自动计算垂直于主方向的X方向和Y方向 找到主方向分量绝对值最小的轴,构造垂直向量

◆ AAx2() [4/4]

AnyCAD.Foundation.AAx2.AAx2 ( Vector3d theLocation,
Vector3d theDirection,
Vector3d theXDirection )

通过原点、主方向和X方向构造坐标系

参数
theLocation坐标系原点
theDirection主方向(Z轴方向)
theXDirectionX轴方向

Y方向会通过叉积自动计算:Y = Z × X 如果X方向与主方向平行,会自动调整

成员函数说明

◆ angle()

double AnyCAD.Foundation.AAx2.angle ( AAx2 theOther)

计算两个坐标系主方向之间的夹角

参数
theOther另一个坐标系
返回
夹角值(弧度),范围在 0 到 π 之间

◆ getDirection()

Vector3d AnyCAD.Foundation.AAx2.getDirection ( )

获取主方向(Z轴方向)

返回
主方向向量(单位向量)

◆ getLocation()

Vector3d AnyCAD.Foundation.AAx2.getLocation ( )

获取原点位置

返回
原点坐标

◆ getXDirection()

Vector3d AnyCAD.Foundation.AAx2.getXDirection ( )

获取X轴方向

返回
X方向向量(单位向量)

◆ getYDirection()

Vector3d AnyCAD.Foundation.AAx2.getYDirection ( )

获取Y轴方向

返回
Y方向向量(单位向量)

◆ isCoplanar() [1/3]

bool AnyCAD.Foundation.AAx2.isCoplanar ( AAx2 theOther)

判断两个坐标系是否共面

参数
theOther另一个坐标系
返回
如果共面返回true

共面条件: 1. 原点之间的距离在容差范围内 2. 主方向平行(在角度容差内)

◆ isCoplanar() [2/3]

bool AnyCAD.Foundation.AAx2.isCoplanar ( AAx2 theOther,
double linearTolerance )

判断两个坐标系是否共面

参数
theOther另一个坐标系
linearTolerance线性容差
返回
如果共面返回true

共面条件: 1. 原点之间的距离在容差范围内 2. 主方向平行(在角度容差内)

◆ isCoplanar() [3/3]

bool AnyCAD.Foundation.AAx2.isCoplanar ( AAx2 theOther,
double linearTolerance,
double angularTolerance )

判断两个坐标系是否共面

参数
theOther另一个坐标系
linearTolerance线性容差
angularTolerance角度容差(弧度)
返回
如果共面返回true

共面条件: 1. 原点之间的距离在容差范围内 2. 主方向平行(在角度容差内)

◆ mirror() [1/2]

void AnyCAD.Foundation.AAx2.mirror ( Vector3d theAxisLocation,
Vector3d theAxisDirection )

关于轴进行对称变换(镜像)

参数
theAxisLocation轴上的点
theAxisDirection轴的方向

会对X和Y方向进行变换,然后重新计算主方向 以保持右手坐标系性质

◆ mirror() [2/2]

void AnyCAD.Foundation.AAx2.mirror ( Vector3d thePoint)

关于点进行对称变换(镜像)

参数
thePoint镜像中心点

变换后: - 主方向不变 - X方向和Y方向反向 - 保持右手坐标系性质

◆ mirrored() [1/2]

AAx2 AnyCAD.Foundation.AAx2.mirrored ( Vector3d theAxisLocation,
Vector3d theAxisDirection )

关于轴进行对称变换并返回新坐标系

参数
theAxisLocation轴上的点
theAxisDirection轴的方向
返回
镜像后的新坐标系

◆ mirrored() [2/2]

AAx2 AnyCAD.Foundation.AAx2.mirrored ( Vector3d thePoint)

关于点进行对称变换并返回新坐标系

参数
thePoint镜像中心点
返回
镜像后的新坐标系

◆ rotate()

void AnyCAD.Foundation.AAx2.rotate ( Vector3d theAxisLocation,
Vector3d theAxisDirection,
double theAngle )

绕轴旋转

参数
theAxisLocation轴上的点
theAxisDirection轴的方向
theAngle旋转角度(弧度)

会对原点、X方向和Y方向进行旋转,然后重新计算主方向

◆ rotated()

AAx2 AnyCAD.Foundation.AAx2.rotated ( Vector3d theAxisLocation,
Vector3d theAxisDirection,
double theAngle )

绕轴旋转并返回新坐标系

参数
theAxisLocation轴上的点
theAxisDirection轴的方向
theAngle旋转角度(弧度)
返回
旋转后的新坐标系

◆ scale()

void AnyCAD.Foundation.AAx2.scale ( Vector3d theCenter,
double theScale )

缩放变换

参数
theCenter缩放中心
theScale缩放因子

如果缩放因子为负,X和Y方向会反向以保持右手坐标系

◆ scaled()

AAx2 AnyCAD.Foundation.AAx2.scaled ( Vector3d theCenter,
double theScale )

缩放变换并返回新坐标系

参数
theCenter缩放中心
theScale缩放因子
返回
缩放后的新坐标系

◆ setAxis()

void AnyCAD.Foundation.AAx2.setAxis ( Vector3d theLocation,
Vector3d theDirection )

设置坐标系的主轴(原点和主方向)

参数
theLocation原点位置
theDirection主方向

会重新计算X方向和Y方向

◆ setDirection()

void AnyCAD.Foundation.AAx2.setDirection ( Vector3d theDirection)

设置主方向(Z轴方向)

参数
theDirection新的主方向

会重新计算X方向和Y方向以保持正交性 新的X方向计算方式:X_new = V × (X_old × V)

◆ setDirectionAuto()

void AnyCAD.Foundation.AAx2.setDirectionAuto ( Vector3d theDirection)

自动设置主方向并计算X和Y方向

参数
theDirection新的主方向

算法: 1. 找到主方向分量绝对值最小的轴 2. 构造一个与主方向垂直的向量作为初始X方向 3. 通过叉积计算Y方向

◆ setDirections()

void AnyCAD.Foundation.AAx2.setDirections ( Vector3d theDirection,
Vector3d theXDirection )

同时设置主方向和X方向

参数
theDirection主方向(Z轴)
theXDirectionX轴方向

Y方向会通过叉积自动计算

◆ setLocation()

void AnyCAD.Foundation.AAx2.setLocation ( Vector3d theLocation)

设置原点位置

参数
theLocation新的原点位置

◆ setXDirection()

void AnyCAD.Foundation.AAx2.setXDirection ( Vector3d theXDirection)

设置X轴方向

参数
theXDirection新的X轴方向

主方向不变,Y方向会重新计算 如果X方向不与主方向垂直,会自动投影到垂直平面

◆ setYDirection()

void AnyCAD.Foundation.AAx2.setYDirection ( Vector3d theYDirection)

设置Y轴方向

参数
theYDirection新的Y轴方向

主方向不变,X方向会重新计算 如果Y方向不与主方向垂直,会自动投影到垂直平面

◆ toWorld()

Matrix4d AnyCAD.Foundation.AAx2.toWorld ( )

转换为世界坐标系

返回
世界坐标系

◆ transform()

void AnyCAD.Foundation.AAx2.transform ( Matrix4d theMatrix)

应用4x4变换矩阵

参数
theMatrix4x4变换矩阵

会对原点、X方向和Y方向进行变换,然后重新计算主方向

◆ transformationFrom()

Matrix4d AnyCAD.Foundation.AAx2.transformationFrom ( AAx2 sourceCoord,
AAx2 targetCoord )
static

计算从源坐标系到当前坐标系的变换矩阵

参数
sourceCoord源坐标系
返回
变换矩阵,将源坐标系中的点变换到当前坐标系

等价于:this->inverse() * sourceCoord.toMatrix()

◆ transformationTo()

Matrix4d AnyCAD.Foundation.AAx2.transformationTo ( AAx2 targetCoord)

计算从当前坐标系到目标坐标系的变换矩阵

参数
targetCoord目标坐标系
返回
变换矩阵,将当前坐标系中的点变换到目标坐标系

算法: 该变换将点从 FromA1 坐标系变换到 ToA2 坐标系 数学原理:M = ToA2^(-1) * FromA1

◆ transformed()

AAx2 AnyCAD.Foundation.AAx2.transformed ( Matrix4d theMatrix)

应用4x4变换矩阵并返回新坐标系

参数
theMatrix4x4变换矩阵
返回
变换后的新坐标系

◆ translate() [1/2]

void AnyCAD.Foundation.AAx2.translate ( Vector3d theFrom,
Vector3d theTo )

从一点平移到另一点

参数
theFrom起始点
theTo目标点

◆ translate() [2/2]

void AnyCAD.Foundation.AAx2.translate ( Vector3d theVector)

平移变换

参数
theVector平移向量

◆ translated() [1/2]

AAx2 AnyCAD.Foundation.AAx2.translated ( Vector3d theFrom,
Vector3d theTo )

从一点平移到另一点并返回新坐标系

参数
theFrom起始点
theTo目标点
返回
平移后的新坐标系

◆ translated() [2/2]

AAx2 AnyCAD.Foundation.AAx2.translated ( Vector3d theVector)

平移变换并返回新坐标系

参数
theVector平移向量
返回
平移后的新坐标系