POV-Ray : Newsgroups : povray.object-collection : Polyhedra library : Re: Polyhedra library Server Time
20 Jun 2024 17:29:45 EDT (-0400)
  Re: Polyhedra library  
From: Bill Pragnell
Date: 21 Jul 2009 18:35:00
Message: <web.4a66411dcda2f1c22d5649c20@news.povray.org>
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
> consistently.

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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.