|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ABX wrote:
> As mentioned, you still can create lathe-like
> mesh from spline.
Is there some macro for this purpose? The sides of the prism are trivial
of course, but the caps not quite as trivial...
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com **updated Apr 27**
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sat, 15 May 2004 14:39:21 +0200, "Rune" <run### [at] runevisioncom> wrote:
> ABX wrote:
> > As mentioned, you still can create lathe-like
> > mesh from spline.
>
> Is there some macro for this purpose?
http://members.home.nl/seedseven/#lathe
> The sides of the prism are trivial
> of course, but the caps not quite as trivial...
It is even less trivial for all splines when written in C++
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ABX wrote:
> Rune wrote:
>> ABX wrote:
>>> As mentioned, you still can create lathe-like
>>> mesh from spline.
>>
>> Is there some macro for this purpose?
>
> http://members.home.nl/seedseven/#lathe
>
>> The sides of the prism are trivial
>> of course, but the caps not quite as trivial...
>
> It is even less trivial for all splines when
> written in C++
I think I must have been tired. In this whole thread only lathes and
sors have been mentioned, but in my head I was thinking prisms (which
are also based on splines). It is prisms that I think are non-trivial to
generate with a macro due to the end caps...
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com **updated Apr 27**
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Sorry, generating meshes from splines is not trivial, especially when you
have a parametric surface with u = "clock value" and v going around the
spline. The issue comes from finding a consistent "normal" vector to the
spline to start the mesh circle. I tried using the standard normal to the
spline (2nd derivative) for this and the results were at best inconsistent,
often leading to a serious case of the "twisties" where the actual radius is
much less than planned.
What I ended up doing was taking an arbitrary normal vector to start with,
then projecting the unit normal point onto the normal plane at the next
point:
<code>
#macro pnt(i, j, p, q, spl)
#if (j=vMin) // Calculate only at start of circle
#declare _st = spl(i); // New start point
#declare _dr = vnormalize(spl(i+1e-4)-spl(i-1e-4)); // New direction
vector
#if (i=uMin) // Initialization, arbitrary start normal
#local nrm = vcross(_dr,z);
#if (vlength(nrm)<.1) #local nrm = vcross(_dr,x); #end // Insurance
against degenerate cross product
#declare _norm = vnormalize(nrm);
#else
#local bas = _ost+_onrm; // get normal offset at old point
#local prj = (bas+_dr*(vdot(_dr,_st)-vdot(_dr,bas))); // project onto
plane at new point, normal as new direction
#declare _norm = vnormalize(prj-_st); // new normal traces from new point
to projected point
#end
#declare _onrm = _norm; // save old normal vector
#declare _ost = _st; // save old point
#declare _ortho = vcross(_dr,_norm); // orthonormal vector
#end
#local mrad = rad1*i+rad0*(uMax-i);
#local irad = 0.85 + 0.10*sin(j*5) + q*.05;
#local mdir = _norm*cos(j)+_ortho*sin(j);
_st+mdir*mrad*irad
#end
</code>
For the end caps (i = uMin || i = uMax) just set the radius to 0. If you
want flat rather than conical ends then set the endpoints just outside the
spline's range and push the endpoints back.
"Rune" <run### [at] runevisioncom> wrote in message
news:40a87c8b$1@news.povray.org...
> ABX wrote:
> > Rune wrote:
> >> ABX wrote:
> >>> As mentioned, you still can create lathe-like
> >>> mesh from spline.
> >>
> >> Is there some macro for this purpose?
> >
> > http://members.home.nl/seedseven/#lathe
> >
> >> The sides of the prism are trivial
> >> of course, but the caps not quite as trivial...
> >
> > It is even less trivial for all splines when
> > written in C++
>
> I think I must have been tired. In this whole thread only lathes and
> sors have been mentioned, but in my head I was thinking prisms (which
> are also based on splines). It is prisms that I think are non-trivial to
> generate with a macro due to the end caps...
>
> Rune
> --
> 3D images and anims, include files, tutorials and more:
> rune|vision: http://runevision.com **updated Apr 27**
> POV-Ray Ring: http://webring.povray.co.uk
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 26 May 2004 05:24:11 -0400, "David Wallace" <dar### [at] earthlinknet>
wrote:
> Sorry, generating meshes from splines is not trivial, especially when you
> have a parametric surface with u = "clock value" and v going around the
> spline.
I'm not sure I understand you. If u=clock then it is constant per scene (if it
is clock of animation). If you mean u=clock as being parameter of the spline
then most probably you mean different spline as for v parameter.
> The issue comes from finding a consistent "normal" vector to the
> spline to start the mesh circle.
If the spline is closed then finding normal at the end is equally difficult on
start/end as in the middle. Just input for calculating it changes, but
algorithm is the same. I coded it a few times and I'm pretty sure it was done
similar way in http://members.home.nl/seedseven/#param and
http://members.home.nl/seedseven/#lathe as well. Of course those are not
perfect solution but non approximation if perfect.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Again, are there any macros available to create mesh *prisms*? So far I
have only heard talk about lathes and sors... Prisms are more difficult
in my opinion.
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com **updated Apr 27**
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 26 May 2004 12:28:14 +0200, "Rune" <run### [at] runevisioncom> wrote:
> Again, are there any macros available to create mesh *prisms*? So far I
> have only heard talk about lathes and sors... Prisms are more difficult
> in my opinion.
Obviously.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
My interpretation of an n-sided prism mesh is a 4 by n structure:
Row 1: Radius 0, initial center
Row 2: Radius r, initial center
Row 3: Radius r, final center
Row 4: Radius 0, final center
What is your interpretation?
"Rune" <run### [at] runevisioncom> wrote in message
news:40b47129$1@news.povray.org...
> Again, are there any macros available to create mesh *prisms*? So far I
> have only heard talk about lathes and sors... Prisms are more difficult
> in my opinion.
>
> Rune
> --
> 3D images and anims, include files, tutorials and more:
> rune|vision: http://runevision.com **updated Apr 27**
> POV-Ray Ring: http://webring.povray.co.uk
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:40bc2a45@news.povray.org David Wallace wrote:
> Row 1: Radius 0, initial center
> Row 2: Radius r, initial center
> Row 3: Radius r, final center
> Row 4: Radius 0, final center
>
>
|------\
|_____ \
| \
| |
+ | |
| |
______| /
| /
|_______/
This is the kind of situation Rune is referring to, I think.
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 1 Jun 2004 03:42:20 -0400, ingo <ing### [at] tagpovrayorg> wrote:
> |------\
> |_____ \
> | \
> | |
> + | |
> | |
> ______| /
> | /
> |_______/
>
> This is the kind of situation Rune is referring to, I think.
I think the most difficoult problem is hole within prism (subshape):
________
/ \
/ /\ \
| / \ |
| \ / |
| \/ |
\ /\ /
\__/ \__/
as in http://www.povray.org/documentation/view/50/#s03_04_03_03
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |