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
peeps[work] has quit [Ping timeout: 246 seconds]
J23k33 has joined #openscad
J23k99 has quit [Ping timeout: 245 seconds]
califax has quit [Remote host closed the connection]
califax has joined #openscad
mmu_man has quit [Ping timeout: 246 seconds]
t4nk_freenode has quit [Remote host closed the connection]
t4nk_freenode has joined #openscad
fling has quit [Remote host closed the connection]
snaked has quit [Ping timeout: 256 seconds]
snaked has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #openscad
fling has joined #openscad
erectus is now known as h-erectus
h-erectus is now known as homo-erectus
homo-erectus is now known as erectus
aiyion2 has quit [Ping timeout: 240 seconds]
aiyion2 has joined #openscad
erectus has quit [Ping timeout: 240 seconds]
erectus has joined #openscad
fling has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
fling_ has joined #openscad
fling_ is now known as fling
erectus has quit [Remote host closed the connection]
erectus has joined #openscad
L29Ah has quit [Ping timeout: 240 seconds]
erectus has quit [Remote host closed the connection]
erectus has joined #openscad
erectus has quit [Remote host closed the connection]
erectus has joined #openscad
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
mmu_man has joined #openscad
qeed_ has joined #openscad
qeed has quit [Ping timeout: 256 seconds]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
rogeliodh has quit [Quit: The Lounge - https://thelounge.chat]
rogeliodh has joined #openscad
e2k has quit [Ping timeout: 250 seconds]
e2k has joined #openscad
e2k has quit [Ping timeout: 256 seconds]
L29Ah has joined #openscad
kintel has joined #openscad
<kintel> teepee: I noticed that CircleCI fails to build macOS snapshots. Fixing it is prob. not hard, but do you know how to get CircleCI to complain more loudly when this happens (especially for snapshot builds), so someone can take notices?
<teepee> I tried to enable notifications going to #openscad-ci but did not finish that yet
<teepee> it currently can't run git due to some library mismatch, not sure how to fix that
<kintel> At least the github badge is red
<teepee> yes it updates after the scheduled run per commit
<kintel> oh, I see, I was away for a few days and didn't check the IRC log. I'll look into it
<teepee> I could not make it work last time, as their irc-orb needed some tools installed we did no have, at least appimage and windows should now have it
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<buZz> maybe the CI can output to irc? :)
<buZz> ah, already looked at
<teepee> calling it supported is unfortunately very generous
<teepee> they removed native support a while ago, but leaving it trying to ping freenode without any obvious way in the configuration to remove that
<buZz> sad
Guest96 has joined #openscad
Guest96 has quit [Client Quit]
Paul94 has joined #openscad
<Paul94> hi everyone! `min = function(a,b) a < b ? a+0.01 : b-0.01;
<Paul94> minWrapped = function(x, y) min(x,y);
<Paul94> echo("min (wrapped):", minWrapped(10, 20));
<Paul94> function limit(x, min, max) = max(min(x, max), min);
<Paul94> echo(limit(-1,0,100));
<Paul94> echo(limit(200,0,100));`
<Paul94> I cannot understand how OpenSCAD resolves function calls: I can redefine a standard function, and minWrapped will pick it up. But if there's a variable with same name the interpreter will get "smart" using either var or function.
<Paul94> But when choosing a function it chooses a standard function, not a redefined one.
<teepee> there's only one suggestion, don't use the same name
<teepee> legacy behavior is 3 separate namespaces which did not cause problems as there was no overlap
<Paul94> yeah, that's what I've figured, but limit is taken from NopSCADlib. so seems like code like that will be maintained for quite a while.
<teepee> but where's the min = function() overwrite coming from?
<InPhase> Yeah, you definitely don't want to redefine cores like min. That's hazardous. :)
<Paul94> min was my addition. Long story is I have my own openscad interpreter, and noticed that limit is broken.
<Paul94> Started experimenting with all the ways a function can be redefined and cannot understand all the rules.
<InPhase> Paul94: Basically, we had legacy functions, and then we introduced function literals which are assigned to variables. This disrupted the principle of three separate namespaces for functions, variables, and modules, which were previously determined purely from syntactic context in the original design.
<InPhase> Paul94: Really we should NOT have three separate namespaces, but this is sort of baked in now for backward compatibility. It might be worth at some point formally deprecating the reuse of variable names between these namespaces, and eventually migrating away from this. But that would have to have a very long lead time, and it would break at least a small amount of old code where this namespace
<InPhase> division had been relied upon (perhaps unwisely).
<InPhase> Paul94: But, for now, we have a lookup order through the contexts.
<Paul94> Yes, that's how stories usually go with compilers :) Three namespaces sounded logical, I too started with that. What is current resolution order? Parser sees a function call with an identifier as a function. It checks functions namespace, then standard functions, then variables?
J23k33 has quit [Quit: Client closed]
J23k33 has joined #openscad
<InPhase> Paul94: Hopefully this illustrates the lookup a bit? https://bpa.st/G2AHS
<Paul94> Thanks, now I understand even less :)
<Paul94> guess I'll have to read the code.
<InPhase> Well knowing better what you don't know is progress!
<Paul94> That snippet prints `ECHO: "x = function()"
<Paul94> ECHO: "x = function()"
<Paul94> ECHO: "y = Foo function()"`
<Paul94> but I was expecting second echo to be "Foo function"
<Paul94> Module cannot define a function, can it?
Paul94 has quit [Quit: Client closed]
kintel has joined #openscad
Paul94 has joined #openscad
Paul94 has quit [Client Quit]
<kintel> FYI: The macOS build failure was caused by a stray libintl.8.dylib file in our library cache. We've since disabled building dynamic libintl, so this was leftover from an old build. Fix is to bump MACOS_CACHE_VERSION on CircleCI to trigger a full dependency rebuild
Paul94 has joined #openscad
<kintel> The real issue is that we pollute the build environment with libraries (we set DYLD_LIBRARY_PATH), since we're building for a different target than the build image itself. Not sure if there is a good way around that. Perhaps we could set DYLD_LIBRARY_PATH as late as possible, and not run tools like 'git' while it's set?
<kintel> ..or perhaps one day, Docker for macOS will happen
Paul94 has quit [Client Quit]
Paul94 has joined #openscad
Paul94 has quit [Client Quit]
<kintel> Also, the library cache is a bit brittle since gettext has a build system which keeps changing. The libintl stuff has been a major pain to get built :(
<Scopeuk> why are build systems so painful. no matter what you are building, or where or why, they always want to start a fight
<kintel> It's annoying.
<kintel> I postulate that one day, the only native piece of software left will be web browsers, everything else will run in some VM/runtime on top of that.
<kintel> Perhaps modulo distro packages
<teepee> luckily there's only one javascript build system
<peepsalot> lol
<kintel> Heh, and by the time we get there, who wants to bet that Web APIs have splintered into 3 or 4 competing stacks?
anotherlucas[m] has quit [Remote host closed the connection]
<InPhase> Scopeuk: Yes...
Paul50 has joined #openscad
Paul50 has quit [Quit: Client closed]
escherial has quit [Quit: The Lounge - https://thelounge.chat]
escherial has joined #openscad
mmu_man has quit [Ping timeout: 240 seconds]
J23k33 has quit [Quit: Client closed]
J23k33 has joined #openscad
mmu_man has joined #openscad
peeps[work] has joined #openscad
J23k33 has quit [Quit: Client closed]
J23k33 has joined #openscad
<Lagopus`> 1st time I've wanted to change variables in a loop, is there no var = var + 1 ;or var++ ; or var = var/2 ; ? If not I will need to rework variable handling. It seems like a variable can be set once and is const only unless specified in the loop conditional. Also scope: is there no scope in openscad?
<InPhase> Lagopus`: It is a declarative language rather than an imperative language, which requires a slight shift in thinking.
<Lagopus`> then consider me brain-shifting at the moment
<InPhase> Lagopus`: There is one location where var = var + 1 is allowed, and that's in the C-style for loop list comprehension.
<InPhase> Lagopus`: In general if you want to do something like var = var + 1, you do so with recursion, either function recursion or module recursion.
<Lagopus`> yes, I'll need to run all the math based on the conditional variable instead of changing other variables in the loop body
<InPhase> Lagopus`: And next in this conversation, you either say, "Ah, okay." or "Oh no, I have no idea how recursion works", or something in between.
<Lagopus`> is that a JoJo reference?
<InPhase> Not intentionally.
<InPhase> Lagopus`: Function recursion can be setup to do exactly the same things that you would do with iterative looping. The best way to do it depends a little on the particular problem, so if you're having issues show an example of what you're trying to do and then maybe one of us can advise.
teepee has quit [Ping timeout: 240 seconds]
teepee has joined #openscad
<Lagopus`> I'll ix.io you an example of what I'm changing
<InPhase> Lagopus`: We've also implemented efficient list concatenation for recursive functions, modeled after how Lisp handles this, so one approach is to build up a list of the values you need, and then loop over them to make your geometry.
<InPhase> Lagopus`: Other times it's better to do recursion directly on the modules, particularly if you're moving along some path or something.
<InPhase> Lagopus`: My favorite example (because it makes me smile) of module recursion is the happy_grass.scad example in the top middle of last year's calendar: https://openscad.org/advent-calendar-2022/
<Lagopus`> http://ix.io/4wcN ok so here's my changes, although I still need to figure out what is incorrect about my use of floor()
<InPhase> And is the goal to make new_ match the output of old_ ?
<Lagopus`> old_ won't work based on what you said. new_ does actually work like you said
<InPhase> Ah.
<InPhase> Oh, you're doing a bit iteration?
<Lagopus`> my core2 duo e7500 can't seem to handle that link you sent
<Lagopus`> yes
<Lagopus`> honestly I'd like a bitwise shift and bitwise & but /2 and %2 are the best I will get
<Lagopus`> oh wait, sorry, floor() is fine.
<Lagopus`> it's just me again
<InPhase> Lagopus`: I will show a nice way.
Paul72 has joined #openscad
<InPhase> Lagopus`: https://bpa.st/XIN4E
<InPhase> Deleted...
<InPhase> Just saw a typo. :)
<Lagopus`> oh lol I had <p>That page does not exist</p> and thought it was curl's lack of js
<Lagopus`> btw my code is now functioning perfect
<InPhase> So if you ever really need to work with bits, the expected mode of thinking is to make lists of them.
<InPhase> We did briefly discuss additional bitwise operator support, but as we have doubles for the values it didn't seem quite right to do. The logic of it is still doable though.
<InPhase> But definitely masking is not a thing one should do for efficiency in OpenSCAD. If you can work with lists from the beginning, this is the more natural way.
<InPhase> You'll find that there is almost never a performance issue due to value computations in OpenSCAD, but it is almost always only an issue of performance for calculating the geometries.
<InPhase> The value computation is typically more than fast enough to stay way ahead of the geometry calculation overhead.
<Lagopus`> Thanks for the paste. My function was pretty much the make_ring_of function in examples but when running multiple rings close together, my goal was to take one or two of the iterations out to avoid overlap
<Lagopus`> you can also blame my train of thought of being based in c & asm instead of these higher languages
<InPhase> Yeah. :) It is a shift.
<InPhase> It's Turing Complete (to within recursion limits), so there is always a way. But some things will be more of a struggle than needed if you try to press to do things in the unnatural way.
<InPhase> I think it can be worthy exercises though to try to do things in the unnatural way once in a while, to explore the language and understand its extrema better.
peeps[work] has quit [Remote host closed the connection]
peeps[work] has joined #openscad
peeps[work] has quit [Remote host closed the connection]
<InPhase> For a dynamic make_ring_of I would simply calculate the number to put in the ring right before the loop, and use that rather than the passed in maximum count.
peeps[work] has joined #openscad
<InPhase> Like, calculate the circumference, divide, ..., do a max.
<InPhase> I mean, min
<InPhase> Then it will smoothly reduce as it shrinks.
<InPhase> Maybe optionally skip N=1.
<InPhase> I have no idea what you are making, but it is indeed a thing. :)
Paul72 has quit [Quit: Client closed]
<Lagopus`> honestly this is merely scaffolding
muesli has quit [Quit: NO CARRIER]
muesli has joined #openscad
<Scopeuk> That clearly is a Kung Fu training area for a hampster
<Lagopus`> I've been found out!
J23k33 has quit [Quit: Client closed]
J23k33 has joined #openscad
<J23k33> and using dvorak Ü
noonien has joined #openscad
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
<Lagopus`> I don't recall admitting I used aoeuidhtns in here
<Lagopus`> oh wait it's in the screenshot
<J23k33> iam using https://neo-layout.org/
<Lagopus`> that actually looks really similar to dvorak
<Lagopus`> I don't normally type outside of ascii, but maybe I'll try it out one day
J23k33 has quit [Quit: Client closed]
J23k33 has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snaked has quit [Quit: Leaving]
tgunr has joined #openscad
foul_owl has joined #openscad
<tgunr> I've been at this all afternoon trying to create a transition between 2 hollow cylinders of different diameters. I have modules to build the cylinders specifying the diameter and thickness and whether the diameter is considered to be the inside or outside. But trying to figure the transition between the cylinders in a hollow code is eluding me.
<tgunr> This is what I have so far, could anyone point me in the  right direction? https://share.polymicro.net/pb-YC9J1B6v1E.txt
<tgunr> And trying to use chatgpt.... well let's just say it was unhelpful
<gbruno> [github] ochafik opened pull request #4642 (Avoid excessive reallocations in PolySet append_poly) https://github.com/openscad/openscad/pull/4642
<gbruno> [github] ochafik opened pull request #4643 (Up to 2-3x faster STL output) https://github.com/openscad/openscad/pull/4643
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
<gbruno> [github] ochafik edited pull request #4642 (Avoid excessive reallocations in PolySet append_poly + append_vertex flow) https://github.com/openscad/openscad/pull/4642
mmu_man has quit [Ping timeout: 246 seconds]
<gbruno> [github] ochafik edited pull request #4643 (Up to 2-3x faster STL output) https://github.com/openscad/openscad/pull/4643
mmu_man has joined #openscad
kintel has joined #openscad
<gbruno> [github] ochafik opened pull request #4644 (Speed up hull() w/ better reserve & less alloc) https://github.com/openscad/openscad/pull/4644
<kintel> meh, I was wrong; looks like glib builds and installs a different version of libintl than gettext. Gah
<gbruno> [github] kintel pushed 1 modifications (Revert "Fix: Bump required version of glib2 (#4610)" This reverts commit ee2bb0578c847eb9841fb5b99faa999d2e2dd758.) https://github.com/openscad/openscad/commit/d289dc8f3d70b5d3f4d49c751884a872732001ee
<gbruno> [github] kintel opened pull request #4645 (Revert "Fix: Bump required version of glib2") https://github.com/openscad/openscad/pull/4645
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gbruno> [github] kintel pushed 1 modifications (Revert "Fix: Bump required version of glib2 (#4610)" This reverts commit ee2bb0578c847eb9841fb5b99faa999d2e2dd758.) https://github.com/openscad/openscad/commit/d289dc8f3d70b5d3f4d49c751884a872732001ee
kintel has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
peeps[work] has quit [Ping timeout: 240 seconds]