POV-Ray : Newsgroups : povray.newusers : simple way to flaten a 'tube' : Re: simple way to flaten a 'tube' Server Time
20 Apr 2024 06:13:34 EDT (-0400)
  Re: simple way to flaten a 'tube'  
From: NoOneEagle
Date: 1 Dec 2015 09:15:00
Message: <web.565daa06886987cbea172afe0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> > Is there a simpler way to flatten a tube, besides using a box with tubes on
> > either side?
> >
> >
> If "tube" = a cylinder, then:
>
> cylinder{30*x, -30*x, 5 scale <1, 0.5, 1>}
> Will give you an elliptic cylinder that is half as high as it is whide.
>
> But, if you want it to have flat faces, then, you need to use an union
> as follow:
>
> union{
>  box{<Left, Top, Front><Right, Bottom, Back>}
>  cylinder{<Left, (Top+Bottom)/2, Front><Left, (Top+Bottom)/2, Back>,
> (Top+Bottom)/2}
>   cylinder{<Right, (Top+Bottom)/2, Front><Right, (Top+Bottom)/2, Back>,
> (Top+Bottom)/2}
> }
>
> If that is to be transparent, replace "union" by "merge" to remove the
> internal surfaces.
>
> If you are OK with having hard edges and rounded parts that don't make a
> half circle, then, you can do this:
> intersection{
>  cylinder{<0, 0, Front><0,0, Back>, Radius}
>  box{<-Radius, 1, Front+0.0001><Radius, -1, Back-0.0001>}
> }
>
> The box is made very slightly larger to prevent coincident surfaces and
> the artefacts they cause.
>
>
>
> Alain

Yes, the 'scale' function is exactly what I needed to know about. Thank you
Alain.
 Later, I might try the union to try to 'inlay' some features in the flattened
'faces' on the surface...

This should keep me busy for awhile until I advance to the next part of my
project and that being that I want a raised ball with a design 'indented' into
the face of the ball but that seems like a more advanced thing that I'll take on
at a later date...

Thanks again.


Post a reply to this message

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