Warp <war### [at] tagpovrayorg> wrote:
> IMO you should group the objects into a smaller amount of include files
> rather than having every single one in its own file (unless the files are
> very large, which I think is not the case with such simple objects).
Many of them are very simple, but the larger ones can be quite complex. Each
include file contains the vertices in a global array (for the advanced user)
and three macros for instantiating the shape; most of the stellar icosahedra
includes are 1200+ lines.
> Just group all the
> polyhedra into logical categories, and create one include file for each
> such category. Then maybe an include file which just includes all those
> separate include files.
That'll probably work. There are some logical sub-groups in the Johnsons, but
the stellar icosahedra don't really have any sub-groups. If I put them all
together it could be several MB for the include... not too bad compared to a
big converted mesh2 I suppose.
> Also, if you haven't done so, I think all the polyhedra should be scaled
> to fit the same space, for consistency. For example, they could be scaled
> so that they all fit perfectly inside a box from <-1, -1, -1> to <1, 1, 1>.
> This way it's easy for the user to scale any polyhedron to the size he needs.
I can add this with no problems, I think. Most of them are already approximately
scaled like this anyway.
> 1) #define each polyhedron as its own identifier, named logically and
I have three macros per shape. Faces (taking texture identifiers for polygon
types by number of sides), faces (no textures) and edges (textures and radii
for the edge cylinders and vertex spheres). Each macro also takes a yes/no for
sitting the shape on the x-z plane (it is centred on the origin otherwise). I
thought I could leave it to the user to combine faces and edges for themselves.
> 2) For each category, create an array with all the polyhedra of that
> category, ordered in some logical way.
This is something I already thought of - invaluable for rendering them in
groups, as I have been doing.
What about the prefixes though? Even if I put them together in one file, there's
a lot of renaming to do for perfect library standards compliance...!
Post a reply to this message