POV-Ray : Newsgroups : povray.general : Difference object that cant be scaled : Re: Difference object that cant be scaled Server Time
2 Nov 2024 07:27:16 EDT (-0400)
  Re: Difference object that cant be scaled  
From: Francois Labreque
Date: 26 Apr 2004 07:50:58
Message: <408cf7a2@news.povray.org>
Program ended abnormally on 26/04/2004 07:07, Due to a catastrophic lars petter 
error:

> Hi. I've got this difference object:
> 
> difference {   // a cylinder subtracted with another cylinder with smaller
> radius -> a ring
> 
>         cylinder {
>           <5, 0, 5>,
>           <5, 1, 5>,
>           1
>           pigment { rgb <1, 0, 0> }
>         }
> 
>        cylinder {
>           <5, 0, 5>,
>           <5, 1, 5>,
>           0.9
>           open
>        }
>     //scale <2,1,1>   is this the right place to insert the scaling?
> 
> }
> 
> if i try to scale it in x- or z- direction, the object simply fails to show
> in the render. scaling i y-direction however, works fine.
> 
> why is this?
> 
Others have already explained why.

You also have the problem of coincident surfaces as the ends of your first and 
second cylinders are at the same place you should do:

difference {
   cylinder { <0,0,0>, <0,1,0>, 1 }
   cylinder { <0,-1,0>, <0,2,0>, 0.9 }
   scale <2,1,1>
   translate <5,0,5>
   pigment { rgb <1, 0, 0> }
}

This way, you will be certain that you object looks like a tube and does not 
have artifacts at the ends.

Secondly, you put the pigment on your first cylinder only.  This makes the 
second one have the "default" texture (black by default), so the inside of your 
tube would be black, not red.  If you want the whole tube to be red, move the 
pigment to the end of the difference block, like I did above.

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   videotron.ca  */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

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