Summary
Methods:
getBBox |
获取拓展几何的三维包围盒 |
getCoordSeqs |
获取椭圆的坐标序列数组,其长度为1。 |
getType |
获取几何体类型 |
setCtrlPoints |
重新设置椭圆的控制点。 |
toPolygon |
将椭圆转化为普通多边形 |
Constructor
new Ellipse(points)
使用点几何体作为控制点构造椭圆,控制点数量为2,且不可以重复。
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<module:geom~Point> | 点几何体数组。数组长度小于2或非数组类型,则抛出构造异常;当数组长度大于2时,取前2个点几何体作为控制点。 |
Throws:
RangeError
|
TypeError
-
当数组长度小于2或非数组类型,抛出异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0));
let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,30,0));
let ellipseGeom = new hmap.geomext.Ellipse([point1,point2]);
Methods
-
getBBox() → {module:basetype~BBox}
-
获取拓展几何的三维包围盒
-
getCoordSeqs() → {Array.<module:basetype~CoordSeq>}
-
获取椭圆的坐标序列数组,其长度为1。
Example
let coordSeqs = ellipseGeom.getCoordSeqs();
-
getType() → {String}
-
获取几何体类型
Example
let type = ellipseGeom.getType();
-
setCtrlPoints(points)
-
重新设置椭圆的控制点。
Parameters:
Name Type Description points
Array.<module:geom~Point> 点几何体数组。数组长度小于2或非数组类型,则抛出构造异常;当数组长度大于2时,取前2个点几何体作为控制点。
Throws:
RangeError | TypeError -当数组长度小于2或非数组类型,抛出异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0)); let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(122,30,0)); ellipseGeom.setCtrlPoints([point1,point2]);
-
toPolygon() → {module:geom~Polygon}
-
将椭圆转化为普通多边形
Example
let polygon = ellipseGeom.toPolygon();