teepee changed the topic of #openscad to: OpenSCAD - The Programmers Solid 3D CAD Modeller | This channel is logged! | Website: http://www.openscad.org/ | FAQ: https://goo.gl/pcT7y3 | Request features / report bugs: https://goo.gl/lj0JRI | Tutorial: https://bit.ly/37P6z0B | Books: https://bit.ly/3xlLcQq | FOSDEM 2020: https://bit.ly/35xZGy6 | Logs: https://bit.ly/32MfbH5
<peepsalot> i was just reading over this link which teepee pasted a while ago https://craftinginterpreters.com/resolving-and-binding.html
<peepsalot> one of the first things it talks about is a bug in resolving variables, which seems like we have it too: https://bpa.st/JXDDA
<peepsalot> i don't think either function or module should be able to resolve `a`
<teepee> sequencing would be nice, but I fear that ship has sailed
<teepee> stopping the variable hoisting would probably break lots of existing scripts
<JordanBrown[m]> I don't see any problem at all with that program.
<teepee> hmm, not sure about the evaluation though
<JordanBrown[m]> It does depend on how your language is structured, but we do our variable lookups at evaluation time, and so what matters is where the a=123 is relative to the calls.
<JordanBrown[m]> Of course, even then we are weird in that we do all assignments before all module calls, so the a=123 could be anywhere relative to the foo() and it would be OK.
<JordanBrown[m]> And if the original C compilers weren't lame, and if everybody and his brother hadn't copied that lameness, it would all be OK. Requiring stuff to be declared before it's used was a non-thing in the 1970s when people routinely did two-pass compilers.
<peepsalot> JordanBrown[m]: did you run it and see the result?
<JordanBrown[m]> I hadn't, but now I have. It says exactly what I predicted it to say.
<JordanBrown[m]> What problem are you seeing?
<peepsalot> well the really weird thing is if you move the assignment of a to the last line
<JordanBrown[m]> Then I would expect the function to give an error and the module to succeed.
<peepsalot> that's not how closures work though
<JordanBrown[m]> yep
<JordanBrown[m]> Like I said, we are weird in that we run all assignments before all module calls.
<JordanBrown[m]> There's no closure there. It's straight scoping.
<JordanBrown[m]> But I'm sorry, I just sat down and am now being called away to dinner.
<JordanBrown[m]> I will read what you write when I get back, ~2 hours.
<peepsalot> `a` should be resolved from the point of function definition, not the call site. if you say that openscad evaluates all assignments first, then why should it matter if `a` is assigned before or after the function call site?
<InPhase> It's about the evaluation order.
<InPhase> peepsalot: I sufficiently confused myself with this variant that resolving it made it clearer: https://bpa.st/IXTTW
<InPhase> Note "bar", 234, with respect to "called baz"
<InPhase> i.e., it's multi-pass.
<peepsalot> ah, just like Leeloo Dallas
<peepsalot> InPhase: in seriousness, i guess I understand the logic behind it now. still feels odd though
foul_owl has quit [Quit: WeeChat 2.3]
foul_owl has joined #openscad
Lagopus has quit [Read error: Connection reset by peer]
Lagopus` has joined #openscad
<InPhase> :)
<InPhase> And yes, it's a bit odd.
<InPhase> If it were known at the start what we know now about a good plan for OpenSCAD, I bet it would be a bit different.
<InPhase> I am convinced that a better design for OpenSCAD would have been built around first-class functions that also provide object literals and thus modules would have never been invented. I don't think the same sort of multi-pass approach would be required then.
<InPhase> Behavior would be determined by type rather than syntax, and everything would be a value.
teepee_ has joined #openscad
<teepee_> InPhase: do you have the openscad command for the video? I need to try getting the size below 10mb for posting on mastodon
<InPhase> I put them in the repository.
<teepee_> I see only the frames->webp command there
<InPhase> Oh, I didn't do that command line.
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
<InPhase> I do the generation in gui so I can align the borders perfectly.
<teepee> ahh, ok :)
<teepee> how many frame did you generate?
<InPhase> 30fps
<InPhase> For JustinSDK, 600 frames
<InPhase> So 20 seconds.
<InPhase> I recommend a target time of 20 seconds.
<InPhase> Otherwise the dynamics are lethargic or too fast.
<InPhase> 300 frames with webp should be 8MB, because I did that in one try.
<InPhase> Swap the 33 in the img2webp with 66.
<teepee> cool, I'll try that. I can reduce the resolution a bit too I think
<InPhase> Right.
<InPhase> 70% of the original x/y dimensions should get you under 10MB at 30fps.
<InPhase> My dimensions were 1259x795 according to the identify command.
<InPhase> Just be sure to check zoom alignment to avoid clipping at left t=0, top t=0.3, bottom t=0.6, and right t=1
<teepee> hmm, I thought I have your color scheme installed, but it's not showing up
<InPhase> Yeah, I invented a new one just for this.
<InPhase> Sleepily at 2am.
<InPhase> One second.
<teepee> :)
<InPhase> Let's not regard that as a final name. ;) https://bpa.st/WGHYI
<teepee> all perfect than, 2:30 am here now
<InPhase> And maybe that's a too-discard theme, but it worked for this.
<jwash> hi guys in line 35 i bevel the corners, how would i bevel the top edge where the button holes are also, all the way around?
<InPhase> to-discard
<InPhase> jwash: Link to a paste of the source in question?
<jwash> what is the website again?
<InPhase> paste?
<othx> paste is https://www.3dcustomizer.net/paste for .scad files, https://bpa.st for text, https://pasteboard.co/ or https://imgur.com/ for images
<InPhase> botsnack!
<othx> YUM! This is why I love #openscad.
<InPhase> jwash: You mean bevel it 3D?
<jwash> i'm not sure what you mean. I want to make the edge where the walls join the top beveled.
<jwash> the same way the offset does for the corner edges
<InPhase> jwash: Here's a library you can either use directly, or grab from and modify: https://github.com/rcolyer/smooth-prim
<jwash> ok
<jwash> cool
<InPhase> I made that to have mostly self-contained copy pasteable modules.
<InPhase> Sometimes there's one or two other modules one depends on, but most are on their own.
Odeqlmd has joined #openscad
foul_owl has quit [Ping timeout: 260 seconds]
<teepee> wtf, it generated something like non-break-spaces that totally break the json parser
califax has quit [Ping timeout: 255 seconds]
<teepee> new rule, always press "raw" button before copy&paste
<InPhase> Yeah, I had that recently not go well with bpa.st
<InPhase> I will speak to supakeen...
califax has joined #openscad
Odeqlmd has quit []
foul_owl has joined #openscad
<teepee> 600 frames, 800x500 @ q 96 = 8.2MB http://files.openscad.org/tmp/caterpillar_small.html
<teepee> openscad-nightly --projection ortho --view axes,scales --imgsize 800,500 --camera 115,-25,25,55,0,330,450 --colorscheme "Test Gem 2" --animate 600 caterpillar.scad -o frames/frame.png
<teepee> argh, "error processing thumbnail", now what's that again
<teepee> maybe it wants to say webp not supported?
LordOfBikes has quit [Ping timeout: 272 seconds]
<linext> i should have submitted the ornament that InPhase helped me with for the advent calendar
<othx> linext linked to "Low Poly Ornament Bulb by jesse" on thingiverse => 1 IRC mentions
LordOfBikes has joined #openscad
<InPhase> linext: You can submit it early to the 2023 calendar. (After teepee opens that up.)
<teepee> the repo already exists :)
<InPhase> Wow, you're as ahead of the game on Christmas as a retail outlet!
L29Ah has quit [Ping timeout: 256 seconds]
<teepee> converted the animation to gif, just about under 10mb after running imagemagick, gifsicle optimized to 5.9mb
<InPhase> Excellent.
J2352 has joined #openscad
J23 has quit [Ping timeout: 260 seconds]
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
<JordanBrown[m]> peepsalot as InPhase said, there's no parse-time variable binding. We don't do lookups until execution time.
<JordanBrown[m]> And sometimes even at execution time we do weird things. In particular, consider
<JordanBrown[m]> sin = function (a) a*2;
<JordanBrown[m]> echo(sin(90));
<JordanBrown[m]> will echo 180.
<JordanBrown[m]> sin = 123;
<JordanBrown[m]> echo(sin(90))
<JordanBrown[m]> will echo ... drum roll please ...
<JordanBrown[m]> 1
<JordanBrown[m]> It starts to process the function call, looks up the variable, gets the number, says "nah, that's not a function", and falls back to built-ins.
<JordanBrown[m]> If we were starting from zero, the #1 thing I would say is "don't invent your own language".
<JordanBrown[m]> That is, if we were starting from zero with what we know now.
Lagopus` has joined #openscad
Lagopus` has quit [Changing host]
ur5us has quit [Ping timeout: 246 seconds]
milza has quit [Quit: milza]
milza has joined #openscad
L29Ah has joined #openscad
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
mohnish has quit [Ping timeout: 252 seconds]
mohnish has joined #openscad
TheAssassin has quit [Ping timeout: 255 seconds]
TheAssassin has joined #openscad
<gbruno> [github] gsohler opened pull request #4456 (Adapt Version numbers in uni-build-dependancies) https://github.com/openscad/openscad/pull/4456
J2352 has quit [Ping timeout: 260 seconds]
castaway has joined #openscad
J23 has joined #openscad
<gbruno> [github] gsohler synchronize pull request #4456 (Adapt Version numbers in uni-build-dependancies) https://github.com/openscad/openscad/pull/4456
<gbruno> [github] sangorrin closed issue #3872 (Problems with scale markers when using the right, left, front and back views) https://github.com/openscad/openscad/issues/3872
teepee has quit [Remote host closed the connection]
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
teepee has joined #openscad
N4buc0 has quit [Remote host closed the connection]
Guest51 has joined #openscad
ferdna_ has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
aiyion has quit [Remote host closed the connection]
aiyion1 has joined #openscad
milza has quit [Ping timeout: 252 seconds]
aiyion1 has quit [Remote host closed the connection]
aiyion1 has joined #openscad
snaked has quit [Ping timeout: 272 seconds]
<gbruno> [github] t-paul closed pull request #4456 (Adapt Version numbers in uni-build-dependancies) https://github.com/openscad/openscad/pull/4456
<gbruno> [github] t-paul pushed 3 modifications (Merge pull request #4456 from gsohler/master Adapt Version numbers in uni-build-dependancies) https://github.com/openscad/openscad/commit/3a74959a222437ba16948c7bd55179c2dea33e0f
snaked has joined #openscad
Guest51 has quit [Quit: Client closed]
califax has quit [Ping timeout: 255 seconds]
califax has joined #openscad
ferdna_ has quit [Quit: Leaving]
Lagopus` has quit [Read error: Connection reset by peer]
Lagopus` has joined #openscad
L29Ah has left #openscad [#openscad]
Lagopus` has joined #openscad
Lagopus` has quit [Changing host]
foul_owl has quit [Quit: WeeChat 2.3]
foul_owl has joined #openscad
Lagopus` has quit [Remote host closed the connection]
ur5us has joined #openscad
J23 has quit [Quit: Client closed]
J23 has joined #openscad
Lagopus has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
<linext> i shared 3dcustomizer.net with some people who opened it on their phones
<linext> took about 30 seconds to load completely
<linext> i looked at the server, the WASM file is 8MB and gzip was turned off the web server
<linext> gzip takes the 8MB wasm down to about 2.5MB
<linext> so cell phones should have less load time
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
othx has quit [Remote host closed the connection]
othx has joined #openscad
ferdna_ has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
SamantazFox has quit [Quit: Bye]