POV-Ray : Newsgroups : povray.advanced-users : Intersection of town and floor? Server Time
23 Nov 2024 15:44:16 EST (-0500)
  Intersection of town and floor? (Message 1 to 7 of 7)  
From: Mike Horvath
Subject: Intersection of town and floor?
Date: 12 Aug 2015 23:39:01
Message: <55cc1155$1@news.povray.org>
I have a model of a town I made in LDraw. How do I make it so the floor 
(a checkered plane) only exists where the town doesn't exist along the 
x+z plane? The reason I can't just use a plane is that parts of the town 
(such as the road surface) are slightly beneath the plane, and a plane 
would hide these areas. What should I do?

Thanks!


Mike


Post a reply to this message

From: Le Forgeron
Subject: Re: Intersection of town and floor?
Date: 13 Aug 2015 02:03:15
Message: <55cc3323@news.povray.org>
Le 13/08/2015 05:39, Mike Horvath a écrit :
> I have a model of a town I made in LDraw. How do I make it so the floor
> (a checkered plane) only exists where the town doesn't exist along the
> x+z plane? The reason I can't just use a plane is that parts of the town
> (such as the road surface) are slightly beneath the plane, and a plane
> would hide these areas. What should I do?
>
> Thanks!
>
>
> Mike

Academic answer: use CSG difference on your floor.
Academic problem: twice the memory is used for the town, and render time 
is slowed. (and town must have an interior, and under-floor road should 
extend their interior toward the sky... maybe doubling the path of roads 
with an invisible container... at least for the troublesome sections 
below the ground)

#declare Town = ...
#declare Floor = ...

object { Town }

difference { Floor Town }


Post a reply to this message

From: Mike Horvath
Subject: Re: Intersection of town and floor?
Date: 13 Aug 2015 03:09:32
Message: <55cc42ac$1@news.povray.org>
On 8/13/2015 2:03 AM, Le_Forgeron wrote:
> Academic answer: use CSG difference on your floor.
> Academic problem: twice the memory is used for the town, and render time
> is slowed. (and town must have an interior, and under-floor road should
> extend their interior toward the sky... maybe doubling the path of roads
> with an invisible container... at least for the troublesome sections
> below the ground)
>
> #declare Town = ...
> #declare Floor = ...
>
> object { Town }
>
> difference { Floor Town }
>
>
>

This would slow things down too much. Too bad I can't just difference 
the objects' bounding boxes.


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Intersection of town and floor?
Date: 13 Aug 2015 22:15:01
Message: <web.55cd4ebfa62186ce5e7df57c0@news.povray.org>
> This would slow things down too much. Too bad I can't just difference
> the objects' bounding boxes.
>
>
> Mike

Um, can you pre-make some sort of town with a mesh object, and then use that for
the CSG difference?  Or just a slice of the town encompassing the height where
the road will be?

I haven't ever used meshes or stored objects read in from disk, etc...

I may be thinking about this all wrong, or backwards..... or is that "Keyword:
inverse" ?  :D


Post a reply to this message

From: Mike Horvath
Subject: Re: Intersection of town and floor?
Date: 13 Aug 2015 22:38:52
Message: <55cd54bc$1@news.povray.org>
On 8/13/2015 10:13 PM, Bald Eagle wrote:
>
>> This would slow things down too much. Too bad I can't just difference
>> the objects' bounding boxes.
>>
>>
>> Mike
>
> Um, can you pre-make some sort of town with a mesh object, and then use that for
> the CSG difference?  Or just a slice of the town encompassing the height where
> the road will be?
>
> I haven't ever used meshes or stored objects read in from disk, etc...
>
> I may be thinking about this all wrong, or backwards..... or is that "Keyword:
> inverse" ?  :D
>
>

I'm looking for a method that I can automate. I don't know how I could 
make such a mesh without doing it all by hand.


Mike


Post a reply to this message

From: Alain
Subject: Re: Intersection of town and floor?
Date: 16 Aug 2015 12:57:54
Message: <55d0c112$1@news.povray.org>
Le 15-08-12 23:39, Mike Horvath a écrit :
> I have a model of a town I made in LDraw. How do I make it so the floor
> (a checkered plane) only exists where the town doesn't exist along the
> x+z plane? The reason I can't just use a plane is that parts of the town
> (such as the road surface) are slightly beneath the plane, and a plane
> would hide these areas. What should I do?
>
> Thanks!
>
>
> Mike

If your town is square, use a plane diferienced with a box used as a 
standin for the town:

difference{
  plane{y,0}
  box{<-100,0.1,-100><100,-1,100>} //adjust to the dimentions of the town.
  pigment{checkers}
}

If the town is not square, you can substitute a prism for the box.


Alain


Post a reply to this message

From: Mike Horvath
Subject: Re: Intersection of town and floor?
Date: 17 Aug 2015 14:38:03
Message: <55d22a0b$1@news.povray.org>
On 8/16/2015 12:58 PM, Alain wrote:
> Le 15-08-12 23:39, Mike Horvath a écrit :
>> I have a model of a town I made in LDraw. How do I make it so the floor
>> (a checkered plane) only exists where the town doesn't exist along the
>> x+z plane? The reason I can't just use a plane is that parts of the town
>> (such as the road surface) are slightly beneath the plane, and a plane
>> would hide these areas. What should I do?
>>
>> Thanks!
>>
>>
>> Mike
>
> If your town is square, use a plane diferienced with a box used as a
> standin for the town:
>
> difference{
>   plane{y,0}
>   box{<-100,0.1,-100><100,-1,100>} //adjust to the dimentions of the town.
>   pigment{checkers}
> }
>
> If the town is not square, you can substitute a prism for the box.
>
>
> Alain

I made some modifications, and the town is now rectangular which makes 
things a lot easier. A rectangular box should be sufficient now.


Mike


Post a reply to this message

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