úÎ![lVx     None;Z!csgKCSG solid is a recursive composition of primitive objects or other solids.csg^Half-space defined by a unit outward normal and a distance of boundary plane from the origin. csg.Sphere defined by a center point and a radius.!csg^Infinite circular cylinder defined by a normalized axis vector, a point on axis and a radius."csguCone defined by an inward axis direction, a vertex and a cosine to the angle h between the axis and the generatrix.€Additionally, a transformation matrix $n * n - cos^2 h$, tangent of angle and odelta are stored for intersection calculations.csgpTrace of a ray/line on a solid is a list of segments corresponding to the portions of the ray inside the solid. } O - ray -- > -- > +------------csg A segment of ray inside a solid.csg½A point at which a ray intersects a surface, given as a distance from the ray's initial point and an outward normal to the surface at the hit point. If hit is in infinity, then normal is #l. If the hit occures on the same line but precedes the initial point of the ray, the distance is negative.™Note that this datatype is strict only on first argument: we do not compare normals when combining traces and thus do not force calculation of normals.csg A ray described by the equation p(t) = p_0 + v * t with an initial point p_0 and a direction v . Substituting a specific time t'. in the equation yields a position of a point p(t')% on the ray. For negative values of t'', position precedes the initial point.csgWe use $ as a simple replacement for (Double, Double, Double). $… implements a contiguous storage scheme for Unboxed and Storable vectors which shows better performance. Compile this package with triples0 flag and run benchmarks to see the difference.%csgIEEE positive infinity.&csgNegative infinity.'csgHit in negative infinity.(csgHit in positive infinity. csgwA half-space defined by an arbitary point on the boundary plane and an outward normal (not necessarily a unit vector). csg0A sphere defined by a center point and a radius. csgTA rectangular cuboid with faces parallel to axes, defined by two opposite vertices. csgSAn infinite circular cylinder defined by two arbitary points on axis and a radius. csg[A finite right circular cylinder defined by two points on its top and bottom and a radius.csgŸAn infinite right circular cone defined by an outward axis vector, an apex point and an angle between the generatrix and the axis (in degrees, less than 90).csgŸA conical frustum defined by two points on its axis with radii at that points. One of radii may be zero (in which case one of frustum ends will be the apex).csgIntersection of two solids.csgUnion of two solids.csg(Complement to a solid (normals flipped).csgSubtract a solid from another.csgTrace of a ray on a solid.csg5Find the next point where a ray hits a solid, if any.0Here we consider only future intersections: the B is guaranteed to have non-negative distance (unlike when using ).SThis means that if the ray starts inside the solid the only way to tell that from N result is to compare it's direction and the surface normal at the hit point.)csgUnion of two traces.*csgIntersection of two traces.+csg(Complement to a trace (normals flipped).csg)True if the point is in inside the solid.,csgFMove point by velocity vector for given time and return new position.-csgSolve quadratic equation ax^2 + bx + c = 0.2If less than two roots exist, Nothing is returned.,csgCurrent position.csg Velocity.csg Time step.-csgacsgbcsgc.$./0123456789:;<=>?@ABC    NoneVDcsgParser with a lookup table.Ecsg1Transformer which adds a lookup table to a monad.Fcsg!Add an entry to the lookup table.GcsgLookup entry in the table.Hcsg.Read three comma-separated doubles into point. /<triple> ::= <double> ',' <double> ',' <double>Icsg-Read variable name or fail if it's a keyword.JcsgJLook up a solid in the table by its name or fail if it's not defined yet.KcsgGParse binary operation on two bodies with given composition operators.Note that due to the way K and LJ combinators recurse into each other multi-solid composition chains are right-associativeš. However, this also means that if we keep simpler solids on the left then ray casting routines will have a chance to work faster and terminate earlier.McsgCRead a stamement which adds a new solid entry to the lookup table. 3<statement> ::= 'solid' <varname> '=' <solid> ';'LcsgjExpression is either a primitive, a reference to previously defined solid or an operation on expressions. O<solid> ::= <union> | <intersection> | <complement> | <primitive> | <reference>Ncsg5Used to terminate left branch of binary compositions. 0<uncomposed-solid> ::= <primitive> | <reference>OcsgTop-level object declaration. <tlo> ::= 'tlo' <solid> ';'Pcsg.Read one-line comment starting with hash sign.Qcsg_Read sequence of statements which define solids, and finally read top level object definition. A<geoFile> ::= <statement> <geoFile> | <comment> <geoFile> | <tlo>csgKRead solid definition. If parsing fails, return error message as a string.csgWRead solid definition from a file. If parsing fails, return error message as a string.SafeVSRSTUVWXYZ      !"#$%&'()*+,-./0123()*(45(46(47(48(49(4:(4;(4<(4=(4>(4?(4@(4A(4B(4C(4D(4E(4F(4G(4H(4IJKLMNOPQRSTUVWXYZ[\]^_`!csg-0.1.0.3-8lnaT3TIHO8PUvMQEYVUkData.CSGData.CSG.Parser Paths_csgSolidTrace HitSegmentHitPointRayPointVec3planespherecuboidcylindercylinderFrustumcone coneFrustum intersectunite complementsubtracttracecastinside $fOrdHitPoint$fArbitrarySolid $fEqHitPoint$fShowHitPoint $fEqSolid $fShowSolid parseGeometryparseGeometryFilePlaneSphereCylinderCone#strict-0.3.2-GUMMwuTAWLDDoRWXG04D6ZData.Strict.MaybeNothing*simple-vec3-0.4.0.6-G8FRFRtpO18Baih7SL2mdb Data.Vec3CVec3 infinityP infinityNhitNhitP uniteTracesintersectTracescomplementTracemoveBysolveqData.Vec3.Class><zipWith<+> normalizeoriginfromXYZtoXYZ<->.^.*normdistanceinvertfromRowstoRowsdotMmxvdiagvxvaddMTVec3 CSGParserTableTaddEntrygetEntrytriplevarNamereadNamebinarysolid statementuncomposedSolidtopLevelcommentgeoFileversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName