r2d.h
Go to the documentation of this file.
12 * Laboratory (LANL) under contract No. DE-AC52-06NA25396 with the U.S. Department of Energy (DOE).
14 * Permission is granted to the public to copy and use this software without charge, provided that
63 r2d_real xy[2];
74 r2d_int ij[2];
89 r2d_int pnbrs[2];
140 void r2d_split(r2d_poly* inpolys, r2d_int npolys, r2d_plane plane, r2d_poly* out_pos, r2d_poly* out_neg);
void r2d_print(r2d_poly *poly)
Prints the vertices and connectivity of a polygon. For debugging.
void r2d_poly_faces_from_verts(r2d_plane *faces, r2d_rvec2 *vertices, r2d_int numverts)
Get all faces (unit normals and distances to the origin) from a general boundary description of a pol...
void r2d_affine(r2d_poly *poly, r2d_real mat[3][3])
Apply a general affine transformation to a polygon.
void r2d_clip(r2d_poly *poly, r2d_plane *planes, r2d_int nplanes)
Clip a polygon against an arbitrary number of clip planes (find its intersection with a set of half-s...
r2d_real r2d_orient(r2d_rvec2 pa, r2d_rvec2 pb, r2d_rvec2 pc)
Get the signed volume of the triangle defined by the input vertices.
void r2d_init_box(r2d_poly *poly, r2d_rvec2 *rbounds)
Initialize a polygon as an axis-aligned box.
void r2d_reduce(r2d_poly *poly, r2d_int polyorder, r2d_real *moments)
Integrate a polynomial density over a polygon using simplicial decomposition.
r2d_int r2d_is_good(r2d_poly *poly)
Checks a polygon to see if all vertices have two valid edges, that all vertices are pointed to by two...
void r2d_shear(r2d_poly *poly, r2d_real shear, r2d_int axb, r2d_int axs)
Shear a polygon. Each vertex undergoes the transformation pos.xy[axb] += shear*pos.xy[axs].
void r2d_shift_moments(r2d_real *moments, r2d_int polyorder, r2d_rvec2 vc)
Adjust moments according to the shift of polygon vertices to the origin.
void r2d_split(r2d_poly *inpolys, r2d_int npolys, r2d_plane plane, r2d_poly *out_pos, r2d_poly *out_neg)
Splits a list of polygons across a single plane.
void r2d_init_poly(r2d_poly *poly, r2d_rvec2 *vertices, r2d_int numverts)
Initialize a (simply-connected) general polygon from a list of vertices. Can use r2d_is_good to check...
double r2d_real
Real type specifying the precision to be used in calculations.
Definition: r2d.h:40
void r2d_box_faces_from_verts(r2d_plane *faces, r2d_rvec2 *rbounds)
Get four faces (unit normals and distances to the origin) from a two-vertex description of an axis-al...