Summary
Methods:
getBBox |
获取闭合曲线的三维包围盒 |
getCoordSeqs |
获取闭合曲线的坐标序列数组,其长度为1。 |
getType |
获取几何体类型 |
setCtrlPoints |
重新设置闭合曲线的控制点。 |
toLine |
将闭合曲线转化为线几何 |
toPolygon |
将闭合曲线转化为面几何 |
Constructor
new CloseCurve(points)
使用点几何体作为控制点构造闭合曲线,控制点数量至少为2,且不可以重复。
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<module:geom~Point> | 点几何体数组,数组长度小于3或非数组类型时,则抛出构造异常。 |
Throws:
RangeError
|
TypeError
-
数组长度小于3或非数组类型时,则抛出构造异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0));
let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,31,0));
let point3 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,31,0));
let closeCurveGeom = new hmap.geomext.CloseCurve([point1,point2,point3]);
Methods
-
getBBox() → {module:basetype~BBox}
-
获取闭合曲线的三维包围盒
-
getCoordSeqs() → {Array.<module:basetype~CoordSeq>}
-
获取闭合曲线的坐标序列数组,其长度为1。
Example
let coordSeqs = closeCurveGeom.getCoordSeqs();
-
getType() → {String}
-
获取几何体类型
Example
let type = closeCurveGeom.getType();
-
setCtrlPoints(points)
-
重新设置闭合曲线的控制点。
Parameters:
Name Type Description points
Array.<module:geom~Point> 点几何体数组,数组长度小于3或非数组类型时,则抛出构造异常。
Throws:
RangeError | TypeError -数组长度小于3或非数组类型时,则抛出构造异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0)); let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,32,0)); let point3 = new hmap.geom.Point(new hmap.basetype.Coordinate(122,32,0)); closeCurveGeom.setCtrlPoints([point1,point2,point3]);
-
toLine() → {module:geom~Line}
-
将闭合曲线转化为线几何
Example
let line = closeCurveGeom.toLine();
-
toPolygon() → {module:geom~Polygon}
-
将闭合曲线转化为面几何
Example
let polygon = closeCurveGeom.toPolygon();