跳到主要内容

KCircle3d 接口

export interface KCircle3d extends KCurve3d 

KCircle3d类代表着三维空间中的一个圆。

The KCircle3d class represents a circle in 3d space.

继承: KCurve3d

属性

center

readonly center: KPoint3d;

获取圆心。

Get center of the circle.

类型: KPoint3d

normal

readonly normal: KVector3d;

获取圆的法向量。

Get the normal of the circle.

类型: KVector3d

radius

readonly radius: number;

获取圆的半径。

Get radius of the circle.

方法

getPlane

getPlane(): KPlane;

获取当前圆所落的平面。

Get the plane where the circle is on.

返回值: KPlane

当前圆所在的平面。

The plane where the circle is on.

getTangent

getTangent(point: KPoint3d): KVector3d;

获取圆上一点的法向量。 注意:传入点需要确保落在圆上。

Get circle's tangent vector of a point on the circle. NOTE: the caller need to make sure the point is on the circle.

参数:

  • point: KPoint3d

    圆上一点。

    A point on the circle.

返回值: KVector3d

切向量。

The tangent vector.

transform

transform(matrix: KMatrix4): boolean;

对当前圆进行变换。 注意:如果变换之后的几何不是一个圆,则会抛出error, 本操作仅支持旋转和平移。

Transform this circle to a new one. NOTE: If the new one is not a circle, it will throw error. Only support for rotate and move translation now.

参数:

  • matrix: KMatrix4

    变换矩阵。

    The transform matrix.

返回值: boolean

当执行正确的话,返回true。

Return true if successful, otherwise return false.