Methods
static Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(threshold, keepAbove, u0, u1, u2, result) → Array.<number>
在给定轴对齐阈值处切割二维三角形,并返回阈值指定一侧的结果多边形。
结果多边形可能有 0、1、2、3 或 4 个顶点。
| Name | Type | Description |
|---|---|---|
threshold |
number | 切割三角形的阈值坐标值。 |
keepAbove |
boolean | 为 true 时保留阈值上方的三角形部分,为 false 时保留下方部分。 |
u0 |
number | 三角形中第一个顶点的坐标,按逆时针顺序。 |
u1 |
number | 三角形中第二个顶点的坐标,按逆时针顺序。 |
u2 |
number | 三角形中第三个顶点的坐标,按逆时针顺序。 |
result |
Array.<number> | optional 用于复制结果的数组。如果未提供此参数, 将构造并返回一个新数组。 |
Returns:
切割后得到的多边形,以顶点列表形式指定。顶点按逆时针顺序指定。
每个顶点要么是现有列表中的索引(标识为 0、1 或 2),
要么是 -1 表示原始三角形中不存在的新顶点。
对于新顶点,-1 后跟三个附加数字:构成新顶点所在线段的
两个原始顶点的索引,以及从第一个顶点到第二个顶点的距离比例。
static Cesium.Intersections2D.computeBarycentricCoordinates(x, y, x1, y1, x2, y2, x3, y3, result) → Cartesian3
计算二维三角形内二维位置的重心坐标。
| Name | Type | Description |
|---|---|---|
x |
number | 要求重心坐标的位置的 x 坐标。 |
y |
number | 要求重心坐标的位置的 y 坐标。 |
x1 |
number | 三角形第一个顶点的 x 坐标。 |
y1 |
number | 三角形第一个顶点的 y 坐标。 |
x2 |
number | 三角形第二个顶点的 x 坐标。 |
y2 |
number | 三角形第二个顶点的 y 坐标。 |
x3 |
number | 三角形第三个顶点的 x 坐标。 |
y3 |
number | 三角形第三个顶点的 y 坐标。 |
result |
Cartesian3 | optional 用于复制结果的实例。如果此参数 为 undefined,将创建并返回一个新实例。 |
Returns:
三角形内位置的重心坐标。
static Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(x00, y00, x01, y01, x10, y10, x11, y11, result) → Cartesian2
计算两条线段之间的交点。
| Name | Type | Description |
|---|---|---|
x00 |
number | 第一条线段第一个顶点的 x 坐标。 |
y00 |
number | 第一条线段第一个顶点的 y 坐标。 |
x01 |
number | 第一条线段第二个顶点的 x 坐标。 |
y01 |
number | 第一条线段第二个顶点的 y 坐标。 |
x10 |
number | 第二条线段第一个顶点的 x 坐标。 |
y10 |
number | 第二条线段第一个顶点的 y 坐标。 |
x11 |
number | 第二条线段第二个顶点的 x 坐标。 |
y11 |
number | 第二条线段第二个顶点的 y 坐标。 |
result |
Cartesian2 | optional 用于复制结果的实例。如果此参数 为 undefined,将创建并返回一个新实例。 |
Returns:
交点,若无交点或线段重合则返回 undefined。
