跳到主要内容

IDP.Math.KGeomFace2d 接口

export interface KGeomFace2d 

二维面的接口类

The interface of a geometry face 2d.

方法

area

area(): number;

获得面积。

Get area

返回值: number

返回face2d的面积。

Return the face2d's area.

containsPoint

containsPoint(point: KPoint2d, bIncludeOn?: boolean): boolean;

判断输入点是否位于面上。

Whether the input point is in the face2d.

参数:

  • point: KPoint2d

    输入点。

    The input point.

  • bIncludeOn: boolean

    是否考虑边界, 默认不考虑。

    Whether to consider the case: input point is on the face2d's boundary. True means the point is on the boundary of the face2d is also be think in face2d. Default value is false.

返回值: boolean

返回输入点是否在面上。

Return true if the point is in face2d.

getContour

getContour(): KGeomLoop2d;

获得外轮廓。

Get contour loop.

返回值: KGeomLoop2d

返回外轮廓。

Return the contour loop.

getHoles

getHoles(): KGeomLoop2d[];

获得内轮廓。

Get hole loops

返回值: KGeomLoop2d[]

返回内轮廓。

Return the hole loops.

isPositive

isPositive(): boolean;

检查外轮廓是否逆时针。

Check whether face2d's contour is counter-clockwise.

返回值: boolean

返回外轮廓的绕向是否为逆时针。

Return true if the the contour loop is counter-clockwise.

isValid

isValid(): boolean;

检查该面是否有效,其中每一个内外轮廓均需都有效, 外轮廓包围所有内轮廓,所有内轮廓不相交。 外轮廓与内轮廓反向。

Whether the face2d is valid, including: - Each contour and hole is valid - Contour contains all holes and holes are not overlapped. - Contour and holes have opposite direction.

返回值: boolean

返回face2d是否有效。

Return true if the face2d is valid.