POV-Ray : Newsgroups : povray.newusers : prism along a curve Server Time
12 Nov 2024 19:17:12 EST (-0500)
  prism along a curve (Message 1 to 8 of 8)  
From: John Bradshaw
Subject: prism along a curve
Date: 22 Oct 2001 18:07:53
Message: <3bd498b9@news.povray.org>
Does anyone know of a way to make a prism-type object along a spline instead
of along the z axis. In other words, how do you sweep a closed spline along
another spline?

John


Post a reply to this message

From: Mike Williams
Subject: Re: prism along a curve
Date: 23 Oct 2001 00:50:12
Message: <Ud3eKAAMYP17EwOW@econym.demon.co.uk>
Wasn't it John Bradshaw who wrote:
>Does anyone know of a way to make a prism-type object along a spline instead
>of along the z axis. In other words, how do you sweep a closed spline along
>another spline?

In 3.5 it might be possible to use a variation of the technique I use at
<http://www.econym.demon.co.uk/isotut/more.htm>.

The third image on that page shows an open spline being swept along
another open spline, and the bottom image shows a circle being swept
along a closed spline. Combining the two effects might be a little more
tricky. 

This is about as close as I can manage at the moment. There's still
something wrong. The closed spline seems to turn itself inside out in
the middle and I can't quite see why at the moment.

I've used Ingo Janssen's param.inc file to speed up the rendering
instead of using true parametric isosurfaces.

// -----------------------------------------------------

camera { location  <4, 0, -5> look_at <0, 0.25, 0> angle 17}

light_source {<100,200,-100> colour rgb 1}

// The open spline 
#declare S = function {
   spline {
     cubic_spline
      -1, < 0, 0.5, 0.0>,
    -0.5, < 0, 0.2, 0.4>,
    0.01, < 0, 0.2, 0.2>,
     0.5, < 0, 0.4, 0.4>,
       1, < 0, 0.0,-0.6>
   }
 }

// The closed spline (prism)
#declare S2 = function {
  spline {
    cubic_spline 
      -1, < 3, -5, 0>, // control point
       // There's currently a bug with splines that have control = zero
       0.001, < 3,  5, 0>, // So use 0.001 
       1, <-5,  0, 0>,
       1.5 <0, -3,0>,
       2, < 3, -5, 0>,
       3, < 3,  5, 0>, // closure
       4, <-5,  0, 0>  // control point
    }
  }

#declare Fx = function(x,y) {u      + 0.05*S2(v).x}
#declare Fy = function(x,y) {S(u).y + 0.05*S2(v).y}
#declare Fz = function(x,y) {S(u).z}
#declare Umin =  -1;
#declare Umax =  1;
#declare Vmin =  0;
#declare Vmax =  3;
#declare Iter_U = 100;
#declare Iter_V = 50;

#include "param.inc"
Parametric()

object {Surface
  pigment {rgb 1}
}


Post a reply to this message

From: anoop
Subject: Re: prism along a curve
Date: 23 Oct 2001 12:53:20
Message: <3bd5a080@news.povray.org>
John Bradshaw wrote in message <3bd498b9@news.povray.org>...
>Does anyone know of a way to make a prism-type object along a spline
instead
>of along the z axis. In other words, how do you sweep a closed spline
along
>another spline?
>
>John

The Striscia macro by Daniele Varazzo (in the links->macros page )
should do what you want - and probably a lot more.

Hope this helps'

Regards,
-Anoop


Post a reply to this message

From: Mike Williams
Subject: Re: prism along a curve
Date: 23 Oct 2001 13:45:00
Message: <w6znDFAf9Y17EwYe@econym.demon.co.uk>
Here's a fixed version of my prism-along-a-spline parametric isosurface.
I had my x's and z's swapped somewhere. I've also drawn in the splines
that generate the surface, and done a bit of tidying up.

// ---------------------------------------------

#version 3.5;

camera { location  <2, 0, -5> look_at <0, 0.25, 0> angle 25}

light_source {<100,200,-500> colour rgb 1}

// The open spline 
#declare S = function {
   spline {
     cubic_spline
      -1, < 0, 0.5, 0.0>,
    -0.5, < 0, 0.2, 0.4>,
    0.01, < 0, 0.2, 0.2>,
     0.5, < 0, 0.4, 0.4>,
       1, < 0, 0.0, 0.0>
   }
 }

// The closed spline (prism)
#declare S2 = function {
  spline {
    cubic_spline 
      -1, <0, 3, -5>, // control point
       // There's currently a bug with splines that have coordinate zero
       0.001, <0, 3,  5>, // So use 0.001 
       1, <0, -5,  0>,
       1.5 <0, 0, -3>,
       2, <0,  3, -5>,
       3, <0,  3,  5>, // closure
       4, <0, -5,  0>  // control point
    }
  }

#declare Fx = function(x,y) {u}
#declare Fy = function(x,y) {S(u).y + 0.08*S2(v).y}
#declare Fz = function(x,y) {S(u).z + 0.08*S2(v).z}
#declare Umin =  -1;
#declare Umax =  1;
#declare Vmin =  0;
#declare Vmax =  3;
#declare Iter_U = 100;
#declare Iter_V = 50;

#include "param.inc"
Parametric()

object {Surface
  pigment {rgb 1}
} 

#declare ctr = Umin;
#while (ctr < Umax)
  sphere {<ctr, S(ctr).y, S(ctr).z-0.22> ,.02  pigment { rgb <1,1,0> }}
  #declare ctr = ctr + 0.01;
#end

#declare ctr = Vmin;
#while (ctr < Vmax)
  sphere {<1, 0.08*S2(ctr).y, 0.08*S2(ctr).z> ,.02  pigment { rgb
<1,0,0> }}
  #declare ctr = ctr + 0.01;
#end


Post a reply to this message

From: John Bradshaw
Subject: Re: prism along a curve
Date: 23 Oct 2001 20:27:44
Message: <3bd60b00$1@news.povray.org>
Mike,

Thanks for the posts! I think this will work well for what I want to
do--when I get my splines working with your idea, I'll post it to let you
know how it turned out. I'm trying to make a simple design in a wood cabinet
door by subtracting prisms from a box. Worked okay for straight designs, but
I was having trouble making curves.

Thanks again,

John


Post a reply to this message

From: John Bradshaw
Subject: Re: prism along a curve
Date: 23 Oct 2001 20:28:36
Message: <3bd60b34$1@news.povray.org>
Anoop,

I found the link, but all it got me was a 404. Do you know of a different
place to get this macro?

Thanks,
John
"anoop" <ano### [at] flashmailcom> wrote in message
news:3bd5a080@news.povray.org...
>
> John Bradshaw wrote in message <3bd498b9@news.povray.org>...
> >Does anyone know of a way to make a prism-type object along a spline
> instead
> >of along the z axis. In other words, how do you sweep a closed spline
> along
> >another spline?
> >
> >John
>
> The Striscia macro by Daniele Varazzo (in the links->macros page )
> should do what you want - and probably a lot more.
>
> Hope this helps'
>
> Regards,
> -Anoop
>
>


Post a reply to this message

From: anoop
Subject: Re: prism along a curve
Date: 24 Oct 2001 06:35:06
Message: <3bd6995a@news.povray.org>
John Bradshaw wrote in message <3bd60b34$1@news.povray.org>...
>Anoop,
>
>I found the link, but all it got me was a 404. Do you know of a
different
>place to get this macro?
>
>Thanks,
>John

I've got it with me. Could post to you if you want; I don't think the
author would mind, it being opensource and all. BTW, you could also
try out Chris Colefax's spline util which, too, does some wonderful
things including (I think) this.

You know, there was a previous post regarding making a central
semi-official repository for such things. Considering the number of
links (some of them really wonderful stuff) going dead, I think it
would be a really wonderful idea. (Also it should prevent us searching
all over the place :-))

Regards,
Anoop

Perhaps you could try these addresses, too:
http://members.nbci.com/dvarrazzo/epov.htm
http://members.nbci.com/dvarrazzo/eindex.htm ?
http://members.nbci.com/_XMCM/dvarrazzo/eindex.htm
http://members.nbci.com/_XMCM/dvarrazzo/striscia/stri101.zip


Post a reply to this message

From: John Bradshaw
Subject: Re: prism along a curve
Date: 24 Oct 2001 22:17:20
Message: <3bd77630$1@news.povray.org>
Strange...all dead links as well. Is it just me?

In any case, would you mind sending/posting it?

I'll have to check out Chris Colefax's util. I'm new to pov-ray, but I've
seen his name all over the place--looks like the king of include files.

John

"anoop" <ano### [at] flashmailcom> wrote in message
news:3bd6995a@news.povray.org...
>
> John Bradshaw wrote in message <3bd60b34$1@news.povray.org>...
> >Anoop,
> >
> >I found the link, but all it got me was a 404. Do you know of a
> different
> >place to get this macro?
> >
> >Thanks,
> >John
>
> I've got it with me. Could post to you if you want; I don't think the
> author would mind, it being opensource and all. BTW, you could also
> try out Chris Colefax's spline util which, too, does some wonderful
> things including (I think) this.
>
> You know, there was a previous post regarding making a central
> semi-official repository for such things. Considering the number of
> links (some of them really wonderful stuff) going dead, I think it
> would be a really wonderful idea. (Also it should prevent us searching
> all over the place :-))
>
> Regards,
> Anoop
>
> Perhaps you could try these addresses, too:
> http://members.nbci.com/dvarrazzo/epov.htm
> http://members.nbci.com/dvarrazzo/eindex.htm ?
> http://members.nbci.com/_XMCM/dvarrazzo/eindex.htm
> http://members.nbci.com/_XMCM/dvarrazzo/striscia/stri101.zip
>
>
>
>
>
>


Post a reply to this message

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