AngelCAD
1.5-00
|
Closed polyhedron volume defined by vertices and planar faces. More...
#include <angelcad.h>
Public Member Functions | |
polyhedron (array< pos3d@>@ points) | |
Construct polyhedron from a point cloud. The result is the convex hull polyhedron. More... | |
polyhedron (array< pos3d@>@ points, array< pface@>@ faces) | |
Construct polyhedron from arrays of points and faces. Face normals must point out. More... | |
polyhedron (string file, int id=- 1) | |
Read polyhedron from file (AMF,OBJ or OFF formats) More... | |
double | face_area (uint iface) const |
polyhedron face area More... | |
double | volume () const |
polyhedron volume More... | |
pface@ | face (uint iface) const |
polyhedron face More... | |
pos3d@ | vertex (uint iv) const |
polyhedron vertex More... | |
uint | nface () const |
Number of faces. More... | |
uint | nvert () const |
Number of vertices. More... | |
void | flip_face (uint iface) |
Flip polyhedron face normal. More... | |
void | flip_faces () |
Flip all polyhedron face normals. More... | |
void | set_vertex (uint iv, pos3d@ pos) |
Set vertex position. More... | |
void | verify () const |
Verify that the polyhedron is closed and without errors. More... | |
Public Member Functions inherited from solid | |
solid@ | opAdd (solid@ b) |
Boolean union operator+ overload. More... | |
solid@ | opAnd (solid@ b) |
Boolean intersection operator& overload. More... | |
solid@ | opMul (tmatrix@ matrix) |
Transform object by matrix multiplication: solid@ o2 = T * o1. More... | |
solid@ | opSub (solid@ b) |
Boolean difference operator- overload. More... | |
Public Member Functions inherited from shape | |
boundingbox@ | box () const |
Return bounding box of object. More... | |
tmatrix@ | transform () const |
Return transformation matrix of object. More... | |
void | write_csg (string path) |
Write object to OpenSCAD .csg file. More... | |
void | write_xcsg (string path, double secant_tolerance=- 1.0) |
Write object to .xcsg file for processing by xcsg program. More... | |
Closed polyhedron volume defined by vertices and planar faces.
a polyhedron is a general 3d object, defined by its vertices and polyhedron faces.
It is useful in many contexts. It can be constructed directly or by reference to an input file.
Construct polyhedron from a point cloud. The result is the convex hull polyhedron.
points | array@ |
Construct polyhedron from arrays of points and faces. Face normals must point out.
points | array@ |
faces | array@ |
polyhedron::polyhedron | ( | string | file, |
int | id = - 1 |
||
) |
Read polyhedron from file (AMF,OBJ or OFF formats)
file | string |
id | int |
pface@ polyhedron::face | ( | uint | iface | ) | const |
polyhedron face
iface | uint, index of polyhedron face |
double polyhedron::face_area | ( | uint | iface | ) | const |
polyhedron face area
iface | uint, index of polyhedron face |
void polyhedron::flip_face | ( | uint | iface | ) |
Flip polyhedron face normal.
iface | uint, index of polyhedron face |
void polyhedron::flip_faces | ( | ) |
Flip all polyhedron face normals.
uint polyhedron::nface | ( | ) | const |
Number of faces.
uint polyhedron::nvert | ( | ) | const |
Number of vertices.
void polyhedron::set_vertex | ( | uint | iv, |
pos3d@ | pos | ||
) |
Set vertex position.
iv | uint, index of polyhedron vertex |
pos | pos3d@, new position of vertex |
void polyhedron::verify | ( | ) | const |
Verify that the polyhedron is closed and without errors.
pos3d@ polyhedron::vertex | ( | uint | iv | ) | const |
polyhedron vertex
iv | uint, index of polyhedron vertex |
double polyhedron::volume | ( | ) | const |
polyhedron volume