POV-Ray : Newsgroups : povray.general : Help needed: ascending spiral to (parametric) isosurface : Re: Help needed: ascending spiral to (parametric) isosurface Server Time
30 Jul 2024 00:27:27 EDT (-0400)
  Re: Help needed: ascending spiral to (parametric) isosurface  
From: Alain
Date: 17 Apr 2010 22:56:35
Message: <4bca74e3$1@news.povray.org>

> Hello yet again,
>
> I've been toying with my ascending spiral for a long time now, and I believe I'm
> achieving some good results, finally. Actually, thanks to you guys, of course.
>
> Anyway, Although I tried it a million different ways, I'm still getting
> artifacts, and I don't see a way to get rid of the problem.
>
> So, I started to wonder if there is a way to transform my ascending spiral into
> an isosurface. A parametric isosurface would be even better. And if there is a
> way to transform a blob straight into a mesh, that would be simply perfect. Here
> is a post to the images forum, so you can see the spiral:
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.4bc8bcc516734c1270e596300%40news.povray.org%3E/
>
> I got it by way of a cylinder blob with some 10,000 cylinders, and still those
> pesky artifacts remain. All I want is to make it completely smooth, and keep it
> "renderable" with my meager equipment.
>
> Thanks once again,
>
> Ruy
>
>

An isosurface can effectively help.
Start by #include "functions.inc"
Then take a look at f_spiral(...)

It can look like:
isosurface{function{f_spiral(x,y-(sqrt(pow(x,2)+pow(z,2))),z,6,1,6*7,0,0,1)}
	contained_by{box{<42,-1,42><-42,40,-42>}}
	threshold 0
	max_gradient 1.7
	all_intersections
...

y-(sqrt(pow(x,2)+pow(z,2))) skew the spiral up as the radius increase. 
The problem is that the section of the spiral is also skewed.
You need to adjust max_gradient acording to your needs. To small and 
there are missing pieces and black spots. To large and it uselessly 
takes to much time. For a circular section, a value a bit under 2 should 
be correct.

all_intersections is needed if you want a transparent spiral.

The first parameter after the z is the step between spires. The next one 
is the width of the spirals arms. The next is the overall dimention.
The last parameter controlls the cross section.
0 = square
1 = circular
2 = rotated square (many call that a "diamond", I can't)

The two "0" are unused parameters that must be present.

	pigment{gradient y
		color_map{[0 rgbf<1,0,0,0.8>][0.25 rgbf<1,1,0,0.8>][0.50 
rgbf<0,1,0,0.8>][0.75 rgbf<0,1,1,0.8>][1 rgbf<0,0,1,0.8>]}
		scale 41*y translate -1*y}
Create a smooth gradient going from red at the bottom to blue. You can 
replace with your own pigment.


Alain


Post a reply to this message

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