Table of Contents

Class CPlane3

Namespace
AT.Librarys.Container.Toolkit.Vision
Assembly
AT.Librarys.Container.dll
public class CPlane3
Inheritance
CPlane3
Inherited Members
Extension Methods

Constructors

CPlane3()

public CPlane3()

CPlane3(CPoint3, double, double, double, double, double)

构造:中心+姿态+尺寸

public CPlane3(CPoint3 center, double rotXDeg, double rotYDeg, double rotZDeg, double lengthX, double lengthY)

Parameters

center CPoint3
rotXDeg double
rotYDeg double
rotZDeg double
lengthX double
lengthY double

Properties

Center

中心点(有限时为面片中心;无限时为平面上一参考点)

public CPoint3 Center { get; set; }

Property Value

CPoint3

IsInfinite

是否无限平面

public bool IsInfinite { get; }

Property Value

bool

LengthX

public double LengthX { get; set; }

Property Value

double

LengthY

public double LengthY { get; set; }

Property Value

double

Point1

Point1 旧接口(+X,+Y)

public CPoint3 Point1 { get; }

Property Value

CPoint3

Point2

Point2 旧接口(+X,-Y)

public CPoint3 Point2 { get; }

Property Value

CPoint3

Point3

Point3 旧接口(-X,+Y)

public CPoint3 Point3 { get; }

Property Value

CPoint3

Point4

Point4 旧接口(-X,-Y)

public CPoint3 Point4 { get; }

Property Value

CPoint3

RotX

绕 X 轴旋转(度)

public double RotX { get; set; }

Property Value

double

RotY

绕 Y 轴旋转(度)

public double RotY { get; set; }

Property Value

double

RotZ

绕 Z 轴旋转(度)

public double RotZ { get; set; }

Property Value

double

Methods

Expand(double)

扩大有限面片尺寸(边缘各向外扩 margin)。无限面返回自身。

public CPlane3 Expand(double margin)

Parameters

margin double

Returns

CPlane3

FromCorners(params CPoint3[])

根据四角点构造(顺序任意)。不足 3 点返回 null。

public static CPlane3 FromCorners(params CPoint3[] corners)

Parameters

corners CPoint3[]

Returns

CPlane3

FromHessian(double, double, double, double, double, double)

通过 Hessian 法向式 (nx,ny,nz,d) 构造平面,可选尺寸

public static CPlane3 FromHessian(double nx, double ny, double nz, double d, double lengthX = 0, double lengthY = 0)

Parameters

nx double
ny double
nz double
d double
lengthX double
lengthY double

Returns

CPlane3

GetCorners()

获取四角点(有限) 顺序(+X,+Y),(+X,-Y),(-X,-Y),(-X,+Y)。无限返回空数组

public CPoint3[] GetCorners()

Returns

CPoint3[]

GetHessian()

获取 Hessian 参数 (nx,ny,nz,d)

public (double nx, double ny, double nz, double d) GetHessian()

Returns

(double nx, double ny, double nz, double d)

GetNormal()

获取单位法向

public (double nx, double ny, double nz) GetNormal()

Returns

(double nx, double ny, double nz)

GetQuadVerticesLegacyOrder()

旧顺序兼容(+X,+Y),(+X,-Y),(-X,+Y),(-X,-Y)

public CPoint3[] GetQuadVerticesLegacyOrder()

Returns

CPoint3[]

InvalidateCorners()

使角点缓存失效

public void InvalidateCorners()

Project(CPoint3)

点正交投影到平面

public CPoint3 Project(CPoint3 p)

Parameters

p CPoint3

Returns

CPoint3

SignedDistance(CPoint3)

点到平面有符号距离(>0 在法向正侧)

public double SignedDistance(CPoint3 p)

Parameters

p CPoint3

Returns

double

ToPlane3(double, double, double, double, CPointCloud, bool, double, double, double[], double[])

public static CPlane3 ToPlane3(double nx, double ny, double nz, double d, CPointCloud pts, bool forceNormalUp = true, double parallelThreshold = 0.97, double defaultSize = 2, double[] reference1 = null, double[] reference2 = null)

Parameters

nx double
ny double
nz double
d double
pts CPointCloud
forceNormalUp bool
parallelThreshold double
defaultSize double
reference1 double[]
reference2 double[]

Returns

CPlane3

ToString()

调试信息

public override string ToString()

Returns

string