Satimage
Dictionary of ConvexPoly.osax
Home page The dictionaries Dictionary of ConvexPoly.osax  
Convex polyhedron Additions
Convex polyhedron utilities
2D utilities
Convex polyhedron Additions
by François Delyon and Michel Duneau, Ecole Polytechnique, Palaiseau. Version 1.2.

half space n : half-space defined by normal.r ≤ cst

properties

normallist of real : {x, y, z}

cst real

polyhedron n, pl polyhedra : a convex polyhedron is just an Applescript record.

properties

plane listlist of half space : as returned by "convex polyhedron" planes and facets follow the same ordering.

vertex listlist of anything : each element is a list of three real numbers {x, y, z}.

facet listlist of anything : each element in facets is a list of integers containing the index in the vertices list.


convex polyhedron v : build a complete (half-spaces + vertices + facets) convex polyhedron as either convex hull of a list of vertices (using the "with vertices" parameter) or intersection of a list of half-spaces (using the "with planes" parameter)

convex polyhedron [anything] : for experts only: alias or string compliant to the ".ine" format.

[with planes list of half space]

[with vertices list of anything] : a list of points (list of 3 reals) or an array of real of size 3*numbers of points.

[as type class] : "string" returns a ".ine" formatted description. "polyhedron reference" returns a reference to a polyhedron. A "polyhedron reference" can be coerced to a polyhedron and must be released with "delete polyhedron". Default: returns a polyhedron as a record.

→ anything : a complete polyhedron as text, polyhedron or polyhedron reference

delete polyhedron v : delete the polyhedron returned as reference by some other command

delete polyhedron polyhedron reference

platonic polyhedron v

platonic polyhedron integer : 1 cube, 2 octahedron, 3 tetrahedron, 4 icosahedron, 5 dodecahedron

[scale real] : radius of the solid. Default: 100

[origin list of real] : {x,y,z} center of the solid. Default: {0, 0, 0}

[as type class] : see "convex polyhedron".

polyhedron : one of the 5 platonic solids

archimedean polyhedron v

archimedean polyhedron integer : 1 thru 13. The 13 archimedean polyhedra. The result contains the name of the requested polyhedron.

[scale real] : radius of the solid. Default: 100

[origin list of real] : {x,y,z} center of the solid. Default: {0, 0, 0}

[as type class] : see "convex polyhedron".

polyhedron : one of the 13 archimedean solids

catalan polyhedron v

catalan polyhedron integer : 1 thru 13. The 13 catalan polyhedra are in the same order as their archimedean duals and the result contains the name of the requested polyhedron.

[scale real] : radius of the inscribed sphere. Default: 100

[origin list of real] : {x,y,z} center of the solid. Default: {0, 0, 0}

[as type class] : see "convex polyhedron".

polyhedron : one of the 13 catalan solids

intersect polyhedra v

intersect polyhedra list of polyhedron : polyhedra to intersect

[as type class] : see "convex polyhedron".

polyhedron

intersect polyhedron v

intersect polyhedron polyhedron : polyhedron to intersect

with anything : a segment {{x1, y1, z1}, {x2, y2, z2}}.

→ list of anything : a list of points

rotate polyhedron v

rotate polyhedron polyhedron : polyhedron to rotate

axis list of real

[origin list of real] : center of the rotation. Default: {0, 0, 0}

angle real : in radians

[as type class] : see "convex polyhedron".

polyhedron

translate polyhedron v

translate polyhedron polyhedron : polyhedron to rotate

vector list of real : {dx, dy, dz}

[as type class] : see "convex polyhedron".

polyhedron

scale polyhedron v

scale polyhedron polyhedron : polyhedron to scale

scale real

[as type class] : see "convex polyhedron".

polyhedron

Convex polyhedron utilities
a set of utilities for drawing polyhedra.

project2D v : returns a 2d representation of the polyhedron for drawings

project2D anything : point or polyhedron or list of points

eye position list of real : {x, y, z, upx, upy, upz} the position and orientation of the camera looking at (0,0,0)

[hidden boolean] : true: hidden facets requested. Default: false.

[planes boolean] : true: 3d planes requested. Default: false.

→ list of anything : points 2d or {vertices:{list of 2d points}, facets:{list of facets}}if direct object is a polyhedron

intersect2D v : given a polyhedron, a 3D segment and a viewpoint "intersect2D" splits the segment into visible, hidden and inside 2D subsegments.

intersect2D polyhedron

eye position list of real : {x, y, z, upx, upy, upz} the position and orientation of the camera looking at (0,0,0)

with anything : a segment {{x1, y1, z1}, {x2, y2, z2}}

→ list of anything : a list of {vertices: {{x1, y1}, {x2, y2}}, visible: ("visible"|"hidden"|"inside")}

sortpolyhedron v

sortpolyhedron list of polyhedron : list of 2 polyhedra.

eye position list of real : {x, y, z} the position of the camera looking at (0,0,0)

→ list of integer : back to front order with respect to the eyye position.

2D utilities
a set of utilities for drawing polygons.

convexhull2D v : returns the polygon surrounding the given 2D points either as an ordered list of points or as the ordered list of the indices of the points in the incoming array.

convexhull2D list of anything : list of 2d points (or even array of real).

as type class : "integer" to get the ordered list of indices. Default: points.

→ list of anything : ordered list of 2d points or ordered list of indices.

intersectpolygon v : returns the intersection of 2 polygons as an ordered list of points.

intersectpolygon list of anything : list of 2 lists of 2d points.

→ list of anything : ordered list of 2d points.

drawpolyhedron v : draw a polyhedron in a Smile's graphic window

drawpolyhedron polyhedron : or a list of polyhedron

[with properties record] : a record containing eye position

[in window] : a graphic window

→ window