A ThreeJS geometry class for drawing polygons on a sphere using cones.
Examples:
import ConicPolygonGeometry from 'three-conic-polygon-geometry';
or using a script tag
<script src="//unpkg.com/three-conic-polygon-geometry"></script>
then
const myMesh = new THREE.Mesh(
new ConicPolygonGeometry(polygonGeoJson),
new THREE.MeshBasicMaterial({ color: 'blue' })
);
ConicPolygonGeometry(polygonGeoJson: GeoJson polygon coordinates, bottomHeight: Float, topHeight: Float, closedBottom: Boolean, closedTop: Boolean, includeSides: Boolean, curvatureResolution: Float)
geometry.coordinates
for type: Polygon
. The first item is the polygon contour, additional items are the inner holes. It’s recommended to split the geometries at the anti-meridian.(lng, lat) => height
accessor function that is invoked for every vertex in the bottom surface. Default is 0
.(lng, lat) => height
accessor function that is invoked for every vertex in the top surface. Default is 1
.true
.true
.true
.5
..parameters: Object
An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
The geometry supports three distinct groups to which different materials can be applied.