## "Fossies" - the Fresh Open Source Software Archive

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TeX and LaTeX source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 \chapter{CREATING NEW OBJECTS}
2
3 \section{Creating New Leaves (Solids/Primitives)}
4
5 A family of commands exists to allow the user to
6 add more actual solids (leaf nodes) to the model database.
7 To obtain a precise duplicate of an existing solid (presumably to be
8 changed by a subsequent editing command), the copy ({\em cp}) command
9 can be used.  It is important to note that the copy operation is
10 different from creating an {\em instance} of an existing solid;
11 there are occasions to use both operations.
12 If the precise configuration of the solid desired is not important, the
13 {\em make} command can be used to create a stock prototype solid of the
14 desired type with the given name, which can then be edited to suit.
15 The {\em mirror} command makes a
16 duplicate of an existing solid reflected about
17 one of the coordinate axes.
18
19 If the actual numeric parameters of a solid are known, then the {\em in}
20 command can be used.  In addition to prompting for the descriptions of
21 the full generic primitive solids, this command also accepts
22 abbreviated input formats.  For example, a wedge or an RPP can be entered
23 with a minimum of parameters, even though a database ARB8 is created.
24 Similarly, the parameters for a right circular cylinder can be given,
25 resulting in a truncated general cone (TGC) being stored.
26 This is not a very sophisticated way to build solids, but it receives
27 a surprising amount of use.
28
29 A number of commands also exist to create new solids with some
30 higher level description.  For example, the {\em inside} command
31 creates a new solid inside an existing solid, separated from the
32 existing solid by specified tolerances.  This is quite useful for
33 creating hollow objects such as fuel tanks.
34 It is possible to create a plate with a specified
35 azimuthal orientation and fallback angle, or to create an ARB8 (plate)
36 by specifying three points and a thickness, or to create an ARB8
37 given one point, an azimuthal orientation, and a fallback angle.
38
39 \section{Specific Cases}
40
41 After having started MGED and created a new database, the next
42 step is to use the {\em units} command to tell the system that you will
43 be entering values in mm, cm, m, in or ft.  For our example we will
44 work in mm:
45
46 \begin{verbatim}
47      units mm
48 \end{verbatim}
49
50 Now you may give your database a title using the {\em title} command as in:
51
52 \begin{verbatim}
53      title Mechanical Bracket
54 \end{verbatim}
55
56 This title (Mechanical Bracket'') now appears at bottom left hand
57 corner of graphics window.  Further examples:
58 \begin{verbatim}
59      title six wheeled tank
60      title stub axle
61 \end{verbatim}
62
63 At this point you can start creating your solid objects using the arbs'',
64 sph'', tor'', {\em etc.},
65 arguments to the {\em make} or {\em in} command.
66 The {\em make} command gives you a solid to a default size,
67 you then have to use the
68 solid edit mode to interactively edit the solid to the desired size.
69 {\em make} command is entered as below:
70 Examples:
71 \begin{verbatim}
72 make box arb8
73 make cyl rcc
74 make ball sph
75 \end{verbatim}
76 The first argument is the solid name, and the second argument is
77 the primitive type.
78
79 The {\em in} command expects you to key in a set of parameters to describe your
80 solid; the parameters can be the x y and z of a vertex (such as the
81 corner of an ARP8), or the x y and z of a vector (such as the height
82 or H vector of a BOX) or the radius (such as for a torus).
83 Below is a list of primitives
84 with their {\em in} commands as requested by MGED and sample input.
85 Reading an {\em in} file into a MGED data file will be discussed later.
86 Note how providing incomplete input to the {\em in} command will result
87 in MGED repeating the prompt for the missing information.
88
89 \begin{figure}
90 \centering \includegraphics{ex.rpp.ps}
91 \caption{Example RPP.}
92 \label{ex.rpp}
93 \end{figure}
94
95 \subsection{RPP (rectangular parallelepiped)}
96
97 {\tt
98 mged> {\em in name rpp}\\
99 Enter XMIN, XMAX, YMIN, YMAX, ZMIN, ZMAX: {\em 0 25} \\
100 Enter YMIN, YMAX, ZMIN, ZMAX: {\em 0 50} \\
101 Enter ZMIN, ZMAX: {\em 0 100} \\
102 }
103
104 This sequence produces the RPP shown in Figure \ref{ex.rpp}.
105
106 \begin{figure}
107 \centering \includegraphics{ex.box.ps}
108 \caption{Example BOX.}
109 \label{ex.box}
110 \end{figure}
111
112 \subsection{BOX (BOX)}
113
114 {\tt
115 mged> {\em in my box} \\
116 Enter X, Y, Z of vertex: {\em 0 0 0} \\
117 Enter X, Y, Z of vector H: {\em 25 0 0} \\
118 Enter X, Y, Z of vector W: {\em 0 50 0} \\
119 Enter X, Y, Z of vector D: {\em 0 0 100} \\
120 }
121 This sequence produces the BOX shown in Figure \ref{ex.box}.
122
123 \begin{figure}
124 \centering \includegraphics{ex.arb8.ps}
125 \caption{Example ARB8.}
126 \label{ex.arb8}
127 \end{figure}
128
129 \subsection{ARB8: Arbitrary Convex Polyhedron, 8 Vertices}
130
131 {\tt
132 mged> {\em in poly arb8} \\
133 Enter X, Y, Z for point 1: {\em 0 0 0} \\
134 Enter X, Y, Z for point 2: {\em 0 150 0} \\
135 Enter X, Y, Z for point 3: {\em 0 150 200} \\
136 Enter X, Y, Z for point 4: {\em 0 0 200} \\
137 Enter X, Y, Z for point 5: {\em 75 0 0} \\
138 Enter X, Y, Z for point 6: {\em 75 150 0} \\
139 Enter X, Y, Z for point 7: {\em 75 150 200} \\
140 Enter X, Y, Z for point 8: {\em 75 0 200} \\
141 }
142 This sequence produces the ARB8 shown in Figure \ref{ex.arb8}.
143 \begin{figure}
144 \centering \includegraphics{ex.arb4.ps}
145 \caption{Example ARB4.}
146 \label{ex.arb4}
147 \end{figure}
148
149 \subsection{ARB4: Arbitrary Convex Polyhedron, 4 vertices}
150
151 {\tt
152 mged> {\em in a4 arb4} \\
153 Enter X, Y, Z for point 1: {\em 0 0 0} \\
154 Enter X, Y, Z for point 2: {\em 10 60 0} \\
155 Enter X, Y, Z for point 3: {\em 40 20 0} \\
156 Enter X, Y, Z for point 4: {\em 20 15 70} \\
157 }
158 This sequence produces the ARB4 shown in Figure \ref{ex.arb4}.
159 \begin{figure}
160 \centering \includegraphics{ex.rcc.ps}
161 \caption{Example Right Circular Cylinder.}
162 \label{ex.rcc}
163 \end{figure}
164
165 \subsection{RCC (Right Circular Cylinder)}
166
167 {\tt
168 mged> {\em in rcyl rcc} \\
169 Enter X, Y, Z of vertex: {\em 0 0 0} \\
170 Enter X, Y, Z of height (H) vector: {\em 0 0 60} \\
171 Enter radius: {\em 15} \\
172 }
173 This sequence produces the RCC shown in Figure \ref{ex.rcc}.
174 Note that in this case, the A,B,C, and D vectors have magnitude
175 which equal the radius, 15.
176 \begin{figure}
177 \centering \includegraphics{ex.trc.ps}
178 \caption{Example Truncated Right Cylinder.}
179 \label{ex.trc}
180 \end{figure}
181
182 \subsection{TRC (Truncated Right Cylinder)}
183
184 {\tt
185 mged> {\em in trcyl trc} \\
186 Enter X, Y, Z of vertex: {\em 0 0 0} \\
187 Enter X, Y, Z of height (H) vector: {\em 40 0 0} \\
188 Enter radius of base: {\em 20} \\
189 Enter radius of top: {\em 10} \\
190 }
191 This sequence produces the TRC shown in Figure \ref{ex.trc}.
192 Note that the magnitude of A and B equal the base radius, 20,
193 \begin{figure}
194 \centering \includegraphics{ex.raw.ps}
195 \caption{Example Right Angle Wedge.}
196 \label{ex.raw}
197 \end{figure}
198
199 \subsection{RAW (Right Angle Wedge)}
200
201 {\tt
202 mged> {\em in weg raw} \\
203 Enter X, Y, Z of vertex: {\em 0 0 0} \\
204 Enter X, Y, Z of vector H: {\em 40 0 0} \\
205 Enter X, Y, Z of vector W: {\em 0 70 0} \\
206 Enter X, Y, Z of vector D: {\em 0 0 100} \\
207 }
208 This sequence produces the RAW shown in Figure \ref{ex.raw}.
209 \begin{figure}
210 \centering \includegraphics{ex.sph.ps}
211 \caption{Example Sphere.}
212 \label{ex.sph}
213 \end{figure}
214
215 \subsection{SPH (Sphere)}
216
217 {\tt
218 mged> {\em in ball sph} \\
219 Enter X, Y, Z of vertex: {\em 0 0 0} \\
220 Enter radius: {\em 50} \\
221 }
222 This sequence produces the sphere shown in Figure \ref{ex.sph}.
223 Note that the A, B, and C vectors all have magnitude equal to
225 \begin{figure}
226 \centering \includegraphics{ex.ellg.ps}
227 \caption{Example General Ellipsoid.}
228 \label{ex.ellg}
229 \end{figure}
230
231 \subsection{ELLG (General Ellipsoid)}
232
233 {\tt
234 mged> {\em in egg ellg} \\
235 Enter X, Y, Z of vertex: {\em 0 0 0} \\
236 Enter X, Y, Z of vector A: {\em 20 0 0} \\
237 Enter X, Y, Z of vector B: {\em 0 60 0} \\
238 Enter X, Y, Z of vector C: {\em 0 0 40} \\
239 }
240 This sequence produces the ellipsoid shown in Figure \ref{ex.ellg}.
241 \begin{figure}
242 \centering \includegraphics{ex.tor.ps}
243 \caption{Example Torus.}
244 \label{ex.tor}
245 \end{figure}
246
247 \subsection{TOR (Torus)}
248
249 {\tt
250 mged> {\em in tube tor} \\
251 Enter X, Y, Z of vertex: {\em 0 0 0} \\
252 Enter X, Y, Z of normal vector: {\em 0 0 50} \\
253 Enter radius 1: {\em 20} \\
254 Enter radius 2: {\em 10} \\
255 }
256 This sequence produces the torus shown in Figure \ref{ex.tor}.
257
258 \section{Creating New Combinations}
259
260 Non-terminal nodes in the directed acyclic graph stored in the database
261 are also called {\em combinations}.
262 It is possible to extend the definition of a non-terminal node by
263 adding an instance of an existing node to the non-terminal node
264 with an associated boolean
265 operation of union;  this is done by the {\em i}
266 (instance) command.  To start with, such an instance has an identity
267 matrix stored in the arc;  the user needs to separately edit the
268 arc to move the instance to some other location.
269 If the non-terminal node being extended does not exist, it is created first.
270
271 The instance command provides the simplest way to create a reference to
272 another node.  Instances of a whole list of nodes can be added to a
273 non-terminal node by way of the group {\em g} command.
274 If instances of a list of nodes with non-union boolean operations
275 is to be added to a non-terminal node, the region {\em r} command
276 accepts a list of (operation, name) pairs, where the single lower case
277 character u'' indicates union, --'' indicates subtraction, and
278 +'' indicates intersection.  The first operation specified
279 is not significant.  An example of this command might be:
280 \begin{center}
281 {\em r non-terminal u node1 -- node2 + node3}
282 \end{center}
283 For historical reasons,
284 there is no explicit grouping possible, occasionally forcing
285 the user to create intermediate non-terminal nodes to allow the
286 realization of the desired boolean formula.
287 It is also important to note that for the same reasons
288 there is an {\em implicit} grouping between union terms, i.e.
289 \begin{center}
290 u n1 -- n2 + n3 u n4 -- n5
291 \end{center}
292 is evaluated as
293 \begin{center}
294 (n1 -- n2 + n3) union (n4 -- n5)
295 \end{center}
296 rather than
297 \begin{center}
298 ((((n1 -- n2) + n3) union n4) -- n5)
299 \end{center}
300 Therefore, you can think of the solids
301 on either side of the union operators as surrounded by parentheses.
302 The order of the region members is
303 critical, and must be scrutinized when members are added or deleted from a
304 region.
305 The order can be printed out using the {\em l} or {\em cat} commands.