DIRECTORY Rope, G3dRender; ShapeTwiddle: CEDAR DEFINITIONS ~ BEGIN Context: TYPE ~ G3dRender.Context; Shape: TYPE ~ G3dRender.Shape; NatPair: TYPE ~ RECORD [x, y: NAT]; ScaleShape: PROCEDURE [context: Context, name: Rope.ROPE, scale, xRatio, yRatio, zRatio: REAL _ 1.0, applyXfm: BOOLEAN _ FALSE]; ScaleTexture: PROCEDURE [ context: Context, name: Rope.ROPE, scale, xRatio, yRatio, zRatio: REAL _ 1.0]; CleanUp: PROC [context: Context, name: Rope.ROPE, deSeam: BOOLEAN _ FALSE, tolerance: REAL _ 0.0]; CopyShape: PROC [context: Context, dstName, srcName: Rope.ROPE] RETURNS[Shape]; Combine: PROC [context: Context, dstName, src1, src2: Rope.ROPE] RETURNS[Shape]; DeletePatches: PROC [context: Context, dstName, srcName: Rope.ROPE, patchList: LIST OF NatPair] RETURNS[Shape]; Bounds: PROC [context: Context, name: Rope.ROPE] RETURNS[xMin, xMax, yMin, yMax, zMin, zMax: REAL]; ShapeExpand: PROC[ context: Context, name: Rope.ROPE, limitType: ATOM _ NIL, limit: REAL _ 0.0] RETURNS [Shape]; ShapeSubdivide: PROC[ context: Context, name: Rope.ROPE, limitType: ATOM _ NIL, limit: REAL _ 0.0] RETURNS [Shape]; END. BShapeTwiddle.mesa Last Edited by: Crow, September 30, 1987 6:43:45 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. Scales texture coordinates of vertices. xRatio, etc. can be used to set scale assymetrically. eg. texture.x _ texture.x * scale * xRatio. Accumulated scale factor is stored on shape shadingProps list ($TextureScale). 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. Procedures for expansion of/to polygons Expands a whole shape, calling procedures supplied by the surface type Subdivide a whole shape once, calling procedures supplied by the surface type Κν˜headšœ™Jšœ7™7IdefaultšΟk œ˜—head2šœœ ˜Jšœ˜—head3šΠbi™Lšœ œ˜%Lšœ œ˜!Lšœ œœœ˜&—šΟb™š Οn œ œœ+œœœ˜”Lšœά™ά—codeš  œ œ œ$œ˜kšœ_™_Ošœ+™+—OšœO™O—š  œœœ œœ œ˜dO™ž—š  œœ+œ œ˜WO™m—š œœ.œœ˜UO™W—š   œœ+œœœ œ˜zO™«—š  œœœ œ%œ˜fOšœM™M——šŸ'™'aš  œœœœœ œœ ˜~P™G—š œœœœœ œœ ˜‚P™N——Jšœ˜—…—° ί