|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
My current WIP (Scrabble) had a need for a helix that I could texture, and I
could not find one in Inigo Quilez article on distance functions, so I decided
to create one myself using his basic principles.
I started just sing a circular cross section, but as you can see from the image,
I abstracted it so you can supply any 2D cross-section SDF, (this one is a
simple 2D square that I rotated 45 degrees).
Since it is an SDF, applying textures by adding noise works as expected.
The updated libisoshapes.inc is in GitHub now:
https://github.com/carath63/povlibrary
-- Chris R
Post a reply to this message
Attachments:
Download 'libisoshapes_test.png' (255 KB)
Preview of image 'libisoshapes_test.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Chris R" <car### [at] comcastnet> wrote:
> My current WIP (Scrabble) had a need for a helix that I could texture, and I
> could not find one in Inigo Quilez article on distance functions, so I decided
> to create one myself using his basic principles.
An explanation of how you went about that would be a welcome tutorial.
I'll probably read that over 100 times when I get some free time in the future
to make some shapes myself.
> I started just sing a circular cross section, but as you can see from the image,
> I abstracted it so you can supply any 2D cross-section SDF, (this one is a
> simple 2D square that I rotated 45 degrees).
There are all of the inbuilt functions and their aliases in functions.inc,
including just such a spiral function with a cross-section parameter.
Hopefully some time this weekend I will post a link to Mike Williams' isosurface
tutorial, which also has a ton of good information.
> Since it is an SDF, applying textures by adding noise works as expected.
And presumably you can make level-set ("coaxial") shells?
Very nice work.
- BW
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 2024-12-13 à 10:04, Chris R a écrit :
> My current WIP (Scrabble) had a need for a helix that I could texture, and I
> could not find one in Inigo Quilez article on distance functions, so I decided
> to create one myself using his basic principles.
>
> I started just sing a circular cross section, but as you can see from the image,
> I abstracted it so you can supply any 2D cross-section SDF, (this one is a
> simple 2D square that I rotated 45 degrees).
>
> Since it is an SDF, applying textures by adding noise works as expected.
>
> The updated libisoshapes.inc is in GitHub now:
> https://github.com/carath63/povlibrary
>
> -- Chris R
You should take a look at the f_helix1(x,y,z, Num_Helix, Period,
Minor_radius, Major_radius, Shape, Cross_section, Section_Rotation)
functions from functions.inc
Playing with the last three parameters affect the shape of the helix.
Shape : Not sure what it does
Cross_section determine how many sides the cross section have
Section_Rotation rotates the cross section.
f_helix2 works the same, but, the Num_Helix and Shape parameter are not
used.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Alain Martel <kua### [at] videotronca> wrote:
> > My current WIP (Scrabble) had a need for a helix that I could texture, and I
> > could not find one in Inigo Quilez article on distance functions, so I decided
> > to create one myself using his basic principles.
> >
> > I started just sing a circular cross section, but as you can see from the image,
> > I abstracted it so you can supply any 2D cross-section SDF, (this one is a
> > simple 2D square that I rotated 45 degrees).
> >
> > Since it is an SDF, applying textures by adding noise works as expected.
> >
> > The updated libisoshapes.inc is in GitHub now:
> > https://github.com/carath63/povlibrary
> >
> > -- Chris R
>
> You should take a look at the f_helix1(x,y,z, Num_Helix, Period,
> Minor_radius, Major_radius, Shape, Cross_section, Section_Rotation)
> functions from functions.inc
>
> Playing with the last three parameters affect the shape of the helix.
> Shape : Not sure what it does
> Cross_section determine how many sides the cross section have
> Section_Rotation rotates the cross section.
>
> f_helix2 works the same, but, the Num_Helix and Shape parameter are not
> used.
I have used both of these in the past. I always find it tricky to get the
parameters to work correctly at different scales. I haven't looked at the
implementation of f_helix, but I know some of the other built-ins are not
implemented as exact SDF functions, which makes applying a surface texture to
the shape more difficult. I'm also finding that exact SDF functions render as
isosurfaces more quickly than inexact methods I have used in the past. These
functions also have limited shape options for the cross section, while mine can
take any function(x,y) that is also an exact 2D SDF.
Plus, it's always fun to go invent something on your own...
-- Chris R
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Hopefully some time this weekend I will post a link to Mike Williams' isosurface
> tutorial, which also has a ton of good information.
Done.
https://wiki.povray.org/content/User:BillW
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
This is pretty nice, and I will definitely be using your library, as it's the
only nice/efficient way to make some good barrel rifling.
Do you ever use Desmos to develop your isosurface functions?
- BE
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> This is pretty nice, and I will definitely be using your library, as it's the
> only nice/efficient way to make some good barrel rifling.
POV-Ray absolutely drives me mad - on many occasions.
I have a nice rifling cross section function, but for some reason - as of yet
unknown to me, it behaves very badly when x is negative - as shown to the left
of the origin.
I could fix/hack it - but I'd like to know WHY it occurs.
Even more baffling is when the twist rate is set very high - then the helix
disappears completely.
#version 3.8;
global_settings {assumed_gamma 1.0 }
#include "math.inc"
#include "functions.inc"
camera {
location <12, 0, -25>
right x*image_width/image_height
up y
look_at <12, 0, 0>
rotate -y*10
}
light_source {<10, 5, -10> rgb 1}
sky_sphere {pigment {rgb 1}}
#declare E = 0.00001;
#declare Dia = 0.4;
#declare Axis = 0.01;
cylinder {<-30, 0, 0>, <30, 0, 0> Axis pigment {rgb x}}
cylinder {<0, -Dia*2, 0>, <0, Dia*2, 0> Axis pigment {rgb y}}
cylinder {<0, 0, -Dia*2>, <0, 0, Dia*2> Axis pigment {rgb z}}
#declare fmod = function (Value, Modulo) {select (Value, 1 - mod (abs (Value),
Modulo), mod (abs (Value), Modulo))} // this gives a mod function that remains
consistant across the origin
//#declare Theta = function {atan2 (y, z)+tau + x*tau}
#declare Theta = function {((atan2 (y, z)+pi)/pi)*tau + x*tau} // adds a
multiple of x to produce the helix
#declare dist = function {sqrt (y*y + z*z)}
#declare Helix = function {select (mod (Theta(x, y, z), tau/3) - tau/6, 0.308,
0.35)} // modulates the radius to produce the rifling
#declare Rifling = function {dist (x, y, z) - Helix (x/12, y, z)}
#declare IS =
isosurface {
function {Rifling(x,y,z)}
contained_by { box { <-12, -Dia, -Dia>, <24, Dia, Dia> } }
accuracy 0.0001
max_gradient 50
open
texture {
pigment {rgb 1}
} // end texture
interior_texture {
pigment {rgb <1, 0, 0>}
} // end texture
} // end isosurface
object {IS}
Post a reply to this message
Attachments:
Download 'isosurfacerifle.png' (37 KB)
Preview of image 'isosurfacerifle.png'
|
|
| |
| |
|
|
|
|
| |
|
|