<> <> <> <<>> DIRECTORY Graphics, Rope, SV2d, SV3d, SVModelTypes; SVMappings: DEFINITIONS = BEGIN Artwork: TYPE = SVModelTypes.Artwork; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = SV3d.Point3d; Polygon: TYPE = SV2d.Polygon; Vector: TYPE = SV3d.Vector; PRect: TYPE = SVModelTypes.PRect; PDisk: TYPE = SVModelTypes.PDisk; Tube: TYPE = SVModelTypes.Tube; Disk: TYPE = SVModelTypes.Disk; Box: TYPE = SVModelTypes.Box; TubeLine: TYPE = SVModelTypes.TubeLine; SpaceFunction: TYPE = SVModelTypes.SpaceFunction; << When you map a straight line in image space onto the surface of a cylinder, you are taking an equation of the form cy -sx -d = 0 and applying the transform: (x,y) <==> (R*theta, h) giving an equation of the form: c*h - s*R*theta -d = 0. which is of the same form. Given two points on the cylinder surface, we can find the line that goes through them in a normal fashion and can map this back to the plane by either mapping the endpoints or converting the equation. >> CartesianToPolar: PROC [x, y: REAL] RETURNS [r, theta: REAL]; PolarToCartesian: PROC [r, theta: REAL] RETURNS [x, y: REAL]; CreatePDisk: PROC [r: REAL, origin: Point2d] RETURNS [pdisk: PDisk]; DrawPDisk: PROC [dc: Graphics.Context, pdisk: PDisk]; <> CreateFunction: PROC [scalars: Point3d] RETURNS [sf: SpaceFunction]; Point3dToFunctionPoint: PROC [point3d: Point3d] RETURNS [sfPoint: Point3d]; FunctionPointToPoint3d: PROC [sfPoint: Point3d, assembly: REF ANY] RETURNS [point3d: Point3d]; <> CreateTube: PROC [R: REAL, H: REAL] RETURNS [tube: Tube]; Point3dToTubePoint: PROC [point3d: Point3d] RETURNS [tubePoint: Point2d]; TubePointToPoint3d: PROC [tubePoint: Point2d, assembly: REF ANY] RETURNS [point3d: Point3d]; ImageToTube: PROC [imagePoint: Point2d, data: REF ANY] RETURNS [surfacePoint: Point2d, onSurf: BOOL]; <> TubeToImage: PROC [surfacePoint: Point2d, data: REF ANY] RETURNS [imagePoint: Point2d, onSurf: BOOL]; <> <> Point3dToDiskPoint: PROC [point3d: Point3d] RETURNS [r, theta: REAL]; DiskPointToPoint3d: PROC [r, theta: REAL, assembly: REF ANY] RETURNS [point3d: Point3d]; ImageToTopDisk: PROC [u,v: REAL, disk: Disk] RETURNS [r, theta: REAL]; TopDiskToImage: PROC [r, theta: REAL, disk: Disk] RETURNS [u,v: REAL]; ImageDiskToTopDiskBoundary: PROC [pdisk: PDisk, disk: Disk] RETURNS [R, halfH: REAL]; TopDiskBoundaryToImageDisk: PROC [R, halfH: REAL, disk: Disk] RETURNS [pdisk: PDisk]; ImageToBottomDisk: PROC [u,v: REAL, disk: Disk] RETURNS [r, theta: REAL]; BottomDiskToImage: PROC [r, theta: REAL, disk: Disk] RETURNS [u,v: REAL]; ImageDiskToBottomDiskBoundary: PROC [pdisk: PDisk, disk: Disk] RETURNS [R, halfH: REAL]; BottomDiskBoundaryToImageDisk: PROC [R, halfH: REAL, disk: Disk] RETURNS [pdisk: PDisk]; <> <> CreateBox: PROC [x, y, z: REAL] RETURNS [box: Box]; BoxOrthogonalOInverse: PROC [point3d: Point3d, normal: Vector, box: Box] RETURNS [boxPoint: Point2d, hit: BOOL]; BoxOrthogonalO: PROC [boxPoint: Point2d, box: Box] RETURNS [point3d: Point3d, hit: BOOL]; BoxRadialOInverse: PROC [point3d: Point3d, normal: Vector, box: Box] RETURNS [boxPoint: Point2d, hit: BOOL]; BoxRadialO: PROC [boxPoint: Point2d, box: Box] RETURNS [point3d: Point3d, hit: BOOL]; ImageToBox: PROC [imagePoint: Point2d, data: REF ANY] RETURNS [surfacePoint: Point2d, onSurf: BOOL]; <> BoxToImage: PROC [surfacePoint: Point2d, data: REF ANY] RETURNS [imagePoint: Point2d, onSurf: BOOL]; <> <<2d Surface Projections>> ImagePolyToSurfacePoly: PROC [imagePoly: Polygon, map: PROC [imagePoint: Point2d, data: REF ANY] RETURNS [surfacePoint: Point2d, onSurf: BOOL], data: REF ANY] RETURNS [surfacePoly: Polygon]; < for some type of 3d surface.>> SurfacePolyToImagePoly: PROC [surfacePoly: Polygon, map: PROC [surfacePoint: Point2d, data: REF ANY] RETURNS [imagePoint: Point2d, onSurf: BOOL], data: REF ANY] RETURNS [imagePoly: Polygon]; < for some type of 3d surface.>> END.