"Fossies" - the Fresh Open Source Software Archive

Member "brlcad-7.32.4/doc/mged/h.tex" (29 Jul 2021, 14366 Bytes) of package /linux/misc/brlcad-7.32.4.tar.bz2:


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{TUTORIALS ON OBJECT EDITING}
    2 
    3 \section{Object Editing a Six-Sided Polyhedron}
    4 
    5 This tutorial illustrates the application of the {\bf OBJ EDIT} state to
    6 the ``arb8'' primitive.  The editing of the arb8 illustrates the
    7 absolute movement of the points.
    8 
    9 \begin{figure}
   10 \centering \includegraphics{eo-start.ps}
   11 \caption{``arb8'' Object Edit; Top View.}
   12 \label{eo-start}
   13 \end{figure}
   14 
   15 \noindent
   16 {\tt
   17 mged> {\em e arb8}\\
   18 vectorized in 0 seconds\\
   19 mged> {\em size 8}\\
   20 mged>\\
   21 {\em Select the {\bf BUTTON MENU} if not already displayed.} \\
   22 {\em Select the {\bf Object Illum} menu entry.} \\
   23 {\em Move the mouse away from the menu area and select twice.} \\
   24 }
   25 
   26 These operations select an object for editing.
   27 Control is passed through the {\bf OBJ PICK} and {\bf OBJ PATH} states
   28 to the {\bf OBJ EDIT} state.  The display should look similar to
   29 Figure \ref{eo-start}.
   30 
   31 \subsection{Scale Operation}
   32 
   33 \begin{figure}
   34 \centering \includegraphics{eo-scale.ps}
   35 \caption{``arb8'' Object Edit; Scaled by 0.5.}
   36 \label{eo-scale}
   37 \end{figure}
   38 
   39 \noindent
   40 {\tt
   41 mged> {\em scale 0.5}\\
   42 mged>\\
   43 }
   44 
   45 As always, the selected operation operates with respect to the key
   46 vertex -- point 1 remains the same, and the distances from point 1 to
   47 the other points are multiplied by the scale factor.  See Figure
   48 \ref{eo-scale}.  What will happen if another {\bf scale 0.5} command
   49 is given?  The {\bf scale} operator is an absolute operator.  It sets
   50 the scale factor associated with a particular transformation matrix.
   51 It does not multiply the current transformation matrix scale factor by
   52 the new scale factor.
   53 
   54 \subsection{X, Y, and XY Move Operation}
   55 
   56 \begin{figure}
   57 \centering \includegraphics{eo-xyzmove.ps}
   58 \caption{``arb8'' Object Edit; Translated to (0.5, -2, 1.5).}
   59 \label{eo-xyzmove}
   60 \end{figure}
   61 
   62 \noindent
   63 {\tt
   64 mged> {\em scale 1}\\
   65 mged> {\em translate .5 -2 1.5}\\
   66 mged>\\
   67 {\em Select the {\bf X move} menu entry.}\\
   68 }
   69 
   70 The first two commands undo the effects of the previous scale operation, and
   71 translate the key point to (0.5, -2, 1.5).  The coordinates of the other
   72 points are changed accordingly; preserving their distances relative
   73 to point 1 (see Figure \ref{eo-xyzmove}).
   74 The last operation above placed MGED into a state where the key point
   75 of the object will track the X component of successive selects, but not the Y
   76 component. Note that on some displays point 1 may not be directly
   77 visible.  It is actually behind point 4. Watch the area listing the
   78 information concerning ``arb8'' as selections are made.
   79 
   80 \noindent
   81 {\em Do several selects while moving the cursor slowly in a circle.}\\
   82 
   83    Observe that only the X axis information changes. Similarly, the {\bf
   84 Y move} tracks only changes in the Y axis, and {\bf XY move} tracks
   85 changes in both axes.
   86 
   87 \begin{figure}
   88 \centering \includegraphics{eo-xymove.ps}
   89 \caption{XY Move.}
   90 \label{eo-xymove}
   91 \end{figure}
   92 
   93 \noindent
   94 {\tt mged> }{\em press 45,45}\\
   95 {\tt mged> }\\
   96 {\em Do several more selects while moving the cursor slowly in a circle.}\\
   97 
   98    This time, moving point 1 modifies the model x and y axes (observe the
   99 changes in the list of vertices).  If {\bf Y move} is selected, all
  100 three sets of axes are modified.  These operators work in screen space,
  101 not model space, so using them with an oblique view moves the model in
  102 more than one axis (Figure \ref{eo-xymove} for example)..
  103 
  104 
  105 \subsection{Rotate Operation}
  106 
  107 \begin{figure}
  108 \centering \includegraphics{eo-arbrot.ps}
  109 \caption{``arb8'' Rotated by (30, 45, 60).}
  110 \label{eo-arbrot}
  111 \end{figure}
  112 
  113 \noindent
  114 {\tt
  115 mged> {\em press reset}\\
  116 mged> {\em translate 0 0 0}\\
  117 mged> {\em rotobj 30 45 60}\\
  118 mged>\\
  119 }
  120 
  121 The primitive is rotated 60, 45, and 30 about the z, y, and x axes in
  122 that order as shown in Figure \ref{eo-arbrot}.
  123 Note that the coordinates of the points are changed when scaling,
  124 translation, and rotation are performed.
  125 
  126 \noindent
  127 {\tt
  128 mged> {\em press reset}\\
  129 mged> {\em d arb8}\\
  130 mged>\\
  131 }
  132 
  133 If an object which is being edited is deleted from view, MGED transitions
  134 back into the {\bf VIEWING} state.
  135 
  136 \section{Object Editing an Ellipsoid}
  137 
  138 \begin{figure}
  139 \centering \includegraphics{eo-ellg.ps}
  140 \caption{Object Edit; Ellipse viewed from 45,45 preset.}
  141 \label{eo-ellg}
  142 \end{figure}
  143 
  144 \noindent
  145 {\tt
  146 mged> {\em e ellg}\\
  147 mged>\\
  148 {\em Select the {\bf 45,45} button menu entry.}\\
  149 {\em Select the {\bf Object Illum} button menu entry.}\\
  150 {\em Move the cursor outside the menu area and select twice.}\\
  151 }
  152 
  153 Control is again passed from the {\bf OBJ PICK} state through the
  154 {\bf OBJ PATH} state to the {\bf OBJ EDIT} state.
  155 When editing a cylinder, ellipsoid, or torus, the coordinates of the
  156 primitives are set relative to the center of the primitive, and are not
  157 changed by any translation of the primitive.  Figure \ref{eo-ellg}
  158 represents the display.
  159 
  160 \subsection{Scale Operation}
  161 
  162 \begin{figure}
  163 \centering \includegraphics{eo-ellg2x.ps}
  164 \caption{Object Edit; Ellipse scaled up by 2.}
  165 \label{eo-ellg2x}
  166 \end{figure}
  167 
  168 \noindent
  169 {\tt
  170 mged> {\em scale 2}\\
  171 mged>\\
  172 }
  173 
  174 The magnitudes of the vectors from the center V to the points A, B, and C
  175 are multiplied by the scale factor 2.  The location of the center V is
  176 unchanged.  See Figure \ref{eo-ellg2x}.
  177 
  178 \subsection{Move Operations}
  179 
  180 \begin{figure}
  181 \centering \includegraphics{eo-ellgxyz.ps}
  182 \caption{Object Edit; Ellipse Translated.}
  183 \label{eo-ellgxyz}
  184 \end{figure}
  185 
  186 \noindent
  187 {\tt
  188 mged> {\em scale 1}\\
  189 mged>\\
  190 {\em Select the {\bf XY move} button menu entry.}\\
  191 {\em Move the cursor to some location away from the menu area and select.}\\
  192 }
  193 
  194 The as with the arb8 in the previous section, the ellipsoid is moved
  195 in the model space plane parallel to the plane of the screen so the
  196 key point (vertex V) is ``placed at'' the point corresponding to the
  197 cursor location.  Note that there is no explicit control over the
  198 location of the point with respect to screen Z (depth in the viewing
  199 cube); the selected point has the same screen Z as the original point.
  200 The screen should look similar to Figure \ref{eo-ellgxyz}.
  201 
  202 \noindent
  203 {\tt
  204 mged> {\em d ellg}\\
  205 mged>\\
  206 }
  207 
  208 \section{Object Path and Object Edit}
  209 
  210 This section illustrates the use of the {\bf OBJ PATH} state to select the
  211 number of objects that are affected by one edit command.  In the previous
  212 sections the user was shown how to manipulate only one primitive.  A group
  213 of primitives may also be edited as a single entity.  This section
  214 shows how an entire group may be edited without addressing each individual
  215 primitive.
  216 
  217 MGED generally has several ways to achieve a particular result.  In
  218 this section, keyboard commands are used instead of the control buttons and
  219 the display menu.  The creation and saving of special primitives is
  220 illustrated.
  221 
  222 In the database, the original primitives are centered around
  223 the origin.  Copies of these primitives will be made, translated away
  224 from the origin and saved for future editing.
  225 
  226 \subsection{Organize the Primitives and Groups}
  227 
  228 \begin{figure}
  229 \centering \includegraphics{eo-stacked.ps}
  230 \caption{Stacked Primitives.}
  231 \label{eo-stacked}
  232 \end{figure}
  233 
  234 \noindent
  235 {\tt
  236 mged> {\em cp arb8 arb8.s}\\
  237 mged> {\em cp ellg ellg.s}\\
  238 mged> {\em cp tgc tgc.s}\\
  239 mged> {\em cp tor tor.s}\\
  240 mged>\\
  241 }
  242 
  243 Figure \ref{eo-stacked} shows the four primitives; arb8.s, ellg.s, tgc.s,
  244 and tor.s.  One convention frequently used by experienced modelers is to
  245 tack an identifying suffix on the names of the various primitives and
  246 objects.  Often, a ``.s'' suffix denotes a {\em solid}, a ``.r'' denotes
  247 a {\em region} and a ``.g'' denotes a {\em group} (note that this is a
  248 different ``.g'' from the ``.g'' suffix used with filenames.).
  249 
  250 \noindent
  251 {\tt
  252 mged> {\em size 16}\\
  253 mged> {\em sed arb8.s}\\
  254 mged> {\em press sxy}\\
  255 mged> {\em p 3 -3 1}\\
  256 mged> {\em press accept}\\
  257 mged>\\
  258 }
  259 
  260 Several things happened in the above sequence.  The net result is that
  261 the solid arb8.s was ``unstacked'' using a Solid Edit so it is more
  262 visible.  The same sequence of operations will be performed with the
  263 other objects to move them to other locations.
  264 
  265 \begin{figure}
  266 \centering \includegraphics{eo-spread.ps}
  267 \caption{Primitives After Translation.}
  268 \label{eo-spread}
  269 \end{figure}
  270 
  271 \noindent
  272 {\tt
  273 mged> {\em sed ellg.s}\\
  274 mged> {\em press sxy}\\
  275 mged> {\em p -3 3 1}\\
  276 mged> {\em press accept}\\
  277 mged> {\em sed tgc.s}\\
  278 mged> {\em press sxy}\\
  279 mged> {\em p -3 -3 1}\\
  280 mged> {\em press accept}\\
  281 mged> {\em sed tor.s}\\
  282 mged> {\em press sxy}\\
  283 mged> {\em p 3 3 1}\\
  284 mged> {\em press accept}\\
  285 mged>\\
  286 }
  287 
  288 The screen should now look like Figure \ref{eo-spread}.  The next step
  289 is to group the primitives
  290 
  291 \noindent
  292 {\tt
  293 mged> {\em g a.g tgc.s arb8.s}\\
  294 mged> {\em g b.g ellg.s tor.s}\\
  295 mged> {\em g c.g a.g b.g}\\
  296 mged> {\em B c.g}\\
  297 vectorized in 0 sec\\
  298 mged> {\em tree c.g}
  299 \begin{verbatim}
  300 | c.g_____________| a.g_____________| tgc.s
  301                                     | arb8.s
  302                   | b.g_____________| ellg.s
  303                                     | tor.s
  304 \end{verbatim}
  305 \noindent
  306 mged>\\
  307 }
  308 
  309 The {\em group} operator ({\bf g}) generates an object, named by the
  310 first argument, which is the union of all objects named in succeeding
  311 arguments.  Therefore, the object ``a.g'' is composed of the union of
  312 ``tgc.s'' and ``arb8.s''.  Likewise, the object ``c.g'' is the union of
  313 ``a.g'' and ``b.g''.  The next command in the above sequence is called
  314 the {\em blast} command.  It is effectively a {\em zap} ({\bf Z})
  315 followed by an {\em edit} ({\bf e}).
  316 
  317 The final command is the {\em tree} command.  It is intended to give the
  318 user some idea of the hierarchical structure of an object.  It presents
  319 a tree laid on its side.  The root is at the left, and the leaves are
  320 at the right. A vertical bar denotes a connection at a given level, with
  321 the proviso that a vertical bar having a line of underscores coming
  322 in from the left represents the start of a particular subtree when read
  323 from top down (``ellg.s'' and ``arb8.s'' do not have a common parent).
  324 
  325 \begin{figure}
  326 \centering \includegraphics{eo-grpath.ps}
  327 \caption{Object Path With ``tor.s'' as Reference Solid.}
  328 \label{eo-grpath}
  329 \end{figure}
  330 
  331 \noindent
  332 {\tt
  333 mged> {\em press oill}\\
  334 mged>\\
  335 {\em Move the cursor up and down the screen until the primitive ``tor.s''
  336 is illuminated, then select}\\
  337 }
  338 
  339 Selecting the solid ``tor.s'' transitions MGED into the {\bf OBJ PATH}
  340 state, and establishes ``tor.s'' as the reference solid for any future
  341 editing operations.
  342 Note that the name ``tor.s'' is shown in the upper left corner of the
  343 display, and on the second status line at the bottom of the display
  344 (Figure \ref{eo-grpath}).
  345 
  346 The {\bf OBJ PATH} state has little meaning unless there is more than one path
  347 or group in the display.  One of the following paths may be selected:
  348 
  349 \begin{quote}
  350 c.g/b.g/\_MATRIX\_/tor.s
  351 
  352 c.g/\_MATRIX\_/b.g/tor.s
  353 
  354 \_MATRIX\_/c.g/b.g/tor.s
  355 \end{quote}
  356 
  357 Although the torus primitive has been selected as the reference solid,
  358 the position of {\bf \_MATRIX\_} determines the extent of the effects of
  359 the edit.  The first choice affects only the torus.  The second choice
  360 affects everything under the group ``b.g'' (the torus and ellipsoid).
  361 The third choice affects all of the primitives.  Remember though, that
  362 in all cases, what is being edited is the Homogeneous Transformation
  363 Matrix (thought of as the arc connecting objects), not the underlying
  364 solid.
  365 
  366 \subsection{Editing One Primitive}
  367 
  368 \begin{figure}
  369 \centering \includegraphics{eo-gredit.ps}
  370 \caption{Object Edit With ``tor.s'' as Reference Solid.}
  371 \label{eo-gredit}
  372 \end{figure}
  373 
  374 \noindent
  375 {\em Move the cursor up and down until {\tt /c.g/b.g/\_MATRIX\_/tor.s} appears
  376 in the bottom status line, then select.}\\
  377 
  378 Figure \ref{eo-gredit} is the new display.  Note that the torus is
  379 illuminated. The {\bf OBJ EDIT} state has been reached.
  380 
  381 \begin{figure}
  382 \centering \includegraphics{eo-tor111.ps}
  383 \caption{Object Edit Affecting Torus Only.}
  384 \label{eo-tor111}
  385 \end{figure}
  386 
  387 \noindent
  388 {\tt
  389 mged> {\em translate 1 1 1}\\
  390 mged>\\
  391 }
  392 
  393 The key point of the torus is moved to 1, 1, 1.  The other primitives are
  394 not moved.  See Figure \ref{eo-tor111}.
  395 
  396 \noindent
  397 {\tt
  398 mged> {\em press reject}\\
  399 mged>\\
  400 }
  401 
  402 \subsection{Editing a Group of Two Primitives}
  403 
  404 \begin{figure}
  405 \centering \includegraphics{eo-bgrp.ps}
  406 \caption{Torus and Ellipsoid Selected for Object Edit.}
  407 \label{eo-bgrp}
  408 \end{figure}
  409 
  410 \noindent
  411 {\tt
  412 mged> {\em press oill}\\
  413 mged>\\
  414 {\em Move the cursor up and down the screen until the primitive ``tor.s''
  415 is illuminated, then select.}\\
  416 {\em Move the cursor up and down until {\tt /c.g/\_MATRIX\_/b.g/tor.s} appears
  417 in the bottom status line, then select.}\\
  418 }
  419 
  420 Control has again been passed to the {\bf OBJ EDIT} state. Notice that
  421 both the torus and ellipsoid are illuminated (Figure \ref{eo-bgrp}.
  422 Although only the parameters for the torus will be changed in the
  423 display, the ellipsoid in group ``b.g'' will be affected by the edit.
  424 
  425 \begin{figure}
  426 \centering \includegraphics{eo-bgrp311.ps}
  427 \caption{Torus and Ellipsoid Translated by (3, 1, 1).}
  428 \label{eo-bgrp311}
  429 \end{figure}
  430 
  431 \noindent
  432 {\tt
  433 mged> {\em translate 3 1 1}\\
  434 mged>\\
  435 }
  436 
  437 The key point of the torus is moved to 3, 1, 1. The ellipsoid is
  438 moved by the same amount.  See Figure \ref{eo-bgrp311}.
  439 
  440 \noindent
  441 {\tt
  442 mged> {\em press reject}\\
  443 mged>\\
  444 }
  445 
  446 \subsection{Editing Two Groups of Four Primitives}
  447 
  448 \begin{figure}
  449 \centering \includegraphics{eo-cgrp.ps}
  450 \caption{All Primitives Selected for Object Edit.}
  451 \label{eo-cgrp}
  452 \end{figure}
  453 
  454 \noindent
  455 {\tt
  456 mged> {\em press oill}\\
  457 mged>\\
  458 {\em Move the cursor up and down the screen until the primitive ``tor.s''
  459 is illuminated, then select.}\\
  460 {\em Move the cursor up and down until {\tt /\_MATRIX\_/c.g/b.g/tor.s} appears
  461 in the bottom status line, then select.}\\
  462 }
  463 
  464 Control has again been passed to the {\bf OBJ EDIT} state. Notice that
  465 all of the primitives are illuminated (Figure \ref{eo-cgrp}).
  466 Although only the parameters for the torus will be changed in the
  467 display, the ellipsoid in group ``b.g'' will be affected by the edit.
  468 
  469 \begin{figure}
  470 \centering \includegraphics{eo-cgrp321.ps}
  471 \caption{All Primitives Translated by (3, 2, 1).}
  472 \label{eo-cgrp321}
  473 \end{figure}
  474 
  475 \noindent
  476 {\tt
  477 mged> {\em translate 3 2 1}\\
  478 mged>\\
  479 }
  480 
  481 The key point of the torus is moved to 3, 2, 1. All other primitives are
  482 moved by the same amount.  See Figure \ref{eo-cgrp321}.
  483 
  484 \noindent
  485 {\tt
  486 mged> {\em press reject}\\
  487 mged>\\
  488 }
  489 
  490 Control has now returned to the VIEWING state.