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-2022 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 "../nmg.h" /* (temporarily?) needed for knot_vector */
48#include "brep.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
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;
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 * The internal form of the NMG is not rt_nmg_internal, but just a
311 * "struct model", from nmg.h. e.g.:
312 *
313 * if (intern.idb_type == ID_NMG)
314 * m = (struct model *)intern.idb_ptr;
315 */
316
317/** @addtogroup rt_ebm */
318/** @{ */
319/*
320 * ID_EBM
321 */
322#define RT_EBM_NAME_LEN 256
324 uint32_t magic;
326 /* NOTE: xdim/ydim cannot be size_t until rel8 as they are
327 * written out to disk via bu_vls_struct_print() as 32-bit ints.
328 */
329 uint32_t xdim; /**< @brief X dimension (w cells) */
330 uint32_t ydim; /**< @brief Y dimension (n cells) */
331 fastf_t tallness; /**< @brief Z dimension (mm) */
332 mat_t mat; /**< @brief convert local coords to model space */
333 unsigned char *buf; /**< @brief actual data */
334 struct bu_mapped_file *mp; /**< @brief mapped file for data */
335 struct rt_db_internal *bip; /**< @brief db object for data */
336#define RT_EBM_SRC_FILE 'f'
337#define RT_EBM_SRC_OBJ 'o'
338 char datasrc; /**< @brief which type of data source */
339};
340#define RT_EBM_CK_MAGIC(_p) BU_CKMAG(_p, RT_EBM_INTERNAL_MAGIC, "rt_ebm_internal")
341/** @} */
342
343/** @addtogroup rt_vol */
344/** @{ */
345/*
346 * ID_VOL
347 */
348#define RT_VOL_NAME_LEN 128
350 uint32_t magic;
352 /* NOTE: [xyz]dim/lo/hi cannot be size_t until rel8 as they are
353 * written out to disk via bu_vls_struct_print() as 32-bit ints.
354 */
355 uint32_t xdim; /**< @brief X dimension */
356 uint32_t ydim; /**< @brief Y dimension */
357 uint32_t zdim; /**< @brief Z dimension */
358 uint32_t lo; /**< @brief Low threshold */
359 uint32_t hi; /**< @brief High threshold */
360 vect_t cellsize; /**< @brief ideal coords: size of each cell */
361 mat_t mat; /**< @brief convert local coords to model space */
362 struct rt_db_internal *bip; /* @brief db object for data*/
363#define RT_VOL_SRC_FILE 'f'
364#define RT_VOL_SRC_OBJ 'o'
365 char datasrc;/**< @brief which type of data source */
366 /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
367 unsigned char *map;
368};
369#define RT_VOL_CK_MAGIC(_p) BU_CKMAG(_p, RT_VOL_INTERNAL_MAGIC, "rt_vol_internal")
370/** @} */
371
372/** @addtogroup rt_hf */
373/** @{ */
374/*
375 * ID_HF
376 */
378 uint32_t magic;
379 /* BEGIN USER SETTABLE VARIABLES */
380 char cfile[128]; /**< @brief name of control file (optional) */
381 char dfile[128]; /**< @brief name of data file */
382 char fmt[8]; /**< @brief CV style file format descriptor */
383 /* NOTE: w/n/shorts cannot be size_t until rel8 as they are
384 * written out to disk via bu_vls_struct_print() as 32-bit ints.
385 */
386 uint32_t w; /**< @brief # samples wide of data file. ("i", "x") */
387 uint32_t n; /**< @brief nlines of data file. ("j", "y") */
388 uint32_t shorts; /**< @brief !0 --> memory array is short, not float */
389 fastf_t file2mm; /**< @brief scale factor to cvt file units to mm */
390 vect_t v; /**< @brief origin of HT in model space */
391 vect_t x; /**< @brief model vect corresponding to "w" dir (will be unitized) */
392 vect_t y; /**< @brief model vect corresponding to "n" dir (will be unitized) */
393 fastf_t xlen; /**< @brief model len of HT rpp in "w" dir */
394 fastf_t ylen; /**< @brief model len of HT rpp in "n" dir */
395 fastf_t zscale; /**< @brief scale of data in ''up'' dir (after file2mm is applied) */
396 /* END USER SETTABLE VARIABLES, BEGIN INTERNAL STUFF */
397 struct bu_mapped_file *mp; /**< @brief actual data */
398};
399#define RT_HF_CK_MAGIC(_p) BU_CKMAG(_p, RT_HF_INTERNAL_MAGIC, "rt_hf_internal")
400/** @} */
401
402/** @addtogroup rt_arbn */
403/** @{ */
404/*
405 * ID_ARBN
406 */
408 uint32_t magic;
409 size_t neqn;
411};
412#define RT_ARBN_CK_MAGIC(_p) BU_CKMAG(_p, RT_ARBN_INTERNAL_MAGIC, "rt_arbn_internal")
413/** @} */
414
415/** @addtogroup rt_pipe */
416/** @{ */
417/*
418 * ID_PIPE
419 */
421 uint32_t pipe_magic;
423 /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
425};
426#define RT_PIPE_CK_MAGIC(_p) BU_CKMAG(_p, RT_PIPE_INTERNAL_MAGIC, "rt_pipe_internal")
428 struct bu_list l; /**< @brief doubly linked list support */
429 point_t pp_coord; /**< @brief "control" point for pipe solid */
430 fastf_t pp_id; /**< @brief inner diam, <=0 if solid (wire) */
431 fastf_t pp_od; /**< @brief pipe outer diam */
432 fastf_t pp_bendradius; /**< @brief bend radius to use for a bend at this point */
433};
434/** @} */
435
436
437/** @addtogroup rt_part */
438/** @{ */
439/*
440 * ID_PARTICLE
441 */
443 uint32_t part_magic;
448 /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
449 int part_type; /**< @brief sphere, cylinder, cone */
450};
451#define RT_PART_CK_MAGIC(_p) BU_CKMAG(_p, RT_PART_INTERNAL_MAGIC, "rt_part_internal")
452
453#define RT_PARTICLE_TYPE_SPHERE 1
454#define RT_PARTICLE_TYPE_CYLINDER 2
455#define RT_PARTICLE_TYPE_CONE 3
456/** @} */
457
458/** @addtogroup rt_rpc */
459/** @{ */
460/*
461 * ID_RPC
462 */
464 uint32_t rpc_magic;
465 point_t rpc_V; /**< @brief rpc vertex */
466 vect_t rpc_H; /**< @brief height vector */
467 vect_t rpc_B; /**< @brief breadth vector */
468 fastf_t rpc_r; /**< @brief scalar half-width of rectangular face */
469};
470#define RT_RPC_CK_MAGIC(_p) BU_CKMAG(_p, RT_RPC_INTERNAL_MAGIC, "rt_rpc_internal")
471/** @} */
472
473/** @addtogroup rt_rhc */
474/** @{ */
475/*
476 * ID_RHC
477 */
479 uint32_t rhc_magic;
480 point_t rhc_V; /**< @brief rhc vertex */
481 vect_t rhc_H; /**< @brief height vector */
482 vect_t rhc_B; /**< @brief breadth vector */
483 fastf_t rhc_r; /**< @brief scalar half-width of rectangular face */
484 fastf_t rhc_c; /**< @brief dist from hyperbola to vertex of asymptotes */
485};
486#define RT_RHC_CK_MAGIC(_p) BU_CKMAG(_p, RT_RHC_INTERNAL_MAGIC, "rt_rhc_internal")
487/** @} */
488
489/** @addtogroup rt_epa */
490/** @{ */
491/*
492 * ID_EPA
493 */
495 uint32_t epa_magic;
496 point_t epa_V; /**< @brief epa vertex */
497 vect_t epa_H; /**< @brief height vector */
498 vect_t epa_Au; /**< @brief unit vector along semi-major axis */
499 fastf_t epa_r1; /**< @brief scalar semi-major axis length */
500 fastf_t epa_r2; /**< @brief scalar semi-minor axis length */
501};
502#define RT_EPA_CK_MAGIC(_p) BU_CKMAG(_p, RT_EPA_INTERNAL_MAGIC, "rt_epa_internal")
503/** @} */
504
505/** @addtogroup rt_ehy */
506/** @{ */
507/*
508 * ID_EHY
509 */
511 uint32_t ehy_magic;
512 point_t ehy_V; /**< @brief ehy vertex */
513 vect_t ehy_H; /**< @brief height vector */
514 vect_t ehy_Au; /**< @brief unit vector along semi-major axis */
515 fastf_t ehy_r1; /**< @brief scalar semi-major axis length */
516 fastf_t ehy_r2; /**< @brief scalar semi-minor axis length */
517 fastf_t ehy_c; /**< @brief dist from hyperbola to vertex of asymptotes */
518};
519#define RT_EHY_CK_MAGIC(_p) BU_CKMAG(_p, RT_EHY_INTERNAL_MAGIC, "rt_ehy_internal")
520/** @} */
521
522/** @addtogroup rt_hyp */
523/** @{ */
524/*
525 * ID_HYP
526 */
528 uint32_t hyp_magic;
529 point_t hyp_Vi; /**< @brief hyp vertex */
530 vect_t hyp_Hi; /**< @brief full height vector */
531 vect_t hyp_A; /**< @brief semi-major axis */
532 fastf_t hyp_b; /**< @brief scalar semi-minor axis length */
533 fastf_t hyp_bnr;/**< @brief ratio of minimum neck width to base width */
534};
535#define RT_HYP_CK_MAGIC(_p) BU_CKMAG(_p, RT_HYP_INTERNAL_MAGIC, "rt_hyp_internal")
536/** @} */
537
538/** @addtogroup rt_eto */
539/** @{ */
540/*
541 * ID_ETO
542 */
544 uint32_t eto_magic;
545 point_t eto_V; /**< @brief eto vertex */
546 vect_t eto_N; /**< @brief vector normal to plane of torus */
547 vect_t eto_C; /**< @brief vector along semi-major axis of ellipse */
548 fastf_t eto_r; /**< @brief scalar radius of rotation */
549 fastf_t eto_rd; /**< @brief scalar length of semi-minor of ellipse */
550};
551#define RT_ETO_CK_MAGIC(_p) BU_CKMAG(_p, RT_ETO_INTERNAL_MAGIC, "rt_eto_internal")
552/** @} */
553
554/** @addtogroup rt_dsp */
555/** @{ */
556/*
557 * ID_DSP
558 */
559#define DSP_NAME_LEN 128
561 uint32_t magic;
562#define dsp_file dsp_name /**< @brief for backwards compatibility */
563 struct bu_vls dsp_name; /**< TODO: make this a pointer, name of data file */
564
565 /* NOTE: dsp_xcnt/dsp_ycnt cannot be size_t until rel8 as they are
566 * written out to disk via bu_vls_struct_print() as 32-bit ints.
567 */
568 uint32_t dsp_xcnt; /**< @brief # samples in row of data */
569 uint32_t dsp_ycnt; /**< @brief # of columns in data */
570 unsigned short dsp_smooth; /**< @brief bool: surf normal interp */
571#define DSP_CUT_DIR_ADAPT 'a'
572#define DSP_CUT_DIR_llUR 'l'
573#define DSP_CUT_DIR_ULlr 'L'
574 unsigned char dsp_cuttype; /**< @brief type of cut to make */
575
576 mat_t dsp_mtos; /**< @brief model to solid space */
577 /* END OF USER SETTABLE VARIABLES, BEGIN INTERNAL STUFF */
578 mat_t dsp_stom; /**< @brief solid to model space
579 * computed from dsp_mtos */
580 unsigned short *dsp_buf; /**< @brief actual data */
581 struct bu_mapped_file *dsp_mp; /**< @brief mapped file for data */
582 struct rt_db_internal *dsp_bip; /**< @brief db object for data */
583#define RT_DSP_SRC_V4_FILE '4'
584#define RT_DSP_SRC_FILE 'f'
585#define RT_DSP_SRC_OBJ 'o'
586 char dsp_datasrc; /**< @brief which type of data source */
587};
588#define RT_DSP_CK_MAGIC(_p) BU_CKMAG(_p, RT_DSP_INTERNAL_MAGIC, "rt_dsp_internal")
589/** @} */
590
591
592/** @addtogroup rt_sketch */
593/** @{ */
594/*
595 * ID_SKETCH
596 */
597
598/**
599 * container for a set of sketch segments
600 */
601struct rt_curve {
602 size_t count; /**< number of segments in this curve */
603 int *reverse; /**< array of boolean flags indicating if
604 * segment should be reversed
605 */
606 void **segment; /**< array of curve segment pointers */
607};
608
609
610/**
611 * used by the sketch, solid of extrusion and the annotation primitive
612 */
613struct line_seg /**< @brief line segment */
614{
615 uint32_t magic;
616 int start, end; /**< @brief indices into sketch's array of vertices */
617};
618
619
620struct carc_seg /**< @brief circular arc segment */
621{
622 uint32_t magic;
623 int start, end; /**< @brief indices */
624 fastf_t radius; /**< @brief radius < 0.0 -> full circle with start point on
625 * circle and "end" at center */
626 int center_is_left; /**< @brief flag indicating where center of curvature is.
627 * If non-zero, then center is to left of vector
628 * from start to end */
629 int orientation; /**< @brief 0 -> ccw, !0 -> cw */
630 int center; /**< @brief index of vertex at center of arc (only used by rt_extrude_prep and rt_extrude_shot) */
631};
632
633
634struct nurb_seg /**< @brief NURB curve segment */
635{
636 uint32_t magic;
637 int order; /**< @brief order of NURB curve (degree - 1) */
638 int pt_type; /**< @brief type of NURB curve */
639 struct knot_vector k; /**< @brief knot vector for NURB curve */
640 int c_size; /**< @brief number of control points */
641 int *ctl_points; /**< @brief array of indices for control points */
642 fastf_t *weights; /**< @brief array of weights for control points (NULL if non_rational) */
643};
644
645
646struct bezier_seg /**< @brief Bezier curve segment */
647{
648 uint32_t magic;
649 int degree; /**< @brief degree of curve (number of control points - 1) */
650 int *ctl_points; /**< @brief array of indices for control points */
651};
652
653
654#define SKETCH_NAME_LEN 16
656{
657 uint32_t magic;
658 point_t V; /**< default embedding of sketch */
659 vect_t u_vec; /**< unit vector 'u' component
660 * defining the sketch plane
661 */
662 vect_t v_vec; /**< unit vector 'v' component
663 * defining the sketch plane
664 */
665 size_t vert_count; /**< number of sketch vertices */
666 point2d_t *verts; /**< array of 2D vertices that may be
667 * used as endpoints, centers, or
668 * spline control points
669 */
670 struct rt_curve curve; /**< the curves of this sketch */
671};
672#define RT_SKETCH_CK_MAGIC(_p) BU_CKMAG(_p, RT_SKETCH_INTERNAL_MAGIC, "rt_sketch_internal")
673/** @} */
674
675/** @addtogroup rt_submodel */
676/** @{ */
677/*
678 * ID_SUBMODEL
679 */
681 uint32_t magic;
682 struct bu_vls file; /**< @brief .g filename, 0-len --> this database. */
683 struct bu_vls treetop; /**< @brief one treetop only */
684 int meth; /**< @brief space partitioning method */
685 /* other option flags (lazy prep, etc.)?? */
686 /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
688 const struct db_i *dbip;
689};
690#define RT_SUBMODEL_CK_MAGIC(_p) BU_CKMAG(_p, RT_SUBMODEL_INTERNAL_MAGIC, "rt_submodel_internal")
691/** @} */
692
693/** @addtogroup rt_extrude */
694/** @{ */
695/*
696 * ID_EXTRUDE
697 */
698
700{
701 uint32_t magic;
702 point_t V; /**< @brief vertex, start and end point of loop to be extruded */
703 vect_t h; /**< @brief extrusion vector, may not be in (u_vec X v_vec) plane */
704 vect_t u_vec; /**< @brief vector in U parameter direction */
705 vect_t v_vec; /**< @brief vector in V parameter direction */
706 int keypoint; /**< @brief DEPRECATED (UNUSED): index of keypoint vertex */
707 char *sketch_name; /**< @brief name of sketch object that defines the curve to be extruded */
708 struct rt_sketch_internal *skt; /**< @brief pointer to referenced sketch */
709};
710
711
712/**
713 * Note that the u_vec and v_vec are not unit vectors, their magnitude
714 * and direction are used for scaling and rotation.
715 */
716#define RT_EXTRUDE_CK_MAGIC(_p) BU_CKMAG(_p, RT_EXTRUDE_INTERNAL_MAGIC, "rt_extrude_internal")
717/** @} */
718
719/** @addtogroup rt_revolve */
720/** @{ */
721/*
722 * ID_REVOLVE
723 */
725 uint32_t magic;
726 point_t v3d; /**< @brief vertex in 3d space */
727 vect_t axis3d; /**< @brief revolve axis in 3d space, y axis */
728
729 point2d_t v2d; /**< @brief vertex in 2d sketch */
730 vect2d_t axis2d; /**< @brief revolve axis in 2d sketch */
731
732 vect_t r; /**< @brief vector in start plane, x axis */
733 fastf_t ang; /**< @brief angle to revolve*/
734 struct bu_vls sketch_name; /**< @brief name of sketch */
735 struct rt_sketch_internal *skt; /**< @brief pointer to sketch */
736};
737#define RT_REVOLVE_CK_MAGIC(_p) BU_CKMAG(_p, RT_REVOLVE_INTERNAL_MAGIC, "rt_revolve_internal")
738/** @} */
739
740/** @addtogroup rt_cline */
741/** @{ */
742/*
743 * ID_CLINE
744 *
745 * Implementation of FASTGEN CLINE element
746 */
747
749{
750 uint32_t magic;
754 fastf_t thickness; /**< @brief zero thickness means volume mode */
755};
756#define RT_CLINE_CK_MAGIC(_p) BU_CKMAG(_p, RT_CLINE_INTERNAL_MAGIC, "rt_cline_internal")
757/** @} */
758
759/** @addtogroup rt_bot */
760/** @{ */
761/*
762 * ID_BOT
763 */
764
766{
767 uint32_t magic;
768 unsigned char mode;
769 unsigned char orientation;
770 unsigned char bot_flags; /**< @brief flags, (indicates surface
771 * normals available, for example)
772 */
773
774 size_t num_faces;
775 int *faces; /**< @brief array of ints for faces
776 * [num_faces*3]
777 */
778
780 fastf_t *vertices; /**< @brief array of floats for
781 * vertices [num_vertices*3]
782 */
783
784 fastf_t *thickness; /**< @brief array of plate mode
785 * thicknesses (corresponds to array
786 * of faces) NULL for modes
787 * RT_BOT_SURFACE and RT_BOT_SOLID.
788 */
789 struct bu_bitv *face_mode; /**< @brief a flag for each face
790 * indicating thickness is appended to
791 * hit point in ray direction (if bit
792 * is set), otherwise thickness is
793 * centered about hit point (NULL for
794 * modes RT_BOT_SURFACE and
795 * RT_BOT_SOLID).
796 */
797
799 fastf_t *normals; /**< @brief array of unit surface
800 * normals [num_normals*3]
801 */
802
803 size_t num_face_normals; /**< @brief current size of the
804 * face_normals array below (number of
805 * faces in the array)
806 */
807 int *face_normals; /**< @brief array of indices into the
808 * "normals" array, one per face
809 * vertex [num_face_normals*3]
810 */
811
812 size_t num_uvs; /**< @brief current size of the vertex
813 * uv mappings (corresponds to number
814 * of vertices)
815 */
816 fastf_t *uvs; /**< @brief array of floats for uv
817 * texturing coordinates [num_uvs*3]
818 */
819
820 size_t num_face_uvs; /**< @brief current size of the
821 * face_uvs array below (number of
822 * faces in the array)
823 */
824 int *face_uvs; /**< @brief array of indices into the
825 * "uvs" array, one per face vertex
826 * [num_uvs*3] */
827
828 void *tie; /* FIXME: blind casting. TIE needs to move from TIE_FUNC to XGLUE before this can not suck. */
829};
830
831
833 struct bu_list l;
835};
836
837
838/* orientations for BOT */
839#define RT_BOT_UNORIENTED 1 /**< @brief unoriented triangles */
840#define RT_BOT_CCW 2 /**< @brief oriented counter-clockwise */
841#define RT_BOT_CW 3 /**< @brief oriented clockwise */
842
843/* modes for BOT */
844#define RT_BOT_SURFACE 1 /**< @brief triangles represent a surface (no volume) */
845#define RT_BOT_SOLID 2 /**< @brief triangles represent the boundary of a solid object */
846
847/**
848 * triangles represent plates. Thicknesses are specified in
849 * "thickness" array, and face mode is specified in "face_mode" bit
850 * vector. This is the FASTGEN "plate" mode. Orientation is ignored.
851 */
852#define RT_BOT_PLATE 3
853
854/**
855 * same as plate mode, but LOS is set equal to face thickness, not the
856 * thickness divided by the cosine of the obliquity angle.
857 */
858#define RT_BOT_PLATE_NOCOS 4
859
860/* flags for bot_flags */
861#define RT_BOT_HAS_SURFACE_NORMALS 0x01 /**< @brief Has surface normals at each face vertex */
862#define RT_BOT_USE_NORMALS 0x02 /**< @brief Use the surface normals if they exist */
863#define RT_BOT_USE_FLOATS 0x04 /**< @brief Use the single precision version of "tri_specific" during prep */
864#define RT_BOT_HAS_TEXTURE_UVS 0x08 /**< @brief Has uv texture coordinates at each face vertex */
865#define RT_BOT_HAS_UNUSED1 0x10 /**< @brief TBD */
866#define RT_BOT_HAS_UNUSED2 0x20 /**< @brief TBD */
867#define RT_BOT_HAS_UNUSED3 0x40 /**< @brief TBD */
868#define RT_BOT_HAS_UNUSED4 0x80 /**< @brief WARNING: use this flag to denote more bits in the export serialization */
869
870#define RT_BOT_CK_MAGIC(_p) BU_CKMAG(_p, RT_BOT_INTERNAL_MAGIC, "rt_bot_internal")
871/** @} */
872
873
874/** @addtogroup rt_pnt */
875/** @{ */
876/**
877 * ID_PNTS
878 *
879 * Points are represented to a structure that contains exactly the
880 * data that it needs for that 'type' of point. The reason this was
881 * done over using something like a union was to fully optimize memory
882 * usage so that the maximum number of points could be stored without
883 * resorting to out-of-core techniques. A union is at least the size
884 * of the largest type and would have wasted memory.
885 *
886 * By using this data-driven approach of type identification, it does
887 * result in needing to have a switching table for all supported types
888 * in order to access data. This could be avoided by storing them as
889 * multiple lists (wasting a few bytes for unused pointers) but is
890 * left as an exercise to the reader.
891 */
892
893typedef enum {
904
905struct pnt {
906 struct bu_list l;
908};
909struct pnt_color {
910 struct bu_list l;
912 struct bu_color c;
913};
914struct pnt_scale {
915 struct bu_list l;
918};
920 struct bu_list l;
923};
925 struct bu_list l;
927 struct bu_color c;
929};
931 struct bu_list l;
933 struct bu_color c;
935};
937 struct bu_list l;
941};
943 struct bu_list l;
945 struct bu_color c;
948};
949
950
952 uint32_t magic;
953 double scale;
955 unsigned long count;
956 void *point;
957};
958#define RT_PNTS_CK_MAGIC(_p) BU_CKMAG(_p, RT_PNTS_INTERNAL_MAGIC, "rt_pnts_internal")
959/** @} */
960
961/** @addtogroup rt_annotation */
962/** @{ */
963/*
964 * ID_ANNO
965 *
966 * Annotations are used to provide labels in-scene when viewing
967 * geometry. Leaders connect labels to geometry objects or fixed
968 * points in space.
969 *
970 */
971
972/**
973 * container for the annotation primitive
974 */
975struct rt_ant {
976 size_t count; /**< @brief number of segments in the annotation */
977 int *reverse; /**< array of boolean flags indicating if the
978 * segment should be reversed */
979 void **segments; /**< @brief array of annotation segment pointer */
980};
981
982/**
983 * text labels used by the annotation primitive
984 */
985struct txt_seg {
986 uint32_t magic;
987 int ref_pt; /** reference point */
988 int rel_pos; /** flag describing position relative to ref_pt */
989 struct bu_vls label;
990 fastf_t txt_size; /** text size */
991 fastf_t txt_rot_angle; /** text rotation angle */
992};
993
994/**
995 * placement flags
996 */
997#define RT_TXT_POS_BL 1
998#define RT_TXT_POS_BC 2
999#define RT_TXT_POS_BR 3
1000#define RT_TXT_POS_ML 4
1001#define RT_TXT_POS_MC 5
1002#define RT_TXT_POS_MR 6
1003#define RT_TXT_POS_TL 7
1004#define RT_TXT_POS_TC 8
1005#define RT_TXT_POS_TR 9
1006
1007/**
1008 * set a position flag to the corresponding placement value given
1009 * numeric settings (1=left/top, 2=middle/center, 3=right/bottom).
1010 */
1011RT_EXPORT int rt_txt_pos_flag(int *pos_flag, int horizontal, int vertical);
1012
1013/**
1014 * internal representation of an annotation object
1015 */
1017{
1018 uint32_t magic;
1019 point_t V; /**< @brief vertex, maps to the origin in the 2D system */
1020 size_t vert_count; /**< @brief number of vertices */
1021 point2d_t *verts; /**< @brief array of vertices that serve as control points */
1022 struct rt_ant ant; /**< @brief segments in the annotation */
1023};
1024
1025
1026
1027#define RT_ANNOT_CK_MAGIC(_p) BU_CKMAG(_p, RT_ANNOT_INTERNAL_MAGIC, "rt_annot_internal")
1028/** @} */
1029
1030/*
1031 * ID_DATUM
1032 *
1033 * Datums provide basic geometric reference entities such as reference
1034 * frames, planes, lines, and/or points. A datum reference frame is
1035 * generally a Cartesian coordinate system that consists of three
1036 * mutually perpendicular axes, three mutually perpendicular base
1037 * planes, and a point representing the origin.
1038 *
1039 * Planes distinguished by (!ZERO(w)) utilize 'pnt', 'dir', and 'w' to
1040 * define an unoriented plane. The plane is defined by the vector
1041 * from 'pnt' in 'dir' direction multiplied by the 'w' scalar value.
1042 *
1043 * Lines distinguished by (MAGNITUDE(dir) > 0.0 && ZERO(w)) utilize
1044 * 'pnt' and 'dir' to define a line.
1045 *
1046 * Points only use the 'pnt' field to define an unoriented point.
1047 *
1048 * Datum references are stored as a simple NULL-terminated linked list
1049 * manually accessed through the 'next' pointer.
1050 *
1051 * This characterization is derived from ASME Y14.5M
1052 *
1053 * TODO:
1054 * - edsol needs to do more than move the first datum
1055 * - tedit is untested
1056 * - wdb needs to support more than one datum
1057 * - validate the datum during prep
1058 * - add CK validation checks to all loops
1059 */
1061{
1062 uint32_t magic;
1063
1067
1069};
1070
1071/**
1072 * validation macro to make sure an rt_datum_internal has the proper magic identifier.
1073 */
1074#define RT_DATUM_CK_MAGIC(_p) BU_CKMAG(_p, RT_DATUM_INTERNAL_MAGIC, "rt_datum_internal")
1075
1076
1077/** @addtogroup rt_hrt */
1078/** @{ */
1080{
1081 uint32_t hrt_magic;
1082 point_t v; /**< @brief center point */
1083 vect_t xdir; /**< @brief unit vector in x direction */
1084 vect_t ydir; /**< @brief unit vector in y direction */
1085 vect_t zdir; /**< @brief unit vector in z direction */
1086 fastf_t d; /**< @brief distance to cusps */
1087};
1088#define RT_HRT_CK_MAGIC(_p) BU_CKMAG(_p, RT_HRT_INTERNAL_MAGIC, "rt_hrt_internal")
1089
1090
1091/** @addtogroup rt_script */
1092/** @{ */
1096};
1097#define RT_SCRIPT_CK_MAGIC(_p) BU_CKMAG(_p, RT_SCRIPT_INTERNAL_MAGIC, "rt_script_internal")
1098/** @} */
1099
1100
1101
1102__END_DECLS
1103
1104#endif /* RT_GEOM_H */
1105
1106/** @} */
1107/*
1108 * Local Variables:
1109 * mode: C
1110 * tab-width: 8
1111 * indent-tabs-mode: t
1112 * c-file-style: "stroustrup"
1113 * End:
1114 * ex: shiftwidth=4 tabstop=8
1115 */
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:322
rt_pnt_type
Definition: geom.h:893
@ RT_PNT_TYPE_NRM
Definition: geom.h:897
@ RT_PNT_TYPE_PNT
Definition: geom.h:894
@ RT_PNT_TYPE_SCA_NRM
Definition: geom.h:900
@ RT_PNT_TYPE_COL
Definition: geom.h:895
@ RT_PNT_TYPE_COL_SCA_NRM
Definition: geom.h:901
@ RT_PNT_TYPE_COL_NRM
Definition: geom.h:899
@ RT_PNT_TYPE_COL_SCA
Definition: geom.h:898
@ RT_PNT_UNKNOWN
Definition: geom.h:902
@ RT_PNT_TYPE_SCA
Definition: geom.h:896
#define RT_VOL_NAME_LEN
Definition: geom.h:348
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 mat_t[ELEMENTS_PER_MAT]
4x4 matrix
Definition: vmath.h:366
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
fastf_t vect2d_t[ELEMENTS_PER_VECT2D]
2-tuple vector
Definition: vmath.h:333
Bezier curve segment.
Definition: geom.h:647
int * ctl_points
array of indices for control points
Definition: geom.h:650
int degree
degree of curve (number of control points - 1)
Definition: geom.h:649
uint32_t magic
Definition: geom.h:648
Definition: bitv.h:108
Definition: color.h:54
Definition: list.h:131
Definition: vls.h:53
circular arc segment
Definition: geom.h:621
fastf_t radius
radius < 0.0 -> full circle with start point on circle and "end" at center
Definition: geom.h:624
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:626
int start
Definition: geom.h:623
int orientation
0 -> ccw, !0 -> cw
Definition: geom.h:629
uint32_t magic
Definition: geom.h:622
int center
index of vertex at center of arc (only used by rt_extrude_prep and rt_extrude_shot)
Definition: geom.h:630
int end
indices
Definition: geom.h:623
Face NURBS surface geometry.
Definition: topology.h:392
Definition of a knot vector.
Definition: topology.h:355
line segment
Definition: geom.h:614
int start
Definition: geom.h:616
uint32_t magic
Definition: geom.h:615
int end
indices into sketch's array of vertices
Definition: geom.h:616
NURB curve segment.
Definition: geom.h:635
int * ctl_points
array of indices for control points
Definition: geom.h:641
uint32_t magic
Definition: geom.h:636
struct knot_vector k
knot vector for NURB curve
Definition: geom.h:639
int c_size
number of control points
Definition: geom.h:640
int order
order of NURB curve (degree - 1)
Definition: geom.h:637
int pt_type
type of NURB curve
Definition: geom.h:638
fastf_t * weights
array of weights for control points (NULL if non_rational)
Definition: geom.h:642
struct bu_list l
Definition: geom.h:931
point_t v
Definition: geom.h:932
vect_t n
Definition: geom.h:934
struct bu_color c
Definition: geom.h:933
struct bu_list l
Definition: geom.h:943
struct bu_color c
Definition: geom.h:945
struct bu_list l
Definition: geom.h:925
point_t v
Definition: geom.h:926
struct bu_color c
Definition: geom.h:927
fastf_t s
Definition: geom.h:928
struct bu_list l
Definition: geom.h:910
point_t v
Definition: geom.h:911
struct bu_color c
Definition: geom.h:912
struct bu_list l
Definition: geom.h:920
point_t v
Definition: geom.h:921
vect_t n
Definition: geom.h:922
struct bu_list l
Definition: geom.h:937
point_t v
Definition: geom.h:938
vect_t n
Definition: geom.h:940
fastf_t s
Definition: geom.h:939
struct bu_list l
Definition: geom.h:915
point_t v
Definition: geom.h:916
fastf_t s
Definition: geom.h:917
Definition: geom.h:905
struct bu_list l
Definition: geom.h:906
point_t v
Definition: geom.h:907
point2d_t * verts
array of vertices that serve as control points
Definition: geom.h:1021
uint32_t magic
Definition: geom.h:1018
point_t V
vertex, maps to the origin in the 2D system
Definition: geom.h:1019
size_t vert_count
number of vertices
Definition: geom.h:1020
struct rt_ant ant
segments in the annotation
Definition: geom.h:1022
Definition: geom.h:975
size_t count
number of segments in the annotation
Definition: geom.h:976
void ** segments
array of annotation segment pointer
Definition: geom.h:979
int * reverse
Definition: geom.h:977
point_t pt[8]
Definition: geom.h:193
uint32_t magic
Definition: geom.h:192
plane_t * eqn
Definition: geom.h:410
uint32_t magic
Definition: geom.h:408
size_t neqn
Definition: geom.h:409
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:770
fastf_t * normals
array of unit surface normals [num_normals*3]
Definition: geom.h:799
void * tie
Definition: geom.h:828
size_t num_normals
Definition: geom.h:798
size_t num_face_normals
current size of the face_normals array below (number of faces in the array)
Definition: geom.h:803
uint32_t magic
Definition: geom.h:767
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:789
int * face_normals
array of indices into the "normals" array, one per face vertex [num_face_normals*3]
Definition: geom.h:807
fastf_t * uvs
array of floats for uv texturing coordinates [num_uvs*3]
Definition: geom.h:816
unsigned char mode
Definition: geom.h:768
unsigned char orientation
Definition: geom.h:769
int * faces
array of ints for faces [num_faces*3]
Definition: geom.h:775
size_t num_face_uvs
current size of the face_uvs array below (number of faces in the array)
Definition: geom.h:820
size_t num_faces
Definition: geom.h:774
fastf_t * thickness
array of plate mode thicknesses (corresponds to array of faces) NULL for modes RT_BOT_SURFACE and RT_...
Definition: geom.h:784
size_t num_uvs
current size of the vertex uv mappings (corresponds to number of vertices)
Definition: geom.h:812
int * face_uvs
array of indices into the "uvs" array, one per face vertex [num_uvs*3]
Definition: geom.h:824
fastf_t * vertices
array of floats for vertices [num_vertices*3]
Definition: geom.h:780
size_t num_vertices
Definition: geom.h:779
struct bu_list l
Definition: geom.h:833
struct rt_bot_internal * bot
Definition: geom.h:834
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:753
uint32_t magic
Definition: geom.h:750
vect_t h
Definition: geom.h:752
fastf_t thickness
zero thickness means volume mode
Definition: geom.h:754
point_t v
Definition: geom.h:751
Definition: geom.h:601
size_t count
Definition: geom.h:602
int * reverse
Definition: geom.h:603
void ** segment
Definition: geom.h:606
uint32_t magic
Definition: geom.h:1062
struct rt_datum_internal * next
Definition: geom.h:1068
point_t pnt
Definition: geom.h:1064
vect_t dir
Definition: geom.h:1065
fastf_t w
Definition: geom.h:1066
unsigned short * dsp_buf
actual data
Definition: geom.h:580
struct rt_db_internal * dsp_bip
db object for data
Definition: geom.h:582
char dsp_datasrc
which type of data source
Definition: geom.h:586
uint32_t magic
Definition: geom.h:561
struct bu_vls dsp_name
Definition: geom.h:563
unsigned char dsp_cuttype
type of cut to make
Definition: geom.h:574
mat_t dsp_stom
solid to model space computed from dsp_mtos
Definition: geom.h:578
uint32_t dsp_xcnt
# samples in row of data
Definition: geom.h:568
mat_t dsp_mtos
model to solid space
Definition: geom.h:576
unsigned short dsp_smooth
bool: surf normal interp
Definition: geom.h:570
uint32_t dsp_ycnt
# of columns in data
Definition: geom.h:569
struct bu_mapped_file * dsp_mp
mapped file for data
Definition: geom.h:581
char name[RT_EBM_NAME_LEN]
Definition: geom.h:325
struct bu_mapped_file * mp
mapped file for data
Definition: geom.h:334
uint32_t xdim
X dimension (w cells)
Definition: geom.h:329
uint32_t magic
Definition: geom.h:324
uint32_t ydim
Y dimension (n cells)
Definition: geom.h:330
char datasrc
which type of data source
Definition: geom.h:338
fastf_t tallness
Z dimension (mm)
Definition: geom.h:331
mat_t mat
convert local coords to model space
Definition: geom.h:332
unsigned char * buf
actual data
Definition: geom.h:333
struct rt_db_internal * bip
db object for data
Definition: geom.h:335
vect_t ehy_Au
unit vector along semi-major axis
Definition: geom.h:514
fastf_t ehy_r1
scalar semi-major axis length
Definition: geom.h:515
fastf_t ehy_r2
scalar semi-minor axis length
Definition: geom.h:516
vect_t ehy_H
height vector
Definition: geom.h:513
point_t ehy_V
ehy vertex
Definition: geom.h:512
fastf_t ehy_c
dist from hyperbola to vertex of asymptotes
Definition: geom.h:517
uint32_t ehy_magic
Definition: geom.h:511
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:498
uint32_t epa_magic
Definition: geom.h:495
fastf_t epa_r2
scalar semi-minor axis length
Definition: geom.h:500
vect_t epa_H
height vector
Definition: geom.h:497
point_t epa_V
epa vertex
Definition: geom.h:496
fastf_t epa_r1
scalar semi-major axis length
Definition: geom.h:499
vect_t eto_N
vector normal to plane of torus
Definition: geom.h:546
uint32_t eto_magic
Definition: geom.h:544
fastf_t eto_rd
scalar length of semi-minor of ellipse
Definition: geom.h:549
point_t eto_V
eto vertex
Definition: geom.h:545
vect_t eto_C
vector along semi-major axis of ellipse
Definition: geom.h:547
fastf_t eto_r
scalar radius of rotation
Definition: geom.h:548
vect_t u_vec
vector in U parameter direction
Definition: geom.h:704
struct rt_sketch_internal * skt
pointer to referenced sketch
Definition: geom.h:708
uint32_t magic
Definition: geom.h:701
char * sketch_name
name of sketch object that defines the curve to be extruded
Definition: geom.h:707
vect_t h
extrusion vector, may not be in (u_vec X v_vec) plane
Definition: geom.h:703
point_t V
vertex, start and end point of loop to be extruded
Definition: geom.h:702
int keypoint
DEPRECATED (UNUSED): index of keypoint vertex.
Definition: geom.h:706
vect_t v_vec
vector in V parameter direction
Definition: geom.h:705
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:394
char cfile[128]
name of control file (optional)
Definition: geom.h:380
char dfile[128]
name of data file
Definition: geom.h:381
fastf_t xlen
model len of HT rpp in "w" dir
Definition: geom.h:393
uint32_t n
nlines of data file. ("j", "y")
Definition: geom.h:387
struct bu_mapped_file * mp
actual data
Definition: geom.h:397
uint32_t magic
Definition: geom.h:378
char fmt[8]
CV style file format descriptor.
Definition: geom.h:382
vect_t v
origin of HT in model space
Definition: geom.h:390
fastf_t file2mm
scale factor to cvt file units to mm
Definition: geom.h:389
uint32_t w
# samples wide of data file. ("i", "x")
Definition: geom.h:386
fastf_t zscale
scale of data in ''up'' dir (after file2mm is applied)
Definition: geom.h:395
vect_t x
model vect corresponding to "w" dir (will be unitized)
Definition: geom.h:391
uint32_t shorts
!0 --> memory array is short, not float
Definition: geom.h:388
vect_t y
model vect corresponding to "n" dir (will be unitized)
Definition: geom.h:392
vect_t ydir
unit vector in y direction
Definition: geom.h:1084
fastf_t d
distance to cusps
Definition: geom.h:1086
uint32_t hrt_magic
Definition: geom.h:1081
vect_t xdir
unit vector in x direction
Definition: geom.h:1083
point_t v
center point
Definition: geom.h:1082
vect_t zdir
unit vector in z direction
Definition: geom.h:1085
point_t hyp_Vi
hyp vertex
Definition: geom.h:529
fastf_t hyp_bnr
ratio of minimum neck width to base width
Definition: geom.h:533
vect_t hyp_A
semi-major axis
Definition: geom.h:531
uint32_t hyp_magic
Definition: geom.h:528
vect_t hyp_Hi
full height vector
Definition: geom.h:530
fastf_t hyp_b
scalar semi-minor axis length
Definition: geom.h:532
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:446
point_t part_V
Definition: geom.h:444
int part_type
sphere, cylinder, cone
Definition: geom.h:449
vect_t part_H
Definition: geom.h:445
uint32_t part_magic
Definition: geom.h:443
fastf_t part_hrad
Definition: geom.h:447
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:422
uint32_t pipe_magic
Definition: geom.h:421
int pipe_count
Definition: geom.h:424
void * point
Definition: geom.h:956
uint32_t magic
Definition: geom.h:952
unsigned long count
Definition: geom.h:955
double scale
Definition: geom.h:953
rt_pnt_type type
Definition: geom.h:954
point2d_t v2d
vertex in 2d sketch
Definition: geom.h:729
struct bu_vls sketch_name
name of sketch
Definition: geom.h:734
struct rt_sketch_internal * skt
pointer to sketch
Definition: geom.h:735
fastf_t ang
angle to revolve
Definition: geom.h:733
uint32_t magic
Definition: geom.h:725
vect_t r
vector in start plane, x axis
Definition: geom.h:732
vect2d_t axis2d
revolve axis in 2d sketch
Definition: geom.h:730
vect_t axis3d
revolve axis in 3d space, y axis
Definition: geom.h:727
point_t v3d
vertex in 3d space
Definition: geom.h:726
point_t rhc_V
rhc vertex
Definition: geom.h:480
uint32_t rhc_magic
Definition: geom.h:479
vect_t rhc_B
breadth vector
Definition: geom.h:482
vect_t rhc_H
height vector
Definition: geom.h:481
fastf_t rhc_c
dist from hyperbola to vertex of asymptotes
Definition: geom.h:484
fastf_t rhc_r
scalar half-width of rectangular face
Definition: geom.h:483
uint32_t rpc_magic
Definition: geom.h:464
vect_t rpc_B
breadth vector
Definition: geom.h:467
vect_t rpc_H
height vector
Definition: geom.h:466
fastf_t rpc_r
scalar half-width of rectangular face
Definition: geom.h:468
point_t rpc_V
rpc vertex
Definition: geom.h:465
struct bu_vls s_type
Definition: geom.h:1095
uint32_t script_magic
Definition: geom.h:1094
point2d_t * verts
Definition: geom.h:666
vect_t u_vec
Definition: geom.h:659
uint32_t magic
Definition: geom.h:657
point_t V
Definition: geom.h:658
size_t vert_count
Definition: geom.h:665
struct rt_curve curve
Definition: geom.h:670
vect_t v_vec
Definition: geom.h:662
uint32_t magic
Definition: geom.h:681
struct bu_vls file
.g filename, 0-len --> this database.
Definition: geom.h:682
int meth
space partitioning method
Definition: geom.h:684
struct bu_vls treetop
one treetop only
Definition: geom.h:683
const struct db_i * dbip
Definition: geom.h:688
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:357
vect_t cellsize
ideal coords: size of each cell
Definition: geom.h:360
unsigned char * map
Definition: geom.h:367
uint32_t xdim
X dimension.
Definition: geom.h:355
uint32_t magic
Definition: geom.h:350
uint32_t ydim
Y dimension.
Definition: geom.h:356
char datasrc
which type of data source
Definition: geom.h:365
char name[RT_VOL_NAME_LEN]
Definition: geom.h:351
uint32_t hi
High threshold.
Definition: geom.h:359
mat_t mat
convert local coords to model space
Definition: geom.h:361
uint32_t lo
Low threshold.
Definition: geom.h:358
struct rt_db_internal * bip
Definition: geom.h:362
Definition: geom.h:985
fastf_t txt_size
Definition: geom.h:990
fastf_t txt_rot_angle
Definition: geom.h:991
struct bu_vls label
Definition: geom.h:989
uint32_t magic
Definition: geom.h:986
int rel_pos
Definition: geom.h:988
int ref_pt
Definition: geom.h:987
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:432
point_t pp_coord
"control" point for pipe solid
Definition: geom.h:429
fastf_t pp_id
inner diam, <=0 if solid (wire)
Definition: geom.h:430
struct bu_list l
doubly linked list support
Definition: geom.h:428
fastf_t pp_od
pipe outer diam
Definition: geom.h:431
fundamental vector, matrix, quaternion math macros