BRL-CAD
pnts.h
Go to the documentation of this file.
1 /* P N T S . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2008-2024 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 /** @addtogroup libanalyze
21  *
22  * Using ray intersection, sample the database object obj and return a pnts
23  * primitive.
24  *
25  */
26 /** @{ */
27 /** @file include/analyze.h */
28 
29 #ifndef ANALYZE_PNTS_H
30 #define ANALYZE_PNTS_H
31 
32 #include "common.h"
33 #include "raytrace.h"
34 
35 #include "analyze/defines.h"
36 
37 __BEGIN_DECLS
38 
39 /**
40  * Using ray intersection, sample the database object obj and return a pnts
41  * primitive.
42  *
43  * For the grid sampling method, the tolerance sets the number of rays fired.
44  * max_time and max_pnts do *not* impact the GRID sampling logic.
45  *
46  * The max_pnts limit will cap the number of reported points for the
47  * pseudorandom sampling methods, on a per method basis - i.e., the function
48  * will return up to max_pnts for each non-grid sampling method that is
49  * enabled. If unset, the maximum pnt count return is 500,000 per method
50  * (except for GRID).
51  *
52  * Likewise, max_time will limit the run time of each pseudorandom method, with
53  * the total limit for all methods being method_cnt_enabled * max_time.
54  *
55  * Return codes:
56  *
57  * -1 - error
58  * 0 - success
59  *
60  */
61 #define ANALYZE_OBJ_TO_PNTS_SURF 0x1 /**< @brief save only the first and last hit point on a ray */
62 #define ANALYZE_OBJ_TO_PNTS_GRID 0x2 /**< @brief sample using an XYZ grid based on the bounding box (default if no method flags are specified) */
63 #define ANALYZE_OBJ_TO_PNTS_RAND 0x4 /**< @brief sample using Marsaglia sampling on the bounding sphere with pseudo random numbers */
64 #define ANALYZE_OBJ_TO_PNTS_SOBOL 0x8 /**< @brief sample using Marsaglia sampling on the bounding sphere with Sobol' low-discrepancy-sequence generation */
65 ANALYZE_EXPORT int analyze_obj_to_pnts(struct rt_pnts_internal *rpnts, double *avg_thickness, struct db_i *dbip,
66  const char *obj, struct bn_tol *tol, int flags, int max_pnts, int max_time, int verbosity);
67 
68 __END_DECLS
69 
70 #endif /* ANALYZE_PNTS_H */
71 
72 /** @} */
73 
74 /*
75  * Local Variables:
76  * tab-width: 8
77  * mode: C
78  * indent-tabs-mode: t
79  * c-file-style: "stroustrup"
80  * End:
81  * ex: shiftwidth=4 tabstop=8
82  */
Header file for the BRL-CAD common definitions.
int analyze_obj_to_pnts(struct rt_pnts_internal *rpnts, double *avg_thickness, struct db_i *dbip, const char *obj, struct bn_tol *tol, int flags, int max_pnts, int max_time, int verbosity)
Definition: tol.h:72