kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
misterfish has joined #openscad
foul_owl has joined #openscad
foul_owl has quit [Ping timeout: 245 seconds]
foul_owl has joined #openscad
SamantazFox has quit [Quit: Bye]
SamantazFox has joined #openscad
arebil has joined #openscad
misterfish has quit [Ping timeout: 264 seconds]
ferdna_ has quit [Quit: Leaving]
misterfish has joined #openscad
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
lastrodamo has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 256 seconds]
teepee_ is now known as teepee
mmu_man has joined #openscad
misterfish has quit [Ping timeout: 255 seconds]
arebil has quit [Quit: arebil]
misterfish has joined #openscad
arebil has joined #openscad
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
cart_ has joined #openscad
erectus has quit [Remote host closed the connection]
erectus has joined #openscad
GNUmoon has quit [Remote host closed the connection]
teepee has quit [Ping timeout: 256 seconds]
erectus has quit [Remote host closed the connection]
GNUmoon has joined #openscad
erectus has joined #openscad
teepee has joined #openscad
misterfish has quit [Ping timeout: 248 seconds]
greenbigfrog has quit [Ping timeout: 255 seconds]
greenbigfrog has joined #openscad
misterfish has joined #openscad
L29Ah has quit [Ping timeout: 255 seconds]
<lf94>
InPhase: are you good at SDF math? or guso78 ? How could we get rid of this bulge at the bottom from the rounded union? http://0x0.st/HyFf.png
<lf94>
I was thinking of some how specifying a normal vector, so the rounding only affects a particular plane.
<lf94>
float fOpUnionRound(float a, float b, float r) {
<lf94>
vec2 u = max(vec2(r - a,r - b), vec2(0));
<lf94>
return max(r, min (a, b)) - length(u);
<lf94>
}
<lf94>
(this is glsl if you wanna go test on shadertoy)
<lf94>
So I'm trying to smooth union walls and a "floor", like this: |_|
<lf94>
But because I think this works on the whole shapes, the bottom of the floor is also being rounded as we see
<lf94>
to the bottom of the walls
<lf94>
The cuts I made were just so you can see the problem really clearly
<lf94>
I think I'm gonna email Inigo if i cant figure this out
<lf94>
He's responded to me before
Guest55 has joined #openscad
Guest55 has quit [Client Quit]
<InPhase>
lf94: Do you have a working shadertoy example of the issue?
<lf94>
I could get you one that would have the same output as the pic, yeah
<InPhase>
lf94: The math of sdf's I have reasonable instincts for. The syntax I'm super rusty with.
<lf94>
Plus it'd probably be good to give to inigo if I have to
<lf94>
I'll do it in a bit!
<lf94>
busy at work
<InPhase>
I take examples sometimes and modify them to look like I want, just focusing my brain on the math. But I never put in the time to sit down and look at all the wrapper code that makes shadertoy designs do their thing. :)
<InPhase>
It's just an extension of my physicist propensity to plot and combine scalar fields in my head.
<lf94>
I think I actually understand the union round math-wise, but Im not sure what I can actually do to fix the problem
<lf94>
max(..,..) is saying "if we're within r, return the distance, otherwise return 0"
<lf94>
and if it's 0, we're just unioning the two shapes normally
<lf94>
since x - length(0) would be a non-rounded shape right
<lf94>
because offsets round
GNUmoon has quit [Remote host closed the connection]
GNUmoon has joined #openscad
<lf94>
So I just put some stuff down on graph paper
L29Ah has joined #openscad
<lf94>
I think the demoscene guy that made this just "got what he needed" and moved on
<lf94>
Because there's something about this that doesnt make much sense: max(r, min(a,b))
<lf94>
The distance is at a minimum r, otherwise, it's the minimum of the distances a or b
<lf94>
but that feels wrong to say. I think that breaks the L-continuity stuff
<lf94>
if r is constant like that...
<lf94>
maybe the smooth union stuff was indeed more correct and I should stick with that
<quiliro>
I want to combine those two shapes like yesterday
<quiliro>
I had explained
<quiliro>
I have learned 10 commands: cube, cylinder, hull, translate, rotate, for, color, union, intersection, difference
<quiliro>
I do not know how to use them comlpetely yet
<quiliro>
But I am tinkering
<quiliro>
the cheatseet is very useful
<quiliro>
cheatsheet
Guest38 has joined #openscad
<JordanBrown>
quiliro: with no render(), I get a non-transparent pale blue thing. With render(), it's transparent, but yours is lit very oddly; it's like the brightness is reversed from what I see.
<quiliro>
I do not have code in openscad...those are real life pictures
<quiliro>
which code did you use, JordanBrown ?
<lf94>
The roof looks basically exactly what J23k42 gave you yesterday
<lf94>
(good job on the real life models by the way ;)
<quiliro>
not quite...I do not think that they make a sine
<quiliro>
it is rather a catenary
<lf94>
right right
<lf94>
the base will be very easy to do
<lf94>
circle -> square lofting is pretty easy if i recall
<quiliro>
but I do not know how to make a catenary in openscad
<quiliro>
the base was incorrect also...it was flat on places which were not the base
<quiliro>
(floor)
rawgreaze has quit [Ping timeout: 255 seconds]
guso78k has joined #openscad
<guso78k>
lf94 my smooth union function looks different, it has one additional clamp function.
<guso78k>
you can find in my fork in libraries/python/pylibfive.py:
<guso78k>
def lv_union_smooth(a, b, r): #Credit: original algorithm in GLSL by Inigo Quilez
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
rawgreaze has joined #openscad
JordanBrown_ has joined #openscad
JordanBrown has quit [Ping timeout: 255 seconds]
<lf94>
guso78k: yeah, that's the typical smooth union
<lf94>
I was doing a "round union" as found on the hg_sdf page
<lf94>
afk, gym
<quiliro>
hull() {
<quiliro>
translate([10,10,20]) circle(10);
<quiliro>
square(20);}
<quiliro>
will not make the circle translate on the z axis
Guest38 has quit [Quit: Client closed]
<quiliro>
like translate([30,0,0]){
<quiliro>
translate([10,10,20]) circle(10);
<quiliro>
square(20);}
<quiliro>
the circle on the later expression does translate on the Z axis
ferdna__ has quit [Quit: Leaving]
erectus has quit [Remote host closed the connection]
erectus has joined #openscad
<peepsalot>
you shouodn't do 3d transformations on 2d geometry
<peepsalot>
circle is 2d
<peepsalot>
linear_extrude to make it 3d
<peepsalot>
then transform
<peepsalot>
or just use cylinder (and cube vs square), depending on the application
<peepsalot>
doing as much as possible in 2d, then extruding is generally much more efficient, if the design allows for it
<peepsalot>
quiliro: ^
misterfish has quit [Ping timeout: 255 seconds]
<quiliro>
thanks, peepsalot
snaked has joined #openscad
<InPhase>
quiliro: 3D transformations on 2D manifest in preview (depending on the operation, I think) but not in render, which causes mass chaos.
<InPhase>
It probably warrants a warning.
<InPhase>
Or we can wait until we purge preview and forget the problem ever existed.
<JordanBrown_>
quiliro: You're saying that https://i.imgur.com/5qfwOV6.png is a photograph, not a screen capture from OpenSCAD?
<JordanBrown_>
I was looking at https://termbin.com/9ggc with the semicolon on the first line removed and with (or without) a render() added at the end of the first line.
teepee has quit [Remote host closed the connection]
<J23k42>
no you write it cosh= function (x,e)(e^x+e^-x)/2;
<quiliro>
Dankon, J23k42
<quiliro>
wait, I do not understand the part after =
<J23k42>
it is a function .. like you use sin(x) you use cosh(x,e=2)
<quiliro>
ok
<quiliro>
dankon
<J23k42>
here an example cosh= function (x,e=2.71828)(e^x+e^-x)/2;for (i =[-1:.01:1])translate([i,0])cube([.01,1,cosh(i)]);
<JordanBrown_>
I like how you make e be a parameter, so that you can use a different value if you like. (But I should note that I don't understand hyperbolic trig at all; maybe it *is* meaningful.)
<quiliro>
nice!
* quiliro
tries it now
<J23k42>
well e is e so lazy me just don't need to write it twice
<quiliro>
cosh= function (x,e=2.71828)(e^x+e^-x)/2