BRL-CAD
revolve.h
Go to the documentation of this file.
1 /* R E V O L V E . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2012-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file revolve.h
21  *
22  * Intersect a ray with an 'revolve' primitive object.
23  *
24  */
25 
26 #ifndef LIBRT_PRIMITIVES_REVOLVE_REVOLVE_H
27 #define LIBRT_PRIMITIVES_REVOLVE_REVOLVE_H
28 
29 #include "common.h"
30 
31 #include "bu/parse.h"
32 #include "bn.h"
33 
34 
35 /* ray tracing form of solid, including precomputed terms */
37  point_t v3d; /**< @brief vertex in 3d space */
38  vect_t zUnit; /**< @brief revolve axis in 3d space, y axis */
39  vect_t xUnit; /**< @brief vector in start plane, x axis */
40  vect_t yUnit;
41  vect_t rEnd;
42  fastf_t ang; /**< @brief angle to revolve */
43  char *sketch_name; /**< @brief name of sketch */
44  struct rt_sketch_internal *skt; /**< @brief pointer to sketch */
45  int *ends; /**< @brief indices of points at end of continuous path */
46  fastf_t bounds[4]; /**< @brief 2D sketch bounds */
47 };
48 
49 
50 const struct bu_structparse rt_revolve_parse[] = {
51  { "%f", 3, "V", bu_offsetofarray(struct rt_revolve_internal, v3d, fastf_t, X), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
52  { "%f", 3, "axis", bu_offsetofarray(struct rt_revolve_internal, axis3d, fastf_t, X), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
53  { "%f", 3, "R", bu_offsetofarray(struct rt_revolve_internal, r, fastf_t, X), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
54  { "%f", 1, "ang", bu_offsetof(struct rt_revolve_internal, ang), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
55  { "%V", 1, "sk_name", bu_offsetof(struct rt_revolve_internal, sketch_name), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
56  { {'\0', '\0', '\0', '\0'}, 0, (char *)NULL, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
57 };
58 
59 #endif /* LIBRT_PRIMITIVES_REVOLVE_REVOLVE_H */
60 
61 /*
62  * Local Variables:
63  * mode: C
64  * tab-width: 8
65  * indent-tabs-mode: t
66  * c-file-style: "stroustrup"
67  * End:
68  * ex: shiftwidth=4 tabstop=8
69  */
fastf_t bounds[4]
2D sketch bounds
Definition: revolve.h:46
Header file for the BRL-CAD common definitions.
struct rt_sketch_internal * skt
pointer to sketch
Definition: revolve.h:44
Definition: color.c:49
point_t v3d
vertex in 3d space
Definition: revolve.h:37
const struct bu_structparse rt_revolve_parse[]
Definition: revolve.h:50
vect_t rEnd
Definition: revolve.h:41
#define bu_offsetofarray(_t, _a, _d, _i)
Definition: parse.h:65
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
vect_t zUnit
revolve axis in 3d space, y axis
Definition: revolve.h:38
#define bu_offsetof(_t, _m)
Definition: parse.h:64
int * ends
indices of points at end of continuous path
Definition: revolve.h:45
char * sketch_name
name of sketch
Definition: revolve.h:43
vect_t yUnit
Definition: revolve.h:40
vect_t xUnit
vector in start plane, x axis
Definition: revolve.h:39
double fastf_t
Definition: defines.h:300
fastf_t ang
angle to revolve
Definition: revolve.h:42