Class CCircle3
圆(位于某一平面内):中心 + 半径 + 姿态(R=RzRyRx)
- Center:圆心(世界坐标)
- Radius:半径(>0)
- RotX/RotY/RotZ:圆所在平面的姿态(度),法向为旋转矩阵的第3列 说明:仅做几何计算;显示时可用 GetPolyline 采样为折线。
public sealed class CCircle3
- Inheritance
-
CCircle3
- Inherited Members
- Extension Methods
Constructors
CCircle3()
构造
public CCircle3()
CCircle3(CPoint3, double, double, double, double)
构造
public CCircle3(CPoint3 center, double rotXDeg, double rotYDeg, double rotZDeg, double radius)
Parameters
Properties
Center
中心点
public CPoint3 Center { get; set; }
Property Value
Radius
半径
public double Radius { get; set; }
Property Value
RotX
X轴旋转
public double RotX { get; set; }
Property Value
RotY
Y轴旋转
public double RotY { get; set; }
Property Value
RotZ
Z轴旋转
public double RotZ { get; set; }
Property Value
Methods
GetAabb()
近似世界坐标 AABB
public double[] GetAabb()
Returns
- double[]
GetNormal()
圆所在平面的单位法向
public (double nx, double ny, double nz) GetNormal()
Returns
GetPlaneBasis()
获取圆平面内的一组正交基 (ex, ey),用于参数化圆周
public (double[] ex, double[] ey) GetPlaneBasis()
Returns
GetPolyline(int)
采样圆周折线,resolution≥3
public CPoint3[] GetPolyline(int resolution = 64)
Parameters
resolutionint
Returns
- CPoint3[]
IsOnCircle(CPoint3, double)
点是否在圆上(既在所在平面且半径匹配);tol 平面距离/半径误差容差
public bool IsOnCircle(CPoint3 p, double tol = 0.001)
Parameters
Returns
ProjectToPerimeter(CPoint3)
点投影到圆平面,并映射到圆周(最近点)
public CPoint3 ProjectToPerimeter(CPoint3 p)
Parameters
pCPoint3
Returns
ToCircle3(double, double, double, double, double, double, double, double)
public static CCircle3 ToCircle3(double px, double py, double pz, double nx, double ny, double nz, double radius, double parallelThreshold = 0.97)