<kintel>
I haven't tested those in a long time though
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lf94>
J23 what's the render time on that
<lf94>
J23: looks really good!
<guso78>
kintel, thank you for your advice. i tested that before. but its very slow and 2nd virtual box does not offer opengl support which is not acceptable to me.
KimK_ has quit [Read error: Connection reset by peer]
KimK_ has joined #openscad
<J23>
lf94 took about a minute to calculate the preview ( the render would probably take bit more as each color (6) are polyhedron - with lazy union this can be as fast but i didn't tried .. Thanks!
<J23>
Geometry cache size in bytes: 179997488
<J23>
Total rendering time: 0:01:02.362 Objects: 6
<lf94>
I'm sooooooooooo happy now with the usability of this
<lf94>
Translating GLSL or OpenSCAD will now be WAY easier
<lf94>
I did this but my brain is too tiny to figure out how to translate this 2D simplex noise to a 3D terrain
<lf94>
My head is having a hard time translating 2D plane -> 3D SDF space
<guso78>
SDF(x,y,z) = f(x,y)-z
<guso78>
you used to have f(x,y) => z
<guso78>
but i dont understand your js code. my js knowledge is more procedural with functions, and statements ....
<guso78>
teepee, i found the checkbox to enable the 3d support. the 3d graph with the axes shows, but there are no rendered objects. i am happy with this right now.
<lf94>
Why -z?
<lf94>
Don't focus too much on what those functions are actually doing - they're all from iq
<lf94>
Help me more with how the hell do I map 2D noise to 3D sdf space :p
<guso78>
i understand that you just wont do display a terrain plot where each x and y coordinate maps to a z value
<guso78>
if at point 5/3 altitude is 10 and sdf scans af 5/3/11 the function must return 1 because its 1 away from the surface.
<guso78>
so it must calculate 11-10
<lf94>
I suppose we have to clamp values also
<lf94>
ok, yes, it's coming back to me
<lf94>
:D
<lf94>
thank you guso78
<guso78>
believe you really did not get it and you are happy now ....
<guso78>
still dont understand the content of the .js file. is it real javascript ?
<guso78>
your functions start with const hash = (p) => { ...
<lf94>
yes
<lf94>
these are "fat arrow" functions
<guso78>
i believe in js a function is like function e(a,b,c) { do_something(); }
<lf94>
Added back in 2015
<guso78>
needto google that
<lf94>
Yes, those are functions as well
<lf94>
The main difference is function(..) {..} has its function scope
<lf94>
i.e. "this" takes on a particular value
<lf94>
() => {} takes on the parent scope
<guso78>
fat arrow functions operate in parent scrope aha :)
<lf94>
but sometimes function(...) {...} is still necessary for when you want to add things to the core prototypes, i.e. Array.prototype.thing = function(...) {...}
<lf94>
or make classes / objects with prototype methods
<lf94>
I think my step function or something is messed up
<lf94>
Cant seem to get anything smooth
<guso78>
cant find a step fat arrow function in your code.
<lf94>
yeah, it's outside x)
<lf94>
I also accidentally did -H^2 instead of 2^-H
<lf94>
Hm
<lf94>
I need to do distance of xyz to (noise(x,y),0) I think
teepee_ has joined #openscad
<lf94>
I dont think -z is enough
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
<guso78>
-z is an approximation but not an exact result.
<guso78>
to create an exact sdf function for each point you must not only look downwards but also to the side if side faces are closer
<guso78>
this depends on the actual terrain function and might be very complicated
<guso78>
generally libfive will work if your sdf function can return positive and negative values. but its very easy to make an error ...
<lf94>
yeah. I think I need a 3D noise function.
<guso78>
your noise functions need to be deterministic!
<guso78>
teepee, i tried all sort of relative pathes here, but my dll fles dont arrive at the target computer.
<guso78>
https://imgpile.com/i/hZy1Sr The Cut Halfspace separtes the base of the cylinder into two halves and the pull region is actually a parabolic function.
<lf94>
Im trying to see 2D output but libfive_tree_save_slice only supports SVG and isnt showing me anything useful
<lf94>
maybe I do need smoothstep()...
<guso78>
did you try to change libfive reololution parameter ?
<guso78>
resolution
<lf94>
yeah
<lf94>
I tried all that
<guso78>
is your sdf funtion determinisitic ?
<guso78>
it must *NOT* contain random() function
<guso78>
lf94 do you perform your sdf using openscad AST tree ?
<lf94>
arent all sdf deterministic
<guso78>
(nope you use *.js)
<lf94>
and yeah, I use libfive - js is just used to write libfive code ;p
<lf94>
(basically what you're doing with python)
<guso78>
sdf(x,y,z) = rand()
<guso78>
is not determinstic
<lf94>
rand() is because it'll be the same seed
<lf94>
no matter what
<guso78>
if you want to achieve random effects you start with a sine wave and you continue overlaying this sine wave with sine waves with *weird* amplitudes, phase offsets and frequencies ...
<lf94>
oh im using randomness from the sdf's iq recommends
<lf94>
which is like, hash()
<guso78>
if you use rand() with a *given* seed it needs to be *conclusive* (about distance) with your sdf function evaluated from any other point in space
guso78 has quit [Ping timeout: 245 seconds]
<lf94>
Haha!
<lf94>
I gott it
<lf94>
The issue was I was not scaling the noise to [-1,1] or whatever