DIRECTORY Rope USING [ ROPE ], ThreeDScenes USING [ Context, ShapeInstance ]; ShapeTwiddle: CEDAR DEFINITIONS ~ BEGIN Context: TYPE ~ ThreeDScenes.Context; ShapeTwiddleError: SIGNAL [reason: ATOM]; NatPair: TYPE ~ RECORD [x, y: NAT]; ScaleShape: PROCEDURE [context: REF Context, name: Rope.ROPE, scale: REAL, xRatio, yRatio, zRatio: REAL _ 1.0]; ScaleTexture: PROCEDURE [context: REF Context, name: Rope.ROPE, scale: REAL, xRatio, yRatio, zRatio: REAL _ 1.0]; CleanUp: PROC [context: REF Context, name: Rope.ROPE, deSeam: BOOLEAN _ FALSE, tolerance: REAL _ 0.0]; CopyShape: PROC [context: REF Context, dstName, srcName: Rope.ROPE] RETURNS[REF ThreeDScenes.ShapeInstance]; Combine: PROC [context: REF Context, dstName, src1, src2: Rope.ROPE] RETURNS[REF ThreeDScenes.ShapeInstance]; DeletePatches: PROC [context: REF Context, dstName, srcName: Rope.ROPE, patchList: LIST OF NatPair] RETURNS[REF ThreeDScenes.ShapeInstance]; Bounds: PROC [context: REF Context, name: Rope.ROPE] RETURNS[xMin, xMax, yMin, yMax, zMin, zMax: REAL]; END. ¨ShapeTwiddle.mesa Last Edited by: Crow, September 23, 1986 10:59:23 pm PDT Types Shape Manipulations Scale vertices, global scale is scaled by ratio for each axis. Transform vertices to current position before scaling. New vertices will be the transformed and scaled result. Position transform is reset to identity. Throw out unused vertices. If deseaming, then coalesce vertices no more than "tolerance" apart. If deseaming polygons, eliminate redundant vertex pointers. Copy shape so that the copy may be abused by the other routines herein whil maintaining the original intact. Combine two objects, producing a new object with all the vertices and patches of both. Produce a new object without the listed intervals of patches. Good for disassembling objects. Use "CleanUp" afterwards, since all vertices are copied to the new object. Find the bounding box of the vertices after applying the position transform. ΚΘ˜headšœ™Jšœ8™8defaultšΟk ˜ Jšœ œœ˜Jšœœ˜/——head2šœœ ˜Jšœ˜—head3šΠbi™Iašœ œ˜%Ošœœ œ˜)Icodešœ œœœ˜#—šΟb™š Οn œ œ œœ œœ˜rLšœά™ά—Pš   œ œ œœ œœ˜tš œœ œœ œœ œ˜hP™ž—š   œœ œ!œ œœ˜tP™m—š  œœ œ$œœœ˜rP™W—š  œœ œ!œœœ œœ˜—P™«—š  œœ œœ œ%œ˜jPšœM™M—Jšœ˜——…—2 ’