r3d.h
Go to the documentation of this file.
void r3d_tet_faces_from_verts(r3d_plane *faces, r3d_rvec3 *verts)
Get four faces (unit normals and distances to the origin) from a four-vertex description of a tetrahe...
Definition: r3d.h:379
void r3d_free_brep(r3d_brep **brep, r3d_int numcomponents)
Free all the memory associated with the boundary representation array.
void r3d_clip(r3d_poly *poly, r3d_plane *planes, r3d_int nplanes)
Clip a polyhedron against an arbitrary number of clip planes (find its intersection with a set of hal...
void r3d_init_poly(r3d_poly *poly, r3d_rvec3 *vertices, r3d_int numverts, r3d_int **faceinds, r3d_int *numvertsperface, r3d_int numfaces)
Initialize a general polyhedron from a full boundary description. Can use r3d_is_good to check that t...
struct r3d_brep r3d_brep
void r3d_init_brep(r3d_poly *poly, r3d_brep **brep, r3d_int *numcomponents)
Convert from R3D's internal vertex-edge format to the boundary representation.
void r3d_shift_moments(r3d_real *moments, r3d_int polyorder, r3d_rvec3 vc)
Adjust moments according to the shift of polyhedron vertices to the origin.
void r3d_box_faces_from_verts(r3d_plane *faces, r3d_rvec3 *rbounds)
Get six faces (unit normals and distances to the origin) from a two-vertex description of an axis-ali...
void r3d_reduce(r3d_poly *poly, r3d_int polyorder, r3d_real *moments)
Integrate a polynomial density over a convex polyhedron using simplicial decomposition.
r3d_int r3d_is_good(r3d_poly *poly)
Checks a polyhedron to see if all vertices have three valid edges, that all vertices are pointed to b...
void r3d_init_box(r3d_poly *poly, r3d_rvec3 *rbounds)
Initialize a polyhedron as an axis-aligned cube.
void r3d_init_tet(r3d_poly *poly, r3d_rvec3 *verts)
Initialize a polyhedron as a tetrahedron.
r3d_real r3d_orient(r3d_rvec3 *verts)
Get the signed volume of the tetrahedron defined by the input vertices.
void r3d_poly_faces_from_verts(r3d_plane *faces, r3d_rvec3 *vertices, r3d_int numverts, r3d_int **faceinds, r3d_int *numvertsperface, r3d_int numfaces)
Get all faces (unit normals and distances to the origin) from a full boundary description of a polyhe...
void r3d_shear(r3d_poly *poly, r3d_real shear, r3d_int axb, r3d_int axs)
Shear a polyhedron. Each vertex undergoes the transformation pos.xyz[axb] += shear*pos.xyz[axs].
void r3d_affine(r3d_poly *poly, r3d_real mat[4][4])
Apply a general affine transformation to a polyhedron.
void r3d_rotate(r3d_poly *poly, r3d_real theta, r3d_int axis)
Rotate a polyhedron about one axis.
void r3d_print_brep(r3d_brep **brep, r3d_int numcomponents)
Prints the boundary representation of an array of polyhedons given in boundary representation form...
double r3d_real
Real type specifying the precision to be used in calculations.
Definition: r3d.h:40
void r3d_split(r3d_poly *inpolys, r3d_int npolys, r3d_plane plane, r3d_poly *out_pos, r3d_poly *out_neg)
Splits a list of polyhedra across a single plane.
void r3d_print(r3d_poly *poly)
Prints the vertices and connectivity of a polyhedron. For debugging.