Skip to main content

KSurface

kds-plugin-document / Exports / KSurface

Interface: KSurface

三维空间所有面的基类。

Root class for all surface in 3d space.

Hierarchy​

Table of contents​

Methods​

Methods​

clone​

▸ clone(): KSurface

复制一个当前面。

Return the cloned surface of this.

Returns​

KSurface

复制的面。

The cloned surface.

Defined in​

api.d.ts:12285


coplanar​

▸ coplanar(other, tolerance?): boolean

考虑两个面的边界,以指定容差检查两个面是否共面。

Check whether two surface are coplanar with respecting their sides and specified tolerance.

Parameters​

NameTypeDescription
otherKSurface要比较的另一个面。 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:12321


coplanarUnsigned​

▸ coplanarUnsigned(other, tolerance?): boolean

忽略两个面的边界,以指定容差检查两个面是否共面。

Check whether two surface are coplanar by ignoring their sides with specified tolerance.

Parameters​

NameTypeDescription
otherKSurface要比较的另一个面。 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:12303


distanceToPoint​

▸ distanceToPoint(point): number

获得点到面的距离。

Get the distance from the input point to this surface.

Parameters​

NameTypeDescription
pointKPoint3d传入点。 The input point.

Returns​

number

传入的点到面的距离。

The distance from the input point to this surface.

Defined in​

api.d.ts:12259


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​

NameTypeDescription
faceKFace3d输入的三维面。 The input 3D face.

Returns​

KFace2d

二维面。

The 2D face.

Defined in​

api.d.ts:12353


getClosestPoint​

▸ getClosestPoint(point, tolerance?): KPoint3d

获得面上距离传入点最近的一点,以指定容差。

Get the closest point on surface for the input point with specified tolerance.

Parameters​

NameTypeDescription
pointKPoint3d输入点。 The input point.
tolerance?number指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6.

Returns​

KPoint3d

最近点。

The closest point.

Defined in​

api.d.ts:12245


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​

NameTypeDescription
uvKPoint2d输入的二维UV点。 The input UV point.

Returns​

KPoint3d

三维点。

The 3D point.

Defined in​

api.d.ts:12391


getType​

▸ getType(): Plane

获取面的类型。

Get the surface's type.

Returns​

Plane

面的类型。

The surface's type.

Defined in​

api.d.ts:12177


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​

NameTypeDescription
pointKPoint3d面上一点。 The input point on the surface

Returns​

KPoint2d

二维点。

The 2d point

Defined in​

api.d.ts:12373


isCurveOnSurface​

▸ isCurveOnSurface(curve, tolerance?): boolean

以指定容差检查输入曲线是否在面上。

Check whether the input curve is on the surface or not with specified tolerance.

Parameters​

NameTypeDescription
curveKCurve3d传入曲线。 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:12227


isPointOnSurface​

▸ isPointOnSurface(point, tolerance?): boolean

以指定容差检查输入点是否在面上。

Check whether the input point is on the surface or not with specified tolerance.

Parameters​

NameTypeDescription
pointKPoint3d输入点。 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:12209


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​

NameTypeDescription
loopKLoop3d输入的三维环。 The input 3D loop.

Returns​

KLoop2d

二维环。

The 2D loop.

Defined in​

api.d.ts:12337


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​

NameTypeDescription
pointKPoint3d传入点。 The input point.

Returns​

number

传入的点到面的距离。

The distance from the input point to this surface.

Defined in​

api.d.ts:12275


transform​

▸ transform(matrix): boolean

对当前面应用一转换矩阵,从而实现对其几何变换。

Transform this surface to a new one.

Parameters​

NameTypeDescription
matrixKMatrix4转换矩阵。 The transform matrix.

Returns​

boolean

当执行正确的话,返回true;否则为false.。

Return true if successful, otherwise return false.

Defined in​

api.d.ts:12191