POV-Ray : Newsgroups : povray.newusers : difference object seems not to work Server Time
23 Nov 2024 14:33:24 EST (-0500)
  difference object seems not to work (Message 1 to 2 of 2)  
From: gharryh
Subject: difference object seems not to work
Date: 11 Jun 2013 16:55:01
Message: <web.51b78e4bc63de103520168c30@news.povray.org>
I need to have a disc with some part deleted.
Written these two scenes it should work IHO
[code]
#declare outer_ring =
union   {
    difference  {
        cylinder{<0.00,3.00,0.00><0.00,6.50,0.00>20.00 }
        cylinder{<0.00,2.95,0.00><0.00,6.55,0.00>18.60 }
        box{<0,0,0><-20.00,6.55,20.00> rotate<0.00, 10.00,0.00>}
        box{<0,0,0>< 20.00,6.55,20.00> rotate<0.00,-10.00,0.00>}
    }
}

#declare disq_slid =
union   {
    difference  {
        cylinder{<0.00,3.00,0.00><0.00,6.50,0.00>20.00 }
        cylinder{<-20.00,2.95,0.00><-20.00,6.55,0.00>1.40 rotate<0.00,
10.00,0.00> }
        cylinder{< 20.00,2.95,0.00>< 20.00,6.55,0.00>1.40
rotate<0.00,-10.00,0.00> }
        object{ outer_ring }
    } texture{red_plastic}
}
[/code]
The object{outer_ring} doesnt do anything.
I am cloeless why and how to solve it.


Post a reply to this message

From: Alain
Subject: Re: difference object seems not to work
Date: 11 Jun 2013 19:18:15
Message: <51b7b037$1@news.povray.org>

> I need to have a disc with some part deleted.
> Written these two scenes it should work IHO
> [code]
> #declare outer_ring =
> union   {
>      difference  {
>          cylinder{<0.00,3.00,0.00><0.00,6.50,0.00>20.00 }
>          cylinder{<0.00,2.95,0.00><0.00,6.55,0.00>18.60 }
>          box{<0,0,0><-20.00,6.55,20.00> rotate<0.00, 10.00,0.00>}
>          box{<0,0,0>< 20.00,6.55,20.00> rotate<0.00,-10.00,0.00>}
>      }
> }
>
> #declare disq_slid =
> union   {
>      difference  {
>          cylinder{<0.00,3.00,0.00><0.00,6.50,0.00>20.00 }
>          cylinder{<-20.00,2.95,0.00><-20.00,6.55,0.00>1.40 rotate<0.00,
> 10.00,0.00> }
>          cylinder{< 20.00,2.95,0.00>< 20.00,6.55,0.00>1.40
> rotate<0.00,-10.00,0.00> }
>          object{ outer_ring }
>      } texture{red_plastic}
> }
> [/code]
> The object{outer_ring} doesnt do anything.
> I am cloeless why and how to solve it.
>
>

outer_ring have an outside radius of 20, the same as the base object.
It's top is at 6.5, whitch is the same as the base object.
It's inner radius is 18.6 while the base object only have 2 small holes 
located in the openings of outer_ring.

The end result is that outer_ring is totaly contained within a larger 
object. As they share the same texture, the coincident surface have no 
effect on the final aspect.

If you give it another texture, like texture{pigment{rgb 
1}finish{reflection{0.5 metallic}}}
You'll get some coincident surface artefacts that would have given you 
the hint.

Try making outer_ring very slightly larger with a different texture. You 
can try this:
#declare outer_ring =
     difference  {
         cylinder{<0.00,3.00,0.00><0.00,6.53,0.00>20.10 }
         cylinder{<0.00,2.99,0.00><0.00,6.54,0.00>18.60 }
         box{<0,2.99,0><-20.11,6.54,20.11> rotate<0.00, 10.00,0.00>}
         box{<0,2.99,0>< 20.11,6.54,20.11> rotate<0.00,-10.00,0.00>}
texture{pigment{rgb 0.7}finish{specular 1 roughness 0.0001 metallic 
reflection{0.7 metallic}}   }
}




Alain


Post a reply to this message

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