![]() |
omdl
v0.9.5
OpenSCAD Mechanical Design Library
|
Polygon and polyhedron tools. More...
Collaboration diagram for Polytope:Files | |
| file | polytope.scad |
| Polygon and polyhedron tools. | |
Functions | |
| module | polytope_number (c, f, e, vi=true, fi=true, ei=true, sp=false, ts, th, to, tr=0) |
| Label the vertices, paths, and edges of a polytope. More... | |
| module | polytope_frame (c, f, e, vi=true, fi=true, ei=true, vc=1, fc=2, ec=0) |
| Assemble a polytope skeletal frame using child objects. More... | |
| module | polytope_bounding_box (c, f, a) |
| The 3d or 2d bounding box shape for a polytope. More... | |
Polygon and polyhedron tools.
| Requires: |
|---|
| include <omdl-base.scad>; |
| include <tools/align.scad>; |
| include <tools/polytope.scad>; |
| module polytope_bounding_box | ( | c | , |
| f | , | ||
| a | |||
| ) |
The 3d or 2d bounding box shape for a polytope.
| c | <coords-3d | coords-2d> A list of 3d or 2d coordinate points. |
| f | <<integer-list>-list> A list of faces (or paths) that enclose the shape where each face is a list of coordinate indexes. |
| a | <decimal-list-1:3 | decimal> The box padding. A list of lengths to equally pad the box dimensions. |
Generates: (1) the 3d box shape that completely encloses the defined 3d polyhedron with the box sides oriented parallel to the coordinate axes. Or: (2) the 2d box shape that exactly encloses the defined 2d polygon with the box sides oriented parallel to the coordinate axes. When f is not given, the listed order of the coordinates c establishes the path.
Bounding box example script
| top | front | diag |
|---|---|---|
![]() | ![]() | ![]() |
Definition at line 1028 of file polytope.scad.
Here is the call graph for this function:| module polytope_frame | ( | c | , |
| f | , | ||
| e | , | ||
| vi | = true, |
||
| fi | = true, |
||
| ei | = true, |
||
| vc | = 1, |
||
| fc | = 2, |
||
| ec | = 0 |
||
| ) |
Assemble a polytope skeletal frame using child objects.
| c | <coords-3d | coords-2d> A list of 3d or 2d coordinate points. |
| f | <<integer-list>-list> A list of faces (or paths) that enclose the shape where each face is a list of coordinate indexes. |
| e | <<integer-list-2>-list> A list of edges where each edge is a list of two coordinate indexes. |
| vi | <index> Vertex index. An index sequence specification. |
| fi | <index> Face index. An index sequence specification. |
| ei | <index> Edge index. An index sequence specification. |
| vc | <integer> Vertex child object index. |
| fc | <integer> Face child object index. |
| ec | <integer> Edge child object index. |
Construct a skeletal frame for a given polytope. A 2d child object is linearly extruded along specified edges of the polytope to form the frame. Additional 3d child objects can be centered on specified vertices and/or the mean coordinates of specified faces.
To disable a child assignment to the vertices, faces, or edges, use an index that is less than zero or greater than the number of children. Parameter f is optional for polygons. When it is not given, the listed order of the coordinates c establishes the polygon path. When e is not specified, it is computed from f using polytope_faces2edges().
A. Framing example script
| top | right | diag |
|---|---|---|
![]() | ![]() | ![]() |
B. Framing example script
| diag |
|---|
![]() |
Definition at line 788 of file polytope.scad.
Here is the call graph for this function:| module polytope_number | ( | c | , |
| f | , | ||
| e | , | ||
| vi | = true, |
||
| fi | = true, |
||
| ei | = true, |
||
| sp | = false, |
||
| ts | , | ||
| th | , | ||
| to | , | ||
| tr | = 0 |
||
| ) |
Label the vertices, paths, and edges of a polytope.
| c | <coords-3d | coords-2d> A list of 3d or 2d coordinate points. |
| f | <<integer-list>-list> A list of faces (or paths) that enclose the shape where each face is a list of coordinate indexes. |
| e | <<integer-list-2>-list> A list of edges where each edge is a list of two coordinate indexes. |
| vi | <index> Vertex index. An index sequence specification. |
| fi | <index> Face index. An index sequence specification. |
| ei | <index> Edge index. An index sequence specification. |
| sp | <boolean> Show polyhedron shape. |
| ts | <decimal> The text size override. |
| th | <decimal> The text extrusion height override. |
| to | <vector-3d | vector-2d> The text offset override. |
| tr | <decimal-list-1:3 | decimal> The text rotation (in degrees). |
Label the vertices, paths, and edges of a polytope. Parameter f is optional for polygons. When it is not given, the listed order of the coordinates c establishes the polygon path. When e is not specified, it is computed from f using polytope_faces2edges().
Numbering example script
| top | front | diag |
|---|---|---|
![]() | ![]() | ![]() |
Definition at line 347 of file polytope.scad.
Here is the call graph for this function: