Skip to main content

KGeomLoop2d

kds-plugin-document / Exports / KGeomLoop2d

Interface: KGeomLoop2d

二维环的接口类。

The interface of a geometry loop 2d.

Table of contents

Methods

Methods

area

area(): number

获得二维环的面积。

The area of the loop2d.

Returns

number

返回二维环的面积。

Return the area of the loop2d.

Defined in

api.d.ts:8744


centroid

centroid(): KPoint2d

获得二维环的质心。

The centroid of the loop2d.

Returns

KPoint2d

返回二维环的质心。

Return the centroid of the loop2d.

Defined in

api.d.ts:8754


containsPoint

containsPoint(point, bIncludeOn?): boolean

检查传入点是否在二维环中。

Check point is inside of geometry loop2d.

Parameters

NameTypeDescription
pointKPoint2d被判断点。 The check point
bIncludeOn?boolean是否考虑二维环的边界, 默认不考虑。 Whether to consider the case: input point is on the loop2d's boundary. True means the point is on the boundary of the loop2d is also be think in loop2d. Default value is false.

Returns

boolean

返回输入点是否在二维环中。

Return true if the point is in loop2d.

Defined in

api.d.ts:8806


getCurves

getCurves(): KBoundedCurve2d[]

获得二维环的所有轮廓线数组。

The curves of a loop2d.

Returns

KBoundedCurve2d[]

返回二维环的所有轮廓线。

Return all curves of the loop2d.

Defined in

api.d.ts:8734


isCCW

isCCW(): boolean

判断该二维环是否为逆时针。

Whether the loop is counter-clockwise.

Returns

boolean

返回二维环的绕向是否为逆时针。

Return true if the loop2d is counter-clockwise.

Defined in

api.d.ts:8764


isSelfIntersect

isSelfIntersect(): boolean

该环是否自相交。

Whether the loop is self-intersect.

Returns

boolean

返回二维环是否存在自相交。

Return true if the loop2d is self-intersected.

Defined in

api.d.ts:8787


isValid

isValid(): boolean

检查该二维环是否有效:是否自相交, 是否封闭,轮廓线是否一个一个首尾向量。 Whether the loop is valid:

  • no self-intersection,
  • closed,
  • connected one by one and tail to head.

Returns

boolean

返回二维环是否有效。

Return true if the loop2d is valid.

Defined in

api.d.ts:8777