POV-Ray : Newsgroups : povray.general : questions on parametric objects and 3d splines Server Time
3 Aug 2024 16:22:42 EDT (-0400)
  questions on parametric objects and 3d splines (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: lars petter
Subject: questions on parametric objects and 3d splines
Date: 15 Mar 2004 07:07:27
Message: <40559c7f@news.povray.org>
Hello!

At school, we're developing a modelling tool that will generate shapes such
as bezier curves, parabolas, ellipses and such in povray.

In the tool we have the parametrisised functions for all the shapes, so when
it comes to the Pov-Ray script-generation, we're thinking about using the
Parametric Object.

However, our shapes are supposed to have thickness and a height as well, and
the Pov-Ray online documentation says; "The parametric object is not a solid
object it is "hollow", like a thin shell."

So then we're wondering if there is some way to make these objects have a
thickness as well.. Like one does with the isosurfaces, just subtract the
thickness from the equation or something...?

The perfect solution however, would be that something like this can be done:
http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif

A rectangle is swept along a parametrisised 3d spline to construct the solid
object.. is this possible?



best regards,
lars petter
norway


Post a reply to this message

From: ingo
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 14:32:09
Message: <Xns94ADD0E604C7Aseed7@news.povray.org>
in news:40559c7f@news.povray.org lars petter wrote:

> So then we're wondering if there is some way to make these objects
> have a thickness as well..


firts option, of witcj I doubt it is what you're looking for; use the 
parametric macro found at http://members.home.nl/seedseven/#param It 
generates parametric objects using mesh', you can makes mesh "solid" by 
adding the "inside_vector" keyword to it, but only when the shape is 
closed. See "6.5.2.3.1  Solid Mesh" in the docs.

Another option, well more of a wild guess from me, could be to use the 
parametric macro to generate vertices and their companion normals. If you 
want to add thickness to your triangle you could go along each normal for 
a certain distance and create a new triangle there. To make a closed shape 
of the two triangles you'd have to add another six triangles. Or you could 
use a prism instead, but that would be slow with many "triangles".


Ingo


Post a reply to this message

From: Florian Brucker
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 15:50:54
Message: <4056172e@news.povray.org>
> A rectangle is swept along a parametrisised 3d spline to construct the solid
> object.. is this possible?
Somewhere in these newsgroups (I think in povray.binary.scene-files, but 
  don't take that for granted) is a script which will create a mesh fake 
of a sphere sweep (shame on me, I've also forgotten the name of the 
author). It lets you use a spline-based base-shape. I think you could 
modify it pretty easy to sweep along a parametric function and to use a 
parametric function as base-shape (if you want the latter at all).

HTH,
Florian


Post a reply to this message

From: Florian Brucker
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 16:10:27
Message: <40561bc3$1@news.povray.org>
So here's the relevant thread:

http://news.povray.org/povray.binaries.scene-files/thread/%3C3fb73d9e@news.povray.org%3E/

HTH,
Florian


Post a reply to this message

From: andrel
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 16:44:18
Message: <40562386.5030700@hotmail.com>
lars petter wrote:

> Hello!
> 
> At school, we're developing a modelling tool that will generate shapes such
> as bezier curves, parabolas, ellipses and such in povray.
> 
> In the tool we have the parametrisised functions for all the shapes, so when
> it comes to the Pov-Ray script-generation, we're thinking about using the
> Parametric Object.
> 
> However, our shapes are supposed to have thickness and a height as well, and
> the Pov-Ray online documentation says; "The parametric object is not a solid
> object it is "hollow", like a thin shell."
> 
> So then we're wondering if there is some way to make these objects have a
> thickness as well.. Like one does with the isosurfaces, just subtract the
> thickness from the equation or something...?
> 
> The perfect solution however, would be that something like this can be done:
> http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
> 
> A rectangle is swept along a parametrisised 3d spline to construct the solid
> object.. is this possible?
> 
In a sense it can be done for bezier patches. If you have
a start bezier surface and a final bezier surface and move
the surface from initial to final position along a bezier
spline (possibly modulating by moving control points
each along different bezier splines) then the 'side-surface'
will be a set of bicubic patches again. (as you wil only
have the true positions in 3D space, you have to compute
the positions of the controlpoints 'backwards', but that
can be done).
So, yes, what the link shows can be done in POV (provided
the curve has a cubic equation.)

I would not be able to do an elepsis along a parabolic
path myself. I have not studied the required equations
in depth. ( I guess I would approximate the ellipses and
oparabolas with bezier splines and patches, but that
would be cheating ;) ).

   Andrel


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 18:47:04
Message: <40564078@news.povray.org>
Hei Lars Petter.

Here's a norwegian page about Frenet frames and a little about
sweeping along Bezier curves:

http://www.ia.hiof.no/~borres/gb/ma-frames/p-frames.html

The modelling is done with OpenGL.

I hope this page has some relevance to your project.


Btw.:
POV-Ray's parametric obejct renders very slow, so I recommend
you to have a look at Ingo's macros if you need render
parametric shapes.


-- 
Tor Olav
http://subcube.com
http://subcube.net


Post a reply to this message

From: Mike Williams
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 02:55:40
Message: <mlbRVDA4KrVAFwkh@econym.demon.co.uk>
Wasn't it lars petter who wrote:
>Hello!
>
>At school, we're developing a modelling tool that will generate shapes such
>as bezier curves, parabolas, ellipses and such in povray.
>
>In the tool we have the parametrisised functions for all the shapes, so when
>it comes to the Pov-Ray script-generation, we're thinking about using the
>Parametric Object.
>
>However, our shapes are supposed to have thickness and a height as well, and
>the Pov-Ray online documentation says; "The parametric object is not a solid
>object it is "hollow", like a thin shell."
>
>So then we're wondering if there is some way to make these objects have a
>thickness as well.. Like one does with the isosurfaces, just subtract the
>thickness from the equation or something...?
>
>The perfect solution however, would be that something like this can be done:
>http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
>
>A rectangle is swept along a parametrisised 3d spline to construct the solid
>object.. is this possible?

All objects in POV are "hollow" in the sense meant in that part of the
documentation. The only difference with parametric objects is that many
sets of parametric equations result in surfaces that are open.

I guess that you're only thinking of using the "parametric object"
because you're working with "parameterisised functions" and they sound a
bit like they might be the same sort of thing. The tricky bit is going
to be that the "parameterisised functions" that create your curves are
likely to be three one-dimensional functions, whereas the POV parametric
object requires three two-dimensional functions.

Do take a look at the "bent prism" and the "sweepspline" in my
isosurface tutorial. 
<http://www.econym.demon.co.uk/isotut/more.htm>
<http://www.econym.demon.co.uk/isotut/splines.htm>

but you might be better off just doing exactly what is drawn in that gif
image you mentioned. Draw a large number of rounded rectangles that
follow the curve. If you draw them so that they are closer than a pixel
then they look like a continuous shape.

Here's some code that does that. Note the "Turn" parameter which
determines whether the rectangles are placed perpendicular to the path
or perpendicular to the z-axis.

#version 3.5;
global_settings {assumed_gamma 1.0}
camera {location  <0,0,-10> look_at <0,0,0> angle 30}
background {rgb 1}
light_source {<30, 100, -30> color rgb 1}
#include "transforms.inc"

// The "spline" parameters
#declare fx=function(u){sin(u)+cos(2*u)}
#declare fy=function(u){sin(3*u)}
#declare fz=function(u){u}

#declare Height=0.5;            // Rectangle Height
#declare Width=0.3;             // Rectangle Width
#declare Radius=0.05;           // Rectangle roundness
#declare Step = Radius/50;      // Make this smaller for larger images
                                // and smaller for quick tests

#declare Turn=1;             // set to 0 for the Rectangle to not turn

#declare Rect = union {
  sphere {<Width,Height,0>,Radius}
  sphere {<-Width,Height,0>,Radius}
  sphere {<-Width,-Height,0>,Radius}
  sphere {<Width,-Height,0>,Radius}
  cylinder {<Width,Height,0><-Width,Height,0>,Radius}
  cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
  cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
  cylinder {<Width,-Height,0><Width,Height,0>,Radius}
  pigment {rgb 1}
}

#declare E=0.00001;
#declare i=-1;
#while (i<1)
  //Use this to show the track of the "spline"
  //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
  
  #if (Turn)
    // calculate the direction
    #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
    // sweep out with turning rounded rectangle
    object {Rect
      transform {Reorient_Trans(z,D)}
      translate <fx(i),fy(i),fz(i)>
    }
  #else
    // sweep out with rounded rectangle
    object {Rect translate <fx(i),fy(i),fz(i)>}
  #end
  #declare i=i+Step;
#end

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: lars petter
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 04:49:32
Message: <4056cdac@news.povray.org>
"Florian Brucker" <tor### [at] torfboldcom> wrote in message
news:40561bc3$1@news.povray.org...
> So here's the relevant thread:
>
>
http://news.povray.org/povray.binaries.scene-files/thread/%3C3fb73d9e@news.povray.org%3E/
>
> HTH,
> Florian
>

Hi!

That .zip file attached in that threaddoesnt work here.. anyone got it and
can attach it in a new post or something?

Thanks in advance
Lars Petter


Post a reply to this message

From: lars petter
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 04:54:49
Message: <4056cee9$1@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> wrote in message
news:mlb### [at] econymdemoncouk...
> Wasn't it lars petter who wrote:
> >Hello!
> >
> >At school, we're developing a modelling tool that will generate shapes
such
> >as bezier curves, parabolas, ellipses and such in povray.
> >
> >In the tool we have the parametrisised functions for all the shapes, so
when
> >it comes to the Pov-Ray script-generation, we're thinking about using the
> >Parametric Object.
> >
> >However, our shapes are supposed to have thickness and a height as well,
and
> >the Pov-Ray online documentation says; "The parametric object is not a
solid
> >object it is "hollow", like a thin shell."
> >
> >So then we're wondering if there is some way to make these objects have a
> >thickness as well.. Like one does with the isosurfaces, just subtract the
> >thickness from the equation or something...?
> >
> >The perfect solution however, would be that something like this can be
done:
> >http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
> >
> >A rectangle is swept along a parametrisised 3d spline to construct the
solid
> >object.. is this possible?
>
> All objects in POV are "hollow" in the sense meant in that part of the
> documentation. The only difference with parametric objects is that many
> sets of parametric equations result in surfaces that are open.
>
> I guess that you're only thinking of using the "parametric object"
> because you're working with "parameterisised functions" and they sound a
> bit like they might be the same sort of thing. The tricky bit is going
> to be that the "parameterisised functions" that create your curves are
> likely to be three one-dimensional functions, whereas the POV parametric
> object requires three two-dimensional functions.
>
> Do take a look at the "bent prism" and the "sweepspline" in my
> isosurface tutorial.
> <http://www.econym.demon.co.uk/isotut/more.htm>
> <http://www.econym.demon.co.uk/isotut/splines.htm>
>
> but you might be better off just doing exactly what is drawn in that gif
> image you mentioned. Draw a large number of rounded rectangles that
> follow the curve. If you draw them so that they are closer than a pixel
> then they look like a continuous shape.
>
> Here's some code that does that. Note the "Turn" parameter which
> determines whether the rectangles are placed perpendicular to the path
> or perpendicular to the z-axis.
>
> #version 3.5;
> global_settings {assumed_gamma 1.0}
> camera {location  <0,0,-10> look_at <0,0,0> angle 30}
> background {rgb 1}
> light_source {<30, 100, -30> color rgb 1}
> #include "transforms.inc"
>
> // The "spline" parameters
> #declare fx=function(u){sin(u)+cos(2*u)}
> #declare fy=function(u){sin(3*u)}
> #declare fz=function(u){u}
>
> #declare Height=0.5;            // Rectangle Height
> #declare Width=0.3;             // Rectangle Width
> #declare Radius=0.05;           // Rectangle roundness
> #declare Step = Radius/50;      // Make this smaller for larger images
>                                 // and smaller for quick tests
>
> #declare Turn=1;             // set to 0 for the Rectangle to not turn
>
> #declare Rect = union {
>   sphere {<Width,Height,0>,Radius}
>   sphere {<-Width,Height,0>,Radius}
>   sphere {<-Width,-Height,0>,Radius}
>   sphere {<Width,-Height,0>,Radius}
>   cylinder {<Width,Height,0><-Width,Height,0>,Radius}
>   cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
>   cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
>   cylinder {<Width,-Height,0><Width,Height,0>,Radius}
>   pigment {rgb 1}
> }
>
> #declare E=0.00001;
> #declare i=-1;
> #while (i<1)
>   //Use this to show the track of the "spline"
>   //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
>
>   #if (Turn)
>     // calculate the direction
>     #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
>     // sweep out with turning rounded rectangle
>     object {Rect
>       transform {Reorient_Trans(z,D)}
>       translate <fx(i),fy(i),fz(i)>
>     }
>   #else
>     // sweep out with rounded rectangle
>     object {Rect translate <fx(i),fy(i),fz(i)>}
>   #end
>   #declare i=i+Step;
> #end
>
> -- 
> Mike Williams
> Gentleman of Leisure


Okay, i see.. But will the rectangles function as a continous shape as well?
I'm asking since we are going to place some lights and such to generate
caustics.. and the objects ought to be solid then.. No light should go
through them :)

Thanks,
Lars Petter


Post a reply to this message

From: andrel
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 05:17:50
Message: <4056D423.5040001@hotmail.com>
It doesn't work here either :(.
There is a SweepMesh.zip macro in mike's post a day before.
that one does work (but is probably not the same).

	Andrel

lars petter wrote:

> "Florian Brucker" <tor### [at] torfboldcom> wrote in message
> news:40561bc3$1@news.povray.org...
> 
>>So here's the relevant thread:
>>
>>
> 
>
http://news.povray.org/povray.binaries.scene-files/thread/%3C3fb73d9e@news.povray.org%3E/
> 
>>HTH,
>>Florian
>>
> 
> 
> Hi!
> 
> That .zip file attached in that threaddoesnt work here.. anyone got it and
> can attach it in a new post or something?
> 
> Thanks in advance
> Lars Petter
> 
>


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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