ClippingPolygon
A geodesic polygon to be used with ClippingPlaneCollection for selectively hiding regions in a model, a 3D tileset, or the globe.
const positions = 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 ClippingPolygon({
positions: positions
});Content copied to clipboard
// A clipping polygon with two holes. Regions inside the holes are not clipped.
const outerRing = Cartesian3.fromDegreesArray([
-100.0, 40.0,
-90.0, 40.0,
-90.0, 50.0,
-100.0, 50.0,
]);
const firstHole = Cartesian3.fromDegreesArray([
-98.0, 42.0,
-96.0, 42.0,
-96.0, 44.0,
-98.0, 44.0,
]);
const secondHole = Cartesian3.fromDegreesArray([
-94.0, 46.0,
-92.0, 46.0,
-92.0, 48.0,
-94.0, 48.0,
]);
const polygonWithHoles = new ClippingPolygon({
positions: outerRing,
holes: [firstHole, secondHole],
});Content copied to clipboard