BRL-CAD
geom.h
Go to the documentation of this file.
1 /* G E O M . 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 /** @addtogroup rt_geom
21  *
22  * @brief Functions and details of the internal forms used by the LIBRT geometry
23  * routines for the different solids.
24  *
25  * These structures are what the struct rt_db_internal generic pointer
26  * idb_ptr points at, based on idb_type indicating a solid id ID_xxx,
27  * such as ID_TGC.
28  *
29  */
30 /** @{ */
31 /** @file rt/geom.h */
32 /** @} */
33 
34 #ifndef RT_GEOM_H
35 #define RT_GEOM_H
36 
37 #include "common.h"
38 
39 #include "bu/bitv.h"
40 #include "bu/color.h"
41 #include "bu/list.h"
42 #include "bu/mapped_file.h"
43 #include "bu/vls.h"
44 #include "vmath.h"
45 #include "rt/defines.h"
46 
47 #include "brep.h"
48 #include "brep/defines.h"
49 
50 
51 __BEGIN_DECLS
52 
53 #define NAMELEN 16 /* NAMESIZE from db.h (can't call it NAMESIZE!!!!!) */
54 
55 /** @addtogroup rt_tor */
56 /** @{ */
57 /*
58  * ID_TOR
59  */
61  uint32_t magic;
62  point_t v; /**< @brief center point */
63  vect_t h; /**< @brief normal, unit length */
64  fastf_t r_h; /**< @brief radius in H direction (r2) */
65  fastf_t r_a; /**< @brief radius in A direction (r1) */
66  /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
67  vect_t a; /**< @brief r_a length */
68  vect_t b; /**< @brief r_b length */
69  fastf_t r_b; /**< @brief radius in B direction (typ == r_a) */
70 };
71 #define RT_TOR_CK_MAGIC(_p) BU_CKMAG(_p, RT_TOR_INTERNAL_MAGIC, "rt_tor_internal")
72 /** @} */
73 
74 /** @addtogroup rt_tgc */
75 /** @{ */
76 /**
77  * ID_TGC and ID_REC
78  */
80  uint32_t magic;
87 };
88 #define RT_TGC_CK_MAGIC(_p) BU_CKMAG(_p, RT_TGC_INTERNAL_MAGIC, "rt_tgc_internal")
89 /** @} */
90 
91 /** @addtogroup rt_ell */
92 /** @{ */
93 /*
94  * ID_ELL, and ID_SPH
95  */
97  uint32_t magic;
98  point_t v; /**< @brief center point */
99  vect_t a; /**< @brief axis a radial length */
100  vect_t b; /**< @brief axis b radial length */
101  vect_t c; /**< @brief axis c radial length */
102 };
103 #define RT_ELL_CK_MAGIC(_p) BU_CKMAG(_p, RT_ELL_INTERNAL_MAGIC, "rt_ell_internal")
104 /** @} */
105 
106 /** @addtogroup rt_superell */
107 /** @{ */
108 /*
109  * ID_SUPERELL
110  */
112  uint32_t magic;
117  double n;
118  double e;
119 };
120 #define RT_SUPERELL_CK_MAGIC(_p) BU_CKMAG(_p, RT_SUPERELL_INTERNAL_MAGIC, "rt_superell_internal")
121 /** @} */
122 
123 /** @addtogroup rt_metaball */
124 /** @{ */
125 /**
126  * ID_METABALL
127  *
128  * The "metaball" primitive contains a method ID, threshold value, and
129  * an unordered set of control points. Each control point contains a
130  * 3d location, a "field strength", and possibly a "blobbiness" value
131  * (called "goo" in rt_metaball_add_point).
132  *
133  * There are three method ID's defined:
134  *
135  * 1. "metaball", which is the Tokyo Metaball approximation of the
136  * Blinn Blobby Surface. This method is not implemented yet.
137  *
138  * 2. "blob", the Blinn method.
139  *
140  * 3. "iso", which is a simple computation like you'd see for
141  * computing gravitational magnitude or point charge in a basic
142  * physics course. Blending function in latex notation is:
143  *
144  @code
145  \Sum_{i}\frac{f_{i}}{d^{2}}
146  @endcode
147  *
148  * The surface of the primitive exists where the summation of the
149  * points contribution is equal to the threshold, with the general
150  * fldstr/distance^2 pattern.
151  *
152  * The blobbiness value is only used in the blob method, and modifies
153  * the gusseting effect.
154  *
155  */
157  uint32_t magic;
158  /* these three defines are used with the method field */
159 #define METABALL_METABALL 0
160 #define METABALL_ISOPOTENTIAL 1
161 #define METABALL_BLOB 2
162  int method;
165  fastf_t finalstep; /* for raytrace stepping. */
167 };
168 #define RT_METABALL_CK_MAGIC(_p) BU_CKMAG(_p, RT_METABALL_INTERNAL_MAGIC, "rt_metaball_internal")
170  struct bu_list l;
171  int type;
172  fastf_t fldstr; /**< @brief field strength */
173  fastf_t sweat; /**< @brief beta value used for metaball and blob evaluation */
176 };
177 #define WDB_METABALLPT_TYPE_POINT 0x0
178 #define WDB_METABALLPT_TYPE_LINE 0x1
179 #define WDB_METABALL_PNT_NULL ((struct wdb_metaball_pnt *)0)
180 /** @} */
181 
182 
183 /** @addtogroup rt_arb */
184 /** @{ */
185 /*
186  * ID_ARB8
187  *
188  * The internal (in memory) form of an ARB8 -- 8 points in space.
189  * The first 4 form the "bottom" face, the second 4 form the "top" face.
190  */
192  uint32_t magic;
194 };
195 #define RT_ARB_CK_MAGIC(_p) BU_CKMAG(_p, RT_ARB_INTERNAL_MAGIC, "rt_arb_internal")
196 /** @} */
197 
198 /** @addtogroup rt_ars */
199 /** @{ */
200 /*
201  * ID_ARS
202  */
204  uint32_t magic;
205  size_t ncurves;
208 };
209 #define RT_ARS_CK_MAGIC(_p) BU_CKMAG(_p, RT_ARS_INTERNAL_MAGIC, "rt_ars_internal")
210 /** @} */
211 
212 /** @addtogroup rt_half */
213 /** @{ */
214 /*
215  * ID_HALF
216  */
218  uint32_t magic;
220 };
221 #define RT_HALF_CK_MAGIC(_p) BU_CKMAG(_p, RT_HALF_INTERNAL_MAGIC, "rt_half_internal")
222 /** @} */
223 
224 /** @addtogroup rt_grip */
225 /** @{ */
226 /*
227  * ID_GRIP
228  */
230  uint32_t magic;
232  /* Remaining elements are used for display purposes only */
235 };
236 #define RT_GRIP_CK_MAGIC(_p) BU_CKMAG(_p, RT_GRIP_INTERNAL_MAGIC, "rt_grip_internal")
237 /** @} */
238 
239 /** @addtogroup rt_joint */
240 /** @{ */
241 /*
242  * ID_JOINT
243  */
245  uint32_t magic;
247  struct bu_vls reference_path_1;
248  struct bu_vls reference_path_2;
249 
250  /* Remaining elements are used for display purposes only */
254 };
255 #define RT_JOINT_CK_MAGIC(_p) BU_CKMAG(_p, RT_JOINT_INTERNAL_MAGIC, "rt_joint_internal")
256 /** @} */
257 
258 /** @addtogroup rt_pg */
259 /** @{ */
260 /**
261  * ID_POLY
262  */
264  size_t npts; /**< @brief number of points for this polygon */
265  fastf_t *verts; /**< @brief has 3*npts elements */
266  fastf_t *norms; /**< @brief has 3*npts elements */
267 }; /**< @brief has npoly elements */
269  uint32_t magic;
270  size_t npoly;
271  struct rt_pg_face_internal *poly; /**< @brief has npoly elements */
272  /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
273  size_t max_npts; /**< @brief maximum value of npts in poly[] */
274 };
275 #define RT_PG_CK_MAGIC(_p) BU_CKMAG(_p, RT_PG_INTERNAL_MAGIC, "rt_pg_internal")
276 /** @} */
277 
278 /** @addtogroup rt_nurb */
279 /** @{ */
280 /* ID_BSPLINE */
282  uint32_t magic;
283  int nsrf; /**< @brief number of surfaces */
284  struct face_g_snurb **srfs; /**< @brief The surfaces themselves */
285  ON_Brep *brep;
286 };
287 
288 
289 #define RT_NURB_CK_MAGIC(_p) BU_CKMAG(_p, RT_NURB_INTERNAL_MAGIC, "rt_nurb_internal");
290 #define RT_NURB_GET_CONTROL_POINT(_s, _u, _v) ((_s)->ctl_points[ \
291  ((_v)*(_s)->s_size[0]+(_u))*RT_NURB_EXTRACT_COORDS((_s)->pt_type)])
292 /** @} */
293 
294 /** @addtogroup rt_brep */
295 /** @{ */
296 /* ID_BREP */
298  uint32_t magic;
299 
300  ON_Brep* brep; /**< @brief An openNURBS brep object containing the solid */
301 };
302 
303 
304 #define RT_BREP_CK_MAGIC(_p) BU_CKMAG(_p, RT_BREP_INTERNAL_MAGIC, "rt_brep_internal");
305 #define RT_BREP_TEST_MAGIC(_p) ((_p) && (*((uint32_t *)(_p)) == (uint32_t)(RT_BREP_INTERNAL_MAGIC)))
306 
307 /** @} */
308 
309 
310 /*
311  * The internal form of the NMG is not rt_nmg_internal, but just a
312  * "struct model", from nmg.h. e.g.:
313  *
314  * if (intern.idb_type == ID_NMG)
315  * m = (struct model *)intern.idb_ptr;
316  */
317 
318 /** @addtogroup rt_ebm */
319 /** @{ */
320 /*
321  * ID_EBM
322  */
323 #define RT_EBM_NAME_LEN 256
325  uint32_t magic;
327  /* NOTE: xdim/ydim cannot be size_t until rel8 as they are
328  * written out to disk via bu_vls_struct_print() as 32-bit ints.
329  */
330  uint32_t xdim; /**< @brief X dimension (w cells) */
331  uint32_t ydim; /**< @brief Y dimension (n cells) */
332  fastf_t tallness; /**< @brief Z dimension (mm) */
333  mat_t mat; /**< @brief convert local coords to model space */
334  unsigned char *buf; /**< @brief actual data */
335  struct bu_mapped_file *mp; /**< @brief mapped file for data */
336  struct rt_db_internal *bip; /**< @brief db object for data */
337 #define RT_EBM_SRC_FILE 'f'
338 #define RT_EBM_SRC_OBJ 'o'
339  char datasrc; /**< @brief which type of data source */
340 };
341 #define RT_EBM_CK_MAGIC(_p) BU_CKMAG(_p, RT_EBM_INTERNAL_MAGIC, "rt_ebm_internal")
342 /** @} */
343 
344 /** @addtogroup rt_vol */
345 /** @{ */
346 /*
347  * ID_VOL
348  */
349 #define RT_VOL_NAME_LEN 128
351  uint32_t magic;
353  /* NOTE: [xyz]dim/lo/hi cannot be size_t until rel8 as they are
354  * written out to disk via bu_vls_struct_print() as 32-bit ints.
355  */
356  uint32_t xdim; /**< @brief X dimension */
357  uint32_t ydim; /**< @brief Y dimension */
358  uint32_t zdim; /**< @brief Z dimension */
359  uint32_t lo; /**< @brief Low threshold */
360  uint32_t hi; /**< @brief High threshold */
361  vect_t cellsize; /**< @brief ideal coords: size of each cell */
362  mat_t mat; /**< @brief convert local coords to model space */
363  struct rt_db_internal *bip; /* @brief db object for data*/
364 #define RT_VOL_SRC_FILE 'f'
365 #define RT_VOL_SRC_OBJ 'o'
366  char datasrc;/**< @brief which type of data source */
367  /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
368  unsigned char *map;
369 };
370 #define RT_VOL_CK_MAGIC(_p) BU_CKMAG(_p, RT_VOL_INTERNAL_MAGIC, "rt_vol_internal")
371 /** @} */
372 
373 /** @addtogroup rt_hf */
374 /** @{ */
375 /*
376  * ID_HF
377  */
379  uint32_t magic;
380  /* BEGIN USER SETTABLE VARIABLES */
381  char cfile[128]; /**< @brief name of control file (optional) */
382  char dfile[128]; /**< @brief name of data file */
383  char fmt[8]; /**< @brief CV style file format descriptor */
384  /* NOTE: w/n/shorts cannot be size_t until rel8 as they are
385  * written out to disk via bu_vls_struct_print() as 32-bit ints.
386  */
387  uint32_t w; /**< @brief # samples wide of data file. ("i", "x") */
388  uint32_t n; /**< @brief nlines of data file. ("j", "y") */
389  uint32_t shorts; /**< @brief !0 --> memory array is short, not float */
390  fastf_t file2mm; /**< @brief scale factor to cvt file units to mm */
391  vect_t v; /**< @brief origin of HT in model space */
392  vect_t x; /**< @brief model vect corresponding to "w" dir (will be unitized) */
393  vect_t y; /**< @brief model vect corresponding to "n" dir (will be unitized) */
394  fastf_t xlen; /**< @brief model len of HT rpp in "w" dir */
395  fastf_t ylen; /**< @brief model len of HT rpp in "n" dir */
396  fastf_t zscale; /**< @brief scale of data in ''up'' dir (after file2mm is applied) */
397  /* END USER SETTABLE VARIABLES, BEGIN INTERNAL STUFF */
398  struct bu_mapped_file *mp; /**< @brief actual data */
399 };
400 #define RT_HF_CK_MAGIC(_p) BU_CKMAG(_p, RT_HF_INTERNAL_MAGIC, "rt_hf_internal")
401 /** @} */
402 
403 /** @addtogroup rt_arbn */
404 /** @{ */
405 /*
406  * ID_ARBN
407  */
409  uint32_t magic;
410  size_t neqn;
412 };
413 #define RT_ARBN_CK_MAGIC(_p) BU_CKMAG(_p, RT_ARBN_INTERNAL_MAGIC, "rt_arbn_internal")
414 /** @} */
415 
416 /** @addtogroup rt_pipe */
417 /** @{ */
418 /*
419  * ID_PIPE
420  */
422  uint32_t pipe_magic;
423  struct bu_list pipe_segs_head;
424  /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
426 };
427 #define RT_PIPE_CK_MAGIC(_p) BU_CKMAG(_p, RT_PIPE_INTERNAL_MAGIC, "rt_pipe_internal")
428 struct wdb_pipe_pnt {
429  struct bu_list l; /**< @brief doubly linked list support */
430  point_t pp_coord; /**< @brief "control" point for pipe solid */
431  fastf_t pp_id; /**< @brief inner diam, <=0 if solid (wire) */
432  fastf_t pp_od; /**< @brief pipe outer diam */
433  fastf_t pp_bendradius; /**< @brief bend radius to use for a bend at this point */
434 };
435 /** @} */
436 
437 
438 /** @addtogroup rt_part */
439 /** @{ */
440 /*
441  * ID_PARTICLE
442  */
444  uint32_t part_magic;
449  /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
450  int part_type; /**< @brief sphere, cylinder, cone */
451 };
452 #define RT_PART_CK_MAGIC(_p) BU_CKMAG(_p, RT_PART_INTERNAL_MAGIC, "rt_part_internal")
453 
454 #define RT_PARTICLE_TYPE_SPHERE 1
455 #define RT_PARTICLE_TYPE_CYLINDER 2
456 #define RT_PARTICLE_TYPE_CONE 3
457 /** @} */
458 
459 /** @addtogroup rt_rpc */
460 /** @{ */
461 /*
462  * ID_RPC
463  */
465  uint32_t rpc_magic;
466  point_t rpc_V; /**< @brief rpc vertex */
467  vect_t rpc_H; /**< @brief height vector */
468  vect_t rpc_B; /**< @brief breadth vector */
469  fastf_t rpc_r; /**< @brief scalar half-width of rectangular face */
470 };
471 #define RT_RPC_CK_MAGIC(_p) BU_CKMAG(_p, RT_RPC_INTERNAL_MAGIC, "rt_rpc_internal")
472 /** @} */
473 
474 /** @addtogroup rt_rhc */
475 /** @{ */
476 /*
477  * ID_RHC
478  */
480  uint32_t rhc_magic;
481  point_t rhc_V; /**< @brief rhc vertex */
482  vect_t rhc_H; /**< @brief height vector */
483  vect_t rhc_B; /**< @brief breadth vector */
484  fastf_t rhc_r; /**< @brief scalar half-width of rectangular face */
485  fastf_t rhc_c; /**< @brief dist from hyperbola to vertex of asymptotes */
486 };
487 #define RT_RHC_CK_MAGIC(_p) BU_CKMAG(_p, RT_RHC_INTERNAL_MAGIC, "rt_rhc_internal")
488 /** @} */
489 
490 /** @addtogroup rt_epa */
491 /** @{ */
492 /*
493  * ID_EPA
494  */
496  uint32_t epa_magic;
497  point_t epa_V; /**< @brief epa vertex */
498  vect_t epa_H; /**< @brief height vector */
499  vect_t epa_Au; /**< @brief unit vector along semi-major axis */
500  fastf_t epa_r1; /**< @brief scalar semi-major axis length */
501  fastf_t epa_r2; /**< @brief scalar semi-minor axis length */
502 };
503 #define RT_EPA_CK_MAGIC(_p) BU_CKMAG(_p, RT_EPA_INTERNAL_MAGIC, "rt_epa_internal")
504 /** @} */
505 
506 /** @addtogroup rt_ehy */
507 /** @{ */
508 /*
509  * ID_EHY
510  */
512  uint32_t ehy_magic;
513  point_t ehy_V; /**< @brief ehy vertex */
514  vect_t ehy_H; /**< @brief height vector */
515  vect_t ehy_Au; /**< @brief unit vector along semi-major axis */
516  fastf_t ehy_r1; /**< @brief scalar semi-major axis length */
517  fastf_t ehy_r2; /**< @brief scalar semi-minor axis length */
518  fastf_t ehy_c; /**< @brief dist from hyperbola to vertex of asymptotes */
519 };
520 #define RT_EHY_CK_MAGIC(_p) BU_CKMAG(_p, RT_EHY_INTERNAL_MAGIC, "rt_ehy_internal")
521 /** @} */
522 
523 /** @addtogroup rt_hyp */
524 /** @{ */
525 /*
526  * ID_HYP
527  */
529  uint32_t hyp_magic;
530  point_t hyp_Vi; /**< @brief hyp vertex */
531  vect_t hyp_Hi; /**< @brief full height vector */
532  vect_t hyp_A; /**< @brief semi-major axis */
533  fastf_t hyp_b; /**< @brief scalar semi-minor axis length */
534  fastf_t hyp_bnr;/**< @brief ratio of minimum neck width to base width */
535 };
536 #define RT_HYP_CK_MAGIC(_p) BU_CKMAG(_p, RT_HYP_INTERNAL_MAGIC, "rt_hyp_internal")
537 /** @} */
538 
539 /** @addtogroup rt_eto */
540 /** @{ */
541 /*
542  * ID_ETO
543  */
545  uint32_t eto_magic;
546  point_t eto_V; /**< @brief eto vertex */
547  vect_t eto_N; /**< @brief vector normal to plane of torus */
548  vect_t eto_C; /**< @brief vector along semi-major axis of ellipse */
549  fastf_t eto_r; /**< @brief scalar radius of rotation */
550  fastf_t eto_rd; /**< @brief scalar length of semi-minor of ellipse */
551 };
552 #define RT_ETO_CK_MAGIC(_p) BU_CKMAG(_p, RT_ETO_INTERNAL_MAGIC, "rt_eto_internal")
553 /** @} */
554 
555 /** @addtogroup rt_dsp */
556 /** @{ */
557 /*
558  * ID_DSP
559  */
560 #define DSP_NAME_LEN 128
562  uint32_t magic;
563 #define dsp_file dsp_name /**< @brief for backwards compatibility */
564  struct bu_vls dsp_name; /**< TODO: make this a pointer, name of data file */
565 
566  /* NOTE: dsp_xcnt/dsp_ycnt cannot be size_t until rel8 as they are
567  * written out to disk via bu_vls_struct_print() as 32-bit ints.
568  */
569  uint32_t dsp_xcnt; /**< @brief # samples in row of data */
570  uint32_t dsp_ycnt; /**< @brief # of columns in data */
571  unsigned short dsp_smooth; /**< @brief bool: surf normal interp */
572 #define DSP_CUT_DIR_ADAPT 'a'
573 #define DSP_CUT_DIR_llUR 'l'
574 #define DSP_CUT_DIR_ULlr 'L'
575  unsigned char dsp_cuttype; /**< @brief type of cut to make */
576 
577  mat_t dsp_mtos; /**< @brief model to solid space */
578  /* END OF USER SETTABLE VARIABLES, BEGIN INTERNAL STUFF */
579  mat_t dsp_stom; /**< @brief solid to model space
580  * computed from dsp_mtos */
581  unsigned short *dsp_buf; /**< @brief actual data */
582  struct bu_mapped_file *dsp_mp; /**< @brief mapped file for data */
583  struct rt_db_internal *dsp_bip; /**< @brief db object for data */
584 #define RT_DSP_SRC_V4_FILE '4'
585 #define RT_DSP_SRC_FILE 'f'
586 #define RT_DSP_SRC_OBJ 'o'
587  char dsp_datasrc; /**< @brief which type of data source */
588 };
589 #define RT_DSP_CK_MAGIC(_p) BU_CKMAG(_p, RT_DSP_INTERNAL_MAGIC, "rt_dsp_internal")
590 /** @} */
591 
592 
593 /** @addtogroup rt_sketch */
594 /** @{ */
595 /*
596  * ID_SKETCH
597  */
598 
599 /**
600  * container for a set of sketch segments
601  */
602 struct rt_curve {
603  size_t count; /**< number of segments in this curve */
604  int *reverse; /**< array of boolean flags indicating if
605  * segment should be reversed
606  */
607  void **segment; /**< array of curve segment pointers */
608 };
609 
610 
611 /**
612  * used by the sketch, solid of extrusion and the annotation primitive
613  */
614 
615 struct line_seg /**< @brief line segment */
616 {
617  uint32_t magic;
618  int start, end; /**< @brief indices into sketch's array of vertices */
619 };
620 
621 
622 struct carc_seg /**< @brief circular arc segment */
623 {
624  uint32_t magic;
625  int start, end; /**< @brief indices */
626  fastf_t radius; /**< @brief radius < 0.0 -> full circle with start point on
627  * circle and "end" at center */
628  int center_is_left; /**< @brief flag indicating where center of curvature is.
629  * If non-zero, then center is to left of vector
630  * from start to end */
631  int orientation; /**< @brief 0 -> ccw, !0 -> cw */
632  int center; /**< @brief index of vertex at center of arc (only used by rt_extrude_prep and rt_extrude_shot) */
633 };
634 
635 
636 struct seg_knot_vector {
637  int k_size; /**< @brief knot vector size */
638  fastf_t * knots; /**< @brief pointer to knot vector */
639 };
640 
641 struct nurb_seg /**< @brief NURB curve segment */
642 {
643  uint32_t magic;
644  int order; /**< @brief order of NURB curve (degree - 1) */
645  int pt_type; /**< @brief type of NURB curve */
646  struct seg_knot_vector k; /**< @brief knot vector for NURB curve */
647  int c_size; /**< @brief number of control points */
648  int *ctl_points; /**< @brief array of indices for control points */
649  fastf_t *weights; /**< @brief array of weights for control points (NULL if non_rational) */
650 };
651 
652 
653 struct bezier_seg /**< @brief Bezier curve segment */
654 {
655  uint32_t magic;
656  int degree; /**< @brief degree of curve (number of control points - 1) */
657  int *ctl_points; /**< @brief array of indices for control points */
658 };
659 
660 
661 #define SKETCH_NAME_LEN 16
663 {
664  uint32_t magic;
665  point_t V; /**< default embedding of sketch */
666  vect_t u_vec; /**< unit vector 'u' component
667  * defining the sketch plane
668  */
669  vect_t v_vec; /**< unit vector 'v' component
670  * defining the sketch plane
671  */
672  size_t vert_count; /**< number of sketch vertices */
673  point2d_t *verts; /**< array of 2D vertices that may be
674  * used as endpoints, centers, or
675  * spline control points
676  */
677  struct rt_curve curve; /**< the curves of this sketch */
678 };
679 #define RT_SKETCH_CK_MAGIC(_p) BU_CKMAG(_p, RT_SKETCH_INTERNAL_MAGIC, "rt_sketch_internal")
680 /** @} */
681 
682 /** @addtogroup rt_submodel */
683 /** @{ */
684 /*
685  * ID_SUBMODEL
686  */
687 struct rt_submodel_internal {
688  uint32_t magic;
689  struct bu_vls file; /**< @brief .g filename, 0-len --> this database. */
690  struct bu_vls treetop; /**< @brief one treetop only */
691  int meth; /**< @brief space partitioning method */
692  /* other option flags (lazy prep, etc.)?? */
693  /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
695  const struct db_i *dbip;
696 };
697 #define RT_SUBMODEL_CK_MAGIC(_p) BU_CKMAG(_p, RT_SUBMODEL_INTERNAL_MAGIC, "rt_submodel_internal")
698 /** @} */
699 
700 /** @addtogroup rt_extrude */
701 /** @{ */
702 /*
703  * ID_EXTRUDE
704  */
705 
706 struct rt_extrude_internal
707 {
708  uint32_t magic;
709  point_t V; /**< @brief vertex, start and end point of loop to be extruded */
710  vect_t h; /**< @brief extrusion vector, may not be in (u_vec X v_vec) plane */
711  vect_t u_vec; /**< @brief vector in U parameter direction */
712  vect_t v_vec; /**< @brief vector in V parameter direction */
713  int keypoint; /**< @brief DEPRECATED (UNUSED): index of keypoint vertex */
714  char *sketch_name; /**< @brief name of sketch object that defines the curve to be extruded */
715  struct rt_sketch_internal *skt; /**< @brief pointer to referenced sketch */
716 };
717 
718 
719 /**
720  * Note that the u_vec and v_vec are not unit vectors, their magnitude
721  * and direction are used for scaling and rotation.
722  */
723 #define RT_EXTRUDE_CK_MAGIC(_p) BU_CKMAG(_p, RT_EXTRUDE_INTERNAL_MAGIC, "rt_extrude_internal")
724 /** @} */
725 
726 /** @addtogroup rt_revolve */
727 /** @{ */
728 /*
729  * ID_REVOLVE
730  */
731 struct rt_revolve_internal {
732  uint32_t magic;
733  point_t v3d; /**< @brief vertex in 3d space */
734  vect_t axis3d; /**< @brief revolve axis in 3d space, y axis */
735 
736  point2d_t v2d; /**< @brief vertex in 2d sketch */
737  vect2d_t axis2d; /**< @brief revolve axis in 2d sketch */
738 
739  vect_t r; /**< @brief vector in start plane, x axis */
740  fastf_t ang; /**< @brief angle to revolve*/
741  struct bu_vls sketch_name; /**< @brief name of sketch */
742  struct rt_sketch_internal *skt; /**< @brief pointer to sketch */
743 };
744 #define RT_REVOLVE_CK_MAGIC(_p) BU_CKMAG(_p, RT_REVOLVE_INTERNAL_MAGIC, "rt_revolve_internal")
745 /** @} */
746 
747 /** @addtogroup rt_cline */
748 /** @{ */
749 /*
750  * ID_CLINE
751  *
752  * Implementation of FASTGEN CLINE element
753  */
754 
755 struct rt_cline_internal
756 {
757  uint32_t magic;
761  fastf_t thickness; /**< @brief zero thickness means volume mode */
762 };
763 #define RT_CLINE_CK_MAGIC(_p) BU_CKMAG(_p, RT_CLINE_INTERNAL_MAGIC, "rt_cline_internal")
764 /** @} */
765 
766 /** @addtogroup rt_bot */
767 /** @{ */
768 /*
769  * ID_BOT
770  */
771 
772 struct rt_bot_internal
773 {
774  uint32_t magic;
775  unsigned char mode;
776  unsigned char orientation;
777  unsigned char bot_flags; /**< @brief flags, (indicates surface
778  * normals available, for example)
779  */
780 
781  size_t num_faces;
782  int *faces; /**< @brief array of ints for faces
783  * [num_faces*3]
784  */
785 
786  size_t num_vertices;
787  fastf_t *vertices; /**< @brief array of floats for
788  * vertices [num_vertices*3]
789  */
790 
791  fastf_t *thickness; /**< @brief array of plate mode
792  * thicknesses (corresponds to array
793  * of faces) NULL for modes
794  * RT_BOT_SURFACE and RT_BOT_SOLID.
795  */
796  struct bu_bitv *face_mode; /**< @brief a flag for each face
797  * indicating thickness is appended to
798  * hit point in ray direction (if bit
799  * is set), otherwise thickness is
800  * centered about hit point (NULL for
801  * modes RT_BOT_SURFACE and
802  * RT_BOT_SOLID).
803  */
804 
805  size_t num_normals;
806  fastf_t *normals; /**< @brief array of unit surface
807  * normals [num_normals*3]
808  */
809 
810  size_t num_face_normals; /**< @brief current size of the
811  * face_normals array below (number of
812  * faces in the array)
813  */
814  int *face_normals; /**< @brief array of indices into the
815  * "normals" array, one per face
816  * vertex [num_face_normals*3]
817  */
818 
819  size_t num_uvs; /**< @brief current size of the vertex
820  * uv mappings (corresponds to number
821  * of vertices)
822  */
823  fastf_t *uvs; /**< @brief array of floats for uv
824  * texturing coordinates [num_uvs*3]
825  */
826 
827  size_t num_face_uvs; /**< @brief current size of the
828  * face_uvs array below (number of
829  * faces in the array)
830  */
831  int *face_uvs; /**< @brief array of indices into the
832  * "uvs" array, one per face vertex
833  * [num_uvs*3] */
834 
835  void *tie; /* FIXME: blind casting. TIE needs to move from TIE_FUNC to XGLUE before this can not suck. */
836 };
837 
838 
839 struct rt_bot_list {
840  struct bu_list l;
842 };
843 
844 
845 /* orientations for BOT */
846 #define RT_BOT_UNORIENTED 1 /**< @brief unoriented triangles */
847 #define RT_BOT_CCW 2 /**< @brief oriented counter-clockwise */
848 #define RT_BOT_CW 3 /**< @brief oriented clockwise */
849 
850 /* modes for BOT */
851 #define RT_BOT_SURFACE 1 /**< @brief triangles represent a surface (no volume) */
852 #define RT_BOT_SOLID 2 /**< @brief triangles represent the boundary of a solid object */
853 
854 /**
855  * triangles represent plates. Thicknesses are specified in
856  * "thickness" array, and face mode is specified in "face_mode" bit
857  * vector. This is the FASTGEN "plate" mode. Orientation is ignored.
858  */
859 #define RT_BOT_PLATE 3
860 
861 /**
862  * same as plate mode, but LOS is set equal to face thickness, not the
863  * thickness divided by the cosine of the obliquity angle.
864  */
865 #define RT_BOT_PLATE_NOCOS 4
866 
867 /* flags for bot_flags */
868 #define RT_BOT_HAS_SURFACE_NORMALS 0x01 /**< @brief Has surface normals at each face vertex */
869 #define RT_BOT_USE_NORMALS 0x02 /**< @brief Use the surface normals if they exist */
870 #define RT_BOT_USE_FLOATS 0x04 /**< @brief Use the single precision version of "tri_specific" during prep */
871 #define RT_BOT_HAS_TEXTURE_UVS 0x08 /**< @brief Has uv texture coordinates at each face vertex */
872 #define RT_BOT_HAS_UNUSED1 0x10 /**< @brief TBD */
873 #define RT_BOT_HAS_UNUSED2 0x20 /**< @brief TBD */
874 #define RT_BOT_HAS_UNUSED3 0x40 /**< @brief TBD */
875 #define RT_BOT_HAS_UNUSED4 0x80 /**< @brief WARNING: use this flag to denote more bits in the export serialization */
876 
877 #define RT_BOT_CK_MAGIC(_p) BU_CKMAG(_p, RT_BOT_INTERNAL_MAGIC, "rt_bot_internal")
878 /** @} */
879 
880 
881 /** @addtogroup rt_pnt */
882 /** @{ */
883 /**
884  * ID_PNTS
885  *
886  * Points are represented to a structure that contains exactly the
887  * data that it needs for that 'type' of point. The reason this was
888  * done over using something like a union was to fully optimize memory
889  * usage so that the maximum number of points could be stored without
890  * resorting to out-of-core techniques. A union is at least the size
891  * of the largest type and would have wasted memory.
892  *
893  * By using this data-driven approach of type identification, it does
894  * result in needing to have a switching table for all supported types
895  * in order to access data. This could be avoided by storing them as
896  * multiple lists (wasting a few bytes for unused pointers) but is
897  * left as an exercise to the reader.
898  */
899 
900 typedef enum {
901  RT_PNT_TYPE_PNT = 0,
911 
912 struct pnt {
913  struct bu_list l;
915 };
916 struct pnt_color {
917  struct bu_list l;
919  struct bu_color c;
920 };
921 struct pnt_scale {
922  struct bu_list l;
924  fastf_t s;
925 };
926 struct pnt_normal {
927  struct bu_list l;
929  vect_t n;
930 };
932  struct bu_list l;
934  struct bu_color c;
936 };
938  struct bu_list l;
940  struct bu_color c;
942 };
944  struct bu_list l;
946  fastf_t s;
948 };
950  struct bu_list l;
952  struct bu_color c;
954  vect_t n;
955 };
956 
957 
958 struct rt_pnts_internal {
959  uint32_t magic;
960  double scale;
962  unsigned long count;
963  void *point;
964 };
965 #define RT_PNTS_CK_MAGIC(_p) BU_CKMAG(_p, RT_PNTS_INTERNAL_MAGIC, "rt_pnts_internal")
966 /** @} */
967 
968 /** @addtogroup rt_annotation */
969 /** @{ */
970 /*
971  * ID_ANNO
972  *
973  * Annotations are used to provide labels in-scene when viewing
974  * geometry. Leaders connect labels to geometry objects or fixed
975  * points in space.
976  *
977  */
978 
979 /**
980  * container for the annotation primitive
981  */
982 struct rt_ant {
983  size_t count; /**< @brief number of segments in the annotation */
984  int *reverse; /**< array of boolean flags indicating if the
985  * segment should be reversed */
986  void **segments; /**< @brief array of annotation segment pointer */
987 };
988 
989 
990 /**
991  * text labels used by the annotation primitive
992  */
993 struct txt_seg {
994  uint32_t magic;
995  int ref_pt; /** reference point */
996  int rel_pos; /** flag describing position relative to ref_pt */
997  struct bu_vls label;
998  fastf_t txt_size; /** text size */
999  fastf_t txt_rot_angle; /** text rotation angle */
1000 };
1002 
1003 /**
1004  * placement flags
1005  */
1006 #define RT_TXT_POS_BL 1
1007 #define RT_TXT_POS_BC 2
1008 #define RT_TXT_POS_BR 3
1009 #define RT_TXT_POS_ML 4
1010 #define RT_TXT_POS_MC 5
1011 #define RT_TXT_POS_MR 6
1012 #define RT_TXT_POS_TL 7
1013 #define RT_TXT_POS_TC 8
1014 #define RT_TXT_POS_TR 9
1016 /**
1017  * set a position flag to the corresponding placement value given
1018  * numeric settings (1=left/top, 2=middle/center, 3=right/bottom).
1019  */
1020 RT_EXPORT int rt_txt_pos_flag(int *pos_flag, int horizontal, int vertical);
1021 
1022 /**
1023  * internal representation of an annotation object
1024  */
1025 struct rt_annot_internal
1026 {
1027  uint32_t magic;
1028  point_t V; /**< @brief vertex, maps to the origin in the 2D system */
1029  size_t vert_count; /**< @brief number of vertices */
1030  point2d_t *verts; /**< @brief array of vertices that serve as control points */
1031  struct rt_ant ant; /**< @brief segments in the annotation */
1032 };
1033 
1034 
1035 #define RT_ANNOT_CK_MAGIC(_p) BU_CKMAG(_p, RT_ANNOT_INTERNAL_MAGIC, "rt_annot_internal")
1036 /** @} */
1038 /*
1039  * ID_DATUM
1040  *
1041  * Datums provide basic geometric reference entities such as reference
1042  * frames, planes, lines, and/or points. A datum reference frame is
1043  * generally a Cartesian coordinate system that consists of three
1044  * mutually perpendicular axes, three mutually perpendicular base
1045  * planes, and a point representing the origin.
1046  *
1047  * Planes distinguished by (!ZERO(w)) utilize 'pnt', 'dir', and 'w' to
1048  * define an unoriented plane. The plane is defined by the vector
1049  * from 'pnt' in 'dir' direction multiplied by the 'w' scalar value.
1050  *
1051  * Lines distinguished by (MAGNITUDE(dir) > 0.0 && ZERO(w)) utilize
1052  * 'pnt' and 'dir' to define a line.
1053  *
1054  * Points only use the 'pnt' field to define an unoriented point.
1055  *
1056  * Datum references are stored as a simple NULL-terminated linked list
1057  * manually accessed through the 'next' pointer.
1058  *
1059  * This characterization is derived from ASME Y14.5M
1060  *
1061  * TODO:
1062  * - edsol needs to do more than move the first datum
1063  * - tedit is untested
1064  * - wdb needs to support more than one datum
1065  * - validate the datum during prep
1066  * - add CK validation checks to all loops
1067  */
1068 struct rt_datum_internal
1069 {
1070  uint32_t magic;
1072  point_t pnt;
1074  fastf_t w;
1077 };
1078 
1080 /**
1081  * validation macro to make sure an rt_datum_internal has the proper magic identifier.
1082  */
1083 #define RT_DATUM_CK_MAGIC(_p) BU_CKMAG(_p, RT_DATUM_INTERNAL_MAGIC, "rt_datum_internal")
1084 
1085 
1086 /** @addtogroup rt_hrt */
1087 /** @{ */
1088 struct rt_hrt_internal
1089 {
1090  uint32_t hrt_magic;
1091  point_t v; /**< @brief center point */
1092  vect_t xdir; /**< @brief unit vector in x direction */
1093  vect_t ydir; /**< @brief unit vector in y direction */
1094  vect_t zdir; /**< @brief unit vector in z direction */
1095  fastf_t d; /**< @brief distance to cusps */
1096 };
1097 #define RT_HRT_CK_MAGIC(_p) BU_CKMAG(_p, RT_HRT_INTERNAL_MAGIC, "rt_hrt_internal")
1099 
1100 /** @addtogroup rt_script */
1101 /** @{ */
1102 struct rt_script_internal {
1103  uint32_t script_magic;
1104  struct bu_vls s_type;
1105 };
1106 #define RT_SCRIPT_CK_MAGIC(_p) BU_CKMAG(_p, RT_SCRIPT_INTERNAL_MAGIC, "rt_script_internal")
1107 /** @} */
1108 
1110 __END_DECLS
1111 
1112 #endif /* RT_GEOM_H */
1113 
1114 /** @} */
1115 /*
1116  * Local Variables:
1117  * mode: C
1118  * tab-width: 8
1119  * indent-tabs-mode: t
1120  * c-file-style: "stroustrup"
1121  * End:
1122  * ex: shiftwidth=4 tabstop=8
1123  */
Header file for the BRL-CAD common definitions.
int rt_txt_pos_flag(int *pos_flag, int horizontal, int vertical)
#define RT_EBM_NAME_LEN
Definition: geom.h:323
rt_pnt_type
Definition: geom.h:902
@ RT_PNT_TYPE_NRM
Definition: geom.h:906
@ RT_PNT_TYPE_PNT
Definition: geom.h:903
@ RT_PNT_TYPE_SCA_NRM
Definition: geom.h:909
@ RT_PNT_TYPE_COL
Definition: geom.h:904
@ RT_PNT_TYPE_COL_SCA_NRM
Definition: geom.h:910
@ RT_PNT_TYPE_COL_NRM
Definition: geom.h:908
@ RT_PNT_TYPE_COL_SCA
Definition: geom.h:907
@ RT_PNT_UNKNOWN
Definition: geom.h:911
@ RT_PNT_TYPE_SCA
Definition: geom.h:905
#define RT_VOL_NAME_LEN
Definition: geom.h:349
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
Definition: vmath.h:349
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:334
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
Definition: vmath.h:370
fastf_t point2d_t[ELEMENTS_PER_POINT2D]
2-tuple point
Definition: vmath.h:343
fastf_t plane_t[ELEMENTS_PER_PLANE]
Definition of a plane equation.
Definition: vmath.h:397
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
fastf_t vect2d_t[ELEMENTS_PER_VECT2D]
2-tuple vector
Definition: vmath.h:337
Bezier curve segment.
Definition: geom.h:655
int * ctl_points
array of indices for control points
Definition: geom.h:658
int degree
degree of curve (number of control points - 1)
Definition: geom.h:657
uint32_t magic
Definition: geom.h:656
Definition: bitv.h:108
Definition: color.h:54
Definition: list.h:132
Definition: vls.h:53
circular arc segment
Definition: geom.h:624
fastf_t radius
radius < 0.0 -> full circle with start point on circle and "end" at center
Definition: geom.h:627
int center_is_left
flag indicating where center of curvature is. If non-zero, then center is to left of vector from star...
Definition: geom.h:629
int start
Definition: geom.h:626
int orientation
0 -> ccw, !0 -> cw
Definition: geom.h:632
uint32_t magic
Definition: geom.h:625
int center
index of vertex at center of arc (only used by rt_extrude_prep and rt_extrude_shot)
Definition: geom.h:633
int end
indices
Definition: geom.h:626
Face NURBS surface geometry.
Definition: topology.h:392
line segment
Definition: geom.h:617
int start
Definition: geom.h:619
uint32_t magic
Definition: geom.h:618
int end
indices into sketch's array of vertices
Definition: geom.h:619
NURB curve segment.
Definition: geom.h:643
int * ctl_points
array of indices for control points
Definition: geom.h:649
uint32_t magic
Definition: geom.h:644
struct seg_knot_vector k
knot vector for NURB curve
Definition: geom.h:647
int c_size
number of control points
Definition: geom.h:648
int order
order of NURB curve (degree - 1)
Definition: geom.h:645
int pt_type
type of NURB curve
Definition: geom.h:646
fastf_t * weights
array of weights for control points (NULL if non_rational)
Definition: geom.h:650
struct bu_list l
Definition: geom.h:940
point_t v
Definition: geom.h:941
vect_t n
Definition: geom.h:943
struct bu_color c
Definition: geom.h:942
struct bu_list l
Definition: geom.h:952
struct bu_color c
Definition: geom.h:954
struct bu_list l
Definition: geom.h:934
point_t v
Definition: geom.h:935
struct bu_color c
Definition: geom.h:936
fastf_t s
Definition: geom.h:937
struct bu_list l
Definition: geom.h:919
point_t v
Definition: geom.h:920
struct bu_color c
Definition: geom.h:921
struct bu_list l
Definition: geom.h:929
point_t v
Definition: geom.h:930
vect_t n
Definition: geom.h:931
struct bu_list l
Definition: geom.h:946
point_t v
Definition: geom.h:947
vect_t n
Definition: geom.h:949
fastf_t s
Definition: geom.h:948
struct bu_list l
Definition: geom.h:924
point_t v
Definition: geom.h:925
fastf_t s
Definition: geom.h:926
Definition: geom.h:914
struct bu_list l
Definition: geom.h:915
point_t v
Definition: geom.h:916
point2d_t * verts
array of vertices that serve as control points
Definition: geom.h:1032
uint32_t magic
Definition: geom.h:1029
point_t V
vertex, maps to the origin in the 2D system
Definition: geom.h:1030
size_t vert_count
number of vertices
Definition: geom.h:1031
struct rt_ant ant
segments in the annotation
Definition: geom.h:1033
Definition: geom.h:984
size_t count
number of segments in the annotation
Definition: geom.h:985
void ** segments
array of annotation segment pointer
Definition: geom.h:988
int * reverse
Definition: geom.h:986
point_t pt[8]
Definition: geom.h:193
uint32_t magic
Definition: geom.h:192
plane_t * eqn
Definition: geom.h:411
uint32_t magic
Definition: geom.h:409
size_t neqn
Definition: geom.h:410
fastf_t ** curves
Definition: geom.h:207
size_t pts_per_curve
Definition: geom.h:206
uint32_t magic
Definition: geom.h:204
size_t ncurves
Definition: geom.h:205
unsigned char bot_flags
flags, (indicates surface normals available, for example)
Definition: geom.h:778
fastf_t * normals
array of unit surface normals [num_normals*3]
Definition: geom.h:807
void * tie
Definition: geom.h:836
size_t num_normals
Definition: geom.h:806
size_t num_face_normals
current size of the face_normals array below (number of faces in the array)
Definition: geom.h:811
uint32_t magic
Definition: geom.h:775
struct bu_bitv * face_mode
a flag for each face indicating thickness is appended to hit point in ray direction (if bit is set),...
Definition: geom.h:797
int * face_normals
array of indices into the "normals" array, one per face vertex [num_face_normals*3]
Definition: geom.h:815
fastf_t * uvs
array of floats for uv texturing coordinates [num_uvs*3]
Definition: geom.h:824
unsigned char mode
Definition: geom.h:776
unsigned char orientation
Definition: geom.h:777
int * faces
array of ints for faces [num_faces*3]
Definition: geom.h:783
size_t num_face_uvs
current size of the face_uvs array below (number of faces in the array)
Definition: geom.h:828
size_t num_faces
Definition: geom.h:782
fastf_t * thickness
array of plate mode thicknesses (corresponds to array of faces) NULL for modes RT_BOT_SURFACE and RT_...
Definition: geom.h:792
size_t num_uvs
current size of the vertex uv mappings (corresponds to number of vertices)
Definition: geom.h:820
int * face_uvs
array of indices into the "uvs" array, one per face vertex [num_uvs*3]
Definition: geom.h:832
fastf_t * vertices
array of floats for vertices [num_vertices*3]
Definition: geom.h:788
size_t num_vertices
Definition: geom.h:787
struct bu_list l
Definition: geom.h:842
struct rt_bot_internal * bot
Definition: geom.h:843
ON_Brep * brep
An openNURBS brep object containing the solid.
Definition: geom.h:300
uint32_t magic
Definition: geom.h:298
fastf_t radius
Definition: geom.h:761
uint32_t magic
Definition: geom.h:758
vect_t h
Definition: geom.h:760
fastf_t thickness
zero thickness means volume mode
Definition: geom.h:762
point_t v
Definition: geom.h:759
Definition: geom.h:603
size_t count
Definition: geom.h:604
int * reverse
Definition: geom.h:605
void ** segment
Definition: geom.h:608
uint32_t magic
Definition: geom.h:1073
struct rt_datum_internal * next
Definition: geom.h:1079
point_t pnt
Definition: geom.h:1075
vect_t dir
Definition: geom.h:1076
fastf_t w
Definition: geom.h:1077
unsigned short * dsp_buf
actual data
Definition: geom.h:582
struct rt_db_internal * dsp_bip
db object for data
Definition: geom.h:584
char dsp_datasrc
which type of data source
Definition: geom.h:588
uint32_t magic
Definition: geom.h:562
struct bu_vls dsp_name
Definition: geom.h:564
unsigned char dsp_cuttype
type of cut to make
Definition: geom.h:576
mat_t dsp_stom
solid to model space computed from dsp_mtos
Definition: geom.h:580
uint32_t dsp_xcnt
# samples in row of data
Definition: geom.h:570
mat_t dsp_mtos
model to solid space
Definition: geom.h:578
unsigned short dsp_smooth
bool: surf normal interp
Definition: geom.h:572
uint32_t dsp_ycnt
# of columns in data
Definition: geom.h:571
struct bu_mapped_file * dsp_mp
mapped file for data
Definition: geom.h:583
char name[RT_EBM_NAME_LEN]
Definition: geom.h:326
struct bu_mapped_file * mp
mapped file for data
Definition: geom.h:335
uint32_t xdim
X dimension (w cells)
Definition: geom.h:330
uint32_t magic
Definition: geom.h:325
uint32_t ydim
Y dimension (n cells)
Definition: geom.h:331
char datasrc
which type of data source
Definition: geom.h:339
fastf_t tallness
Z dimension (mm)
Definition: geom.h:332
mat_t mat
convert local coords to model space
Definition: geom.h:333
unsigned char * buf
actual data
Definition: geom.h:334
struct rt_db_internal * bip
db object for data
Definition: geom.h:336
vect_t ehy_Au
unit vector along semi-major axis
Definition: geom.h:515
fastf_t ehy_r1
scalar semi-major axis length
Definition: geom.h:516
fastf_t ehy_r2
scalar semi-minor axis length
Definition: geom.h:517
vect_t ehy_H
height vector
Definition: geom.h:514
point_t ehy_V
ehy vertex
Definition: geom.h:513
fastf_t ehy_c
dist from hyperbola to vertex of asymptotes
Definition: geom.h:518
uint32_t ehy_magic
Definition: geom.h:512
uint32_t magic
Definition: geom.h:97
vect_t a
axis a radial length
Definition: geom.h:99
vect_t c
axis c radial length
Definition: geom.h:101
vect_t b
axis b radial length
Definition: geom.h:100
point_t v
center point
Definition: geom.h:98
vect_t epa_Au
unit vector along semi-major axis
Definition: geom.h:499
uint32_t epa_magic
Definition: geom.h:496
fastf_t epa_r2
scalar semi-minor axis length
Definition: geom.h:501
vect_t epa_H
height vector
Definition: geom.h:498
point_t epa_V
epa vertex
Definition: geom.h:497
fastf_t epa_r1
scalar semi-major axis length
Definition: geom.h:500
vect_t eto_N
vector normal to plane of torus
Definition: geom.h:547
uint32_t eto_magic
Definition: geom.h:545
fastf_t eto_rd
scalar length of semi-minor of ellipse
Definition: geom.h:550
point_t eto_V
eto vertex
Definition: geom.h:546
vect_t eto_C
vector along semi-major axis of ellipse
Definition: geom.h:548
fastf_t eto_r
scalar radius of rotation
Definition: geom.h:549
vect_t u_vec
vector in U parameter direction
Definition: geom.h:712
struct rt_sketch_internal * skt
pointer to referenced sketch
Definition: geom.h:716
uint32_t magic
Definition: geom.h:709
char * sketch_name
name of sketch object that defines the curve to be extruded
Definition: geom.h:715
vect_t h
extrusion vector, may not be in (u_vec X v_vec) plane
Definition: geom.h:711
point_t V
vertex, start and end point of loop to be extruded
Definition: geom.h:710
int keypoint
DEPRECATED (UNUSED): index of keypoint vertex.
Definition: geom.h:714
vect_t v_vec
vector in V parameter direction
Definition: geom.h:713
point_t center
Definition: geom.h:231
uint32_t magic
Definition: geom.h:230
fastf_t mag
Definition: geom.h:234
vect_t normal
Definition: geom.h:233
uint32_t magic
Definition: geom.h:218
plane_t eqn
Definition: geom.h:219
fastf_t ylen
model len of HT rpp in "n" dir
Definition: geom.h:395
char cfile[128]
name of control file (optional)
Definition: geom.h:381
char dfile[128]
name of data file
Definition: geom.h:382
fastf_t xlen
model len of HT rpp in "w" dir
Definition: geom.h:394
uint32_t n
nlines of data file. ("j", "y")
Definition: geom.h:388
struct bu_mapped_file * mp
actual data
Definition: geom.h:398
uint32_t magic
Definition: geom.h:379
char fmt[8]
CV style file format descriptor.
Definition: geom.h:383
vect_t v
origin of HT in model space
Definition: geom.h:391
fastf_t file2mm
scale factor to cvt file units to mm
Definition: geom.h:390
uint32_t w
# samples wide of data file. ("i", "x")
Definition: geom.h:387
fastf_t zscale
scale of data in ''up'' dir (after file2mm is applied)
Definition: geom.h:396
vect_t x
model vect corresponding to "w" dir (will be unitized)
Definition: geom.h:392
uint32_t shorts
!0 --> memory array is short, not float
Definition: geom.h:389
vect_t y
model vect corresponding to "n" dir (will be unitized)
Definition: geom.h:393
vect_t ydir
unit vector in y direction
Definition: geom.h:1096
fastf_t d
distance to cusps
Definition: geom.h:1098
uint32_t hrt_magic
Definition: geom.h:1093
vect_t xdir
unit vector in x direction
Definition: geom.h:1095
point_t v
center point
Definition: geom.h:1094
vect_t zdir
unit vector in z direction
Definition: geom.h:1097
point_t hyp_Vi
hyp vertex
Definition: geom.h:530
fastf_t hyp_bnr
ratio of minimum neck width to base width
Definition: geom.h:534
vect_t hyp_A
semi-major axis
Definition: geom.h:532
uint32_t hyp_magic
Definition: geom.h:529
vect_t hyp_Hi
full height vector
Definition: geom.h:531
fastf_t hyp_b
scalar semi-minor axis length
Definition: geom.h:533
vect_t vector2
Definition: geom.h:252
fastf_t value
Definition: geom.h:253
struct bu_vls reference_path_2
Definition: geom.h:248
vect_t vector1
Definition: geom.h:251
uint32_t magic
Definition: geom.h:245
point_t location
Definition: geom.h:246
struct bu_vls reference_path_1
Definition: geom.h:247
fastf_t initstep
Definition: geom.h:164
fastf_t finalstep
Definition: geom.h:165
struct bu_list metaball_ctrl_head
Definition: geom.h:166
uint32_t magic
Definition: geom.h:157
fastf_t threshold
Definition: geom.h:163
int nsrf
number of surfaces
Definition: geom.h:283
ON_Brep * brep
Definition: geom.h:285
uint32_t magic
Definition: geom.h:282
struct face_g_snurb ** srfs
The surfaces themselves.
Definition: geom.h:284
fastf_t part_vrad
Definition: geom.h:447
point_t part_V
Definition: geom.h:445
int part_type
sphere, cylinder, cone
Definition: geom.h:450
vect_t part_H
Definition: geom.h:446
uint32_t part_magic
Definition: geom.h:444
fastf_t part_hrad
Definition: geom.h:448
has npoly elements
Definition: geom.h:263
size_t npts
number of points for this polygon
Definition: geom.h:264
fastf_t * verts
has 3*npts elements
Definition: geom.h:265
fastf_t * norms
has 3*npts elements
Definition: geom.h:266
size_t max_npts
maximum value of npts in poly[]
Definition: geom.h:273
struct rt_pg_face_internal * poly
has npoly elements
Definition: geom.h:271
uint32_t magic
Definition: geom.h:269
size_t npoly
Definition: geom.h:270
struct bu_list pipe_segs_head
Definition: geom.h:423
uint32_t pipe_magic
Definition: geom.h:422
int pipe_count
Definition: geom.h:425
void * point
Definition: geom.h:965
uint32_t magic
Definition: geom.h:961
unsigned long count
Definition: geom.h:964
double scale
Definition: geom.h:962
rt_pnt_type type
Definition: geom.h:963
point2d_t v2d
vertex in 2d sketch
Definition: geom.h:737
struct bu_vls sketch_name
name of sketch
Definition: geom.h:742
struct rt_sketch_internal * skt
pointer to sketch
Definition: geom.h:743
fastf_t ang
angle to revolve
Definition: geom.h:741
uint32_t magic
Definition: geom.h:733
vect_t r
vector in start plane, x axis
Definition: geom.h:740
vect2d_t axis2d
revolve axis in 2d sketch
Definition: geom.h:738
vect_t axis3d
revolve axis in 3d space, y axis
Definition: geom.h:735
point_t v3d
vertex in 3d space
Definition: geom.h:734
point_t rhc_V
rhc vertex
Definition: geom.h:481
uint32_t rhc_magic
Definition: geom.h:480
vect_t rhc_B
breadth vector
Definition: geom.h:483
vect_t rhc_H
height vector
Definition: geom.h:482
fastf_t rhc_c
dist from hyperbola to vertex of asymptotes
Definition: geom.h:485
fastf_t rhc_r
scalar half-width of rectangular face
Definition: geom.h:484
uint32_t rpc_magic
Definition: geom.h:465
vect_t rpc_B
breadth vector
Definition: geom.h:468
vect_t rpc_H
height vector
Definition: geom.h:467
fastf_t rpc_r
scalar half-width of rectangular face
Definition: geom.h:469
point_t rpc_V
rpc vertex
Definition: geom.h:466
struct bu_vls s_type
Definition: geom.h:1107
uint32_t script_magic
Definition: geom.h:1106
point2d_t * verts
Definition: geom.h:674
vect_t u_vec
Definition: geom.h:667
uint32_t magic
Definition: geom.h:665
point_t V
Definition: geom.h:666
size_t vert_count
Definition: geom.h:673
struct rt_curve curve
Definition: geom.h:678
vect_t v_vec
Definition: geom.h:670
uint32_t magic
Definition: geom.h:689
struct bu_vls file
.g filename, 0-len --> this database.
Definition: geom.h:690
int meth
space partitioning method
Definition: geom.h:692
struct bu_vls treetop
one treetop only
Definition: geom.h:691
const struct db_i * dbip
Definition: geom.h:696
uint32_t magic
Definition: geom.h:112
uint32_t magic
Definition: geom.h:80
vect_t a
Definition: geom.h:83
vect_t c
Definition: geom.h:85
vect_t h
Definition: geom.h:82
vect_t b
Definition: geom.h:84
vect_t d
Definition: geom.h:86
point_t v
Definition: geom.h:81
uint32_t magic
Definition: geom.h:61
vect_t a
r_a length
Definition: geom.h:67
fastf_t r_b
radius in B direction (typ == r_a)
Definition: geom.h:69
vect_t h
normal, unit length
Definition: geom.h:63
vect_t b
r_b length
Definition: geom.h:68
fastf_t r_a
radius in A direction (r1)
Definition: geom.h:65
point_t v
center point
Definition: geom.h:62
fastf_t r_h
radius in H direction (r2)
Definition: geom.h:64
uint32_t zdim
Z dimension.
Definition: geom.h:358
vect_t cellsize
ideal coords: size of each cell
Definition: geom.h:361
unsigned char * map
Definition: geom.h:368
uint32_t xdim
X dimension.
Definition: geom.h:356
uint32_t magic
Definition: geom.h:351
uint32_t ydim
Y dimension.
Definition: geom.h:357
char datasrc
which type of data source
Definition: geom.h:366
char name[RT_VOL_NAME_LEN]
Definition: geom.h:352
uint32_t hi
High threshold.
Definition: geom.h:360
mat_t mat
convert local coords to model space
Definition: geom.h:362
uint32_t lo
Low threshold.
Definition: geom.h:359
struct rt_db_internal * bip
Definition: geom.h:363
fastf_t * knots
pointer to knot vector
Definition: geom.h:639
int k_size
knot vector size
Definition: geom.h:638
Definition: geom.h:995
fastf_t txt_size
Definition: geom.h:1000
fastf_t txt_rot_angle
Definition: geom.h:1001
struct bu_vls label
Definition: geom.h:999
uint32_t magic
Definition: geom.h:996
int rel_pos
Definition: geom.h:998
int ref_pt
Definition: geom.h:997
point_t coord
Definition: geom.h:174
fastf_t sweat
beta value used for metaball and blob evaluation
Definition: geom.h:173
fastf_t fldstr
field strength
Definition: geom.h:172
point_t coord2
Definition: geom.h:175
struct bu_list l
Definition: geom.h:170
fastf_t pp_bendradius
bend radius to use for a bend at this point
Definition: geom.h:433
point_t pp_coord
"control" point for pipe solid
Definition: geom.h:430
fastf_t pp_id
inner diam, <=0 if solid (wire)
Definition: geom.h:431
struct bu_list l
doubly linked list support
Definition: geom.h:429
fastf_t pp_od
pipe outer diam
Definition: geom.h:432
fundamental vector, matrix, quaternion math macros