omdl  v0.6.1
OpenSCAD Mechanical Design Library
math_polytope.scad File Reference

Polygon and polyhedron mathematical functions. More...

#include <math-base.scad>
+ Include dependency graph for math_polytope.scad:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

function polytope_faces2edges (f)
 List the edge coordinate index pairs of a polytope. More...
 
function polytope_limits (c, f, a, d=[0:2], s=true)
 Determine the bounding limits of a polytope. More...
 
function polytope_bbox_pf (c, f, a)
 Generate a bounding box polytope for another polytope in 3d or 2d. More...
 
function polytope_line (c, f, e, i, l, r=false)
 Get a line from an edge or any two vetices of a polytope. More...
 
function polytope_vertex_av (f, i)
 List the adjacent vertices for a given polytope vertex. More...
 
function polytope_vertex_af (f, i)
 List the adjacent face indexes for a polytope vertex. More...
 
function polytope_edge_af (f, e, i)
 List the adjacent face indexes for a polytope edge. More...
 
function polytope_vertex_n (c, f, i)
 Get a normal vector for a polytope vertex. More...
 
function polytope_edge_n (c, f, e, i)
 Get a normal vector for a polytope edge. More...
 
function polytope_face_n (c, f, i, l, cw=true)
 Get the normal vector of a polytope face. More...
 
function polytope_face_m (c, f, i, l)
 Get the mean coordinate of all vertices of a polytope face. More...
 
function polytope_face_mn (c, f, i, l, cw=true)
 Get the mean coordinate and normal vector of a polytope face. More...
 
function polytope_plane (c, f, i, l, cw=true)
 Get a plane for a polytope face. More...
 
function polytope_face_vcounts (f)
 List the vertex counts for all polytope faces. More...
 
function polytope_face_angles (c, f)
 List the angles between all adjacent faces of a polyhedron. More...
 
function polytope_edge_lengths (c, e)
 List the edge lengths of a polytope. More...
 
function polytope_edge_angles (c, f)
 List the adjacent edge angles for each polytope vertex. More...
 
function polytope_faces_are_regular (c, f, e, d=6)
 Test if the faces of a polytope are all regular. More...
 
function polytope_triangulate_ft (f)
 Triangulate the faces of a convex polytope using fan triangulation. More...
 
function polygon2d_perimeter (c, p)
 Calculate the perimeter length of a polygon in 2d. More...
 
function polygon2d_area (c, p, s=false)
 Compute the signed area of a polygon in a Euclidean 2d-space. More...
 
function polygon3d_area (c, p, n)
 Compute the area of a polygon in a Euclidean 3d-space. More...
 
function polygon2d_centroid (c, p)
 Compute the center of mass of a polygon in a Euclidean 2d-space. More...
 
function polygon2d_is_cw (c, p)
 Test the vertex ordering of a polygon in a Euclidean 2d-space. More...
 
function polygon2d_is_convex (c, p)
 Test the convexity of a polygon in a Euclidean 2d-space. More...
 
function polygon2d_winding (c, p, t)
 Compute the winding number of a polygon about a point in a Euclidean 2d-space. More...
 
function polygon2d_is_pip_wn (c, p, t)
 Test if a point is inside a polygon in a Euclidean 2d-space using winding number. More...
 
function polygon2d_is_pip_as (c, p, t)
 Test if a point is inside a polygon in a Euclidean 2d-space using angle summation. More...
 
function polyhedron_area (c, f)
 Compute the surface area of a polyhedron in a Euclidean 3d-space. More...
 
function polyhedron_volume_tf (c, f)
 Compute the volume of a triangulated polyhedron in a Euclidean 3d-space. More...
 
function polyhedron_centroid_tf (c, f)
 Compute the center of mass of a triangulated polyhedron in a Euclidean 3d-space. More...
 
function linear_extrude_pp2pf (c, p, h=1, centroid=false, center=false)
 Convert a polygon to a polyhedron by adding a height dimension. More...
 

Detailed Description

Polygon and polyhedron mathematical functions.

Author
Roy Allen Sutton
Date
2017

This file is part of omdl, an OpenSCAD mechanical design library.

The omdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

The omdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the omdl; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA; or see http://www.gnu.org/licenses/.

Definition in file math_polytope.scad.