Library generator (POV-Ray)

by Oyonale
The library macros generate in a random fashion a whole library containing hundreds or thousands of books without having to create and position each one manually. There are 3 macros working together: MakeBook, MakeShelf and MakeLibrary. These macros can also be used independently. For a complete documentation, please refer to each file. Note that these macros were developed for a very specific objective and are therefore not exhaustive in terms of library modeling.The zip file contains also two demo files: library_new.pov creates a library of modern style books while library_old.pov creates a library of old style books.MakeBook macroThe MakeBook macro creates a book of a given size. The books are primarily designed to be placed on a shelf, so that only their back is visible (and sometimes their top). The covers and pages have simplistic textures, and the book cannot be opened.The books exist in 2 flavours: old style and modern style. Old style books have dark colours, a golden trim and round bindings, while modern style books have bright colours and flatter bindings.The titles are chosen randomly in the "titles.txt" file. You can edit this file to add your own titles. The only requirement is that the titles must be between "" and that they are separated by commas.The fonts are chosen randomly in the "fonts.txt" file. You can also edit this file and you'll probably need to if you use an operating system other than Windows, since the "fonts.txt" file contains the full paths and names for the fonts. Note than since these macros are made for POV-Ray 3.1, the positionning of the text is imprecise. Megapov and later versions of POV contain text functions that could be used to improve MakeBook.The patterns for the old books are rather complex, with bands of a main colour separated by bands or dots of gold or of another dark colour.The patterns for the modern books are much simpler, with only two colours in a somehow square pattern.MakeShelf macroThe MakeShelf macro arranges the books on a row of given length. The shelf extends along the x axis and the back of the books face the -z direction. The macro doesn't create the supporting structure (this is done by the MakeLibrary macro).The MakeShelf algorithm creates rows (sets) of books leaning on each other in a particular direction (right or left) and joins the subsequent sets to form an entire shelf. The algorithm makes the book slide on each other in a semi-realistic way.A set may be made of different books, or of the same book repeated several times (series).MakeLibrary macroThe MakeLibrary macro creates a entire library by superposing a variable number of shelves of variable heights.