Stedit is a utility for creating and editing single or multiple patch Bezier surfaces, as well as distorting and placing textures.
The Bezier utility can be invoked in the following ways:
stedit (+flags)
stedit -bezier (+flags)
stedit -bezier [surface filename] (+flags)
stedit -bezier [surface filename] [texture filename] (+flags)
stedit -both [surface filename] [texture filename] (+flags)
A window is displayed as in Figure 1. If a surface filename was specified, the surface will be preloaded. If a texture was specified as well, this will also be preloaded. Specifying both will also open the Warp window. Specifying the flag -ef will force the program to save in the extended surface file format.
Bezier loads and saves surface files as described in section 5.4.3 of the CPFG user manual.
The extended surface file format is the same as the original format, except that it saves two peices of adjacency information for each patch connection instead of one, to prevent ambiguities. Extended surface files are denoted by the line VERSION stedit at the top of the file.
Patches can be added, deleted and duplicated using the buttons below the "Patches" list box. Patches can be selected from the list box by clicking on them, or renamed by double clicking on them. Right clicking on the "Add" button gives a choice for the basic shape of the patch that will be added; square or triangular.
Patches can be edited in a variety of ways. The grid of numbered buttons allows for the selection of control points by number, in the currently selected patch. The boxes at the bottom of the bar display the point's current x, y and z coordinates, and these numbers can be edited by typing in new numbers, or using the arrows or mouse wheel for a slider effect. Holding down Control and clicking on the points directly in the viewer will also select them, and they can be moved by dragging. Dragging points by this method will move them such that they remain directly under the mouse pointer in the current view plane. Points can be selected and dragged without holding control if the view is locked from the view menu or the quick menu (right click).
The symmetry options allow for the editing of multiple points at once. Selecting "1-4 Y", for example, will move the points in the axis of 1-4 symmetrically about the Y axis through the contact point. This means points like 1 and 4, 2 and 3, 9 and 12 etc. will move together symmetrically about the Y axis through the contact point. "1-4 X" will do the same about the X axis through the contact point, whereas the 1-13 options will move point combinations like 1 and 13, 5 and 9, 3 and 15 etc. about the chosen axis. Choosing 1-4 X and 1-13 Y or 1-4 Y and 1-13 X will cause four points to move symmetrically in a square. Choosing 1-4 X and 1-13 X or 1-4 Y and 1-13 Y is not recommended.
Patches can also be edited as a whole by selecting an action from the Edit > Transform menu. Flip allows a patch to be mirrored about the X, Y or Z axis, translate allows the entire patch to be moved, rotate allows it to be rotated by an arbitrary angle about any axis, and scale allows the patch to be stretched or compressed along any axis, or uniformly.
The contact point can be edited the same way as any other point. It can be selected with the "Contact" button on the sidebar, or by control clicking on it. To edit the vectors associated with the contact point, as well as other positioning parameters, open the Control Point dialog from the Edit menu, or by pressing Ctrl+T.
Patch adjacencies can be opened from the Adjacencies window. Open the Adjacencies window from the Edit menu, or press Ctrl+Shift+A. A window is displayed as in Figure 2. This window can be used to edit the adjacency information of the patch selected in the center box. The patch shown in the box has coloured edges and corner points corresponding to the eight boxes surrounding it. To create an adjacency, choose the patch that should appear on that side from the corresponding dropdown menu. If the basic surface format is being used, it is assumed that the right of one patch will connect to the left of another, top will connect to bottom, etc. If the extended surface file format is being used, a colour can be chosen from the second drop down menu to specify which edge of the adjacent patch will complete the adjacency. For example, if Patch_1 is selected in the center box, and Patch_2 is placed in the red (top) box, and "Green" is chosen from that dropdown menu, the left edge of Patch_2 will be connected to the top of Patch_1.
If the "Enforce Adjacencies" option in the Edit menu is active, then all adjacent edges will snap together, and move together if the points are moved. If this option is inactive, the adjacencies will be ignored.
Texture placement options can be found in the Texture menu. From here, textures can be loaded, flipped, and rotated. For more information about the texture editor, see Warp.
Viewing options can be accessed from the View menu. From here, different view elements can be shown and hidden, and the surface can be toggled between textured and wireframe. The viewer rotation can also be locked, allowing for editing of points without holding Control. The camera can be centered at the center of the surface, or at the contact point. Reset restores all view parameters to their initial states. Some of these actions are also available from the quick menu (right click).
The preferences dialog can be accessed from the File menu, or by pressing Ctrl+P. From here, the appearance of the surface viewer can be set. The parameters are saved in a configuration file and loaded each time the program is run.
Option Details:
The Warp utility can be invoked in the following ways:
stedit -warp
stedit -warp [texture filename]
stedit -both [surface filename] [texture filename] (+flags)
A window is displayed as in Figure 3. If a texture filename was specified, the texture will be preloaded. Specifying both will also open the Bezier window.
Warp can load and save texture files as "warp" files (extension .dtx). These files save the positions of the control points in the warped texture so that it can be loaded and re-edited without loss of quality. Warp files do not save actual texture information, but only a reference to the texture they were created on. If the texture being edited does not exist in the same directory as the saved warp file, it cannot be loaded.
Textures are edited directly by clicking and dragging control points. Clicking while holding down control will add a new control point at the mouse's current position. Control points cannot be dragged into adjacent triangles. The points will instead snap to the edge of the neighbouring triangle. The texture can be resized, rotated or flipped via commands in the Edit menu.
Other Options:
The preferences dialog can be accessed from the File menu, or by pressing Ctrl+P. From here, the appearance of the texture viewer can be set. The parameters are saved in a configuration file and loaded each time the program is run.
Option Details:
Mark Koleszar - Stedit - Implementation and documentation