64#define BG_TRIMESH_EDGES_INIT_NULL {0, NULL}
65#define BG_TRIMESH_FACES_INIT_NULL {0, NULL}
66#define BG_TRIMESH_SOLID_ERRORS_INIT_NULL {BG_TRIMESH_FACES_INIT_NULL, BG_TRIMESH_EDGES_INIT_NULL, BG_TRIMESH_EDGES_INIT_NULL, BG_TRIMESH_EDGES_INIT_NULL}
188#define BG_TRIMESH_DECIMATION_METHOD_DEFAULT 0
189#define BG_TRIMESH_DECIMATION_SETTINGS_INIT {BG_TRIMESH_DECIMATION_METHOD_DEFAULT, 0.0, 0.0, 0, BU_VLS_INIT_ZERO}
217 int **faces_inside_1,
int *num_faces_inside_1,
int **faces_inside_2,
int *num_faces_inside_2,
218 int **faces_isect_1,
int *num_faces_isect_1,
int **faces_isect_2,
int *num_faces_isect_2,
219 int *faces_1,
int num_faces_1,
point_t *vertices_1,
int num_vertices_1,
220 int *faces_2,
int num_faces_2,
point_t *vertices_2,
int num_vertices_2);
250#define BG_TRIMESH_OPTIMIZATION_SETTINGS_INIT {0, 0.0, 0.0, 0}
272 int **ofaces,
int *n_ofaces,
274 const int *ifaces,
int n_ifaces,
296 const int *ifaces,
int n_ifaces,
const point2d_t *ipnts);
314 const int *faces,
int num_faces,
const point_t *in_pts);
403 const int *f1,
size_t num_f1,
const point_t *p1,
size_t num_p1,
404 const int *f2,
size_t num_f2,
const point_t *p2,
size_t num_p2,
451BG_EXPORT
extern unsigned long long
453 const int *f,
size_t num_f,
const point_t *p,
size_t num_p,
474#define BG_TRIMESH_REPAIR_OPTS_DEFAULT {0.0, 5.0}
503 int **ofaces,
int *n_ofaces,
505 const int *ifaces,
int n_ifaces,
506 const point_t *ipnts,
int n_ipnts,
527#define BG_TRIMESH_REMESH_OPTS_DEFAULT {0, 10.0, 0.04, 5, 30}
552 int **ofaces,
int *n_ofaces,
554 const int *ifaces,
int n_ifaces,
555 const point_t *ipnts,
int n_ipnts,
Header file for the BRL-CAD common definitions.
int bg_trimesh_hanging_nodes(int num_vertices, int num_faces, fastf_t *vertices, int *faces, struct bg_trimesh_solid_errors *errors)
int bg_trimesh_misoriented_edges(int num_edges, struct bg_trimesh_halfedge *edge_list, bg_edge_error_funct_t error_edge_func, void *data)
int bg_trimesh_aabb(point_t *min, point_t *max, const int *faces, size_t num_faces, const point_t *p, size_t num_pnts)
Calculate an axis aligned bounding box (RPP) for a triangle mesh.
int bg_trimesh_face_gather(int face_idx, void *data)
int bg_trimesh_sync(int *of, int *f, int fcnt)
Return a face set where all topologically connected faces are oriented consistently relative to their...
int bg_trimesh_diff(const int *f1, size_t num_f1, const point_t *p1, size_t num_p1, const int *f2, size_t num_f2, const point_t *p2, size_t num_p2, fastf_t dist_tol)
Compare two trimeshes to determine if they (within tolerance) define the same mesh.
int bg_trimesh_degenerate_faces(int num_faces, int *fpoints, bg_face_error_func_t degenerate_func, void *data)
int bg_trimesh_face_continue(int face_idx, void *data)
int bg_trimesh_edge_gather(struct bg_trimesh_halfedge *edge, void *data)
int bg_trimesh_excess_edges(int num_edges, struct bg_trimesh_halfedge *edge_list, bg_edge_error_funct_t error_edge_func, void *data)
int bg_trimesh_decimate(int **ofaces, int *n_ofaces, int *ifaces, int n_ifaces, point_t *p, int n_p, struct bg_trimesh_decimation_settings *s)
Decimate a mesh and return the decimated faces.
fastf_t bg_trimesh_area(const int *faces, size_t num_faces, const point_t *p, size_t num_pnts)
Calculate the surface area of a triangle mesh.
int bg_trimesh_edge_exit(struct bg_trimesh_halfedge *edge, void *data)
int bg_trimesh_oriented(int vcnt, int fcnt, fastf_t *v, int *f)
int bg_trimesh_manifold_closed(int vcnt, int fcnt, fastf_t *v, int *f)
int bg_trimesh_2d_gc(int **ofaces, int *n_ofaces, point2d_t **opnts, int *n_opnts, const int *ifaces, int n_ifaces, const point2d_t *ipnts)
Return trimesh information for a planar (2D) mesh that contains just the set of points active in the ...
int bg_trimesh_optimize(int **ofaces, int *n_ofaces, point_t **opnts, vect_t **onorms, int *n_opnts, const int *ifaces, int n_ifaces, const point_t *ipnts, const vect_t *inorms, struct bg_trimesh_optimization_settings *s)
Return trimesh information for a 3D mesh that contains just the date needed to represent in the mesh....
int bg_trimesh_edge_continue(struct bg_trimesh_halfedge *edge, void *data)
void bg_free_trimesh_edges(struct bg_trimesh_edges *edges)
int bg_trimesh_unmatched_edges(int num_edges, struct bg_trimesh_halfedge *edge_list, bg_edge_error_funct_t error_edge_func, void *data)
int bg_trimesh_3d_gc(int **ofaces, point_t **opnts, int *n_opnts, const int *faces, int num_faces, const point_t *in_pts)
Return trimesh information for a 3D mesh that contains just the set of points active in the mesh.
int bg_trimesh_isect(int **faces_inside_1, int *num_faces_inside_1, int **faces_inside_2, int *num_faces_inside_2, int **faces_isect_1, int *num_faces_isect_1, int **faces_isect_2, int *num_faces_isect_2, int *faces_1, int num_faces_1, point_t *vertices_1, int num_vertices_1, int *faces_2, int num_faces_2, point_t *vertices_2, int num_vertices_2)
int bg_trimesh_2d_plot3(const char *fname, const int *faces, size_t num_faces, const point2d_t *pnts, size_t num_pnts)
Return a set of face sets where all topologically connected faces are grouped into common sets.
int bg_trimesh_split(int ***ofs, int **ofc, int *f, int fcnt)
Return a set of face sets where all topologically connected faces are grouped into common sets.
int bg_trimesh_remesh(int **ofaces, int *n_ofaces, point_t **opnts, int *n_opnts, const int *ifaces, int n_ifaces, const point_t *ipnts, int n_ipnts, struct bg_trimesh_remesh_opts *opts)
Remesh a triangle mesh to improve element quality and/or change density.
int(* bg_face_error_func_t)(int face_idx, void *data)
fastf_t bg_trimesh_volume(const int *faces, size_t num_faces, const point_t *p, size_t num_pnts)
struct bg_trimesh_halfedge * bg_trimesh_generate_edge_list(int fcnt, int *f)
int bg_trimesh_solid2(int vcnt, int fcnt, fastf_t *v, int *f, struct bg_trimesh_solid_errors *errors)
int bg_trimesh_face_exit(int face_idx, void *data)
int bg_trimesh_normals(vect_t **onorms, int *ifaces, int n_ifaces, point_t *p, int n_p)
Compute vertex normals for a mesh based on the connected faces.
void bg_free_trimesh_solid_errors(struct bg_trimesh_solid_errors *errors)
int bg_trimesh_repair(int **ofaces, int *n_ofaces, point_t **opnts, int *n_opnts, const int *ifaces, int n_ifaces, const point_t *ipnts, int n_ipnts, struct bg_trimesh_repair_opts *opts)
Attempt to repair a non-manifold triangle mesh so that it becomes a closed, consistently-oriented sol...
int(* bg_edge_error_funct_t)(struct bg_trimesh_halfedge *edge, void *data)
void bg_free_trimesh_faces(struct bg_trimesh_faces *faces)
unsigned long long bg_trimesh_hash(const int *f, size_t num_f, const point_t *p, size_t num_p, fastf_t dist_tol)
Generate a hash from the mesh data, using the tolerance parameter to clamp the numerical values....
int bg_trimesh_solid(int vcnt, int fcnt, fastf_t *v, int *f, int **bedges)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
double fastf_t
fastest 64-bit (or larger) floating point type
fastf_t point2d_t[ELEMENTS_PER_POINT2D]
2-tuple point
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Algorithms related to 3D meshes built from triangles.
fastf_t degenerate_edge_length
fastf_t max_hole_area_percent
struct bg_trimesh_edges excess
struct bg_trimesh_edges misoriented
struct bg_trimesh_faces degenerate
struct bg_trimesh_edges unmatched
fundamental vector, matrix, quaternion math macros