KSurface
kds-plugin-document / Exports / KSurface
Interface: KSurface
三维空间所有面的基类。
Root class for all surface in 3d space.
Hierarchy
KSurface
↳
KPlane
Table of contents
Methods
- clone
- coplanar
- coplanarUnsigned
- distanceToPoint
- faceToUV
- getClosestPoint
- getPoint
- getType
- getUVPoint
- isCurveOnSurface
- isPointOnSurface
- loopToUV
- signedDistanceTo
- transform
Methods
clone
▸ clone(): KSurface
复制一个当前面。
Return the cloned surface of this.
Returns
复制的面。
The cloned surface.
Defined in
api.d.ts:10293
coplanar
▸ coplanar(other
, tolerance?
): boolean
考虑两个面的边界,以指定容差检查两个面是否共面。
Check whether two surface are coplanar with respecting their sides and specified tolerance.
Parameters
Name | Type | Description |
---|---|---|
other | KSurface | 要比较的另一个面。 The surface to compare this surface with. |
tolerance? | number | 指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6. |
Returns
boolean
如果共面返回true。
Return true if coplanar, otherwise return false.
Defined in
api.d.ts:10329
coplanarUnsigned
▸ coplanarUnsigned(other
, tolerance?
): boolean
忽略两个面的边界,以指定容差检查两个面是否共面。
Check whether two surface are coplanar by ignoring their sides with specified tolerance.
Parameters
Name | Type | Description |
---|---|---|
other | KSurface | 要比较的另一个面。 The surface to compare this surface with. |
tolerance? | number | 指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6. |
Returns
boolean
如果共面返回true。
Return true if coplanar, otherwise return false.
Defined in
api.d.ts:10311
distanceToPoint
▸ distanceToPoint(point
): number
获得点到面的距离。
Get the distance from the input point to this surface.
Parameters
Name | Type | Description |
---|---|---|
point | KPoint3d | 传入点。 The input point. |
Returns
number
传入的点到面的距离。
The distance from the input point to this surface.
Defined in
api.d.ts:10267
faceToUV
▸ faceToUV(face
): KFace2d
通过面的UV参数坐标系将三维面转换成二维面。 注意:需要保证该三维面落在面上。
Convert a 3D face to 2d face based on surface's uv coordinate system. NOTE: The caller needs to make sure the face is on the surface.
Parameters
Name | Type | Description |
---|---|---|
face | KFace3d | 输入的三维面。 The input 3D face. |
Returns
二维面。
The 2D face.
Defined in
api.d.ts:10361
getClosestPoint
▸ getClosestPoint(point
, tolerance?
): KPoint3d
获得面上距离传入点最近的一点,以指定容差。
Get the closest point on surface for the input point with specified tolerance.
Parameters
Name | Type | Description |
---|---|---|
point | KPoint3d | 输入点。 The input point. |
tolerance? | number | 指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6. |
Returns
最近点。
The closest point.
Defined in
api.d.ts:10253
getPoint
▸ getPoint(uv
): KPoint3d
通过传入的二维点获取三维点。 输入点的x坐标是面上一点的u参数。 y坐标是v参数。
Get a 3d point from the input 2d UV point. The input point's x coordinate is parameter u for a point on the surface. y coordinate is parameter v for a point on the surface.
Parameters
Name | Type | Description |
---|---|---|
uv | KPoint2d | 输入的二维UV点。 The input UV point. |
Returns
三维点。
The 3D point.
Defined in
api.d.ts:10399
getType
▸ getType(): Plane
获取面的类型。
Get the surface's type.
Returns
面的类型。
The surface's type.
Defined in
api.d.ts:10185
getUVPoint
▸ getUVPoint(point
): KPoint2d
通过面的UV参数坐标系将三维点转换成二维点。 需要确保传入点在面上。 输出点的x坐标是传入点的u参数。 y坐标是v参数。
Get a 2d point corresponding to a 3d point on the surface. We need make sure the input point is on the surface. The returned point's x coordinate is parameter u of the input 3d point. y coordinate is parameter v of the input 3d point.
Parameters
Name | Type | Description |
---|---|---|
point | KPoint3d | 面上一点。 The input point on the surface |
Returns
二维点。
The 2d point
Defined in
api.d.ts:10381
isCurveOnSurface
▸ isCurveOnSurface(curve
, tolerance?
): boolean
以指定容差检查输入曲线是否在面上。
Check whether the input curve is on the surface or not with specified tolerance.
Parameters
Name | Type | Description |
---|---|---|
curve | KCurve3d | 传入曲线。 The input curve. |
tolerance? | number | 指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6. |
Returns
boolean
如果在面上返回true。
Return true if on the surface, otherwise return false.
Defined in
api.d.ts:10235
isPointOnSurface
▸ isPointOnSurface(point
, tolerance?
): boolean
以指定容差检查输入点是否在面上。
Check whether the input point is on the surface or not with specified tolerance.
Parameters
Name | Type | Description |
---|---|---|
point | KPoint3d | 输入点。 The input point. |
tolerance? | number | 指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6. |
Returns
boolean
如果在面上返回true。
Return true if on the surface, otherwise return false.
Defined in
api.d.ts:10217
loopToUV
▸ loopToUV(loop
): KLoop2d
通过面的UV参数坐标系将三维环转换成二维环。 注意:需要保证该三维环落在面上。
Convert a 3D loop to 2d loop based on surface's uv coordinate system. NOTE: The caller needs to make sure the loop is on the surface.
Parameters
Name | Type | Description |
---|---|---|
loop | KLoop3d | 输入的三维环。 The input 3D loop. |
Returns
二维环。
The 2D loop.
Defined in
api.d.ts:10345
signedDistanceTo
▸ signedDistanceTo(point
): number
获得点到面的距离, 如果点在面的正向则距离为正,否则为负。
Get signed distance between the point and the plane. If the point is on the positive normal side, the sign is +, otherwise it's -
Parameters
Name | Type | Description |
---|---|---|
point | KPoint3d | 传入点。 The input point. |
Returns
number
传入的点到面的距离。
The distance from the input point to this surface.
Defined in
api.d.ts:10283
transform
▸ transform(matrix
): boolean
对当前面应用一转换矩阵,从而实现对其几何变换。
Transform this surface to a new one.
Parameters
Name | Type | Description |
---|---|---|
matrix | KMatrix4 | 转换矩阵。 The transform matrix. |
Returns
boolean
当执行正确的话,返回true;否则为false.。
Return true if successful, otherwise return false.
Defined in
api.d.ts:10199