POV-Ray : Newsgroups : povray.general : Mike William's SweepSpline macro Server Time
16 Nov 2024 07:13:21 EST (-0500)
  Mike William's SweepSpline macro (Message 1 to 3 of 3)  
From: Greg M  Johnson
Subject: Mike William's SweepSpline macro
Date: 27 Feb 2004 23:08:30
Message: <4040143e$1@news.povray.org>
is quite cool, as evidenced at least in part by:
http://news.povray.org/povray.binaries.animations/thread/%3C4036deea%40news.povray.org%3E/

But I believe that there might be an error in the normal assignment of the
second version of the macro, the one allowing a closed cubic spline as cross
section.  I'm making objects with it and one side is oddly dark; povray
gives me an error:


----------------------------------------------------------------------------
 Building mesh2:
   - vertex_vectors
   - normal_vectors
File: C:\pov35\INCLUDE\makemesh.inc  Line: 265
Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>.
   - uv_vectors
   - face_indices
Warning: This rendering uses the following experimental feature(s): spline.
The design and implementation of these features is likely to change in
future versions
of POV-Ray. Full backward compatibility with the current implementation is
NOT guaranteed.

Scene contains 1 frame level objects; 0 infinite.


Post a reply to this message

From: Mike Williams
Subject: Re: Mike William's SweepSpline macro
Date: 28 Feb 2004 03:49:35
Message: <SCUHfAAsTFQAFwIu@econym.demon.co.uk>
Wasn't it Greg M. Johnson who wrote:
>is quite cool, as evidenced at least in part by:
>http://news.povray.org/povray.binaries.animations/thread/%3C4036deea%40news.povr
>ay.org%3E/
>
>But I believe that there might be an error in the normal assignment of the
>second version of the macro, the one allowing a closed cubic spline as cross
>section.  I'm making objects with it and one side is oddly dark; povray
>gives me an error:
>
>
>----------------------------------------------------------------------------
> Building mesh2:
>   - vertex_vectors
>   - normal_vectors
>File: C:\pov35\INCLUDE\makemesh.inc  Line: 265
>Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>.
>   - uv_vectors
>   - face_indices
>Warning: This rendering uses the following experimental feature(s): spline.
>The design and implementation of these features is likely to change in
>future versions
>of POV-Ray. Full backward compatibility with the current implementation is
>NOT guaranteed.
>
>Scene contains 1 frame level objects; 0 infinite.


I've produced a new version which fixes the warning. If stepping along
the spline in one direction produces a zero vector it tries stepping in
the other direction. This typically happens at the end of the cross
section spline.

I've uploaded the new version to my isosurface tutorial web page.
Although it doesn't use an isosurface, it does a job that's similar to
some of the isosurfaces on the page
<http://www.econym.demon.co.uk/isotut/more.htm>

It doesn't fix all the problems. In particular, if you use a
linear_spline for the cross section there isn't really anything that can
be said to be the true normal at the vertices. The normal is
discontinuous, so it should really be modelled as two points - one with
the normal from the face on one side and one with the normal from the
face on the other. Sweepspline.inc will choose one of these two possible
normals, and the face not chosen will look wrong. (I tried it with
Sweepspline.inc choosing a normal half way between the two options, but
that makes the faces on both sides look even worse).

If it still doesn't behave sensibly with the particular cubic_spline you
are using, email me some source code that exhibits the effect and I'll
see if I can improve things. (The FROM address in this email is actually
valid. You don't need to attempt to unmunge it.)

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Mike William's SweepSpline macro
Date: 28 Feb 2004 23:43:33
Message: <40416df5$1@news.povray.org>
Thanks greatly, mon.
Posted to p.b.i.
Perhaps I am just trying to make a spline macro do something it's not
capable of.  There are artifacts  that I believe to be evident of a normals
problem.


Post a reply to this message

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