|
PLaSM (short for Programming Language for Solid Modeling) is a geometry-oriented extension of the FL programming language developed by the CAD Group at the Universities "La Sapienza" and "Roma Tre". It is constituted by a translation unit from the FL syntax to a Scheme environment, handling all evaluations, and a geometric library written in C and . The PLaSM language was introduced in two publications, in 1992 on Computer Aided Design, and later described in the ACM Transactions on Graphics. Programming approach to "generative" modeling Geometrical objects generated by language expressions Algebraic calculus over embedded polyhedra Dim-independent approach to geometry repr and algorithms Extended variational geometry (classes of objects with varying topology and shape) Geometry-oriented extension of the functional language FL Validity of geometry syntactically guaranteed Repr. domain broader than in solid modelers (points, wire-frames, surfaces, solids, etc.) PLaSM is a geometry-oriented extension of a subset of FL: it is a functional "design language" strongly influenced by FL can evaluate expressions whose value is a polyhedral complex can produce higher-level functions in the FL style; no free nesting of scopes and environments is allowed; no pattern matching is provided; allows identifiers for any language object. The syntax of PLaSM is very similar to that one of FL. The differences only concern the meaning of few characters and the use of multiple lists of formal parameters of functions. Two new combining forms AC (apply-in-composition) and AS (apply-in-sequence) are introduced, in order to use a function with a number of actual parameters greater than the number used in the function definition. Syntax FL is a pure functional language based on combinational logic. The language introduces an algebra over programs (a set of algebraic identities between functional expressions) for reasoning formally about programs, so that one may find simpler equivalent programs (both at design and at compile times); programs are easily combined, so that new programs are obtained in a simple and elegant way; great advantages in style and efficiency of program development are achieved. Primitive objects Characters, numbers and truth values Expressions Primitive objects, functions, applications and sequences Sequences Expressions separated by commas and contained within a pair of angle brackets: <source lang="text"> <5, fun> </source> Application The application expression <source lang="text"> exp1:exp2 </source> applies the function resulting from the evaluation of <tt>exp1</tt> on the argument resulting from the evaluation of <tt>exp2</tt>. Binary functions can also be used in infix form: <source lang="text"> +:<1,3> = 1+3 = 4 </source> Geometric functions Elementary shape contructors, i.e. geometric primitives: <tt>SIMPLEX</tt>, <tt>CUBOID</tt>, <tt>CYLINDER</tt>, ... <source lang="text"> SIMPLEX:5 = segment of length 5; SIMPLEX:<1,1> = standard triangle of area 1/2!; SIMPLEX:<1,a,1> = standard tetrahedron of volume a/3!; SIMPLEX:<1,a,b,1> = standard 4-simplex of volume ab/4!; CUBOID:5 = segment of length 5; CUBOID:<5,10> = rectangle of area 5×10; CUBOID:<5,10,5> = parallelepiped of volume 5×10×5; CUBOID:<1,1,1,1> = hypercuboid of volume 1; </source> The "Make Polyhedron" constructor <tt>MKPOL</tt> generates polyhedral complexes of different dimension. It is the only basic geometry constructor in PLaSM. It is a mapping from triples of sequences to polyhedral complexes: <source lang="text"> MKPOL:< verts, cells, pols > </source> where * <tt>verts</tt> is a sequence of points; * <tt>cells</tt> is a sequence of convex cells (given as indices of points); * <tt>pols</tt> is a sequence of polyhedra (given as indices of cells). Any cell is defined as the convex hull of its vertices, any polyhedron is defined as the union set of its convex cells. This definition is quite general, and may include (complexes of) polylines, plane and space polygons, 3D polyhedra and higher dimensional geometric objects, both solid and embedded.
|
|
|