![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Now that I have made my wall, I need to cut a few shapes into it (i.e.: for
a door). I have tried the difference statement, but the recursiveness of a
while loop is giving me trouble on one hand, errors on the other. Can you
help me to simply make a hole in the wall?
Thanks a lot.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Parasonic wrote:
>
> Now that I have made my wall, I need to cut a few shapes into it (i.e.: for
> a door). I have tried the difference statement, but the recursiveness of a
> while loop is giving me trouble on one hand, errors on the other. Can you
> help me to simply make a hole in the wall?
Wrap your while loop in a union and difference from that.
Using Peter's example
#declare Box = box { -1, 1 }
#declare Wall =
union{
#declare i=0;
#while (i<5)
object { Box translate 2.1*i*x }
#declare i=i+1;
#end
}
difference {
object {Wall}
box{-1,1}
}
--
Ken Tyler
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sun, 10 Mar 2002 14:50:19 -0800, Ken <tyl### [at] pacbell net> wrote:
>> Now that I have made my wall, I need to cut a few shapes into it (i.e.: for
>> a door). I have tried the difference statement, but the recursiveness of a
>> while loop is giving me trouble on one hand, errors on the other. Can you
>> help me to simply make a hole in the wall?
>
>Wrap your while loop in a union and difference from that.
Ouch! That's slow :(
Better not generate the boxes which you don't need that cut them out
completely. Inside the #while loop, only generate the box #if it fits
some criteria. For example,
...
#if ( !((Row>=0) & (Row<=8) & (Column >=6) & (Column <= 10)) )
box {... whatever...
#end
If your wall has "staggered" stones (as it should), then you should
have a separate check for the left and right end of the door and use a
difference as Ken pointed out (but not the whole union, just the
bricks that you need!)
Hope this helps. I won't spoil more of your fun, learning POV does
include some banging your head against a wall <g>
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <n8lo8u0nlh6h0fc8vnj61h6eh3bgfm1ekt@4ax.com>,
Peter Popov <pet### [at] vip bg> wrote:
> Better not generate the boxes which you don't need that cut them out
> completely. Inside the #while loop, only generate the box #if it fits
> some criteria. For example,
Even better:
If any part of the box will be cut, don't generate that box. Then, go
through again, and make a union of the boxes that will be cut (minus the
ones that will be removed completely)...difference from that.
Alternatively, loop through once, if the block is partially cut use a
difference *for that block*. This uses many differences of single
objects instead of one difference of many objects, only requires one
loop and simpler code, and is probably faster.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Mon, 11 Mar 2002 10:35:39 -0600, Christopher James Huff
<chr### [at] mac com> wrote:
>Alternatively, loop through once, if the block is partially cut use a
>difference *for that block*.
But that's what I meant!
Even better. If the door is a box, don't intersect at all, just
generate the necessary boxes as wide as necessary :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
no one yet suggested to create it as a mesh ?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3c8d30e9@news.povray.org>, "Jan Walzer" <jan### [at] lzer net>
wrote:
> no one yet suggested to create it as a mesh ?
Not very much reason for it...a mesh would be helpful in reducing the
memory requirements of large areas of plain wall (if you don't mind the
repeating), but probably wouldn't be worth the trouble for small
segments with windows and doors cut out.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <a2vp8ukt97hjbfnf0qkatteubd2qn26llh@4ax.com>,
Peter Popov <pet### [at] vip bg> wrote:
> >Alternatively, loop through once, if the block is partially cut use a
> >difference *for that block*.
>
> But that's what I meant!
Sorry, I thought you were talking about not generating blocks that would
be completely removed anyway.
> Even better. If the door is a box, don't intersect at all, just
> generate the necessary boxes as wide as necessary :)
Could take quite a few boxes and be tedious to code if you want to cover
all cases, and probably wouldn't be much faster (a cutout from the very
center of the block would require 6 boxes, an equivalent difference
would only need 2). However, if you only consider the most likely cases
(cutting off one end or cutting off one edge), you could keep it down to
1 or 2 boxes.
Actually, I think I'm making it too hard, trying to imitate the effect
of CSG...bricks usually aren't cut that way, they are just chopped off.
Just use one block that is shortened to fit, maybe with some randomness
to make the edge slightly uneven.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |