5 #include "cgmath/cgmath.h"
15 struct cmesh *mesh; /* no ownership */
16 struct frac_cell *cells; /* dynarr */
19 int frac_init(struct fracture *frac);
20 void frac_destroy(struct fracture *frac);
22 /* fracture does not take ownership of the mesh, and does not modify it */
23 void frac_mesh(struct fracture *frac, const struct cmesh *m);
25 int frac_point(struct fracture *frac, float x, float y, float z);
26 int frac_num_cells(struct fracture *frac);
28 /* add a bunch of random points in the bounding box of the mesh */
29 int frac_gen_points(struct fracture *frac, int num);
31 /* construct the voronoi cells */
32 int frac_build_cells(struct fracture *frac);
33 /* generate the polygons for the outer shell of each cell */
34 int frac_build_shell(struct fracture *frac);
35 /* generate the polygons for the inner walls of the cells */
36 int frac_build_walls(struct fracture *frac);
38 /* perform all the steps in order */
39 int frac_build(struct fracture *frac);