PLaSM

functional language for computing with geometry

shapes

the library collects the generators of 1D, 2D, 3D geometric objects, as well the generators of poluhedral objects of higher dimensions, including the  Sierpinski simplex of any dimension, the n-dimensioonal sphere, the n-dimensional permutahedron, and so on

  • Circle returns on approx. with m×n quads/triangles of the 2D circle of r radius
    Pre/Post conds (r::isreal)(m,n::isintpos) => (ispol)
    Example circle:1:< 24,1>

  • Circumference approx. with m segments of the 2D circle boundary of unit radius
    Pre/Post conds (m::isintpos) => (ispol)
    Example circumference:36

  • Cone approx. with m facets of the 3D cone with r radius and h height
    Pre/Post conds (r, h::isreal)(n::isint) => (ispol)
    Example Cone:< 1,2>:24

  • Convexhull multidimensional operator returning the convex hull of points â‚ IEd
    Pre/Post conds (points::ismat) => (ispol)
    Example convexhull:< < 0,0,0,0>,< 1,0,0,0>,< 0,1,0,0>,< 0,0,1,0>,< 0,0,0,1>>

  • Crosspolytope returns the d-dimensional crossPolytope
    Pre/Post conds (d::isintpos) => (ispol)
    Example crossPolytope:3

  • Cube generator of the 3D hexahedron of given side, with a vertex on the origin
    Pre/Post conds (side::isrealpos) => (ispol)
    Example mxmy:(cube:2)

  • Dsphere generator of d-sphere of unit radius, with boundary facets of Ï€/m resolution
    Pre/Post conds (d::isnat)(m::isintpos) => (ispol)
    Example dsphere:3:24 material transparentmaterial:< red,0.7>

  • Dodecahedron constant value inscribed in the unit sphere
    Pre/Post conds => (ispol)
    Example VRML:dodecahedron: path/out.wrl

  • Ellipse approx. with 4 × m segments of the ellipse boundary of a,b radiuses
    Pre/Post conds (a,b::isreal)(m::isintpos) => (ispol)
    Example ellipse:< 1/2,1>:8 * quote:< 1/2>

  • Finitecone d-dimensional cone with given basis and apex in (0, . . . , 0) ∈ IEd
    Pre/Post conds (basis::ispol) => (ispol)
    Example finitecone:((t:< 1,2,3>:< 1,2,3> ~ cuboid):< 1,1,1>)

  • Fractalsimplex generator of recursive d-simplex with n levels
    Pre/Post conds (d::isintpos)(n::isintpos) => (ispol)
    Example fractalsimplex:3:5

  • Hexahedron constant value. 3D cube inscribed in the standard unit sphere
    Pre/Post conds => (ispol)
    Example VRML:hexahedron: path/out.wrl

  • Icosahedron constant value. 3D icosahedron inscribed in the standard unit sphere
    Pre/Post conds => (ispol)
    Example VRML:icosahedron: path/out.wrl

  • Intervals constructor of a uniform partition of 1D interval [0, a] with m segments
    Pre/Post conds (a::isrealpos)(m::isintpos)
    => (and ~ [ispol,c:eq:< 1,1> ~ [dim,rn]])
    Example intervals:(2*pi):24

  • Ispolytope predicate testing if arg is a polytope (bounded polyhedron) or not
    Pre/Post conds (arg::ispol) => (isbool)
    Example ispolytope:(cuboid:< 1,1,1,1>) == true

  • Issimplex predicate testing if arg is either a simplex or not
    Pre/Post conds (arg::ispol) => (isbool)
    Example issimplex:(simplex:3) == true

  • Mkframe constant geometric value, returning a model of the 3D reference frame
    Pre/Post conds => (ispol)
    Example struct:< mkframe, cuboid:< 1,1,1>>

  • Mkvector constructor of a 3D model of vector p2 - p1, with p1,p2 ∈ IE3
    Pre/Post conds (p1::ispoint)(p2::ispoint) => (ispol)
    Example mkvector:< 1,0,0>:< 1,1,1>

  • Mkversork constant geometric value. Returns a 3D model of unit vector e3 ∈ IE3
    Pre/Post conds => (ispol)
    Example struct:< mkversork, cuboid:< 1,1,1>>

  • Ngon constructor of 2D regular polygons with n sides
    Pre/Post conds (n::and ~ [isintpos, ge:3]) => (ispol)
    Example (struct ~ cat):(aa:ngon:(3..8) distr t:1:2.5)

  • Octahedron constant value. 3D Octahedron inscribed in the standard unit sphere
    Pre/Post conds => (ispol)
    Example VRML:octahedron: path/out.wrl

  • Permutahedron generator of the d-dimensional permutahedron
    Pre/Post conds (d::isintpos) => (ispol)
    Example permutahedron:3

  • Plane generator of the 2-flat passing through 3 points in IE3
    Pre/Post conds (point0, point1, point2::ispoint) => (ispol)
    Example (s3 ~ plane):< < 0,0,0>,< 1,0,0>,< 1,1,1>>

  • Prism generator of the (d + 1)-prism with given height and d-dimensional basis
    Pre/Post conds (height::isrealpos)(basis::ispol) => (ispol)
    Example prism:1:(crosspolytope:2)

  • Pyramid complex of (d+1)-pyramids of h height, associated with the basis d-cells
    Pre/Post conds (h::isreal)(basis::ispol) => (ispol)
    Example (struct ~ aa:(pyramid:1) ~ splitcells): (q:< 3,3,3>*q:< 3,3,3>)

  • Ring difference of 2D circles with radiuses r1, r2, approximated with m×n steps
    Pre/Post conds (r1,r2::isrealpos)(m,n::isintpos) => (ispol)
    Example (@1 ~ Ring:< 0.5,1>):< 24,2>

  • Segment scaled segment through two d-points a and b, with coeffi cient sx
    Pre/Post conds (sx::isreal)(a,b::ispoint) => (ispol)
    Example segment:2:< < 0,0,0>,< 1,1,1>>

  • Simplexpile extrusion operator for the d-simplex
    Pre/Post conds (cell::issimplex) => (ispol)
    Example (struct ~ [@1 ~ simplexpile, id] ~ simplex):2

  • Sphere generator of 3D sphere of r radius, approximated with m×n facets
    Pre/Post conds (r::isrealpos)(m,n::isintpos) => (ispol)
    Example Sphere:1:< 12,24>

  • Tetrahedron constant value. 3D regular tetrahedron, inscribed in the unit sphere
    Pre/Post conds => (ispol)
    Example VRML:tetrahedron: path/out.wrl

  • Torus generator of 3D torus with radiuses r1,r2, approximated with m×n facets
    Pre/Post conds (r1,r2::isreal) (n,m::isintpos) => (ispol)
    Example torus:< 1,3>:< 12,24> == PolComplex< 2,3>

  • Truncone 3D truncated cone, with h height, r1,r2 radiuses and n lateral facets
    Pre/Post conds (r1,r2,h::isrealpos)(n::isintpos) => (ispol)
    Example truncone:< 2,1,2>:24

  • Tube 3D empty tube with h height, r1,r2 radiuses and 2 × n lateral facets
    Pre/Post conds (r1,r2,h::isreal)(n::isint) => (ispol)
    Example tube:< 0.8,1,2>:24

PLaSM is Free Software and may be distributed under GNU GPL