Skip to main content

KPlane

kds-plugin-document / Exports / KPlane

Interface: KPlane

KPlane类代表三维空间中的一个平面。

The KPlane class represents a plane in 3d space.

Hierarchy

Table of contents

Properties

Methods

Properties

normal

Readonly normal: KVector3d

获取平面的法向量。

Get plane's normal.

Defined in

api.d.ts:9444

Methods

clone

clone(): KSurface

复制一个当前面。

Return the cloned surface of this.

Returns

KSurface

复制的面。

The cloned surface.

Inherited from

KSurface.clone

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

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.

Inherited from

KSurface.coplanar

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

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.

Inherited from

KSurface.coplanarUnsigned

Defined in

api.d.ts:10311


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.

Inherited from

KSurface.distanceToPoint

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

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

Returns

KFace2d

二维面。

The 2D face.

Inherited from

KSurface.faceToUV

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

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

Returns

KPoint3d

最近点。

The closest point.

Inherited from

KSurface.getClosestPoint

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

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

Returns

KPoint3d

三维点。

The 3D point.

Inherited from

KSurface.getPoint

Defined in

api.d.ts:10399


getType

getType(): Plane

获取面的类型。

Get the surface's type.

Returns

Plane

面的类型。

The surface's type.

Inherited from

KSurface.getType

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

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

Returns

KPoint2d

二维点。

The 2d point

Inherited from

KSurface.getUVPoint

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

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.

Inherited from

KSurface.isCurveOnSurface

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

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.

Inherited from

KSurface.isPointOnSurface

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

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

Returns

KLoop2d

二维环。

The 2D loop.

Inherited from

KSurface.loopToUV

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

NameTypeDescription
pointKPoint3d传入点。 The input point.

Returns

number

传入的点到面的距离。

The distance from the input point to this surface.

Inherited from

KSurface.signedDistanceTo

Defined in

api.d.ts:10283


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.

Inherited from

KSurface.transform

Defined in

api.d.ts:10199