POV-Ray : Newsgroups : povray.newusers : simple way to flaten a 'tube' Server Time
21 Dec 2024 13:07:33 EST (-0500)
  simple way to flaten a 'tube' (Message 1 to 7 of 7)  
From: NoOneEagle
Subject: simple way to flaten a 'tube'
Date: 30 Nov 2015 09:45:00
Message: <web.565c5fc431fc5fd7ea172afe0@news.povray.org>
Is there a simpler way to flatten a tube, besides using a box with tubes on
either side?


Post a reply to this message

From: NoOneEagle
Subject: Re: simple way to flaten a 'tube'
Date: 30 Nov 2015 10:15:01
Message: <web.565c66dc886987cbea172afe0@news.povray.org>
Actually, I'm fairly new to POV but I have programmed in my past...

In my post I said 'tube' but I meant cylinder and by reading through some
information, I am 'thinking' that maybe using the 'blob component' might lead me
in the direction that I am looking to achieve? Is this the direction I should be
going?


Post a reply to this message

From: Stephen
Subject: Re: simple way to flaten a 'tube'
Date: 30 Nov 2015 10:22:35
Message: <565c69bb$1@news.povray.org>
On 11/30/2015 3:10 PM, NoOneEagle wrote:
>
>
> Actually, I'm fairly new to POV but I have programmed in my past...
>
> In my post I said 'tube' but I meant cylinder and by reading through some
> information, I am 'thinking' that maybe using the 'blob component' might lead me
> in the direction that I am looking to achieve? Is this the direction I should be
> going?
>
>
>
Would changing the scale of one of the "circular" axis give you what you 
want?

-- 

Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: simple way to flaten a 'tube'
Date: 30 Nov 2015 16:43:18
Message: <565cc2f6@news.povray.org>

> 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


Post a reply to this message

From: Bald Eagle
Subject: Re: simple way to flaten a 'tube'
Date: 30 Nov 2015 19:55:00
Message: <web.565ceee3886987cb5e7df57c0@news.povray.org>
Also check out
http://www.f-lohmueller.de/pov_tut/all_shapes/shapes000e.htm
for some ideas about what's already available.
Sometimes these problems have already been worked out in some way.

Keep in mind that if it's a shape that you're likely to use a lot, you can write
a macro and place that in an include file, so that you have a "user-defined
object" that you can use just like all the other POV-Ray objects.


Post a reply to this message

From: NoOneEagle
Subject: Re: simple way to flaten a 'tube'
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

From: NoOneEagle
Subject: Re: simple way to flaten a 'tube'
Date: 1 Dec 2015 09:15:01
Message: <web.565daaac886987cbea172afe0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Also check out
> http://www.f-lohmueller.de/pov_tut/all_shapes/shapes000e.htm
> for some ideas about what's already available.
> Sometimes these problems have already been worked out in some way.
>
> Keep in mind that if it's a shape that you're likely to use a lot, you can write
> a macro and place that in an include file, so that you have a "user-defined
> object" that you can use just like all the other POV-Ray objects.

I'll definitely check out this link. Thanks.


Post a reply to this message

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