BRL-CAD
nurb.h
Go to the documentation of this file.
1/* N U R B . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2004-2023 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_nurbs
23 *
24 * Note that some of the NURBS specific data structures currently live in
25 * topology.h - this is less than ideal, but the original implementation
26 * does not hide them from the topology containers...
27 */
28/** @{ */
29/** @file nmg/nurb.h */
30
31#ifndef NMG_NURB_H
32#define NMG_NURB_H
33
34#include "common.h"
35
36#include "vmath.h"
37#include "bu/list.h"
38#include "nmg/defines.h"
39#include "nmg/topology.h"
40
41__BEGIN_DECLS
42
43#define NMG_CK_EDGE_G_CNURB(_p) NMG_CKMAG(_p, NMG_EDGE_G_CNURB_MAGIC, "edge_g_cnurb")
44#define NMG_CK_EDGE_G_EITHER(_p) NMG_CK2MAG(_p, NMG_EDGE_G_LSEG_MAGIC, NMG_EDGE_G_CNURB_MAGIC, "edge_g_lseg|edge_g_cnurb")
45#define NMG_CK_VERTEXUSE_A_CNURB(_p) NMG_CKMAG(_p, NMG_VERTEXUSE_A_CNURB_MAGIC, "vertexuse_a_cnurb")
46#define NMG_CK_VERTEXUSE_A_EITHER(_p) NMG_CK2MAG(_p, NMG_VERTEXUSE_A_PLANE_MAGIC, NMG_VERTEXUSE_A_CNURB_MAGIC, "vertexuse_a_plane|vertexuse_a_cnurb")
47
48#define RT_NURB_SPLIT_ROW 0
49#define RT_NURB_SPLIT_COL 1
50#define RT_NURB_SPLIT_FLAT 2
51
52/* Definition of NURB point types and coordinates
53 * Bit: 8765 4321 0
54 * |nnnn|tttt|h
55 * h - 1 if Homogeneous
56 * tttt - point type
57 * 1 = XY
58 * 2 = XYZ
59 * 3 = UV
60 * 4 = Random data
61 * 5 = Projected surface
62 * nnnnn - number of coordinates per point
63 * includes the rational coordinate
64 */
65
66/* point types */
67#define RT_NURB_PT_XY 1 /**< @brief x, y coordinates */
68#define RT_NURB_PT_XYZ 2 /**< @brief x, y, z coordinates */
69#define RT_NURB_PT_UV 3 /**< @brief trim u, v parameter space */
70#define RT_NURB_PT_DATA 4 /**< @brief random data */
71#define RT_NURB_PT_PROJ 5 /**< @brief Projected Surface */
72
73#define RT_NURB_PT_RATIONAL 1
74#define RT_NURB_PT_NONRAT 0
75
76#define RT_NURB_MAKE_PT_TYPE(n, t, h) ((n<<5) | (t<<1) | h)
77#define RT_NURB_EXTRACT_COORDS(pt) (pt>>5)
78#define RT_NURB_EXTRACT_PT_TYPE(pt) ((pt>>1) & 0x0f)
79#define RT_NURB_IS_PT_RATIONAL(pt) (pt & 0x1)
80#define RT_NURB_STRIDE(pt) (RT_NURB_EXTRACT_COORDS(pt) * sizeof( fastf_t))
81
82#define DEBUG_NMG_SPLINE 0x00000100 /**< @brief 9 Splines */
83
84/* macros to check/validate a structure pointer
85 */
86#define NMG_CK_KNOT(_p) BU_CKMAG(_p, RT_KNOT_VECTOR_MAGIC, "knot_vector")
87#define NMG_CK_CNURB(_p) BU_CKMAG(_p, NMG_EDGE_G_CNURB_MAGIC, "cnurb")
88#define NMG_CK_SNURB(_p) BU_CKMAG(_p, NMG_FACE_G_SNURB_MAGIC, "snurb")
89
90/* DEPRECATED */
91#define GET_CNURB(p/*, m*/) { \
92 BU_ALLOC((p), struct edge_g_cnurb); \
93 /* NMG_INCR_INDEX(p, m); */ \
94 BU_LIST_INIT( &(p)->l ); (p)->l.magic = NMG_EDGE_G_CNURB_MAGIC; \
95 }
96
97/* DEPRECATED */
98#define GET_SNURB(p/*, m*/) { \
99 BU_ALLOC((p), struct face_g_snurb); \
100 /* NMG_INCR_INDEX(p, m); */ \
101 BU_LIST_INIT( &(p)->l ); (p)->l.magic = NMG_FACE_G_SNURB_MAGIC; \
102 }
103
104/* ----- Internal structures ----- */
105
108 point_t ply[3]; /**< @brief Vertices */
109 fastf_t uv[3][2]; /**< @brief U, V parametric values */
110};
111
114 int sub;
117};
118
119
120struct oslo_mat {
121 struct oslo_mat * next;
123 int osize;
125};
126
127/* --- new way */
128
130 struct bu_list l;
132};
133
134/**
135 * Evaluate a Bezier curve at a particular parameter value. Fill in
136 * control points for resulting sub-curves if "Left" and "Right" are
137 * non-null.
138 */
139NMG_EXPORT extern void bezier(point2d_t *V, int degree, double t, point2d_t *Left, point2d_t *Right, point2d_t eval_pt, point2d_t normal );
140
141/**
142 * Given an equation in Bernstein-Bezier form, find all of the roots
143 * in the interval [0, 1]. Return the number of roots found.
144 */
145NMG_EXPORT extern int bezier_roots(point2d_t *w, int degree, point2d_t **intercept, point2d_t **normal, point2d_t ray_start, point2d_t ray_dir, point2d_t ray_perp, int depth, fastf_t epsilon);
146
147/**
148 * subdivide a 2D bezier curve at t=0.5
149 */
150NMG_EXPORT extern struct bezier_2d_list *bezier_subdivide(struct bezier_2d_list *bezier_hd, int degree, fastf_t epsilon, int depth);
151
152
153/* TODO - this is another one of those data concepts common to librt and libnmg */
155 vect_t crv_pdir; /**< @brief Principle direction */
156 fastf_t crv_c1; /**< @brief curvature in principle dir */
157 fastf_t crv_c2; /**< @brief curvature in other direction */
158};
159
160/* nurb_basis.c */
161NMG_EXPORT extern fastf_t nmg_nurb_basis_eval(struct knot_vector *knts, int interval,
162 int order, fastf_t mu);
163
164/* nurb_bezier.c */
165NMG_EXPORT extern int nmg_nurb_bezier(struct bu_list *bezier_hd, const struct face_g_snurb * srf);
166NMG_EXPORT extern int nmg_bez_check(const struct face_g_snurb * srf);
167NMG_EXPORT extern int nurb_crv_is_bezier(const struct edge_g_cnurb *crv);
168NMG_EXPORT extern void nurb_c_to_bezier(struct bu_list *clist, struct edge_g_cnurb *crv);
169
170/* nurb_bound.c */
171NMG_EXPORT extern int nmg_nurb_s_bound(struct face_g_snurb *srf, point_t bmin, point_t bmax);
172NMG_EXPORT extern int nmg_nurb_c_bound(struct edge_g_cnurb *crv, point_t bmin, point_t bmax);
173NMG_EXPORT extern int nmg_nurb_s_check(struct face_g_snurb *srf);
174NMG_EXPORT extern int nmg_nurb_c_check(struct edge_g_cnurb *crv);
175
176/* nurb_copy.c */
177NMG_EXPORT extern struct face_g_snurb *nmg_nurb_scopy(const struct face_g_snurb *srf);
178NMG_EXPORT extern struct edge_g_cnurb *nmg_nurb_crv_copy(const struct edge_g_cnurb * crv);
179
180/* nurb_diff.c */
181NMG_EXPORT extern struct face_g_snurb *nmg_nurb_s_diff(const struct face_g_snurb *srf, int dir);
182NMG_EXPORT extern struct edge_g_cnurb *nmg_nurb_c_diff(const struct edge_g_cnurb *crv);
183NMG_EXPORT extern void nmg_nurb_mesh_diff(int order, const fastf_t *o_pts,
184 fastf_t *n_pts,
185 const fastf_t *knots, int o_stride, int n_stride,
186 int o_size, int pt_type);
187
188/* nurb_eval.c */
189NMG_EXPORT extern void nmg_nurb_s_eval(const struct face_g_snurb *srf, fastf_t u, fastf_t v, fastf_t * final_value);
190NMG_EXPORT extern void nmg_nurb_c_eval(const struct edge_g_cnurb *crv, fastf_t param, fastf_t * final_value);
191NMG_EXPORT extern fastf_t *nmg_nurb_eval_crv(fastf_t *crv, int order,
192 fastf_t param,
193 const struct knot_vector *k_vec, int k_index, int coords);
194NMG_EXPORT extern void nmg_nurb_pr_crv(fastf_t *crv, int c_size, int coords);
195
196/* nurb_flat.c */
197NMG_EXPORT extern int nmg_nurb_s_flat(struct face_g_snurb *srf, fastf_t epsilon);
198NMG_EXPORT extern fastf_t nmg_nurb_crv_flat(fastf_t *crv, int size, int pt_type);
199
200/* nurb_knot.c */
201NMG_EXPORT extern void nmg_nurb_kvknot(struct knot_vector *new_knots, int order,
202 fastf_t lower, fastf_t upper, int num);
203NMG_EXPORT extern void nmg_nurb_kvmult(struct knot_vector *new_kv,
204 const struct knot_vector *kv,
205 int num, fastf_t val);
206NMG_EXPORT extern void nmg_nurb_kvgen(struct knot_vector *kv,
207 fastf_t lower, fastf_t upper, int num);
208NMG_EXPORT extern void nmg_nurb_kvmerge(struct knot_vector *new_knots,
209 const struct knot_vector *kv1,
210 const struct knot_vector *kv2);
211NMG_EXPORT extern int nmg_nurb_kvcheck(fastf_t val, const struct knot_vector *kv);
212NMG_EXPORT extern void nmg_nurb_kvextract(struct knot_vector *new_kv,
213 const struct knot_vector *kv,
214 int lower, int upper);
215NMG_EXPORT extern void nmg_nurb_kvcopy(struct knot_vector *new_kv,
216 const struct knot_vector *old_kv);
217NMG_EXPORT extern void nmg_nurb_kvnorm(struct knot_vector *kv);
218NMG_EXPORT extern int nmg_nurb_knot_index(const struct knot_vector *kv, fastf_t k_value, int order);
219NMG_EXPORT extern void nmg_nurb_gen_knot_vector(struct knot_vector *new_knots,
220 int order, fastf_t lower, fastf_t upper);
221
222/* nurb_norm.c */
223NMG_EXPORT extern void nmg_nurb_s_norm(struct face_g_snurb *srf, fastf_t u, fastf_t v, fastf_t * norm);
224
225/* nurb_c2.c */
226NMG_EXPORT extern void nmg_nurb_curvature(struct nmg_curvature *cvp,
227 const struct face_g_snurb *srf, fastf_t u, fastf_t v);
228
229/* nurb_plot.c */
230NMG_EXPORT extern void nmg_nurb_plot_snurb(FILE *fp, const struct face_g_snurb *srf);
231NMG_EXPORT extern void nmg_nurb_plot_cnurb(FILE *fp, const struct edge_g_cnurb *crv);
232NMG_EXPORT extern void nmg_nurb_s_plot(const struct face_g_snurb *srf);
233
234/* nurb_interp.c */
235NMG_EXPORT extern void nmg_nurb_cinterp(struct edge_g_cnurb *crv, int order,
236 const fastf_t *data, int n);
237NMG_EXPORT extern void nmg_nurb_sinterp(struct face_g_snurb *srf, int order,
238 const fastf_t *data, int ymax, int xmax);
239
240/* nurb_poly.c */
241NMG_EXPORT extern struct nmg_nurb_poly *nmg_nurb_to_poly(struct face_g_snurb *srf);
242NMG_EXPORT extern struct nmg_nurb_poly *nmg_nurb_mk_poly(fastf_t *v1, fastf_t *v2, fastf_t *v3,
243 fastf_t uv1[2], fastf_t uv2[2], fastf_t uv3[2]);
244
245/* nurb_ray.c */
246NMG_EXPORT extern struct face_g_snurb *nmg_nurb_project_srf(const struct face_g_snurb *srf,
247 plane_t plane1, plane_t plane2);
248NMG_EXPORT extern void nmg_nurb_clip_srf(const struct face_g_snurb *srf,
249 int dir, fastf_t *min, fastf_t *max);
250NMG_EXPORT extern struct face_g_snurb *nmg_nurb_region_from_srf(const struct face_g_snurb *srf,
251 int dir, fastf_t param1, fastf_t param2);
252NMG_EXPORT extern struct nmg_nurb_uv_hit *nmg_nurb_intersect(const struct face_g_snurb * srf,
253 plane_t plane1, plane_t plane2, double uv_tol, struct bu_list *plist);
254
255/* nurb_refine.c */
256NMG_EXPORT extern struct face_g_snurb *nmg_nurb_s_refine(const struct face_g_snurb *srf,
257 int dir, struct knot_vector *kv);
258NMG_EXPORT extern struct edge_g_cnurb *nmg_nurb_c_refine(const struct edge_g_cnurb * crv,
259 struct knot_vector *kv);
260
261/* nurb_solve.c */
262NMG_EXPORT extern void nmg_nurb_solve(fastf_t *mat_1, fastf_t *mat_2,
263 fastf_t *solution, int dim, int coords);
264NMG_EXPORT extern void nmg_nurb_doolittle(fastf_t *mat_1, fastf_t *mat_2,
265 int row, int coords);
266NMG_EXPORT extern void nmg_nurb_forw_solve(const fastf_t *lu, const fastf_t *b,
267 fastf_t *y, int n);
268NMG_EXPORT extern void nmg_nurb_back_solve(const fastf_t *lu, const fastf_t *y,
269 fastf_t *x, int n);
270NMG_EXPORT extern void nmg_nurb_p_mat(const fastf_t * mat, int dim);
271
272/* nurb_split.c */
273NMG_EXPORT extern void nmg_nurb_s_split(struct bu_list *split_hd, const struct face_g_snurb *srf,
274 int dir);
275NMG_EXPORT extern void nmg_nurb_c_split(struct bu_list *split_hd, const struct edge_g_cnurb *crv);
276
277/* nurb_trim.c */
278NMG_EXPORT extern int nmg_uv_in_lu(const fastf_t u, const fastf_t v, const struct loopuse *lu);
279
280/* nurb_util.c */
281NMG_EXPORT extern struct face_g_snurb *nmg_nurb_new_snurb(int u_order, int v_order,
282 int n_u_knots, int n_v_knots,
283 int n_rows, int n_cols, int pt_type);
284NMG_EXPORT extern struct edge_g_cnurb *nmg_nurb_new_cnurb(int order, int n_knots,
285 int n_pts, int pt_type);
286NMG_EXPORT extern void nmg_nurb_free_snurb(struct face_g_snurb *srf);
287NMG_EXPORT extern void nmg_nurb_free_cnurb(struct edge_g_cnurb * crv);
288NMG_EXPORT extern void nmg_nurb_c_print(const struct edge_g_cnurb *crv);
289NMG_EXPORT extern void nmg_nurb_s_print(char *c, const struct face_g_snurb *srf);
290NMG_EXPORT extern void nmg_nurb_pr_kv(const struct knot_vector *kv);
291NMG_EXPORT extern void nmg_nurb_pr_mesh(const struct face_g_snurb *m);
292NMG_EXPORT extern void nmg_nurb_print_pnt_type(int c);
293NMG_EXPORT extern void nmg_nurb_clean_cnurb(struct edge_g_cnurb *crv);
294
295/* nurb_xsplit.c */
296NMG_EXPORT extern struct face_g_snurb *nmg_nurb_s_xsplit(struct face_g_snurb *srf,
297 fastf_t param, int dir);
298NMG_EXPORT extern struct edge_g_cnurb *nmg_nurb_c_xsplit(struct edge_g_cnurb *crv, fastf_t param);
299
300/* oslo_calc.c */
301NMG_EXPORT extern struct oslo_mat *nmg_nurb_calc_oslo(int order,
302 const struct knot_vector *tau_kv,
303 struct knot_vector *t_kv);
304NMG_EXPORT extern void nmg_nurb_pr_oslo(struct oslo_mat *om);
305NMG_EXPORT extern void nmg_nurb_free_oslo(struct oslo_mat *om);
306
307/* oslo_map.c */
308NMG_EXPORT extern void nmg_nurb_map_oslo(struct oslo_mat *oslo,
309 fastf_t *old_pts, fastf_t *new_pts,
310 int o_stride, int n_stride,
311 int lower, int upper, int pt_type);
312
313/* nurb_tess.c */
314NMG_EXPORT extern fastf_t rt_cnurb_par_edge(const struct edge_g_cnurb *crv, fastf_t epsilon);
315
316
317NMG_EXPORT extern void nmg_face_g_snurb(struct faceuse *fu,
318 int u_order,
319 int v_order,
320 int n_u_knots,
321 int n_v_knots,
322 fastf_t *ukv,
323 fastf_t *vkv,
324 int n_rows,
325 int n_cols,
326 int pt_type,
327 fastf_t *mesh);
328
329/* From nmg_misc.c */
330NMG_EXPORT extern int nmg_snurb_calc_lu_uv_orient(const struct loopuse *lu);
331NMG_EXPORT extern void nmg_snurb_fu_eval(const struct faceuse *fu,
332 const fastf_t u,
333 const fastf_t v,
334 point_t pt_on_srf);
335NMG_EXPORT extern void nmg_snurb_fu_get_norm(const struct faceuse *fu,
336 const fastf_t u,
337 const fastf_t v,
338 vect_t norm);
339NMG_EXPORT extern void nmg_snurb_fu_get_norm_at_vu(const struct faceuse *fu,
340 const struct vertexuse *vu,
341 vect_t norm);
342
343
344NMG_EXPORT extern void nmg_vertexuse_a_cnurb(struct vertexuse *vu,
345 const fastf_t *uvw);
346NMG_EXPORT extern void nmg_edge_g_cnurb(struct edgeuse *eu,
347 int order,
348 int n_knots,
349 fastf_t *kv,
350 int n_pts,
351 int pt_type,
352 fastf_t *points);
353NMG_EXPORT extern void nmg_edge_g_cnurb_plinear(struct edgeuse *eu);
354NMG_EXPORT extern struct edge_g_cnurb *nmg_join_cnurbs(struct bu_list *crv_head);
355NMG_EXPORT extern struct edge_g_cnurb *nmg_arc2d_to_cnurb(point_t i_center,
356 point_t i_start,
357 point_t i_end,
358 int point_type,
359 const struct bn_tol *tol);
360NMG_EXPORT extern int nmg_cnurb_is_linear(const struct edge_g_cnurb *cnrb);
361
362
363NMG_EXPORT extern int nmg_snurb_is_planar(const struct face_g_snurb *srf,
364 const struct bn_tol *tol);
365NMG_EXPORT extern void nmg_eval_linear_trim_curve(const struct face_g_snurb *snrb,
366 const fastf_t uvw[3],
367 point_t xyz);
368
369
370NMG_EXPORT extern void nmg_eval_trim_curve(const struct edge_g_cnurb *cnrb,
371 const struct face_g_snurb *snrb,
372 const fastf_t t, point_t xyz);
373/* nmg_split_trim */
374NMG_EXPORT extern void nmg_eval_trim_to_tol(const struct edge_g_cnurb *cnrb,
375 const struct face_g_snurb *snrb,
376 const fastf_t t0,
377 const fastf_t t1,
378 struct bu_list *head,
379 const struct bn_tol *tol);
380/* nmg_split_linear_trim */
381NMG_EXPORT extern void nmg_eval_linear_trim_to_tol(const struct edge_g_cnurb *cnrb,
382 const struct face_g_snurb *snrb,
383 const fastf_t uvw1[3],
384 const fastf_t uvw2[3],
385 struct bu_list *head,
386 const struct bn_tol *tol);
387NMG_EXPORT extern int nmg_cnurb_lseg_coincident(const struct edgeuse *eu1,
388 const struct edge_g_cnurb *cnrb,
389 const struct face_g_snurb *snrb,
390 const point_t pt1,
391 const point_t pt2,
392 const struct bn_tol *tol);
393NMG_EXPORT extern int nmg_cnurb_is_on_crv(const struct edgeuse *eu,
394 const struct edge_g_cnurb *cnrb,
395 const struct face_g_snurb *snrb,
396 const struct bu_list *head,
397 const struct bn_tol *tol);
398
399
400__END_DECLS
401
402#endif /* NMG_NURB_H */
403/** @} */
404/*
405 * Local Variables:
406 * mode: C
407 * tab-width: 8
408 * indent-tabs-mode: t
409 * c-file-style: "stroustrup"
410 * End:
411 * ex: shiftwidth=4 tabstop=8
412 */
Header file for the BRL-CAD common definitions.
void float float int * n
Definition: tig.h:74
void float float int int int int * interval
Definition: tig.h:131
void float float * y
Definition: tig.h:73
void float float int int int int float * size
Definition: tig.h:132
void int char int int double * min
Definition: tig.h:182
void int * c
Definition: tig.h:139
void float * x
Definition: tig.h:72
void nmg_vertexuse_a_cnurb(struct vertexuse *vu, const fastf_t *uvw)
void nmg_nurb_mesh_diff(int order, const fastf_t *o_pts, fastf_t *n_pts, const fastf_t *knots, int o_stride, int n_stride, int o_size, int pt_type)
void nmg_nurb_plot_cnurb(FILE *fp, const struct edge_g_cnurb *crv)
struct nmg_nurb_poly * nmg_nurb_to_poly(struct face_g_snurb *srf)
void nmg_eval_linear_trim_to_tol(const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t uvw1[3], const fastf_t uvw2[3], struct bu_list *head, const struct bn_tol *tol)
void nmg_snurb_fu_get_norm_at_vu(const struct faceuse *fu, const struct vertexuse *vu, vect_t norm)
int nmg_nurb_c_bound(struct edge_g_cnurb *crv, point_t bmin, point_t bmax)
fastf_t nmg_nurb_crv_flat(fastf_t *crv, int size, int pt_type)
void nmg_nurb_s_norm(struct face_g_snurb *srf, fastf_t u, fastf_t v, fastf_t *norm)
void nmg_nurb_s_split(struct bu_list *split_hd, const struct face_g_snurb *srf, int dir)
void nmg_nurb_kvmerge(struct knot_vector *new_knots, const struct knot_vector *kv1, const struct knot_vector *kv2)
void nmg_nurb_pr_kv(const struct knot_vector *kv)
struct face_g_snurb * nmg_nurb_s_refine(const struct face_g_snurb *srf, int dir, struct knot_vector *kv)
int bezier_roots(point2d_t *w, int degree, point2d_t **intercept, point2d_t **normal, point2d_t ray_start, point2d_t ray_dir, point2d_t ray_perp, int depth, fastf_t epsilon)
void nmg_edge_g_cnurb_plinear(struct edgeuse *eu)
void nmg_nurb_forw_solve(const fastf_t *lu, const fastf_t *b, fastf_t *y, int n)
struct nmg_nurb_uv_hit * nmg_nurb_intersect(const struct face_g_snurb *srf, plane_t plane1, plane_t plane2, double uv_tol, struct bu_list *plist)
void nmg_nurb_plot_snurb(FILE *fp, const struct face_g_snurb *srf)
struct face_g_snurb * nmg_nurb_s_xsplit(struct face_g_snurb *srf, fastf_t param, int dir)
void nmg_nurb_clip_srf(const struct face_g_snurb *srf, int dir, fastf_t *min, fastf_t *max)
int nmg_nurb_kvcheck(fastf_t val, const struct knot_vector *kv)
void nmg_nurb_s_eval(const struct face_g_snurb *srf, fastf_t u, fastf_t v, fastf_t *final_value)
int nmg_cnurb_is_on_crv(const struct edgeuse *eu, const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const struct bu_list *head, const struct bn_tol *tol)
struct oslo_mat * nmg_nurb_calc_oslo(int order, const struct knot_vector *tau_kv, struct knot_vector *t_kv)
void nmg_nurb_kvnorm(struct knot_vector *kv)
void nmg_nurb_gen_knot_vector(struct knot_vector *new_knots, int order, fastf_t lower, fastf_t upper)
void nmg_eval_linear_trim_curve(const struct face_g_snurb *snrb, const fastf_t uvw[3], point_t xyz)
void nmg_eval_trim_curve(const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t t, point_t xyz)
int nurb_crv_is_bezier(const struct edge_g_cnurb *crv)
int nmg_snurb_is_planar(const struct face_g_snurb *srf, const struct bn_tol *tol)
void nmg_nurb_kvmult(struct knot_vector *new_kv, const struct knot_vector *kv, int num, fastf_t val)
struct edge_g_cnurb * nmg_nurb_c_xsplit(struct edge_g_cnurb *crv, fastf_t param)
fastf_t nmg_nurb_basis_eval(struct knot_vector *knts, int interval, int order, fastf_t mu)
void nmg_edge_g_cnurb(struct edgeuse *eu, int order, int n_knots, fastf_t *kv, int n_pts, int pt_type, fastf_t *points)
struct edge_g_cnurb * nmg_nurb_crv_copy(const struct edge_g_cnurb *crv)
int nmg_nurb_s_flat(struct face_g_snurb *srf, fastf_t epsilon)
void nmg_nurb_free_cnurb(struct edge_g_cnurb *crv)
void nmg_nurb_c_split(struct bu_list *split_hd, const struct edge_g_cnurb *crv)
void nmg_nurb_curvature(struct nmg_curvature *cvp, const struct face_g_snurb *srf, fastf_t u, fastf_t v)
int nmg_uv_in_lu(const fastf_t u, const fastf_t v, const struct loopuse *lu)
void nmg_nurb_print_pnt_type(int c)
void nmg_face_g_snurb(struct faceuse *fu, int u_order, int v_order, int n_u_knots, int n_v_knots, fastf_t *ukv, fastf_t *vkv, int n_rows, int n_cols, int pt_type, fastf_t *mesh)
void nmg_nurb_clean_cnurb(struct edge_g_cnurb *crv)
void nmg_snurb_fu_eval(const struct faceuse *fu, const fastf_t u, const fastf_t v, point_t pt_on_srf)
void nmg_nurb_kvcopy(struct knot_vector *new_kv, const struct knot_vector *old_kv)
void nmg_nurb_free_snurb(struct face_g_snurb *srf)
int nmg_nurb_s_bound(struct face_g_snurb *srf, point_t bmin, point_t bmax)
struct nmg_nurb_poly * nmg_nurb_mk_poly(fastf_t *v1, fastf_t *v2, fastf_t *v3, fastf_t uv1[2], fastf_t uv2[2], fastf_t uv3[2])
void nmg_nurb_cinterp(struct edge_g_cnurb *crv, int order, const fastf_t *data, int n)
struct edge_g_cnurb * nmg_nurb_new_cnurb(int order, int n_knots, int n_pts, int pt_type)
void nmg_nurb_p_mat(const fastf_t *mat, int dim)
void nmg_nurb_solve(fastf_t *mat_1, fastf_t *mat_2, fastf_t *solution, int dim, int coords)
struct edge_g_cnurb * nmg_join_cnurbs(struct bu_list *crv_head)
void bezier(point2d_t *V, int degree, double t, point2d_t *Left, point2d_t *Right, point2d_t eval_pt, point2d_t normal)
int nmg_nurb_s_check(struct face_g_snurb *srf)
void nurb_c_to_bezier(struct bu_list *clist, struct edge_g_cnurb *crv)
struct edge_g_cnurb * nmg_arc2d_to_cnurb(point_t i_center, point_t i_start, point_t i_end, int point_type, const struct bn_tol *tol)
int nmg_nurb_bezier(struct bu_list *bezier_hd, const struct face_g_snurb *srf)
void nmg_nurb_back_solve(const fastf_t *lu, const fastf_t *y, fastf_t *x, int n)
void nmg_nurb_free_oslo(struct oslo_mat *om)
void nmg_nurb_kvknot(struct knot_vector *new_knots, int order, fastf_t lower, fastf_t upper, int num)
void nmg_nurb_c_eval(const struct edge_g_cnurb *crv, fastf_t param, fastf_t *final_value)
int nmg_snurb_calc_lu_uv_orient(const struct loopuse *lu)
fastf_t rt_cnurb_par_edge(const struct edge_g_cnurb *crv, fastf_t epsilon)
void nmg_nurb_kvgen(struct knot_vector *kv, fastf_t lower, fastf_t upper, int num)
void nmg_nurb_pr_mesh(const struct face_g_snurb *m)
struct face_g_snurb * nmg_nurb_s_diff(const struct face_g_snurb *srf, int dir)
struct edge_g_cnurb * nmg_nurb_c_refine(const struct edge_g_cnurb *crv, struct knot_vector *kv)
void nmg_nurb_sinterp(struct face_g_snurb *srf, int order, const fastf_t *data, int ymax, int xmax)
int nmg_cnurb_is_linear(const struct edge_g_cnurb *cnrb)
struct bezier_2d_list * bezier_subdivide(struct bezier_2d_list *bezier_hd, int degree, fastf_t epsilon, int depth)
void nmg_eval_trim_to_tol(const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t t0, const fastf_t t1, struct bu_list *head, const struct bn_tol *tol)
int nmg_nurb_c_check(struct edge_g_cnurb *crv)
void nmg_nurb_kvextract(struct knot_vector *new_kv, const struct knot_vector *kv, int lower, int upper)
int nmg_nurb_knot_index(const struct knot_vector *kv, fastf_t k_value, int order)
void nmg_nurb_s_print(char *c, const struct face_g_snurb *srf)
struct edge_g_cnurb * nmg_nurb_c_diff(const struct edge_g_cnurb *crv)
void nmg_nurb_c_print(const struct edge_g_cnurb *crv)
void nmg_nurb_pr_crv(fastf_t *crv, int c_size, int coords)
int nmg_cnurb_lseg_coincident(const struct edgeuse *eu1, const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const point_t pt1, const point_t pt2, const struct bn_tol *tol)
void nmg_nurb_doolittle(fastf_t *mat_1, fastf_t *mat_2, int row, int coords)
fastf_t * nmg_nurb_eval_crv(fastf_t *crv, int order, fastf_t param, const struct knot_vector *k_vec, int k_index, int coords)
void nmg_snurb_fu_get_norm(const struct faceuse *fu, const fastf_t u, const fastf_t v, vect_t norm)
struct face_g_snurb * nmg_nurb_scopy(const struct face_g_snurb *srf)
struct face_g_snurb * nmg_nurb_project_srf(const struct face_g_snurb *srf, plane_t plane1, plane_t plane2)
void nmg_nurb_s_plot(const struct face_g_snurb *srf)
void nmg_nurb_map_oslo(struct oslo_mat *oslo, fastf_t *old_pts, fastf_t *new_pts, int o_stride, int n_stride, int lower, int upper, int pt_type)
struct face_g_snurb * nmg_nurb_region_from_srf(const struct face_g_snurb *srf, int dir, fastf_t param1, fastf_t param2)
void nmg_nurb_pr_oslo(struct oslo_mat *om)
int nmg_bez_check(const struct face_g_snurb *srf)
struct face_g_snurb * nmg_nurb_new_snurb(int u_order, int v_order, int n_u_knots, int n_v_knots, int n_rows, int n_cols, int pt_type)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
Definition: vmath.h:345
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:330
fastf_t point2d_t[ELEMENTS_PER_POINT2D]
2-tuple point
Definition: vmath.h:339
fastf_t plane_t[ELEMENTS_PER_PLANE]
Definition of a plane equation.
Definition: vmath.h:393
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:351
point2d_t * ctl
Definition: nurb.h:131
struct bu_list l
Definition: nurb.h:130
Definition: tol.h:72
Definition: list.h:131
Edge NURBS curve geometry.
Definition: topology.h:376
int c_size
number of ctl points
Definition: topology.h:382
int order
Curve Order.
Definition: topology.h:379
int pt_type
curve point type
Definition: topology.h:383
NMG topological edge usage.
Definition: topology.h:155
Face NURBS surface geometry.
Definition: topology.h:392
int dir
direction of last refinement
Definition: topology.h:406
int pt_type
surface point type
Definition: topology.h:403
NMG topological face usage.
Definition: topology.h:230
Definition of a knot vector.
Definition: topology.h:355
NMG topological loop usage.
Definition: topology.h:192
vect_t crv_pdir
Principle direction.
Definition: nurb.h:155
fastf_t crv_c1
curvature in principle dir
Definition: nurb.h:156
fastf_t crv_c2
curvature in other direction
Definition: nurb.h:157
fastf_t uv[3][2]
U, V parametric values.
Definition: nurb.h:109
struct nmg_nurb_poly * next
Definition: nurb.h:107
point_t ply[3]
Vertices.
Definition: nurb.h:108
fastf_t u
Definition: nurb.h:115
fastf_t v
Definition: nurb.h:116
struct nmg_nurb_uv_hit * next
Definition: nurb.h:113
Definition: nurb.h:120
fastf_t * o_vec
Definition: nurb.h:124
int osize
Definition: nurb.h:123
struct oslo_mat * next
Definition: nurb.h:121
int offset
Definition: nurb.h:122
NMG topological vertex usage.
Definition: topology.h:109
fundamental vector, matrix, quaternion math macros