POV-Ray : Newsgroups : povray.newusers : Smooth the corners in the intersection of two tubes Server Time
3 Jul 2024 02:42:22 EDT (-0400)
  Smooth the corners in the intersection of two tubes (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Smooth the corners in the intersection of two tubes
Date: 7 Feb 2011 15:39:42
Message: <4d50588e@news.povray.org>

> Thanks to all, (Grin) all the information you post here is invaluable...
>
> I went to boxxes trying the same thing and I ran into a snag...
>
>
> // camera position
> camera {
>    //location<5,-15,-20>
>    location<0,0,-30>
>    look_at<0,0,0>
> }
>
>
>
> // light
>    light_source {<15,-15,40>
>    color rgb<1,1,1>    }
>    light_source {<-5,15,-40>
>    color rgb<1,1,1>    }
>
> //horizontal center
>     difference {
> //By using the 'difference' I want to weave the horizonal box underneath the
> verticle box
> //This works well when using 'tubes'
>        box{
>            <  -6.0, -1.0, -1.00>,<  6.0, 1.0, 1.00>
>            //scale<.5,.5,.5>
>            pigment { color rgbf<1,1,1,.0>  }
>        }
>
> //center black out
>        box{
>            <  -1.2, -1.0, -1.00>,<  1.0, 1.0, 1.00>
>            //scale<.5,.5,.5>
>            //rotate<0.0,0.0,0.0>
>            translate<0.1,0.0,0.0>
>        }
>     }
NO pigment = Black (rgb 0)
You have coincident surfaces. Make this box a bit larger as this:
...<  -1.2, -1.0001, -1.0001>,<  1.0, 1.0001, 1.0001>...
You may alternatively scale it:
scale<1, 1.001, 1.001>
>
>
> //verticle center
>        box{
>            <  -1.0, -7.0, -1.00>,<  1.0, 7.0, 1.00>
>            //scale<.5,.5,.5>
>            pigment { color rgbf<1,1,1,.0>  }
>
>        }
> //It works well to this point but if I add any other boxxes...
>
> // if I add these boxes, then I loose the weave effect I had and a blacked out
> box appears.
> // Using tubes, this effect works but when I went to using boxes, I run across
> this problem.
> // I can't seem to find what I am doing wrong
> /*
> //verticle top left
>        box{
>            <  -1.0, -0.0, -1.00>,<  1.0, 6.0, 1.00>
>            //scale<.5,.5,.5>
>            translate<-5,1,0.0>
>            pigment { color rgbf<1,1,1,.0>  }
>         }
This adds another coincident surface.
>
>
> //verticle bottom right
>        box{
>            <  -1.0, -0.0, -1.00>,<  1.0, 6.0, 1.00>
>            //scale<.5,.5,.5>
>            translate<5,1,0.0>
>            pigment { color rgbf<1,1,1,.0>  }
>         }
...and yet another.
>
> */
>
>

Coincident surfaces are a common problem. When you encounter 2 or more 
surfaces at the same location, it's impossible to know whitch one you 
encounter first. This leads to random artefacts caused by the inherent 
rounding error from the FPU.
You must always make sure that, in any intersection/difference, there 
are NO such surfaces. It also causes problems if the surfaces don't have 
the same texture in the case of an union or merge.

Unless you want to actualy have some transparency, it's beter to use 
rgb<red, green, blue> instead of rgbf<red, green, blue, filter> and set 
filter to zero.

It makes your code cleaner.

If all your components share the same pigment, it's beter to apply it to 
the complete CSG object instead of each individual component. This works 
particularly well for solid pigments.
Benefit: you don't get black surfaces in the cut parts.

Also, when you combine several objects in a difference, what you see in 
the cut part is actualy the texture of the cutting object.
Any untextures object use the default texture unless the whole 
difference does have a texture. The default pigment is BLACK.




Alain


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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