POV-Ray : Newsgroups : povray.advanced-users : Enabling relative coordinate placement : Re: Enabling relative coordinate placement Server Time
1 Jul 2024 04:52:34 EDT (-0400)
  Re: Enabling relative coordinate placement  
From: Kene
Date: 21 Sep 2009 01:40:01
Message: <web.4ab710eeba1022f6772dd76f0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "Kene" <nomail@nomail> wrote in message
> news:web.4ab65a2cf8370660772dd76f0@news.povray.org...
> > Hi:
> >
> > I am building a set of macros and hopefully functions that can assist an
> > architect in making a building using POVRay. I understand that I cannot
> > export
> > 2D technical sections of the resulting design but my hopes are that if I
> > can cut
> > 3D sections of the building, then I can wait until POVRay can support the
> > process more.
>
> I've done a few similar things. I used a somewhat different approach some
> time ago, using Inkscape to draw floor plans in the SVG 2D vector graphics
> format. That uses POV-Ray macros to use the prism objects that Inkscape can
> export to create the corresponding buildings. See
> http://www.geocities.com/povstairs/povhouse/ for the sort of things it was
> able to do.
>
> If you prefer to work directly in POV-Ray, you can certainly generate
> cross-sections through a building using CSG (as illustrated in the
> documentation accompanying the site above). For example, you could take a
> thin slice through a union of all the walls, place a flat plane beneath it
> (with a grid pattern drawn on it) and use an orthographic camera to 'draw'
> the floor plan.
>
> > My hitch right now is that I cannot enable relative coordinate placement.
> >
> > It is important to be able to create an object relative to the position of
> > another in architecture.
>
>
> POV-Ray does have some features that make this sort of thing fairly
> straight-forward once you're familiar with the syntax and constructs. I
> wouldn't wish to overstate the ease with which this can be done as it's a
> lot of work, but your post implies that you're looking to invest a fair bit
> of time, so getting a straight-forward standardised approach at the outset
> is probably a good starting point.
>
> One feature that I would consider important is the array syntax which allows
> you to store arrays of objects, text strings, transformations etc. The other
> is the 'transform' syntax which means you can easily store transformations
> and read them back later so that you can accumulate or reverse (inverse)
> them.
>
> With a bit of careful design, you can set up an array to hold the component
> parts of the building, a corresponding array to hold the transformation and
> as many other arrays as you feel you need to index these two main arrays.
> One of the indexing arrays can hold the name of the component, so that, once
> declared, you can use the name of the object to refer to it instead of
> having to remember the indices. This also makes your code more readable.
> You can add other indexing information as you require, for example you could
> add an indicator to show if it's part of the walls, the roof, the floors or
> the furniture (a sort of 'category' classification).
>
> To add a component you would call a macro that increments the array index,
> stores the object, the transformation, the component name and the category
> etc, passed in as parameters. You can create a simple macro to look up any
> previous transformation based upon the component name, so that you can
> position a component relative to any component that's already been declared.
> You can then have a set of macros to draw your chosen image, whether it be a
> 3D perspective image or a 2D plan or section. These macros can decide what
> to include in the image based on the 'category' array, or on any other
> indexing information you choose to implement.
>
> p.s. Once you get to the stage where you're adding detail, you may find the
> StairCase macro on the POV-Ray object collection at
> http://lib.povray.org/collection/staircase/chrisb%202.0/staircase.html
> handy, along with some of the other 'canned' architectural objects (chairs,
> tables etc.). Scroll down to see the staircases fitted inside a more complex
> architectural structure.
>
>
> Regards,
> Chris B.

This is great! Exactly what I was looking for. It sounds like worth the effort
because I wanted to stay with the SDL as much as possible. I will investigate
this instead of creating a new program for now. I am also interested in your
method for floor plans.

I was starting a program that reads a custom SDL and draws simple shapes at the
right location using a split screen of TOP, FRONT and SIDE views as I type. Has
this been done before? I will come back to it later. I think that design is so
much more fun when you can type. Then exports to POVray SDL. Its just like
having a conversation if you know what I mean.

But first I need to get a handle on your idea. Thanks a million!


Post a reply to this message

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