BRL-CAD
Loading...
Searching...
No Matches
trimesh.h
Go to the documentation of this file.
1/* T R I M E S H . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2004-2025 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20
21/*----------------------------------------------------------------------*/
22/* @file trimesh.h */
23/** @addtogroup bg_trimesh */
24/** @{ */
25
26/**
27 * @brief
28 * Algorithms related to 3D meshes built from triangles.
29 */
30
31#ifndef BG_TRIMESH_H
32#define BG_TRIMESH_H
33
34#include "common.h"
35#include "vmath.h"
36#include "bg/defines.h"
37#include "bu/vls.h"
38
39__BEGIN_DECLS
40
42 int va, vb;
44};
45
46/* every pair of contiguous elements is the start and end vertex index of an edge */
48 int count;
49 int *edges;
50};
51
53 int count;
54 int *faces;
55};
56
63
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}
67
68BG_EXPORT extern void bg_free_trimesh_edges(struct bg_trimesh_edges *edges);
69BG_EXPORT extern void bg_free_trimesh_faces(struct bg_trimesh_faces *faces);
70BG_EXPORT extern void bg_free_trimesh_solid_errors(struct bg_trimesh_solid_errors *errors);
71
72/**
73 * Check if a mesh is topologically closed and manifold. True if for
74 * every edge, there is exactly one other edge with the same two end
75 * vertices.
76 */
77BG_EXPORT extern int bg_trimesh_manifold_closed(int vcnt, int fcnt, fastf_t *v, int *f);
78
79/**
80 * Check if a mesh is consistently oriented. True if for every edge
81 * that has exactly one matching edge, the two edges have opposite
82 * orientations. Note that an open mesh can be oriented, but a
83 * non-manifold mesh cannot.
84 */
85BG_EXPORT extern int bg_trimesh_oriented(int vcnt, int fcnt, fastf_t *v, int *f);
86
87/**
88 * Check if a mesh is topologically solid. Returns 1 if the mesh is NOT SOLID
89 * and 0 if the mesh is SOLID. A SOLID (0) outcome indicates the mesh satisfies
90 * all three criteria: Closed, Manifold, Oriented
91 */
92BG_EXPORT extern int bg_trimesh_solid(int vcnt, int fcnt, fastf_t *v, int *f, int **bedges);
93
94/* The below functions are for use as arguments to error tests. Given
95 * a face/edge, they return true if the caller should continue
96 * iterating through faces/edges, and false otherwise.
97 *
98 * The *_exit and *_continue functions just return false and true
99 * respectively. The *_gather functions expect the data argument to
100 * be a struct bg_trimesh_faces or struct bg_trimesh_edges with
101 * pre-allocated members of the correct size and count members set to
102 * 0, that they will populate.
103 */
104typedef int (*bg_face_error_func_t)(int face_idx, void *data);
105typedef int (*bg_edge_error_funct_t)(struct bg_trimesh_halfedge *edge, void *data);
106
107BG_EXPORT extern int bg_trimesh_face_exit(int face_idx, void *data);
108BG_EXPORT extern int bg_trimesh_face_continue(int face_idx, void *data);
109BG_EXPORT extern int bg_trimesh_face_gather(int face_idx, void *data);
110BG_EXPORT extern int bg_trimesh_edge_exit(struct bg_trimesh_halfedge *edge, void *data);
111BG_EXPORT extern int bg_trimesh_edge_continue(struct bg_trimesh_halfedge *edge, void *data);
112BG_EXPORT extern int bg_trimesh_edge_gather(struct bg_trimesh_halfedge *edge, void *data);
113
114/* These functions return 0 if no instances of the error are found.
115 * Otherwise, they return the number of instances of the error found
116 * before the error function argument returned false (at least 1).
117 */
118BG_EXPORT extern int bg_trimesh_degenerate_faces(int num_faces, int *fpoints, bg_face_error_func_t degenerate_func, void *data);
119BG_EXPORT extern int bg_trimesh_unmatched_edges(int num_edges, struct bg_trimesh_halfedge *edge_list, bg_edge_error_funct_t error_edge_func, void *data);
120BG_EXPORT extern int bg_trimesh_misoriented_edges(int num_edges, struct bg_trimesh_halfedge *edge_list, bg_edge_error_funct_t error_edge_func, void *data);
121BG_EXPORT extern int bg_trimesh_excess_edges(int num_edges, struct bg_trimesh_halfedge *edge_list, bg_edge_error_funct_t error_edge_func, void *data);
122BG_EXPORT extern int bg_trimesh_solid2(int vcnt, int fcnt, fastf_t *v, int *f, struct bg_trimesh_solid_errors *errors);
123BG_EXPORT extern int bg_trimesh_hanging_nodes(int num_vertices, int num_faces, fastf_t *vertices, int *faces, struct bg_trimesh_solid_errors *errors);
124
125BG_EXPORT extern struct bg_trimesh_halfedge * bg_trimesh_generate_edge_list(int fcnt, int *f);
126
127/**
128 * @brief
129 * Calculate an axis aligned bounding box (RPP) for a triangle mesh.
130 *
131 * NOTE: This routine bounds only those points that are active in the triangle
132 * mesh, not all points present in the supplied points array.
133 *
134 * @param[out] min XYZ coordinate defining the minimum bbox point
135 * @param[out] max XYZ coordinate defining the maximum bbox point
136 * @param[in] faces array of trimesh faces
137 * @param[in] num_faces size of faces array
138 * @param[in] p array that holds the points defining the trimesh
139 * @param[in] num_pnts size of pnts array
140 */
141BG_EXPORT extern int
142bg_trimesh_aabb(point_t *min, point_t *max, const int *faces, size_t num_faces, const point_t *p, size_t num_pnts);
143
144/**
145 * @brief
146 * Calculate the surface area of a triangle mesh.
147 *
148 * @param[in] faces array of trimesh faces
149 * @param[in] num_faces size of faces array
150 * @param[in] p array that holds the points defining the trimesh
151 * @param[in] num_pnts size of pnts array
152 *
153 * @return -1 if error, else area of mesh in millimeters
154 */
155BG_EXPORT extern fastf_t
156bg_trimesh_area(const int *faces, size_t num_faces, const point_t *p, size_t num_pnts);
157
158
159/* Structure holding user-adjustable decimation settings */
161 int method; // Select decimation method to use
162 fastf_t feature_size; // Smallest feature size (mm) to leave undecimated
163 fastf_t max_runtime; // If the decimation takes more than max_runtime seconds, abort
164 size_t max_threads; // Don't use more than max_threads when processing.
165 struct bu_vls msgs; // Messages reported during decimation
166};
167#define BG_TRIMESH_DECIMATION_METHOD_DEFAULT 0
168#define BG_TRIMESH_DECIMATION_SETTINGS_INIT {BG_TRIMESH_DECIMATION_METHOD_DEFAULT, 0.0, 0.0, 0, BU_VLS_INIT_ZERO}
169
170/**
171 * @brief
172 * Decimate a mesh and return the decimated faces.
173 *
174 * @param[out] ofaces faces array for the new output mesh
175 * @param[out] n_ofaces length of ofaces array
176 * @param[in] ifaces array of input trimesh
177 * @param[in] n_ifaces size of input faces array
178 * @param[in] p array that holds the points defining the trimesh
179 * @param[in] n_p size of points array
180 * @param[in] s decimation settings
181 *
182 * NOTE: This routine will not produce a points array that includes only the
183 * points used in the decimated mesh - to generate that output, use the
184 * bg_trimesh_3d_gc routine with the ofaces set produced by this function.
185 *
186 * @return -1 if error, 0 if successful */
187BG_EXPORT extern int bg_trimesh_decimate(int **ofaces, int *n_ofaces,
188 int *ifaces, int n_ifaces, point_t *p, int n_p, struct bg_trimesh_decimation_settings *s);
189
190
191/* Make an attempt at a trimesh intersection calculator that returns the sets
192 * of faces intersecting and inside the other for each mesh. Doesn't attempt
193 * a boolean evaluation, just characterizes faces */
194BG_EXPORT extern int
196 int **faces_inside_1, int *num_faces_inside_1, int **faces_inside_2, int *num_faces_inside_2,
197 int **faces_isect_1, int *num_faces_isect_1, int **faces_isect_2, int *num_faces_isect_2,
198 int *faces_1, int num_faces_1, point_t *vertices_1, int num_vertices_1,
199 int *faces_2, int num_faces_2, point_t *vertices_2, int num_vertices_2);
200
201/**
202 * @brief
203 * Compute vertex normals for a mesh based on the connected faces.
204 *
205 * @param[out] onorms array of normals - will have the same length as the input points array
206 * @param[in] ifaces array of input trimesh
207 * @param[in] n_ifaces size of input faces array
208 * @param[in] p array that holds the points defining the trimesh
209 * @param[in] n_p size of points array
210 *
211 * NOTE: Any vertex point not used by the triangles in the trimesh will have a
212 * zero normal in the onorms array. This routine does not repack the data to
213 * eliminate unused vertices - for that use bg_trimesh_optimize
214 *
215 * @return -1 if error, 0 if successful */
216BG_EXPORT extern int bg_trimesh_normals(vect_t **onorms, int *ifaces, int n_ifaces, point_t *p, int n_p);
217
218
219/* Various additional mesh optimization steps that can be enabled
220 * NOTE: If we want to look at exposing the capabilities of something like
221 * https://github.com/zeux/meshoptimizer this would be the place to start... */
223 int collapse_degenerate; // Remove degenerate faces
224 fastf_t degenerate_edge_length; // If near zero and collapse_degenerate is set, only collapse triangles with two or more uses of the exact same vertex
225 fastf_t max_runtime; // If the optimization takes more than max_runtime seconds, abort
226 size_t max_threads; // Don't use more than max_threads when processing.
227};
228
229#define BG_TRIMESH_OPTIMIZATION_SETTINGS_INIT {0, 0.0, 0.0, 0}
230
231/**
232 * @brief
233 * Return trimesh information for a 3D mesh that contains just the date needed
234 * to represent in the mesh. Used to finalize intermediate processing meshes
235 * to generate a compact mesh for export or storage.
236 *
237 * @param[out] ofaces faces array for the new output mesh with new indices based on opnts array.
238 * @param[out] n_ofaces length of ofaces array
239 * @param[out] opnts compact points array for the new output mesh.
240 * @param[out] onorms (optional) compact normals array for the output mesh's points.
241 * @param[out] n_opnts length of opnts array.
242 * @param[in] ifaces array of input trimesh
243 * @param[in] n_ifaces size of input faces array
244 * @param[in] ipnts array that holds the points defining the original trimesh
245 * @param[in] inorms (optional) array that holds the normals for the mesh vertices
246 * @param[in] s (optional) settings to enable various additional processing steps
247 *
248 * @return -1 if error, number of faces in new trimesh if successful
249 */
250BG_EXPORT extern int bg_trimesh_optimize(
251 int **ofaces, int *n_ofaces,
252 point_t **opnts, vect_t **onorms, int *n_opnts,
253 const int *ifaces, int n_ifaces,
254 const point_t *ipnts, const vect_t *inorms,
256
257
258/**
259 * @brief
260 * Return trimesh information for a planar (2D) mesh that contains just the set
261 * of points active in the mesh.
262 *
263 * @param[out] ofaces faces array for the new output mesh
264 * @param[out] n_ofaces length of ofaces array
265 * @param[out] opnts points array for the new output mesh
266 * @param[out] n_opnts length of opnts array
267 * @param[in] ifaces array of input trimesh
268 * @param[in] n_ifaces size of input faces array
269 * @param[in] ipnts array that holds the points defining the original trimesh
270 *
271 * @return -1 if error, number of faces in new trimesh if successful (should
272 * match the original face count)
273 */
274BG_EXPORT extern int bg_trimesh_2d_gc(int **ofaces, int *n_ofaces, point2d_t **opnts, int *n_opnts,
275 const int *ifaces, int n_ifaces, const point2d_t *ipnts);
276
277/**
278 * @brief
279 * Return trimesh information for a 3D mesh that contains just the set
280 * of points active in the mesh.
281 *
282 * @param[out] ofaces faces array for the new output mesh.
283 * @param[out] opnts points array for the new output mesh.
284 * @param[out] n_opnts length of opnts array.
285 * @param[in] faces array of input trimesh
286 * @param[in] num_faces size of input faces array
287 * @param[in] in_pts holds the points defining the original trimesh
288 *
289 * @return -1 if error, number of faces in new trimesh if successful (should
290 * match the original face count)
291 */
292BG_EXPORT extern int bg_trimesh_3d_gc(int **ofaces, point_t **opnts, int *n_opnts,
293 const int *faces, int num_faces, const point_t *in_pts);
294
295/**
296 * @brief
297 * Return a face set where all topologically connected faces are oriented
298 * consistently relative to their neighbors.
299 *
300 * @param[out] of faces array for the new output mesh (of==f is valid).
301 * @param[in] f input set of faces.
302 * @param[in] fcnt input face count
303 *
304 * @return -1 if error, otherwise return the number of times a face flipping
305 * operation was performed
306 */
307BG_EXPORT extern int
308bg_trimesh_sync(int *of, int *f, int fcnt);
309
310/**
311 * @brief
312 * Return a set of face sets where all topologically connected faces are
313 * grouped into common sets.
314 *
315 * @param[out] ofs array of faces arrays containing the new output face sets.
316 * @param[out] ofc array of face counts for the new output face sets.
317 * @param[in] f input set of faces.
318 * @param[in] fcnt input face count
319 *
320 * @return -1 if error, otherwise return the number of face sets created
321 */
322BG_EXPORT extern int
323bg_trimesh_split(int ***ofs, int **ofc, int *f, int fcnt);
324
325/**
326 * @brief
327 * Return a set of face sets where all topologically connected faces are
328 * grouped into common sets.
329 *
330 * @param[in] fname plot file name
331 * @param[in] faces face index array
332 * @param[in] num_faces number of faces
333 * @param[in] pnts points array
334 * @param[in] num_pnts number of points
335 *
336 * @return BRLCAD_ERROR if error, otherwise return BRLCAD_OK
337 */
338BG_EXPORT extern int
339bg_trimesh_2d_plot3(const char *fname, const int *faces, size_t num_faces, const point2d_t *pnts, size_t num_pnts);
340
341/**
342 * @brief
343 * Compare two trimeshes to determine if they (within tolerance) define the
344 * same mesh.
345 *
346 * This is a fairly focused function whose purpose is to spot meshes that have
347 * potentially gone through numerical or topological reordering but still
348 * define the same volume (for example, meshes that have been rotated or
349 * translated and then returned to an origin with PCA.) By design it does not
350 * analyze the differences to report on why two meshes differ - it simply
351 * returns a yes/no decision. Different vertex or face counts are grounds
352 * for immediate declaration the meshes differ - no effort is made to look for
353 * duplicate vertices or degenerate faces. Any such clean-ups must be performed
354 * before calling this function.
355 *
356 * The specification of a distance tolerance is used for vertex comparisons.
357 * Below the specified threshold, vertices that would otherwise be considered
358 * rejection criteria for being different will be considered the same.
359 * HOWEVER, that tolerance does NOT merge vertices - rather, when vertices are
360 * organized and sorted for comparison the candidate pairing vertices in the
361 * arrays are compared using the tolerance.
362 *
363 * Both vertex positions and face topology must be compatible - faces may use a
364 * different starting vertex (i.e. 0->1->2 and 1->2->0 are considered to be the
365 * same) but the ordering must be consistent (i.e. 0->2->1 would not be
366 * considered the same.)
367 *
368 * @param[in] f1 face index array referencing points in p1
369 * @param[in] num_f1 number of faces in f1
370 * @param[in] p1 first points array
371 * @param[in] num_p1 number of points in p1
372 * @param[in] f2 face index array referencing points in p2
373 * @param[in] num_f2 number of faces in f2
374 * @param[in] p2 second points array
375 * @param[in] num_p2 number of points in p2
376 * @param[in] dist_tol distance in mm below which points are considered the same
377 *
378 * @return 0 if same, otherwise return 1.
379 */
380BG_EXPORT extern int
382 const int *f1, size_t num_f1, const point_t *p1, size_t num_p1,
383 const int *f2, size_t num_f2, const point_t *p2, size_t num_p2,
384 fastf_t dist_tol
385 );
386
387/**
388 * @brief
389 * Generate a hash from the mesh data, using the tolerance parameter to
390 * clamp the numerical values. Both vertex positions and face topology
391 * are considered, in a style similar to bg_trimesh_diff.
392 *
393 * The clamping needed to generate a hash value will increase the chances of
394 * two similar meshes having the same hash, but the nature of numerical
395 * clamping results in some very close but not exact values clamping in
396 * opposite directions. Without global awareness of all vertex points at play
397 * in a database it is not possible to establish a binning that will work for
398 * all meshes in the same way (and there are no guarantees it is possible even
399 * with that knowledge, strictly speaking.) For a proper distance-based
400 * comparison of two meshes, bg_trimesh_diff should be used rather than
401 * comparing hash values. However, if mesh hash values DO match then the
402 * associated meshes should be quite close to being the same geometry per the
403 * specified tolerance - and in practice there are situations where we can get
404 * enough matching hashes to be useful - trial runs of PCA oriented BoT object
405 * grouping on a large database were able to identify matching hashes for
406 * about 80% of the cases were bg_trimesh_diff was able to geometrically
407 * identify fuzzy matches.
408 *
409 * Applications for this hash include looking up data associated with meshes
410 * via hash keys - if a large majority of duplicate meshes can be spotted in a
411 * .g database and indexed this way, it makes it possible to reduce the amount
412 * of duplicate data being stored. It is also possible to associated meshes
413 * with their hashes and then use a bg_trimesh_diff result to further map those
414 * hashes to unique data copies.
415 *
416 * TODO - look into whether some form of similarity hash might do better for
417 * our purposes here:
418 * https://github.com/seomoz/simhash-cpp
419 * https://github.com/FALCONN-LIB/FALCONN
420 * https://github.com/trendmicro/tlsh
421 *
422 * @param[in] f face index array referencing points in p
423 * @param[in] num_f number of faces in f
424 * @param[in] p points array
425 * @param[in] num_p number of points in p
426 * @param[in] dist_tol tolerance used when clamping points
427 *
428 * @return the bu_data_hash value of the mesh.
429 */
430BG_EXPORT extern unsigned long long
432 const int *f, size_t num_f, const point_t *p, size_t num_p,
433 fastf_t dist_tol
434 );
435
436
437
438
439__END_DECLS
440
441#endif /* BG_TRIMESH_H */
442/** @} */
443/*
444 * Local Variables:
445 * mode: C
446 * tab-width: 8
447 * indent-tabs-mode: t
448 * c-file-style: "stroustrup"
449 * End:
450 * ex: shiftwidth=4 tabstop=8
451 */
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_face_error_func_t)(int face_idx, void *data)
Definition trimesh.h:104
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_edge_error_funct_t)(struct bg_trimesh_halfedge *edge, void *data)
Definition trimesh.h:105
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)
void int char int int double * min
Definition tig.h:182
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
Definition vmath.h:349
double fastf_t
fastest 64-bit (or larger) floating point type
Definition vmath.h:334
fastf_t point2d_t[ELEMENTS_PER_POINT2D]
2-tuple point
Definition vmath.h:343
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition vmath.h:355
Algorithms related to 3D meshes built from triangles.
Definition trimesh.h:41
struct bg_trimesh_edges excess
Definition trimesh.h:60
struct bg_trimesh_edges misoriented
Definition trimesh.h:61
struct bg_trimesh_faces degenerate
Definition trimesh.h:58
struct bg_trimesh_edges unmatched
Definition trimesh.h:59
Definition vls.h:53
NMG topological edge.
Definition topology.h:144
fundamental vector, matrix, quaternion math macros