meta data for this page
  •  

Polyhedron

A three dimensional shape where connecting faces create a solid. Each face is a three dimensional polygon (a flat shape with straight sides).

Learn about polyhedrons at MathIsFun.com

Create a polyhedron from a list of points and a list of faces. The points list all the vertexes of the shape, while the faces define the points used within each face.

Note: The order of the points must be consistent, defining 'inward' or 'outward' facing polygons.

const { polyhedron } = require('@jscad/modeling').primitives
 
const points = [ [10, 10, 0], [10, -10, 0], [-10, -10, 0], [-10, 10, 0], [0, 0, 10] ]
const faces = [ [0, 1, 4], [1, 2, 4], [2, 3, 4], [3, 0, 4], [1, 0, 3], [2, 1, 3] ]
const myshape = polyhedron({points, faces, orientation: 'inward'})