POV-Ray : Newsgroups : povray.general : Help needed: ascending spiral to (parametric) isosurface Server Time
30 Jul 2024 02:24:34 EDT (-0400)
  Help needed: ascending spiral to (parametric) isosurface (Message 1 to 5 of 5)  
From: ruy
Subject: Help needed: ascending spiral to (parametric) isosurface
Date: 16 Apr 2010 16:00:00
Message: <web.4bc8c141f2501ba970e596300@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


Post a reply to this message

From: Alain
Subject: Re: Help needed: ascending spiral to (parametric) isosurface
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

From: Alain
Subject: Re: Help needed: ascending spiral to (parametric) isosurface
Date: 17 Apr 2010 23:50:04
Message: <4bca816c$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
>
>
After looking at your image ant the other posts, here a sample:

isosurface{function{f_helix1(x,y,z,1,2,1,y,1,0,0)}
	contained_by{box{<42,-1,42><-42,40,-42>}}
	threshold 0
	max_gradient 1.7
	all_intersections
	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}
	finish{specular 0.7 roughness 0.001 reflection{0.001, 0.3 
fresnel}conserve_energy}
	interior{ior 1.4}
	scale<1,5,1>}


Alain


Post a reply to this message

From: Alain
Subject: Re: Help needed: ascending spiral to (parametric) isosurface
Date: 21 Apr 2010 17:13:16
Message: <4bcf6a6c@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
>
>

After some testing, my best result is with the following:

#declare Radius = 42;
isosurface{
	function{f_spiral(x,
y/45-sqrt(pow(x,2)+pow(z,2))/30,
z,
  7, // The spacing between turns.
  0.12, // Controlls the thickness of the ribon. Keep small.
  Radius, // How large
  0, 0, // 2 throw away parameters
  0.06)} // Controls the shape. Almost square but slightly rounded.
	contained_by{box{<Radius,-3,Radius><-Radius,Radius/2,-Radius>}}
	threshold 0
	max_gradient 20
	all_intersections // As it is transparent, you need it.
	pigment{cylindrical // for the colour.
		color_map{[0 rgbf<0.01,0.01,1,Filter>][0.25 
rgbf<0.01,1,1,Filter>][0.50 rgbf<0.01,1,0.01,Filter>][0.75 
rgbf<1,1,0.01,Filter>][1 rgbf<1,0.01,0.01,Filter>]}
		scale Radius} //Adjust to the overall size.
	finish{specular 0.7 roughness 0.001 reflection{0.001, 0.6 
fresnel}conserve_energy ambient 0 diffuse 0.8}
	interior{ior 1.4}
	}

"y/45" effectively act as "scale<1,45,1>". It controlls the width of the 
ribon as well as the overall height of the spiral.
"-sqrt(pow(x,2)+pow(z,2))/30" controlls how fast the spiral climb. 
Adjust "/30" to change the rate of ascention. SMALL = steep, LARGE = 
slow climb.
You can declare the colours of the color_map any way you want. You can 
hace up to 255 entries, but don't need as many.


Alain


Post a reply to this message

From: ruy
Subject: Re: Help needed: ascending spiral to (parametric) isosurface
Date: 23 Apr 2010 07:20:01
Message: <web.4bd181ec52a4354ff6acae590@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> After some testing, my best result is with the following:
>
> #declare Radius = 42;
> isosurface{
>  function{f_spiral(x,
> y/45-sqrt(pow(x,2)+pow(z,2))/30,
> z,
>   7, // The spacing between turns.
>   0.12, // Controlls the thickness of the ribon. Keep small.
>   Radius, // How large
>   0, 0, // 2 throw away parameters
>   0.06)} // Controls the shape. Almost square but slightly rounded.
>  contained_by{box{<Radius,-3,Radius><-Radius,Radius/2,-Radius>}}
>  threshold 0
>  max_gradient 20
>  all_intersections // As it is transparent, you need it.
>  pigment{cylindrical // for the colour.
>   color_map{[0 rgbf<0.01,0.01,1,Filter>][0.25
> rgbf<0.01,1,1,Filter>][0.50 rgbf<0.01,1,0.01,Filter>][0.75
> rgbf<1,1,0.01,Filter>][1 rgbf<1,0.01,0.01,Filter>]}
>   scale Radius} //Adjust to the overall size.
>  finish{specular 0.7 roughness 0.001 reflection{0.001, 0.6
> fresnel}conserve_energy ambient 0 diffuse 0.8}
>  interior{ior 1.4}
>  }
>
> "y/45" effectively act as "scale<1,45,1>". It controlls the width of the
> ribon as well as the overall height of the spiral.
> "-sqrt(pow(x,2)+pow(z,2))/30" controlls how fast the spiral climb.
> Adjust "/30" to change the rate of ascention. SMALL = steep, LARGE =
> slow climb.
> You can declare the colours of the color_map any way you want. You can
> hace up to 255 entries, but don't need as many.
>
>
> Alain

Wow, Alain, that is fantastic!

Thank you so much for your help!

Have a great weekend,

Ruy


Post a reply to this message

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