operations

general-purpose geometric operators, most of which do work on the internal representation of  a polyhedral complex as a triple of vertices, convex and polyhedral cells. Examples include the optimize operator used to compress the representation by putting all vertices in world cooordinates, and the explode operator used to get  a view of the parts of an assembly

  • Depth sort returns a depth-sort ordering of the 2-faces of a polyhedral scene
    Pre/Post conds (scene::ispol) => (isseqof:ispol)
    Example (depth sort ~ @2 ~ r:< 1,2>:(pi/6) ~ cuboid):< 1,1,1>

  • Depth test is the Newell s binary predicate used to compare two 2-faces
    Pre/Post conds (a,b::and ~ [ispol,c:eq:< 2,3> ~ [dim,rn]]) => (isbool)
    Example (depth test ~ [t:3:1, id] ~ embed:1 ~ simplex):2

  • Explode 3D “explosion†operator of the scene parameter
    Pre/Post conds (sx,sy,sz::isreal) (scene::isseqof:ispol) => (isseqof:ispol)
    Example def hole = ((id - s:< 1,2>:< 0.5,0.5>) ~ mxmy ~ cuboid):< 2,2,2>;
    (struct ~ explode:< 1,1,1.5> ~ extract polygons):hole

  • Extract_bodies returns the 3D cells from the scene parameter
    Pre/Post conds (scene::and ~ [ispol,ge:3 ~ dim]) => (isseqof:ispol)
    Example extract_bodies:(q:< 1,-1,1,-1,1> * q:1 * q:10)

  • Extract_polygons returns the 2D cells from the scene parameter
    Pre/Post conds (scene::and ~ [ispol,ge:2 ~ dim]) => (isseqof:ispol)
    Example extract_polygons:(q:< 1,-1,1,-1,1> * q:1 * q:10)

  • Extract_wires returns the 1D cells from the scene parameter
    Pre/Post conds (scene::and ~ [ispol,ge:1 ~ dim]) => (isseqof:ispol)
    Example extract_wires:(q:< 1,-1,1,-1,1> * q:1 * q:10)

  • Extrude with h displacement, the n-th convex cell in a pol complex
    Pre/Post conds (n::isintpos; pol::ispol; h::isrealpos) => (ispol)
    Example extrude:< 2,q:< 1,-1,1,-1,1> * q:1,10>

  • Extrusion generalized operator, with h steps and alpha angle, of pol parameter
    Pre/Post conds (alpha::isreal)(h::isint)(pol::ispol) => (ispol)
    Example extrusion:(pi/18):1:(q:1 * q:1)

  • Ex right extrusion, with x2 - x1 height and x1 starting
    Pre/Post conds (x1,x2::isreal)(pol::ispol) => (ispol)
    Example ex:< 0.5,1>:(q:1 * q:1)

  • Lex linear extrusion, with x2 - x1 height and shearing, and x1 starting
    Pre/Post conds (x1,x2::isreal)(pol::ispol) => (ispol)
    Example lex:< 0.5,1>:(q:1 * q:1)

  • Lxmy left x, middle y alignment operator. Moves the origin of the local frame
    Pre/Post conds (ispol) => (ispol)
    Example lxmy:(cuboid:< 5,5>)

  • Mirror returns the obj parameter reflected on the d-th coordinate direction
    Pre/Post conds (d::isintpos)(obj::ispol) => (ispol)
    Example (@1 ~ struct ~ [id, mirror:1] ~ simplex):2

  • Minkowski sum of p complex with the zonotope defined by vects sequence
    Pre/Post conds (vects::isseqof:isvect)(p::ispol) => (ispol)
    Example minkowski:< < -1/2, SQRT:2/-2>,< -1/2, SQRT:2/2>,< 1, 0>>:
    ((@1 ~ cuboid):< 5,5>)

  • Multextrude a polyhedral complex, by associating the facets of p with the h heights
    Pre/Post conds (p::ispol) (h::isseqof:isreal) => (ispol)
    Example multextrude:(q:< 1,-1,1,-1,1> * q:1):< 1.0,2.0,3.0>

  • Mxby middle x, bottom y alignment operator. Moves the origin of the local frame
    Pre/Post conds (ispol) => (ispol)
    Example mxby:(cuboid:< 5,5>)

  • Mxmy middle x, middle y alignment operator. Moves the origin of the local frame
    Pre/Post conds (ispol) => (ispol)
    Example mxmy:(cuboid:< 5,5>)

  • Mxty middle x, top y alignment operator. Moves the origin of the local frame
    Pre/Post conds (ispol) => (ispol)
    Example mxty:(cuboid:< 5,5>)

  • Offset geometric operator. Implemented as the composition of suitable extrusions, followed by projection
    Pre/Post conds (v::isvect)(pol::ispol) => (ispol)
    Example offSet:< 0.1,0.2,0.1>:((@1 ~ cuboid):< 1,1,1>)

  • Optimize is used to flatten the internal hpc data structure. The annotations of
    parts with properties are lost. Alias for mkpol ~ ukpol
    Pre/Post conds (ispol) => (ispol)
    Example (optimize ~ struct ~ [id, t:1:1, t:2:1]):(simplex:2)

  • Planemapping plane mapping through three points p0, p1 and p2
    Pre/Post conds (p0,p1,p2::ispoint) => (ispol)
    Example map:(planemapping:< < 0,0,0>,< 1,0,0>,< 1,1,1>>):(cuboid:< 1,1>)

  • Polar generator of the polar set of a n-dimensional convex
    Pre/Post conds (ispol) => (ispol)
    Example (polar ~ simplex):4 == polcomplex< 4,4>

  • Presort executes the preliminary z-ordering when depth-sorting a polygon sequence
    Pre/Post conds (pols::isseqof:(c:eq:< 2,3> ~ [dim,rn])) => (isseqof:ispol)
    Example (presort ~ [t:3:1, id] ~ embed:1 ~ simplex):2

  • Project projection operator, that removes the last m coordinates of pol
    Pre/Post conds (m::isintpos)(pol::ispol) => (ispol)
    Example (Project:1 ~ @1 ~ R:< 1,4>:(PI/6) ~ R:< 1,3>:(PI/7)):
    (cuboid:< 1,1,1,1>);

  • Rxmy right x, middle y alignment operator. Moves the origin of the local frame
    Pre/Post conds (ispol) => (ispol)
    Example rxmy:(cuboid:< 5,5>)

  • Schlegel2d returns 2D Schlegel diagrams of 3-polytopes, projected from (0, 0, d)
    Pre/Post conds (d::isreal)(pol::ispol) => (ispol)
    Example (@1 ~ schlegel2D:0.2 ~ T:3:2.5 ~ CUBOID):< 1,1,1>

  • Schlegel3d returns 3D Schlegel diagrams of 4-polytopes, projected from (0, 0, 0, d)
    Pre/Post conds (d::isreal)(pol::ispol) => (ispol)
    Example (schlegel3d:0.2 ~ @1 ~ t:< 1,2,3,4>:< -1,-1,-1,1> ~ cuboid):< 2,2,2,2>

  • Sex screw extrusion of pol, with h steps, x2 - x1 total angle, and x1 starting angle
    Pre/Post conds (x1,x2::isreal)(h::isintpos)(pol::ispol) => (ispol)
    Example sex:< 0,pi>:12:(q:1 * q:1)

  • Solidify mapping boundary to interior; multidimensional operator
    Pre/Post conds (and ~ [ispol, c:eq:1 ~ (rn - dim)]) => (ispol)
    Example Solidify ~ STRUCT ~ AA:polyline

  • Splitcells extracts the convex d-cells of the d-dimensional scene
    Pre/Post conds (scene::ispol) => (isseqof:ispol)
    Example (struct ~ explode:< 1,1,1.5> ~ splitcells ~ @2):hole

  • Splitpols extracts the polyhedral d-cells of the d-dimensional scene
    Pre/Post conds (scene::ispol) => (isseqof:ispol)
    Example (struct ~ explode:< 1.5,1.5,1.5> ~ splitpols ~ @2):hole

  • Sweep returns the point set swept by pol when moved by a v displacement
    Pre/Post conds (v::isvect)(pol::ispol) => (ispol)
    Example sweep:< 10,0>:(circle:1:< 24,1>)

PLaSM is Free Software and may be distributed under GNU LGPL