DIRECTORY Commander, Controls, CtBasic, CtFilter, G2dBasic, G3dBasic, G3dDraw, G3dMatrix, G3dPlane, G3dTool, Imager, ImagerColor, ImplicitDefs, ImplicitDesign, IO, Rope; ImplicitConvolve: CEDAR DEFINITIONS ~ BEGIN PixelArray: TYPE ~ CtBasic.PixelArray; SampleBuffer: TYPE ~ CtBasic.SampleBuffer; SampleMap: TYPE ~ CtBasic.SampleMap; Filter: TYPE ~ CtFilter.Filter; Pair: TYPE ~ G2dBasic.Pair; IntegerPair: TYPE ~ G2dBasic.IntegerPair; NatSequence: TYPE ~ G2dBasic.NatSequence; Box: TYPE ~ G3dBasic.Box; RealSequence: TYPE ~ G3dBasic.RealSequence; Quad: TYPE ~ G3dBasic.Quad; Triple: TYPE ~ G3dBasic.Triple; TripleSequence: TYPE ~ G3dBasic.TripleSequence; DrawType: TYPE ~ G3dDraw.DrawType; Matrix: TYPE ~ G3dMatrix.Matrix; Viewport: TYPE ~ G3dMatrix.Viewport; MajorPlane: TYPE ~ G3dPlane.MajorPlane; Context: TYPE ~ Imager.Context; RGB: TYPE ~ ImagerColor.RGB; PairList: TYPE ~ LIST OF Pair; TripleList: TYPE ~ LIST OF Triple; PrimitiveType: TYPE ~ {polygon, triangle, line, point}; PrimitiveList: TYPE ~ LIST OF Primitive; Thickness: TYPE ~ REF ThicknessRep; ThicknessRep: TYPE ~ RECORD [ value: REAL ¬ 0.0, -- thickness of the primitive array: PixelArray ¬ NIL, -- spatial modifier, if non-nil display: IntegerPair ¬ [0, 0] -- pixel array display location ]; Primitive: TYPE ~ REF PrimitiveRep; PrimitiveRep: TYPE ~ RECORD [ id: INT ¬ -1, -- mostly for debugging active: BOOL ¬ TRUE, -- FALSE: as if intensity = 0 nVertices: INTEGER ¬ 0, -- points.length or indices.length points: TripleSequence ¬ NIL, -- `global' set of vertex locations indices: NatSequence ¬ NIL, -- indices to points/intensities thickness: Thickness ¬ NIL, -- thickness of the primitive intensities: RealSequence ¬ NIL, -- `global' set of vertex intensities intensity: REAL ¬ 1.0, -- flat shaded value or multiplier valueScale: REAL ¬ 1.0, -- derived from intensity plane: Quad ¬ [], -- for polygon normal: Triple ¬ [], -- plane normal origin: Triple ¬ [], -- image alignment origin xAxis, yAxis: Triple ¬ [], -- image alignment axes p0x, p1x: Triple ¬ [], -- for twisted axis h: REAL ¬ 0.0, -- for twisted height size: Pair ¬ [0.0, 0.0], -- size of 3d bounding rectangle scale: REAL ¬ 1.0, -- scale up to image resolution twist: Twist ¬ [], -- normal twist about axis (in radians) accV: Triple ¬ [], -- nearness accelerator for segment accW: REAL ¬ 0.0, -- nearness accelerator for segment filter: Filter ¬ [], -- convolution filter interp: BOOL ¬ TRUE, -- bilinear or linear interpolation extent: REAL ¬ 0.1, -- filter support in world units bounds: Box ¬ [], -- bounding box, for fast cull recipExtent: REAL ¬ 10.0, -- performance accelerator res: IntegerPair ¬ [0, 0], -- pixel array resolution color: RGB ¬ [1.0, 1.0, 1.0], -- color of primitive path: PairList ¬ NIL, -- for image outline image: PixelArray ¬ NIL, -- for 2d convolution of a polygon buffer: SampleBuffer ¬ NIL, -- for 1d convolution of a line distance: REAL ¬ 0.0, -- distance from point to plane distanceSet: BOOL ¬ FALSE, -- if distance valid display: IntegerPair ¬ [0, 0] -- pixel array display location ]; Twist: TYPE ~ RECORD [ tw0, tw1: REAL ¬ 0.0, -- amount of twist in radians p0, p1: Triple ¬ [] -- axis endpoints, presumed on poly ]; PrimitiveProc: TYPE ~ PROC [p: Primitive] RETURNS [continue: BOOL ¬ TRUE]; GetPoint: PROC [p: Primitive, n: INTEGER] RETURNS [Triple]; MakePrimitive: PROC [ points: TripleSequence, extent: REAL ¬ 0.1, thickness: REAL ¬ 0.0, intensity: REAL ¬ 1.0, intensities: RealSequence ¬ NIL, indices: LIST OF INTEGER ¬ NIL, res: IntegerPair ¬ [50, 50], color: RGB ¬ [1.0, 1.0, 1.0], twist: Twist ¬ []] RETURNS [Primitive]; SetGeometry: PROC [p: Primitive]; GetImageProjection: PROC [q: Triple, p: Primitive] RETURNS [xy: Pair, distance: REAL]; ValueOfPrimitive: PROC [q: Triple, p: Primitive] RETURNS [REAL]; ValueOfPrimitives: PROC [q: Triple, primitives: PrimitiveList] RETURNS [REAL]; ConvolvePrimitive: PROC [p: Primitive, filter: BOOL]; SetImagePath: PROC [p: Primitive, path: PairList, filter: BOOL ¬ TRUE]; DisplayPrimitive: PROC [p: Primitive, map: SampleMap]; GetTwisted: PROC [p: Primitive, q: Triple] RETURNS [Triple]; NActivePrimitives: PROC [primitives: PrimitiveList] RETURNS [INTEGER]; SetIDs: PROC [list: LIST OF PrimitiveList, startID: INTEGER ¬ 0]; CombinePrimitives: PROC [list: LIST OF PrimitiveList] RETURNS [PrimitiveList]; InvalidateDistance: PROC [primitives: PrimitiveList]; InsideSolid: PROC [q: Triple, convexSolid: PrimitiveList] RETURNS [BOOL]; DrawPrimitive: PROC [ p: Primitive, context: Context, view: Matrix, viewport: Viewport ¬ [], whatChanged: REF ¬ NIL, type: DrawType ¬ solid, log: IO.STREAM ¬ NIL]; DrawPrimitives: PROC [ list: LIST OF Primitive, context: Context, view: Matrix, viewport: Viewport ¬ [], whatChanged: REF ¬ NIL, type: DrawType ¬ solid, log: IO.STREAM ¬ NIL]; Tool: TYPE ~ REF ToolRep; ToolRep: TYPE ~ RECORD [ cmd: Commander.Handle ¬ NIL, tool: ImplicitDesign.Tool ¬ NIL, client: G3dTool.Client ¬ [], res: IntegerPair ¬ [50, 50], filter: BOOL ¬ TRUE, interp: BOOL ¬ TRUE, primitives: PrimitiveList ¬ NIL, convexSolids: LIST OF PrimitiveList ¬ NIL, nPrimitives: INTEGER ¬ 0 ]; MakeTool: PUBLIC PROC [ name: Rope.ROPE ¬ NIL, primitives: PrimitiveList ¬ NIL, convexSolids: LIST OF PrimitiveList ¬ NIL, res: IntegerPair ¬ [50, 50], client: G3dTool.Client ¬ [], ops: G3dTool.Operations ¬ G3dTool.allOps, extraControls: LIST OF Controls.Control ¬ NIL, extraButtons: LIST OF Controls.Button ¬ NIL, controlSizes: Controls.ControlSizes ¬ [], useArcBalls: BOOL ¬ TRUE, arcBallSize: INT ¬ 136, graphicsHeight: INT ¬ 475, camera: G3dTool.CameraRep ¬ [[0, 2, 0], [], 1, 60], background: Triple ¬ [0.3, 0.3, 1.0], noOpen: BOOL ¬ FALSE, toolSettings: ImplicitDesign.ToolRep ¬ [], tool3dSettings: G3dTool.ToolRep ¬ []] RETURNS [Tool]; DoMakeMaps: PROC [t: Tool]; END. φ ImplicitConvolve.mesa Copyright Σ 1990 by Xerox Corporation. All rights reserved. Bloomenthal, November 21, 1992 10:15 pm PST Type Declarations Operations on Primitives Return the indexed point from the primitive. Create a primitive defined by a sequence of 3d planar points. If intensities # NIL, the primitive is smooth shaded, flat shaded otherwise; intensity is for flat shading or a multiplier for the individual intensities. If indices # NIL, it indexes points and (optionally) intensities. extent is the filter support, in world units. thickness is the width of the primitive, in world units. Set internal geometric attributes of the primitive; this procedure usually not used by clients. Project the point onto the primitive. distance is signed. Compute the implicit value of a primitive given the query point q. Compute the implicit value of the primitives given the query point q. Create a planar image at the specified resolution; if filter, convolve the polygon with a cubic kernel of radius strength. intensity: 0 = black, 1 = white Set the primitive's image based on the path(s). The path should be a 2d projection of 3d world points; SetImagePath scales to fit the image. Display the primitives's 1d, 2d, thickness image(s), on the given map. Return the point q twisted about the axis of p (return q if p.twist not defined). Return the number of active primitives in the list. Assign primitive.id in ascending order. Combine arbitrary lists of primitives into a single list. Set primitive.distanceSet FALSE. Return TRUE iff point inside all primitive planes. Draw the primitive as a polygon onto the given Imager context. Draw the primitives as polygons onto the given Imager context. A Design Tool Convolve and display the primitive maps. ΚR•NewlineDelimiter ™™Jšœ<™Jšœœœ ˜6Jšœ% ˜DJ˜J˜—šœ œœ˜Jšœœ  ˜J™—š’œœ˜Jšœœœ ˜Jšœ˜Jšœ ˜ J˜Jšœ œœ˜J˜Jšœœœœ˜J™>——šŸ ™ Jšœœœ ˜šœœœ˜Jšœœ˜Jšœœ˜#J˜J˜Jšœ œœ˜Jšœ œœ˜Jšœœ˜!Jšœœœœ˜+Jšœœ˜J˜J˜—š’œ£œ£œ˜Jšœœœ˜Jšœœ˜!Jšœ œœœ˜+J˜J˜J˜,Jšœœœœ˜/Jšœ œœœ˜-J˜*Jšœ œœ˜Jšœ œ˜Jšœœ˜Jšœ5£˜6J˜&Jšœœœ˜J˜+J˜%Jšœ˜J™—š’ œœ ˜J™(——J™Jšœ˜J˜J˜—…—b'ͺ