BRL-CAD
shell.h
Go to the documentation of this file.
1 /* S H E L L . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-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 
21 /*----------------------------------------------------------------------*/
22 /** @addtogroup nmg_shell */
23 /** @{ */
24 /** @file nmg/shell.h */
25 
26 #ifndef NMG_SHELL_H
27 #define NMG_SHELL_H
28 
29 #include "common.h"
30 
31 #include "vmath.h"
32 #include "bu/list.h"
33 #include "nmg/defines.h"
34 #include "nmg/topology.h"
35 
36 __BEGIN_DECLS
37 
38 #define NMG_CK_SHELL(_p) NMG_CKMAG(_p, NMG_SHELL_MAGIC, "shell")
39 #define NMG_CK_SHELL_A(_p) NMG_CKMAG(_p, NMG_SHELL_A_MAGIC, "shell_a")
40 
41 #define GET_SHELL(p, m) {NMG_GETSTRUCT(p, shell); NMG_INCR_INDEX(p, m);}
42 #define GET_SHELL_A(p, m) {NMG_GETSTRUCT(p, shell_a); NMG_INCR_INDEX(p, m);}
43 
44 #define FREE_SHELL(p) NMG_FREESTRUCT(p, shell)
45 #define FREE_SHELL_A(p) NMG_FREESTRUCT(p, shell_a)
46 
47 NMG_EXPORT extern void nmg_shell_a(struct shell *s,
48  const struct bn_tol *tol);
49 
50 /* From file nmg_mk.c */
51 /* MAKE routines */
52 NMG_EXPORT extern struct loopuse *nmg_ml(struct shell *s);
53 NMG_EXPORT extern int nmg_keu_zl(struct shell *s,
54  const struct bn_tol *tol);
55 NMG_EXPORT extern int nmg_ks(struct shell *s);
56 
57 NMG_EXPORT extern void nmg_shell_coplanar_face_merge(struct shell *s,
58  const struct bn_tol *tol,
59  const int simplify,
60  struct bu_list *vlfree);
61 NMG_EXPORT extern int nmg_simplify_shell(struct shell *s, struct bu_list *vlfree);
62 NMG_EXPORT extern void nmg_rm_redundancies(struct shell *s,
63  struct bu_list *vlfree,
64  const struct bn_tol *tol);
65 NMG_EXPORT extern void nmg_sanitize_s_lv(struct shell *s,
66  int orient);
67 NMG_EXPORT extern void nmg_s_split_touchingloops(struct shell *s,
68  const struct bn_tol *tol);
69 NMG_EXPORT extern void nmg_s_join_touchingloops(struct shell *s,
70  const struct bn_tol *tol);
71 NMG_EXPORT extern void nmg_js(struct shell *s1,
72  struct shell *s2,
73  struct bu_list *vlfree,
74  const struct bn_tol *tol);
75 NMG_EXPORT extern void nmg_invert_shell(struct shell *s);
76 
77 NMG_EXPORT extern int nmg_shell_is_empty(const struct shell *s);
78 NMG_EXPORT extern struct shell *nmg_find_s_of_lu(const struct loopuse *lu);
79 NMG_EXPORT extern struct shell *nmg_find_s_of_eu(const struct edgeuse *eu);
80 NMG_EXPORT extern struct shell *nmg_find_s_of_vu(const struct vertexuse *vu);
81 
82 
83 NMG_EXPORT extern struct shell *nmg_extrude_cleanup(struct shell *is, const int is_void, struct bu_list *vlfree, const struct bn_tol *tol);
84 NMG_EXPORT extern void nmg_hollow_shell(struct shell *s, const fastf_t thick, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol);
85 NMG_EXPORT extern struct shell *nmg_extrude_shell(struct shell *s, const fastf_t dist, const int normal_ward, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol);
86 
87 NMG_EXPORT extern void nmg_close_shell(struct shell *s, struct bu_list *vlfree,
88  const struct bn_tol *tol);
89 
90 NMG_EXPORT extern struct shell *nmg_dup_shell(struct shell *s,
91  long ***copy_tbl,
92  struct bu_list *vlfree,
93  const struct bn_tol *tol);
94 NMG_EXPORT extern void nmg_glue_face_in_shell(const struct faceuse *fu,
95  struct shell *s,
96  const struct bn_tol *tol);
97 NMG_EXPORT extern int nmg_open_shells_connect(struct shell *dst,
98  struct shell *src,
99  const long **copy_tbl,
100  struct bu_list *vlfree,
101  const struct bn_tol *tol);
102 NMG_EXPORT extern int nmg_simplify_shell_edges(struct shell *s,
103  const struct bn_tol *tol);
104 NMG_EXPORT extern char *nmg_shell_manifolds(struct shell *sp,
105  char *tbl);
106 
107 NMG_EXPORT extern void nmg_mv_vu_between_shells(struct shell *dest,
108  struct shell *src,
109  struct vertexuse *vu);
110 NMG_EXPORT extern struct shell *nmg_find_shell(const uint32_t *magic_p);
111 
112 NMG_EXPORT extern struct vertexuse *nmg_find_v_in_shell(const struct vertex *v,
113  const struct shell *s,
114  int edges_only);
115 NMG_EXPORT extern struct vertex *nmg_find_pnt_in_shell(const struct shell *s,
116  const point_t pt,
117  const struct bn_tol *tol);
118 NMG_EXPORT extern int nmg_is_vertex_a_selfloop_in_shell(const struct vertex *v,
119  const struct shell *s);
120 NMG_EXPORT extern struct shell *nmg_extrude_cleanup(struct shell *is, const int is_void, struct bu_list *vlfree, const struct bn_tol *tol);
121 NMG_EXPORT extern void nmg_hollow_shell(struct shell *s, const fastf_t thick, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol);
122 NMG_EXPORT extern struct shell *nmg_extrude_shell(struct shell *s, const fastf_t dist, const int normal_ward, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol);
123 
124 NMG_EXPORT extern struct face *nmg_find_top_face_in_dir(const struct shell *s,
125  int dir, long *flags);
126 NMG_EXPORT extern struct face *nmg_find_top_face(const struct shell *s,
127  int *dir,
128  long *flags);
129 NMG_EXPORT extern int nmg_find_outer_and_void_shells(struct nmgregion *r,
130  struct bu_ptbl ***shells,
131  struct bu_list *vlfree,
132  const struct bn_tol *tol);
133 NMG_EXPORT extern void nmg_isect_shell_self(struct shell *s,
134  struct bu_list *vlfree,
135  const struct bn_tol *tol);
136 NMG_EXPORT extern struct edgeuse *nmg_next_radial_eu(const struct edgeuse *eu,
137  const struct shell *s,
138  const int wires);
139 NMG_EXPORT extern struct edgeuse *nmg_prev_radial_eu(const struct edgeuse *eu,
140  const struct shell *s,
141  const int wires);
142 NMG_EXPORT extern int nmg_radial_face_count(const struct edgeuse *eu,
143  const struct shell *s);
144 NMG_EXPORT extern int nmg_check_closed_shell(const struct shell *s,
145  const struct bn_tol *tol);
146 NMG_EXPORT extern fastf_t nmg_shell_area(const struct shell *s);
147 NMG_EXPORT extern int nmg_shell_is_void(const struct shell *s);
148 NMG_EXPORT extern void nmg_connect_same_fu_orients(struct shell *s);
149 NMG_EXPORT extern void nmg_fix_decomposed_shell_normals(struct shell *s,
150  const struct bn_tol *tol);
151 NMG_EXPORT extern void nmg_fix_normals(struct shell *s_orig,
152  struct bu_list *vlfree,
153  const struct bn_tol *tol);
154 NMG_EXPORT extern int nmg_break_long_edges(struct shell *s,
155  const struct bn_tol *tol);
156 NMG_EXPORT extern int nmg_decompose_shell(struct shell *s, struct bu_list *vlfree,
157  const struct bn_tol *tol);
158 NMG_EXPORT extern void nmg_vlist_to_eu(struct bu_list *vlist,
159  struct shell *s);
160 NMG_EXPORT extern int nmg_mv_shell_to_region(struct shell *s,
161  struct nmgregion *r);
162 NMG_EXPORT extern int nmg_bad_face_normals(const struct shell *s,
163  const struct bn_tol *tol);
164 NMG_EXPORT extern void nmg_vlist_to_wire_edges(struct shell *s,
165  const struct bu_list *vhead);
166 NMG_EXPORT extern void nmg_follow_free_edges_to_vertex(const struct vertex *vpa,
167  const struct vertex *vpb,
168  struct bu_ptbl *bad_verts,
169  const struct shell *s,
170  const struct edgeuse *eu,
171  struct bu_ptbl *verts,
172  int *found);
173 NMG_EXPORT extern int nmg_kill_cracks(struct shell *s);
174 NMG_EXPORT extern void nmg_make_faces_within_tol(struct shell *s,
175  struct bu_list *vlfree,
176  const struct bn_tol *tol);
177 NMG_EXPORT extern void nmg_intersect_loops_self(struct shell *s,
178  const struct bn_tol *tol);
179 NMG_EXPORT extern void nmg_triangulate_shell(struct shell *s,
180  struct bu_list *vlfree,
181  const struct bn_tol *tol);
182 NMG_EXPORT extern int nmg_classify_s_vs_s(struct shell *s,
183  struct shell *s2,
184  struct bu_list *vlfree,
185  const struct bn_tol *tol);
186 NMG_EXPORT extern int nmg_class_pnt_s(const point_t pt,
187  const struct shell *s,
188  const int in_or_out_only,
189  struct bu_list *vlfree,
190  const struct bn_tol *tol);
191 NMG_EXPORT extern int nmg_mesh_face_shell(struct faceuse *fu1,
192  struct shell *s,
193  const struct bn_tol *tol);
194 NMG_EXPORT extern int nmg_mesh_shell_shell(struct shell *s1,
195  struct shell *s2,
196  struct bu_list *vlfree,
197  const struct bn_tol *tol);
198 NMG_EXPORT extern void nmg_class_shells(struct shell *sA,
199  struct shell *sB,
200  char **classlist,
201  struct bu_list *vlfree,
202  const struct bn_tol *tol);
203 NMG_EXPORT extern void nmg_evaluate_boolean(struct shell *sA,
204  struct shell *sB,
205  int op,
206  char **classlist,
207  struct bu_list *vlfree,
208  const struct bn_tol *tol);
209 
210 __END_DECLS
211 
212 #endif /* NMG_SHELL_H */
213 /** @} */
214 /*
215  * Local Variables:
216  * mode: C
217  * tab-width: 8
218  * indent-tabs-mode: t
219  * c-file-style: "stroustrup"
220  * End:
221  * ex: shiftwidth=4 tabstop=8
222  */
Header file for the BRL-CAD common definitions.
int nmg_decompose_shell(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
struct face * nmg_find_top_face_in_dir(const struct shell *s, int dir, long *flags)
char * nmg_shell_manifolds(struct shell *sp, char *tbl)
void nmg_class_shells(struct shell *sA, struct shell *sB, char **classlist, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_simplify_shell_edges(struct shell *s, const struct bn_tol *tol)
void nmg_rm_redundancies(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_mv_vu_between_shells(struct shell *dest, struct shell *src, struct vertexuse *vu)
int nmg_kill_cracks(struct shell *s)
void nmg_fix_normals(struct shell *s_orig, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_triangulate_shell(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
struct vertexuse * nmg_find_v_in_shell(const struct vertex *v, const struct shell *s, int edges_only)
int nmg_simplify_shell(struct shell *s, struct bu_list *vlfree)
struct shell * nmg_find_s_of_vu(const struct vertexuse *vu)
int nmg_check_closed_shell(const struct shell *s, const struct bn_tol *tol)
struct shell * nmg_find_s_of_eu(const struct edgeuse *eu)
int nmg_classify_s_vs_s(struct shell *s, struct shell *s2, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_mesh_shell_shell(struct shell *s1, struct shell *s2, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_js(struct shell *s1, struct shell *s2, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_vlist_to_wire_edges(struct shell *s, const struct bu_list *vhead)
struct face * nmg_find_top_face(const struct shell *s, int *dir, long *flags)
void nmg_s_join_touchingloops(struct shell *s, const struct bn_tol *tol)
struct shell * nmg_find_shell(const uint32_t *magic_p)
fastf_t nmg_shell_area(const struct shell *s)
struct shell * nmg_dup_shell(struct shell *s, long ***copy_tbl, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_shell_is_empty(const struct shell *s)
int nmg_find_outer_and_void_shells(struct nmgregion *r, struct bu_ptbl ***shells, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_class_pnt_s(const point_t pt, const struct shell *s, const int in_or_out_only, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_bad_face_normals(const struct shell *s, const struct bn_tol *tol)
void nmg_sanitize_s_lv(struct shell *s, int orient)
void nmg_follow_free_edges_to_vertex(const struct vertex *vpa, const struct vertex *vpb, struct bu_ptbl *bad_verts, const struct shell *s, const struct edgeuse *eu, struct bu_ptbl *verts, int *found)
void nmg_s_split_touchingloops(struct shell *s, const struct bn_tol *tol)
int nmg_ks(struct shell *s)
int nmg_keu_zl(struct shell *s, const struct bn_tol *tol)
int nmg_is_vertex_a_selfloop_in_shell(const struct vertex *v, const struct shell *s)
struct edgeuse * nmg_next_radial_eu(const struct edgeuse *eu, const struct shell *s, const int wires)
struct shell * nmg_find_s_of_lu(const struct loopuse *lu)
struct vertex * nmg_find_pnt_in_shell(const struct shell *s, const point_t pt, const struct bn_tol *tol)
int nmg_radial_face_count(const struct edgeuse *eu, const struct shell *s)
void nmg_invert_shell(struct shell *s)
void nmg_glue_face_in_shell(const struct faceuse *fu, struct shell *s, const struct bn_tol *tol)
void nmg_close_shell(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_shell_is_void(const struct shell *s)
int nmg_mv_shell_to_region(struct shell *s, struct nmgregion *r)
void nmg_connect_same_fu_orients(struct shell *s)
void nmg_shell_a(struct shell *s, const struct bn_tol *tol)
struct edgeuse * nmg_prev_radial_eu(const struct edgeuse *eu, const struct shell *s, const int wires)
int nmg_mesh_face_shell(struct faceuse *fu1, struct shell *s, const struct bn_tol *tol)
void nmg_vlist_to_eu(struct bu_list *vlist, struct shell *s)
void nmg_shell_coplanar_face_merge(struct shell *s, const struct bn_tol *tol, const int simplify, struct bu_list *vlfree)
struct shell * nmg_extrude_cleanup(struct shell *is, const int is_void, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_break_long_edges(struct shell *s, const struct bn_tol *tol)
void nmg_hollow_shell(struct shell *s, const fastf_t thick, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_open_shells_connect(struct shell *dst, struct shell *src, const long **copy_tbl, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_fix_decomposed_shell_normals(struct shell *s, const struct bn_tol *tol)
struct loopuse * nmg_ml(struct shell *s)
struct shell * nmg_extrude_shell(struct shell *s, const fastf_t dist, const int normal_ward, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_evaluate_boolean(struct shell *sA, struct shell *sB, int op, char **classlist, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_intersect_loops_self(struct shell *s, const struct bn_tol *tol)
void nmg_isect_shell_self(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_make_faces_within_tol(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:334
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
Definition: tol.h:72
Definition: list.h:132
Definition: ptbl.h:53
NMG topological edge usage.
Definition: topology.h:155
NMG topological face.
Definition: topology.h:210
NMG topological face usage.
Definition: topology.h:230
NMG topological loop usage.
Definition: topology.h:192
NMG topological region.
Definition: topology.h:277
NMG topological shell.
Definition: topology.h:261
NMG topological vertex - the simplest element of the topology system.
Definition: topology.h:98
NMG topological vertex usage.
Definition: topology.h:109
fundamental vector, matrix, quaternion math macros