Skip to content

KBE3D / KBCore / Cesium / ClippingPolygon

类: ClippingPolygon

A geodesic polygon to be used with ClippingPlaneCollection for selectively hiding regions in a model, a 3D tileset, or the globe.

示例

ts
const positions = Cesium.Cartesian3.fromRadiansArray([
    -1.3194369277314022,
    0.6988062530900625,
    -1.31941,
    0.69879,
    -1.3193955980204217,
    0.6988091578771254,
    -1.3193931220959367,
    0.698743632490865,
    -1.3194358224045408,
    0.6987471965556998,
]);

const polygon = new Cesium.ClippingPolygon({
    positions: positions
});

参数

Object with the following properties:

参数

A list of three or more Cartesian coordinates defining the outer ring of the clipping polygon.

属性

length

readonly length: number

Returns the total number of positions in the polygon, include any holes.


positions

readonly positions: Cartesian3[]

Returns the outer ring of positions.


ellipsoid

readonly ellipsoid: Ellipsoid

Returns the ellipsoid used to project the polygon onto surfaces when clipping.

方法

clone()

static clone(polygon: ClippingPolygon, result?: ClippingPolygon): ClippingPolygon

Clones the ClippingPolygon without setting its ownership.

参数

polygon

ClippingPolygon

The ClippingPolygon to be cloned

result?

ClippingPolygon

The object on which to store the cloned parameters.

返回

ClippingPolygon

a clone of the input ClippingPolygon


equals()

static equals(left: ClippingPolygon, right: ClippingPolygon): boolean

Compares the provided ClippingPolygons and returns <code>true</code> if they are equal, <code>false</code> otherwise.

参数

left

ClippingPolygon

The first polygon.

ClippingPolygon

The second polygon.

返回

boolean

true if left and right are equal, false otherwise.


computeRectangle()

computeRectangle(result?: Rectangle): Rectangle

Computes a cartographic rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles.

参数

result?

Rectangle

An object in which to store the result.

返回

Rectangle

The result rectangle

构造函数

构造函数

new ClippingPolygon(options: { positions: Cartesian3[]; ellipsoid?: Ellipsoid; }): ClippingPolygon

参数

options
positions

Cartesian3[]

ellipsoid?

Ellipsoid

返回

ClippingPolygon

KBE3D @3.0.0 Copyright © 2024-present KBE3D