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
pca006132 has joined #openscad
mmu_man has quit [Ping timeout: 256 seconds]
mmu_man has joined #openscad
LordOfBikes has quit [Ping timeout: 256 seconds]
LordOfBikes has joined #openscad
J24k57 has joined #openscad
J24k61 has quit [Ping timeout: 250 seconds]
pca006132 has quit [Remote host closed the connection]
teepee has quit [Ping timeout: 260 seconds]
teepee has joined #openscad
mmu_man has quit [Ping timeout: 252 seconds]
L29Ah has quit [Read error: Connection reset by peer]
pca006132 has joined #openscad
pca006132 has quit [Remote host closed the connection]
pca006132 has joined #openscad
GNUmoon2 has quit [Ping timeout: 260 seconds]
L29Ah has joined #openscad
teepee has quit [Quit: bye...]
teepee has joined #openscad
J24k57 has quit [Ping timeout: 250 seconds]
R2robot has joined #openscad
qeed_ has joined #openscad
qeed has quit [Ping timeout: 256 seconds]
J24k has joined #openscad
Guest_Plonker has joined #openscad
<Guest_Plonker> Hi everyone. I'm trying to generate a list that contains elements that are always larger than the previous, but are larger by a random amount. How would i achieve this?
<Guest_Plonker> I've tried `lt = [ for (i = [0 : floor(rands(1, 4, 1)[0]) : 100]) i];` but it seems that rand is run only once, not every iteration.
<J24k> Guest_Plonker  add i as seed for the rands
<J24k> hm ok that is not working .. this should lt = [ for (i = [0 : 4 : 100]) i+floor(rands(1, 4, 1)[0])];
<J24k> or you make this recursive
<Guest_Plonker> `lt = [ for (i = [0 : floor(rands(1, 4, 1, i)[0]) : 100]) i];` ---> "Ignoring unknown variable 'i'"
<J24k> Guest_Plonker yes i noticed that too .. you can add the rands to i   or  recursive ```f=function(in=0,out) in<100? f(in+floor(rands(1, 4, 1)[0]),out=concat(out,in) ) : out;echo(f());```
<J24k> removing the undef `f=function(in=2,out) in<100? f(in+floor(rands(1, 4, 1)[0]),out=concat(out?out:[],in) ) : out;echo(f());`
<Guest_Plonker> Thanks for the help. I'll need a moment to get my head round that.
<J24k> it is building the array by adding a random to "in" and adding "in" as the last member to "out" via concat
<Guest_Plonker> Ah! I see! Yes, that's exactly what i was after. Thank you.
<J24k> u're welcome
<J24k> if you want this predictable you use in as seed (maybe adding a seed to change the sequence)
<J24k> f=function(in=2,out,seed=42) in<100? f(in+floor(rands(1, 4, 1,seed)[0]),out=concat(out?out:[],in),seed=seed+1 ) : out;echo(f());
<J24k> more compact `f=function(in=0,seed=44) in<100? concat(in,f(in+floor(rands(1, 4, 1,seed)[0]),seed=seed+1 )) : [];`
<Guest_Plonker> I understand everything happening there, but i wouldn't have been able to write it from scratch. I know the jokes and memes about recursion but i'm definitely not comfortable with it.
<J24k> that is why i used "out" it makes it much more clearer
<Guest_Plonker> So different question: `for (j = [0 : 1 : len(lt) - 1]) { echo(lt[j], lt[j+1]); }` works fine but...
<Guest_Plonker> `for (j = [0 : 1 : len(lt) - 1]) { translate([lt[j] * n, n, 0]) square([n, n], center = false); translate([lt[j+1] * n, n, 0]) square([n, n], center = false); }` gives an "undefined operation (undefined * number)" for that second translate.
<Guest_Plonker> so `lt[j], lt[j+1]` works in the `echo()` but not in a translate?
<Guest_Plonker> Yeah, `translate([lt[j] * n, lt[j+1] * n, 0]) square(...)` gives the same error. So you can't access elements other than the current `for` loop iterator in a call to `translate`?
mmu_man has joined #openscad
GNUmoon2 has joined #openscad
pca006132 has quit [Remote host closed the connection]
<Scopeuk> Hmm I'm wondering if you are reading past the end of the vector
<Scopeuk> 0->len(lt)-1 is fine but once you add the +1 you are going to len(lt)
<Scopeuk> Which is one past vector end
<Guest_Plonker> You're spot on, it was an off-by-one error. Wow, that was an idiotic mistake... I feel twenty years younger.
<Guest_Plonker> in an effort to save my ego, i'd say the error message wasn't particularly helpful.
<Scopeuk> I don't think I would argue otherwise on that
<Scopeuk> the error is "technically correct" but not helpful
mmu_man has quit [Ping timeout: 246 seconds]
mmu_man has joined #openscad
extor has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
extor has joined #openscad
drfff has quit [Ping timeout: 260 seconds]
gwillen has quit [Read error: Connection reset by peer]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 260 seconds]
teepee_ is now known as teepee
snaked has quit [Quit: Leaving]
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
Guest_Plonker has quit [Quit: Client closed]
mmu_man has quit [Ping timeout: 255 seconds]
mmu_man has joined #openscad
fling has quit [Ping timeout: 260 seconds]
fling_ has joined #openscad
fling_ is now known as fling
Guest82 has joined #openscad
<Guest82> Hello ?
<teepee> hello Guest82
<Guest82> Can you point me in a direction to set up a user account for Libera.chat, it only aloowed me to sign in as a guest, no set up account here
<Guest82> thanks I'll check it out and be back as sidilakies
<teepee> as additional safety, give those /msg commands in the status channel
<teepee> that helps not accidentally posting the password :-)
<Guest82> ok , thanks
sidilakies has joined #openscad
<sidilakies> Hello, I think I set this up properly.
<InPhase> Scopeuk: Yeah, it probably would be good if we gave a warning at an out of bounds read. I know to look for it in that situation, but by experience of transitive reasoning on the message implications.
<sidilakies> I installed Konversation on my system and these posts showed up on the browser version so it's working.
<sidilakies> Any way I'm here since I started using Openscad and was looking for a place to ask questions, probaly not help since I just started this week. But not new to modeling
<InPhase> sidilakies: Well, this is the place. :)
<InPhase> tutorial?
<othx> tutorial is The OpenSCAD tutorial is a great place to learn how to create designs in OpenSCAD, and can be found at: https://en.wikibooks.org/wiki/OpenSCAD_Tutorial
<InPhase> sidilakies: And this tutorial is the optimal thing to start out with. ^
<teepee> InPhase: getting serious now... https://imgur.com/a/zo6DMw6
<sidilakies> yes I have been using that one and I think it led me here
<J24k> Guest82 you can simply change your /nick in irc
J24k is now known as Guest83
<Guest83> see
<InPhase> teepee: :) How many iterations until it becomes a monitor?
Guest83 is now known as J24k
<teepee> J24k: but unregistered nick can get problematic if there's ever a spam wave again ;-)
<teepee> good thing that did not happen for ages, lets hope it stays that way
<J24k> i already thought .. what did i missed it?
<teepee> InPhase: unless I get permission for a 1kw solar installation, I'd say not so good
<Guest82> do I need to delete this guest account or just close it in the browser?
<teepee> yeah, just close, it will go away after a short time
<J24k> Guest82  try to type /nick YOURNICK
Guest82 has quit [Quit: Client closed]
<teepee> some awesome design work: https://mastodon.gamedev.place/@marian42/112422872988154578 - probably not OpenSCAD though, that would be even cooler
<teepee> the only thing that seems not so ideal is the contrast of the digits
jan64 has joined #openscad
<InPhase> teepee: That mechanical digital clock is pretty cool. :)
<InPhase> Bad from a usability perspective, but awesome from a mechanical design perspective.
<teepee> yep, exactly
<teepee> I wonder if there's some color trick to handle the usability issue
<InPhase> Rotating 7-element white/black strips would fix it.
<InPhase> One would just need to translate the extension into a rotate-unrotate with an additional axial component.
<InPhase> Like a round disk with a radially offset attachment point, and the extension arm being on a pivot.
<teepee> first thing I want to do is to look at how it's done in detail, there's probably something to learn from that
<InPhase> And probably putting that all inside, attaching it to the front display by an additional gearing mechanism so that there is no big disk sticking out the front.
<InPhase> This is clear and doable in my head, so let me know if you decide to try it and can't understand the idea from the terse description. :)
<InPhase> teepee: Also, I just stumbled on this. It seemed in your aesthetic style, although with different toolsets. :) https://imgur.com/gallery/rLouTQ7
<teepee> that looks very cool, bonus points for moon craters?
<teepee> as one of the commentors mentions, there is some sort of "and now magic happened" cut when modelling the surface
<InPhase> Yes, then paint the whole moon.
<InPhase> s/paint/draw/