three-conic-polygon-geometry

ThreeJS Conic Polygon Geometry

NPM package Build Size NPM Downloads

A ThreeJS geometry class for drawing polygons on a sphere using cones.

Examples:

Quick start

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 THREE.ConicPolygonGeometry(polygonGeoJson),
  new THREE.MeshBasicMaterial({ color: 'blue' })
);

API reference

Constructor

ConicPolygonGeometry(polygonGeoJson: GeoJson polygon coordinates, bottomHeight: Float, topHeight: Float, closedBottom: Boolean, closedTop: Boolean, includeSides: Boolean, curvatureResolution: Float)

Properties

.parameters: Object

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

Groups

The geometry supports three distinct groups to which different materials can be applied.