omdl  v0.9.5
OpenSCAD Mechanical Design Library
Polyhedrons

Polyhedron mathematical functions; 3-polytope. More...

+ Collaboration diagram for Polyhedrons:

Files

file  polyhedron.scad
 Polyhedron shapes, conversions, properties, and tests functions..
 

Properties

function polyhedron_area (c, f)
 Compute the surface area of a polyhedron in a Euclidean 3d-space. More...
 
function polyhedron_tf_volume (c, f)
 Compute the volume of a triangulated polyhedron in a Euclidean 3d-space. More...
 
function polyhedron_tf_centroid (c, f)
 Compute the center of mass of a triangulated polyhedron in a Euclidean 3d-space. More...
 

Detailed Description

Polyhedron mathematical functions; 3-polytope.

Requires:
include <omdl-base.scad>;

Function Documentation

◆ polyhedron_area()

function polyhedron_area ( ,
 
)

Compute the surface area of a polyhedron in a Euclidean 3d-space.

Parameters
c<coords-3d> A list of 3d cartesian coordinates [[x, y, z], ...].
f<integer-list-list> A list of faces that enclose the shape where each face is a list of coordinate indexes.
Returns
<decimal> The surface area of the given polyhedron.

◆ polyhedron_tf_centroid()

function polyhedron_tf_centroid ( ,
 
)

Compute the center of mass of a triangulated polyhedron in a Euclidean 3d-space.

Parameters
c<coords-3d> A list of 3d cartesian coordinates [[x, y, z], ...].
f<integer-list-3-list> A list of triangular faces that enclose the polyhedron where each face is a list of three coordinate indexes.
Returns
<point-3d> The center of mass of the given polyhedron.

See Wikipedia for more information on centroid determined via the divergence theorem and midpoint quadrature.

Note
All faces are assumed to be a union of triangles oriented clockwise from the outside inwards.

◆ polyhedron_tf_volume()

function polyhedron_tf_volume ( ,
 
)

Compute the volume of a triangulated polyhedron in a Euclidean 3d-space.

Parameters
c<coords-3d> A list of 3d cartesian coordinates [[x, y, z], ...].
f<integer-list-3-list> A list of triangular faces that enclose the polyhedron where each face is a list of three coordinate indexes.
Returns
<decimal> The volume of the given polyhedron.

See Wikipedia for more information on volumes determined using the divergence theorem.

Note
All faces are assumed to be a union of triangles oriented clockwise from the outside inwards.