POV-Ray : Newsgroups : povray.advanced-users : Alternative to CSG Server Time
1 Nov 2024 15:27:30 EDT (-0400)
  Alternative to CSG (Message 1 to 4 of 4)  
From: jkior
Subject: Alternative to CSG
Date: 8 Dec 2001 20:47:19
Message: <1103_1007820242@jkior>
Hello (should this be posted on the newusers group?),
I'm constructing a tunnel out of many small blocks - fairly simple stuff. However, I'd
like to cut a hole in it, for a doorway. Since I'm using while loops, I don't see any
way 
to remove certain blocks, and #difference is *really* slow. Any suggestions on this?
By the way, deleting whole blocks to make the hole is perfectly fine.

Thanks!
Jkior



The image thus far:
<a
href="http://www.spacetowns.com/jkior/tunnel.jpg">http://www.spacetowns.com/jkior/tunnel.jpg</a>


Post a reply to this message

From: Slime
Subject: Re: Alternative to CSG
Date: 9 Dec 2001 01:23:06
Message: <3c13034a$1@news.povray.org>
Make an object that defines the doorway shape that you want to cut out.

Then, before placing any blocks, test to see if the center of them is inside
the doorway object by using the inside() function (look it up in the
documentation). Don't place them if they're inside the object.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]

<jki### [at] zworgcom> wrote in message news:1103_1007820242@jkior...
> Hello (should this be posted on the newusers group?),
> I'm constructing a tunnel out of many small blocks - fairly simple stuff.
However, I'd like to cut a hole in it, for a doorway. Since I'm using while
loops, I don't see any way
> to remove certain blocks, and #difference is *really* slow. Any
suggestions on this? By the way, deleting whole blocks to make the hole is
perfectly fine.
>
> Thanks!
> Jkior
>
>
>
> The image thus far:
> <a
href="http://www.spacetowns.com/jkior/tunnel.jpg">http://www.spacetowns.com/
jkior/tunnel.jpg</a>
>


Post a reply to this message

From: Mike Williams
Subject: Re: Alternative to CSG
Date: 9 Dec 2001 02:15:44
Message: <Eb7m5LA36wE8EwoB@econym.demon.co.uk>
Wasn't it Jkior who wrote:
>Hello (should this be posted on the newusers group?),
>I'm constructing a tunnel out of many small blocks - fairly simple stuff. 
>However, I'd like to cut a hole in it, for a doorway. Since I'm using while 
>loops, I don't see any way 
>to remove certain blocks, and #difference is *really* slow. Any suggestions on 
>this? By the way, deleting whole blocks to make the hole is perfectly fine.

Rather than trying to work out which bricks to delete, it's possible to
make "difference" got very much faster.

Differencing with collections of many small objects will often defeat
POVRay's automatic bounding algorithm. Effectively you end up with POV
having to check every brick for every ray, rather than only those that
bricks that are close to the ray.

I'd suggest that you try converting it from 

difference {
  union {
    lots of {
      individual_brick
    }
  }
  hole
}

to

union {
  lots of {
    difference {
      individual_brick
      hole
    }
  }
}

Which will allow POV to apply sensible automatic bounds around each
brick, and the scene will render in a fraction of the time.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Warp
Subject: Re: Alternative to CSG
Date: 9 Dec 2001 08:22:01
Message: <3c136579@news.povray.org>
Hmm? Wouldn't it just work if you put an #if which checks if the
coordinates of the blocks are inside a certain area, and put the block
only if it's outside this area.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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