POV-Ray : Newsgroups : povray.advanced-users : Make a Pipe : Re: Make a Pipe Server Time
14 May 2024 14:15:58 EDT (-0400)
  Re: Make a Pipe  
From: Le Forgeron
Date: 30 Jul 2015 01:14:51
Message: <55b9b2cb$1@news.povray.org>
Le 30/07/2015 05:36, bakom a écrit :
> I want to make a pipe with any number of points, say starting point then more
> than one points. These points are having different radiuses i.e. inner radius
> and outer radius. I just make a macro for it with only two points.
>
> #include "functions.inc"
> #include "textures.inc"
> #include "colors.inc"
>
> camera { location  <0, 400, 400> look_at <0, 0, 0> angle 15}
>
> light_source {<10,60,-10> colour rgb 1}
> light_source {<10,60,10> colour rgb 1}
> light_source {<10,-60,-10> colour rgb 1}
> light_source {<-10,-60,10> colour rgb 1}
>
> #macro Pipe(p1, p2, r1, r2, r3, r4)
>    difference
>    {
>      cone {p1, r1, p2, r3 hollow on}
>      cone {p1, r2, p2, r4 } hollow off
>     texture{ pigment{ rgb 0.9}}
>    }
> #end
>
> object{
> Pipe(<0, 0, 0>, <0, 30, 0>, 20, 10, 40, 20)
> hollow on
> }
>
>
> As we know the inner part of pipe is hollow but I'm not able to make this pipe
> hollow. Whats wrong in it?
> Also how I modify this macro so that I can make a long pipe with different
> points i.e. more that two points for it( may be with different radiuses ).
> Waiting for reply.
>

Hollow is related to media, in your situation it is useless so far.

you also have a problem of coincident surface, which might still show 
the cap of the first cone. I would suggest using the "open" modifier on 
the first cone, but then there would be no cap at all for the 
difference. So that's not the solution.

Do you have to "see" the inside ? If not, you should have a look at 
sphere_sweep object (cut with some rotated box at each end, so still a 
difference)

If yes, a difference of sphere_sweep and 2 rotated box (one at each end) 
would be my easy to write solution (it might crawl to render), passing 
the points and radius as either arrays (vector can be 5D, so you are 
fine with a single arrays of vector), or as a spline (but that would be 
with my own derivative of povray or megapov, so as to get access to the 
spline definition points inside the macro)


Post a reply to this message

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