|
![](/i/fill.gif) |
Remco de Korte wrote:
> /*
> There's something weird with the following code:
> */
>
> camera{location <0,0,-13.5> look_at<0,0,0> angle 30}
>
> light_source{<-200,100,-150> color rgb <1,1,1>.1}
>
> plane{z,600 hollow on pigment{rgb .25}}
>
> #declare xx=1.9;
> #declare yy=.5;
>
> merge{
> sphere{<-xx,-yy,0>,.1}
> sphere{<xx,-yy,0>,.1}
> sphere{<-xx,yy,0>,.1}
> sphere{<xx,yy,0>,.1}
> cylinder{<-xx,-yy,0><xx,-yy,0>,.1}
> cylinder{<-xx,yy,0><xx,yy,0>,.1}
> cylinder{<-xx,-yy,0><-xx,yy,0>,.1}
> cylinder{<xx,-yy,0><xx,yy,0>,.1}
>
> cylinder{<-xx,-yy,0><-xx,-yy,5>,.1}
> cylinder{<xx,-yy,0><xx,-yy,5>,.1}
> cylinder{<-xx,yy,0><-xx,yy,5>,.1}
> cylinder{<xx,yy,0><xx,yy,5>,.1}
>
> box{<-xx,-yy-.1,0><xx,yy+.1,5>}
> box{<-xx-.1,-yy,0><xx+.1,yy,5>}
> pigment{rgb 5}
> }
>
> /*
> What you should get is a bevelled box.
> If I make this into a union it's okay,
> but with merge the inner part is gone.
>
> Is this some known weird merge-behaviour
> or am I making a stupid mistake?
> (I thought union and merge should look
> the same on the outside)
>
> Cheerio,
>
> Remco
You have coincident surfaces. Use this code instead:
merge {
sphere{<-xx,-yy,0>,.1}
sphere{<xx,-yy,0>,.1}
sphere{<-xx,yy,0>,.1}
sphere{<xx,yy,0>,.1}
cylinder{<-xx,-yy,0><xx,-yy,0>,.1}
cylinder{<-xx,yy,0><xx,yy,0>,.1}
cylinder{<-xx,-yy,0><-xx,yy,0>,.1}
cylinder{<xx,-yy,0><xx,yy,0>,.1}
cylinder{<-xx,-yy,0><-xx,-yy,5>,.1}
cylinder{<xx,-yy,0><xx,-yy,5>,.1}
cylinder{<-xx,yy,0><-xx,yy,5>,.1}
cylinder{<xx,yy,0><xx,yy,5>,.1}
box{<-xx,-yy-.1,0.00001><xx,yy+.1,5>}
box{<-xx-.1,-yy,0><xx+.1,yy,5>}
}
Post a reply to this message
|
![](/i/fill.gif) |