BRL-CAD
bn_private.h
Go to the documentation of this file.
1 /* B N _ P R I V A T E . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2013-2014 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 /** @addtogroup libbn */
22 /** @{ */
23 /** @file bn_private.h
24  *
25  * Private header file for the BRL-CAD Numerical Computation Library, LIBBN.
26  *
27  */
28 
29 #ifndef LIBBN_BN_PRIVATE_H
30 #define LIBBN_BN_PRIVATE_H
31 
32 #include "common.h"
33 #include "vmath.h"
34 
35 /**
36  * @brief
37  * Find a 2D coordinate system for a set of co-planar 3D points
38  *
39  * Based on the planar normal and the vector from the center point to the
40  * point furthest from that center, find vectors describing a 2D coordinate system.
41  *
42  * @param[out] origin_pnt Origin of 2D coordinate system in 3 space
43  * @param[out] u_axis 3D vector describing the U axis of the 2D coordinate system in 3 space
44  * @param[out] v_axis 3D vector describing the V axis of the 2D coordinate system in 3 space
45  * @param points_3d Array of 3D points
46  * @param n the number of points in the input set
47  * @return 0 if successful
48  */
49 int
50 coplanar_2d_coord_sys(point_t *origin_pnt, vect_t *u_axis, vect_t *v_axis, const point_t *points_3d, int n);
51 
52 /**
53  * @brief
54  * Find 2D coordinates for a set of co-planar 3D points
55  *
56  * @param[out] points_2d Array of parameterized 2D points
57  * @param origin_pnt Origin of 2D coordinate system in 3 space
58  * @param u_axis 3D vector describing the U axis of the 2D coordinate system in 3 space
59  * @param v_axis 3D vector describing the V axis of the 2D coordinate system in 3 space
60  * @param points_3d 3D input points
61  * @param n the number of points in the input set
62  * @return 0 if successful
63  */
64 int
65 coplanar_3d_to_2d(point2d_t **points_2d, const point_t *origin_pnt,
66  const vect_t *u_axis, const vect_t *v_axis,
67  const point_t *points_3d, int n);
68 
69 /**
70  * @brief
71  * Find 3D coordinates for a set of 2D points given a coordinate system
72  *
73  * @param[out] points_3d Array of 3D points
74  * @param origin_pnt Origin of 2D coordinate system in 3 space
75  * @param u_axis 3D vector describing the U axis of the 2D coordinate system in 3 space
76  * @param v_axis 3D vector describing the V axis of the 2D coordinate system in 3 space
77  * @param points_2d 2D input points
78  * @param n the number of points in the input set
79  * @return 0 if successful
80  */
81 int
82 coplanar_2d_to_3d(point_t **points_3d, const point_t *origin_pnt,
83  const vect_t *u_axis, const vect_t *v_axis,
84  const point2d_t *points_2d, int n);
85 
86 
87 #endif /* LIBBN_BN_PRIVATE_H */
88 
89 /** @} */
90 /*
91  * Local Variables:
92  * mode: C
93  * tab-width: 8
94  * indent-tabs-mode: t
95  * c-file-style: "stroustrup"
96  * End:
97  * ex: shiftwidth=4 tabstop=8
98  */
Header file for the BRL-CAD common definitions.
int coplanar_2d_coord_sys(point_t *origin_pnt, vect_t *u_axis, vect_t *v_axis, const point_t *points_3d, int n)
Find a 2D coordinate system for a set of co-planar 3D points.
Definition: util.c:29
int coplanar_3d_to_2d(point2d_t **points_2d, const point_t *origin_pnt, const vect_t *u_axis, const vect_t *v_axis, const point_t *points_3d, int n)
Find 2D coordinates for a set of co-planar 3D points.
Definition: util.c:93
int coplanar_2d_to_3d(point_t **points_3d, const point_t *origin_pnt, const vect_t *u_axis, const vect_t *v_axis, const point2d_t *points_2d, int n)
Find 3D coordinates for a set of 2D points given a coordinate system.
Definition: util.c:113