POV-Ray : Newsgroups : povray.newusers : extrude ? Server Time
14 Nov 2024 00:19:15 EST (-0500)
  extrude ? (Message 1 to 5 of 5)  
From: christof schuler
Subject: extrude ?
Date: 23 Oct 1999 08:57:10
Message: <3811B061.A0E75155@t-online.de>
Hy, 
I have some hundreds of points along a special curve. Now I want to
connect each after another with cylinders so that you have the
impression of a tube.
I tried cylinders (closed and open) from one to the next point but that
didn't look good because you saw the caps. The next possibility I
thought are prisms, but here you also can extrude only "linear" (and not
cubic) from one point to the next. 
Is there a tool do extrude a circle or any other 2d-shape along a
spline  or along a set of points 

Thank you


Post a reply to this message

From: Chris Huff
Subject: Re: extrude ?
Date: 23 Oct 1999 09:05:17
Message: <3811B318.1B36CC61@yahoo.com>
Well, you got most of the way there with the cylinders, to make the
joints smooth just place a sphere of the same radius as the cylinders at
each point.
Alternatively, you could use the Superpatch, which has a sphere_sweep
object that does the same thing, but can also sweep across a curved path
instead of just a linear one.


Post a reply to this message

From: Ken
Subject: Re: extrude ?
Date: 23 Oct 1999 10:19:46
Message: <3811C37C.18E6EA0E@pacbell.net>
"christof.schuler" wrote:
> 
> Hy,
> I have some hundreds of points along a special curve. Now I want to
> connect each after another with cylinders so that you have the
> impression of a tube.
> I tried cylinders (closed and open) from one to the next point but that
> didn't look good because you saw the caps. The next possibility I
> thought are prisms, but here you also can extrude only "linear" (and not
> cubic) from one point to the next.
> Is there a tool do extrude a circle or any other 2d-shape along a
> spline  or along a set of points
> 
> Thank you

  Try this simple macro by John VanSickle. In your case where you already
have a set of point values you could store them in an array and pass them
to both the location of the spheres and the end points of the cones used
by the macro to connect the spheres locations. It's a little complicated
so I have provided a full example for you to study.


/*

By: John VanSickle

    This macro creates a cone object which will smoothly connect two spheres. An
example:

object {
  Connect(y*4,2,y*9,3)
  texture { MyTexture }
}

This macro does not generate the spheres at each point, just the cone that
connects them.    

*/


// the connect macro
#macro Connect(SP,SR,EP,ER)
  #local D=vlength(EP-SP);
  #local Rd=SR-ER;
  #local D2=sqrt(D*D-Rd*Rd);
  cone { SP+(EP-SP)/D*Rd*(SR)/D,(SR)*D2/D,EP+(EP-SP)/D*Rd*(ER)/D,(ER)*D2/D }
#end

// example of storing your points in an array

#declare Points = 9;
#declare Spline =
array [Points][3] {
{-2.0,  1,  1},
{-1.0,  2, -1},
{ 1.0,  2,  1},
{ 2.0,  1, -1},
{ 2.0, -1,  1},
{ 1.0, -2, -1},
{-1.0, -2,  1},
{-2.0, -1, -1},
{-2.0,  1,  1},
}


// place the spheres with a while loop

#declare Joints =
union{
  #declare a=0;
   #while (a < Points)
    sphere {<Spline[a][0],Spline[a][1], Spline[a][2]>, .5 }
  #declare a = a + 1;
 #end }

// connect the spheres using the macro and a while loop

#declare Links =
 union {
  #declare ab = 0;
   #while (ab < Points-1)
     Connect (
               <Spline[ab  ][0], Spline[ab  ][1], Spline[ab  ][2]>, .5,
               <Spline[ab+1][0], Spline[ab+1][1], Spline[ab+1][2]>, .5 
             )
   #declare ab = ab + 1;
  #end
 }

#declare Your_Object =
 union {
         object  { Joints }
         object  { Links  }
         pigment { rgb 1  }
       }

object { Your_Object }


 camera { location<0,0,-8> look_at 0}
 light_source {<0,0,-300> rgb 1}


-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ken
Subject: Re: extrude ?
Date: 23 Oct 1999 17:55:44
Message: <38122E54.95CCCC24@pacbell.net>
"christof.schuler" wrote:
> 
> Hy,
> I have some hundreds of points along a special curve. Now I want to
> connect each after another with cylinders so that you have the
> impression of a tube.
> I tried cylinders (closed and open) from one to the next point but that
> didn't look good because you saw the caps. The next possibility I
> thought are prisms, but here you also can extrude only "linear" (and not
> cubic) from one point to the next.
> Is there a tool do extrude a circle or any other 2d-shape along a
> spline  or along a set of points
> 
> Thank you

You may also wish to try out Ron Parkers Torus Spline include file. It
does a pretty good job of connecting points smoothly.

http://www2.fwi.com/~parkerr/traces.html

-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: christof schuler
Subject: Re: extrude ?
Date: 26 Oct 1999 13:42:42
Message: <3815E7CC.819661E4@t-online.de>
Hy Ken,
thank you for the solution of my problem. The way with cylinders and
spheres is ok. The other possibility (torus) is not good, because my
diameter(cylinder)>>high(cylinder). The centerline seems to make a
"wave" as a result of the "toroidal problem" and as a result the
torus-part intersects itself.

Nevertheless: thanks a lot

christof


Post a reply to this message

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