POV-Ray : Newsgroups : povray.object-collection : Polyhedra library : Re: Polyhedra library Server Time
25 Apr 2024 23:59:59 EDT (-0400)
  Re: Polyhedra library  
From: Chris B
Date: 22 Jul 2009 04:57:27
Message: <4a66d477@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote in message 
news:web.4a66345af9355cc2d5649c20@news.povray.org...
>I have a question concerning the polyhedra objects I have recently been
> amassing. Silly me, I haven't been creating the include files with the 
> object
> collection in mind, and there are A LOT of include files.
>
> I have organised the polyhedra into groups (Platonic, Archimedean etc). 
> Each
> group has a main include file, which has a list of everything defined in 
> that
> group and another set of includes. Each polyhedron then has its own 
> separate
> include file, which defines three macros and a global vertex array. In 
> this
> way, one can include individual shapes without having to include the whole 
> lot,
> or a whole group without having to manually list the whole lot. I've been
> putting the groups into separate directories for convenience, although 
> this
> needn't be compulsory. The macros and arrays are all prefixed by the shape 
> name
> and an underscore (e.g., tetrahedron_faces(), tetrahedron_edges() etc), 
> and each
> include file is named for this prefix.
>
> My question is, therefore (and eventually!), is this layout sufficient for
> inclusion in the object library? It feels sensible to submit each group as 
> a
> separate item, but the prefixes are per shape-include, not per group. 
> Also, as
> there are so many files per group (92 shapes for the Johnson solids, for
> example) it might be better to submit a .zip file - is this supported by 
> the
> submission system?
>

These objects would be a great addition to the collection.
To answer your technical questions about the site:


File Names:
The upload scripts check that all files start with either the name of the 
submission (e.g. "Polyhedra"), or a prefix that you can define (e.g. 'P'). 
This would mean that a file called 'tetrahedron.inc' would need to be 
renamed 'p_tetrahedron.inc' or 'polyhedra_tetrahedron.inc', otherwise the 
upload screen will raise an error.

SubDirectories:
Web browsers don't allow you to select a folder in the file upload screen 
associated with a file field on a web page (or at least none of the web 
browsers I've ever come across). The submission screen doesn't currently 
provide any functionality to create subfolders within a single entry. OTOH, 
if memory serves me correctly, I coded the server-side code to support 
sub-directories. So if it makes most sense to organize them that way, I can 
probably upload the directory structure for you (I'd need to do some testing 
first to verify that this works ok).

ZIP Files:
The upload scripts don't accept 'zip' files, only files with extensions 
'BMP, CSS, CSV, GIF, HTM, HTML, INC, INI, JPEG, JPG, JS, MAC, MCR, MDL, PGM, 
PNG, POV, PPM, TGA, TIF, TIFF, TXT'. This is intended to reduce the risk of 
harmful content being uploaded.

Identifier Names:
Variable and Macro names are less critical. The scripts do allow you to 
upload files containing non-standard identifiers. The aim of the standards 
is to avoid naming collisions for people using the files. It would therefore 
be preferable to rename them, for example 'P_tetrahedron_faces()'. In any 
case it is a POV-Ray convention to start identifier names with an uppercase 
letter as I believe that names starting with lowercase letters are all 
reserved for future versions of POV-Ray.


If you'd like help renaming files and variables for this impressive 
collection of shapes, then I'd like to offer you my assistance. I'm quite 
adept with editors and editor/OS scripts, so it's likely that I could do 
that quite quickly. Also, if there is a large number of files it can get a 
bit tedious selecting them one by one on the submission screen. I've done 
this with about 30 files in one go and I would say that this is probably 
about the practical limit. I do have access to the file system though, so if 
you need a large number of files uploading for a single entry, I can easily 
do the bulk of that for you.


Best Regards,
Chris B.


Post a reply to this message

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