; surface.pro - Defines the ancestor to all CSG surface objects. This ; object by itself is null - It has no points on its interior, and a ; ray never intersects it ; ; ---------------------------------------------------------------------- ; CONSTRUCTOR ; ---------------------------------------------------------------------- ; function surface::init status = 1 return, status end ;function is_inside ;Inputs: ; R - a vector to test. May be a grid ;Returns: ; 1 if given vector is inside the surface, 0 if not. In general, this should ; return true if the point is exactly on the surface. This particular ; object occupies no space, so it always returns 0 function surface::is_inside,r return, bytarr(shape_grid(r)) end ;function intersect ; Calculates intersection parameter t for this surface and a ray ; R=R0+V*t ;Inputs: ; R0 - Origin of ray to test. Must be a single vector ; V - Direction of ray to test. May be a grid ;Returns: ; t parameter of intersection, or negative value or NaN if no intersection. ; This particular object is never intersected, so it always returns -1 function surface::intersect,r0,v return, dblarr(shape_grid(v))-1 end ;function to_pov ; Returns a string containing a representation of this surface in POV-Ray code. ; All vectors in the representation must be converted to left-handed. This ; particular object has no representation, so it returns an empty string function surface::to_pov return,'' end function surface::to_pov_array return,'' end ;-------------------------------------------------------------------------- ; CLEANUP ; -------------------------------------------------------------------------- ; PURPOSE: ; Lifecycle method to clean itself up. ; pro surface::CLEANUP end ; -------------------------------------------------------------------------- ; Object Data Structure Definition ; -------------------------------------------------------------------------- ; PURPOSE: ; Define the data structure associated with this object. pro surface__define self = {surface, version:0} end