BRL-CAD
Loading...
Searching...
No Matches
ballpivot.h
Go to the documentation of this file.
1/* B A L L P I V O T . H
2 * BRL-CAD
3 *
4 * Copyright (c) 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/** @file ballpivot.h */
21/** @addtogroup bg_surf_recon_ballpivot */
22/** @{ */
23
24/**
25 * @brief Surface Reconstruction using Ball Pivoting
26 *
27 * This functionality is based on the Bernardini et. al. work from
28 * 1999 describing a method of defining a surface on a point cloud
29 * with normals by "rolling" a 3D ball over the set of points and
30 * creating triangles where the ball does not fall through.
31 */
32
33
34#ifndef BG_BALLPIVOT_H
35#define BG_BALLPIVOT_H
36
37#include "common.h"
38#include "vmath.h"
39#include "bg/defines.h"
40
41__BEGIN_DECLS
42
43/**
44 *@brief
45 * Build a surface reconstruction (triangle mesh) using the Ball Pivot
46 * methodology. Note that this has fewer topology guarantees as compared to
47 * the SPSR method, so callers must validate that the output has the
48 * properties they are looking for.
49 *
50 * @param[out] faces set of faces in the output surface, stored as integer indices to the vertices. The first three indices are the vertices of the face, the second three define the second face, and so forth.
51 * @param[out] num_faces the number of faces in the faces array
52 * @param[out] vertices the set of vertices used by the surface.
53 * @param[out] num_vertices the number of vertices in the surface.
54 * @param input_points_3d The input points
55 * @param num_input_pnts the number of points in the input set
56 * @param radii array of ball radii to be used. If NULL, a default radius set is calculated based on the point data.
57 * @param radii_cnt number of radii in radii array
58 * @return 0 if successful, else error
59 *
60 */
61#define BG_3D_BALLPIVOT_DEFAULT_RADIUS -1
62BG_EXPORT int bg_3d_ballpivot(int **faces, int *num_faces, point_t **vertices, int *num_vertices,
63 const point_t *input_points_3d, const vect_t *input_normals_3d,
64 int num_input_pnts, const double *radii, int radii_cnt);
65
66__END_DECLS
67
68#endif /* BG_BALLPIVOT_H */
69/** @} */
70/*
71 * Local Variables:
72 * mode: C
73 * tab-width: 8
74 * indent-tabs-mode: t
75 * c-file-style: "stroustrup"
76 * End:
77 * ex: shiftwidth=4 tabstop=8
78 */
Header file for the BRL-CAD common definitions.
int bg_3d_ballpivot(int **faces, int *num_faces, point_t **vertices, int *num_vertices, const point_t *input_points_3d, const vect_t *input_normals_3d, int num_input_pnts, const double *radii, int radii_cnt)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
Definition vmath.h:349
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition vmath.h:355
fundamental vector, matrix, quaternion math macros