Up    Next

pol_recip - polar reciprocals (duals)

Usage    |    Examples    |    Notes

Usage

Synopsis

pol_recip [options] [input_file]

Description

Read a file in OFF format and make a polar reciprocal from the face planes.

Options

input_file
input file in OFF format, or if not given the program reads from stdin

-h
program help

-c <cent>
reciprocation centre (default: E)

-C <init>
initial value for a centre calculation, in form 'X,Y,Z', or C to use centroid (default), M to calculate approx mid-sphere

-r <rad>
reciprocation radius (default: calculated) or a comma separated list of vertex indices (starting from 0) and the distance is to the space containing those vertices

-R <rad>
initial value for a radius calculation (default: calculated)

-I <dist>
maximum distance to project any normal or infinite dual vertex (default: 1e15), if 0 then use actual distances and delete infinite points

-n <iters>
maximum number of iterations used in calculation default values for reciprocation sphere (default: 100000)

-l <lim>
minimum distance change to terminate calculation of default values for reciprocation sphere, as negative exponent 1e-lim (default: 13 giving 1e-13)

-o <file>
write output to file, if this option is not used the program writes to standard output

Examples

Make a reciprocal pair. Make the dual of a cuboctahedron, a rhombic dodecahedron, and then make the dual of that. The final output is the same as the original cuboctahedron.
   pol_recip -o rh_dodec.off cuboct.off
pol_recip -o orig_cuboct.off rh_dodec.off
Make a cube whose vertices are the mid-points of an octahedron's faces
   pol_recip -o cube.off -R f octahedron.off
A polyhedron has a face made of vertices with indexes 0, 2, 4. Make a dual which has a vertex in the plane of this face
   pol_recip -o dual.off -R 0,2,4 poly.off

Notes

A dual of a convex polyhedron is normally made with the centre of reciprocation at the polyhedron centre and the radius to just touch the edges.

Some polyhedra have faces passing through their natural centre. This causes a problem when making a dual because the vertex which is dual to this face should be infinitely far away. pol_recip allows these vertices to be included by placing them at a specified (probably very large) distance normal to the face. Any programs dealing with these distant vertices (e.g. povray) can interpret these distant vertices accordingly.

The default reciprocation centre and radius are found by the following algorithm. It aims to find a reciprocation sphere that is balanced, in the sense that the polyhedron and its dual have the same relationship with the sphere.

   centre = centroid of vertices of base polyhedron
   radius = average distance from centre to edges
   LOOP:
      dual = polar reciprocal of base, using centre and radius
      
      invert dual in centre point

      edge_centroid    = centroid of the nearest points to the centre
                         on the base's edges and duals edges
      radius_sum_base  = sum of distances from the centre to the nearest
                         point to the centre on the base's edges
      radius_sum_dual  = sum of distances from the centre to the nearest
                         point to the centre on the dual's edges

      if loop count is even:
         centre = 0.9*centre + 0.1*edge_centroid
      if loop count is odd:
         radius = radius * sqrt(rad_sum_g/rad_sum_d)

      finish loop if change in centre and radius are small enough

The aim is that this will be a similar reciprocation method. That is to say

The default method above tends to reciprocate in the midsphere, if it exists.

The other available balanced reciprocation methods use the centroid of combined face near-points and vertex offsets, or the centroid of the near-points of all three elements combined. For all three cases the dual may be inverted in the reciprocation centre before the centroid calculation.

-R e may select a sphere suitable for self-duality.

-R v and -R V may always give the same results.

Up: Programs and Documentation
Next: geodesic - geodesic spheres

Antiprism Documentation 21.8.2007 - http://www.antiprism.com/