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
krushia has joined #openscad
JordanBrown1 has joined #openscad
JordanBrown has quit [Ping timeout: 240 seconds]
J25k26 has quit [Quit: Client closed]
J25k26 has joined #openscad
marcus has quit [Ping timeout: 272 seconds]
marcus has joined #openscad
Jerr87 has joined #openscad
teepee_ has joined #openscad
Jerr8 has quit [Ping timeout: 245 seconds]
Jerr87 is now known as Jerr8
teepee has quit [Ping timeout: 244 seconds]
teepee_ is now known as teepee
califax has joined #openscad
_whitelogger has joined #openscad
J25k5 has joined #openscad
J25k26 has quit [Ping timeout: 272 seconds]
mmu_man has quit [Ping timeout: 252 seconds]
snaked has joined #openscad
Guest57 has joined #openscad
Guest57 has quit [Quit: Client closed]
misterfish[x] has quit [Quit: Gateway shutdown]
dustinm` has quit [Ping timeout: 245 seconds]
dustinm` has joined #openscad
sculptor has quit [Quit: Leaving]
othx has quit [Ping timeout: 252 seconds]
othx has joined #openscad
sculptor has joined #openscad
sculptor has quit [Changing host]
sculptor has joined #openscad
howiemnt1 has quit [Ping timeout: 260 seconds]
howiemnt has joined #openscad
bitbasher has joined #openscad
tja has quit [Ping timeout: 244 seconds]
tja has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 244 seconds]
teepee_ is now known as teepee
sculptor_ has joined #openscad
sculptor has quit [Ping timeout: 276 seconds]
Guest51 has joined #openscad
guso78k has joined #openscad
phryk has quit [Quit: ZNC 1.9.1 - https://znc.in]
phryk has joined #openscad
Guest51 has quit [Quit: Client closed]
mmu_man has joined #openscad
<bitbasher> there is a statement about assert() in the docs .. Assert returns its children .. as far as i can tell assert does not return anyting .. but neither do i get an error from xx = assert( true );
<bitbasher> anyone able to shed any light?
J25k5 has quit [Quit: Client closed]
howiemnt has quit [Ping timeout: 260 seconds]
sculptor_ has quit [Changing host]
sculptor_ has joined #openscad
J25k has joined #openscad
<guso78k> assert shall abort the program on false - not true
howiemnt has joined #openscad
bitbasher has quit [Ping timeout: 240 seconds]
guso78k has quit [Ping timeout: 272 seconds]
howiemnt has quit [Remote host closed the connection]
howiemnt has joined #openscad
<InPhase> Works fine: x = assert(true) 5; echo(x);
<InPhase> Also assert(true) square(5); makes a square.
LordOfBikes has quit [Ping timeout: 248 seconds]
bozo16 has quit [Ping timeout: 276 seconds]
sculptor_ is now known as sculptor
howiemnt1 has joined #openscad
howiemnt has quit [Ping timeout: 276 seconds]
sculptor_ has joined #openscad
sculptor_ has quit [Changing host]
sculptor_ has joined #openscad
sculptor has quit [Ping timeout: 260 seconds]
mmu_man has quit [Ping timeout: 240 seconds]
guso78k has joined #openscad
mmu_man has joined #openscad
mmu_man has quit [Ping timeout: 252 seconds]
mmu_man has joined #openscad
guso78k has quit [Ping timeout: 272 seconds]
bitbasher has joined #openscad
<bitbasher> the condition given to an assert has to be be true to pass right?
<bitbasher> or .. did i write it the wrong way somewhere?
<teepee> you just typed about 10 times the characters compared to just trying that out :D
<bitbasher> ??
<bitbasher> and i had tried it out
<teepee> echo(assert(true) 3);
<teepee> echos 3
<teepee> echo(assert(false) 3);
<teepee> ERROR: Assertion 'false' failed in file ., line 1
bozo16 has joined #openscad
<bitbasher> the assert() is not returning any value .. doing this :
<bitbasher> echo(assert(true) 1) echo(assert(true) 3);
sculptor__ has joined #openscad
sculptor__ has quit [Client Quit]
<bitbasher> echos the 1 and the 3 and no errors .. the asserts are sort of not really there, unless they trip on condition==false
<bitbasher> they do seem to execute "beside" normal statements .. as does echo
<bitbasher> as you see in echo(assert(true) 1) echo(assert(true) 3); this is a single line of code
sculptor_ has quit [Ping timeout: 248 seconds]
<bitbasher> interestingly using the labeling feature of echo triggers a error
<teepee> that's the point of the assert, so I don't understand the question here
<bitbasher> echo(assert(true) one=1);
<teepee> that's obviously a syntax error
<teepee> the one= would go before the assert
guso78k has joined #openscad
<bitbasher> oh? when i do echo( lable=12); the output is ECHO: lable = 12
<bitbasher> why would the position of the assert make any difference?
<teepee> because there's so correct way of parsing the thing you wrote
<bitbasher> this echo( lable=12 assert(true)); throws an error
<teepee> sure, also invalid syntax
<bitbasher> then how does echo( assert(true) 12 ); just output ECHO 12 with no error at all?
<teepee> the syntax is:
<teepee> echo(assignment, assignment, ...)
<teepee> with assignment being: id = expression
<bitbasher> yep .. i know that
<teepee> and expression can be as simple as 12
<teepee> or something like "assert(true) 12"
<teepee> you can't just randomly put the id of an assignment in the middle of an expression
<teepee> echo(label=assert(true) 12);
<teepee> that works as it as a valid structure according to openscad syntax
<bitbasher> so how is assert(true) 12 diff from assert(true) lable=12 ?? both are literal 12 expressions
<teepee> no, label = 12 is not an expression
<bitbasher> oh .. and this works echo( lable = assert(true) 12 ); .. outputs 12 no error
<bitbasher> so there are some places in an expression one CAN drop an insert into, but not everywhere .. interesting
<teepee> ?
<teepee> insert = assert?
<teepee> yes, pretty much anywhere, worst case you need ( ) around it
<teepee> depending on the operator order
<bitbasher> i think this is inconsistent
<teepee> well, it's a special syntax that happened, I suppose due to the list comprehensions
<bitbasher> the syntax of echo is echo( this=1, that=2 ) right? but the lables can be omitted
<teepee> yes
<bitbasher> so then echo( 1,2 )
<bitbasher> this echo( l1 = assert(true) 12, l1 = assert(true) 13 ); outputs l1=12, l2=13
<teepee> good, that' what I would expect :)
<bitbasher> the asserts are "inserted" at the start of the RHS of the expressions
<teepee> now for extra fun, for() has the same properties ;-)
<teepee> like it can accept any number of assignments and the names are not predefined
<bitbasher> yep .. now this echo( l1 = assert(true) 12 + assert(true) 13 );
<bitbasher> fails with a syntax error
<teepee> echo can do that too: echo( l1 = assert(true) 12, l1 = echo("blah") assert(true) 13 );
<teepee> like I said, operator precedence
<teepee> echo( l1 = (assert(true) 12) + (assert(true) 13));
<bitbasher> so asset can be inserted in some parts of an expression .. but not everywhere .. i am just curiuos about where it is allowed and where not
<teepee> 12 + assert(true) is not a valid thing
<bitbasher> then how is l1 = assert(true) 12 valid?
<teepee> because it's an assignment
<teepee> and assert(true) 12 is the valid expression
<bitbasher> so the rule is i can put an assert directly after an equals sign ?
<teepee> just like in math (3 + 4) * 5 gives something different from 3 + 4 * 5
<teepee> no
<teepee> you can put it in front of any expression and it will result in another valid expression
<bitbasher> well of course .. but assert is not participating in the expression
<teepee> not in the value, correct
<teepee> it's just a checkpoint that could abort the calculation as sideeffect of it's evaluation
<bitbasher> what? assert DOES participate in an expression without being on either side of an operator?
<teepee> who said that?
<teepee> assert() + expression is as a whole just another expression
<bitbasher> i just did .. reponding to what you said
<bitbasher> but you cannot write that with a + sign
<teepee> so ( assert(3) 3 ) can stand *everywhere* where a 3 can stand alone
<bitbasher> and .. in echo( l1 = assert(true) 12 + assert(true) 13 ); there are two expressions
<teepee> note the braces to make sure there's no funny precedence business
<teepee> only when you put the braces around
<bitbasher> the literal 12 and the literal 13 are expressions .. but this throws a syntax error on the second assert .. either both should pass or neither
<teepee> no, due to operator precedence the parser will see 12 + assert(true) first
<teepee> and that is not valid
<bitbasher> braces ?? {} what braces?
<teepee> echo( l1 = (assert(true) 12) + (assert(true) 13));
ccox_ has joined #openscad
<bitbasher> l1 = assert(true) ( 12 + 13 ) ; echo(l1);
ccox has quit [Ping timeout: 240 seconds]
<bitbasher> so .. assert is a sort of monadic operator of really low precedence
* teepee shrugs
<teepee> maybe
<bitbasher> it does not modify the numeric or string expression
<bitbasher> well .. at least i know how to document it now
<bitbasher> i guess echo is pretty much the same
<teepee> yes, and let
mmu_man has quit [Ping timeout: 240 seconds]
<teepee> with let being different in that it makes the assignments visible
<teepee> where echo does not but puts them on console instead
mmu_man has joined #openscad
<teepee> now question... what does that echo: echo([for (3) 5]);
<teepee> ?
<teepee> :)
<bitbasher> that is not even legal syntax
<teepee> sure it is
<teepee> think of for() behaving like echo()
<teepee> echo(i=3); and echo(3); are both valid
<bitbasher> oh .. for inside [] is the generator .. and that is how "each" can be used in about 5 diff places in a vector comprehension
<teepee> yes
<teepee> and now: echo([for ("blah") 5]);
<bitbasher> so it does not matter what is in the for( xxx ) as long as there is no loop variable defined the loop only runs one time
<teepee> we can also add each to the mix: echo([each for ("blah") [5, 0]]);
<teepee> yes, you can obviously not *use* the non-existent name of the loop "variable" but it still does the loop
<bitbasher> oh .. where does the 0 come to?
<teepee> just to create nested vectors
<teepee> the for creates [[5,0], [5,0], [5, 0], [5, 0]]
<teepee> and each flattens it to just a single vector [5,0,5,0,5,0,5,0]
<bitbasher> that is an interesting difference from the normal for loop .. most languages the for loop can run zero times if conditions are wrong
<teepee> start = 1; end = 0; echo([for ([start:1:end]) 5]);
<teepee> sure, 0 iterations -> empty list
<teepee> if you write the values directly it will generate a warning
<bitbasher> umm no .. this echo([for ([1:1:0]) 5]); emits an error as start is greater
<bitbasher> and echo([for ([1:-1:0]) 5]);
<teepee> like I said
<teepee> with literals it will warn
<bitbasher> outputs [5,5]
<teepee> and for deprections: start = 1; end = 0; echo([for ([start:end]) 5]);
<teepee> this will give [] in the nightlies
<teepee> but a deprecation warning and [5,5] in the release
<bitbasher> but the loop has run once to establish the empty vector
<teepee> no? why?
<teepee> start = 1; end = 0; echo([for ([start:1:end]) echo("blah") 5]);
<bitbasher> if the loop did not run the output would be undef , no?
<teepee> no the [] are always there, it's always a vector, the for() only fills it (or not)
<bitbasher> the regular for statement DOES work correctly for( a=[start:1:end]) echo("x");
<bitbasher> gives no output
<bitbasher> ha .. yes .. i see that .. the vector definition starts with the empty []
<bitbasher> so .. i am going to wrap up my work on the object() function
<bitbasher> and i have my notes on how to correct my description of the weirdo syntatic things that are echo, let and assert
<bitbasher> oh .. one thing
<bitbasher> how is the for loop supposed to work on objects?
<teepee> I think it iterates over keys
<teepee> o = object(a = 2, b=3); for (o = o) echo(o);
<teepee> yep
<teepee> gives "a", "b"
<bitbasher> yeah .. i got it now .. my definition of the object was flawed
teepee_ has joined #openscad
teepee has quit [Ping timeout: 244 seconds]
teepee_ is now known as teepee
Guest53 has joined #openscad
Guest53 has quit [Client Quit]
sculptor has joined #openscad
sculptor has quit [Changing host]
sculptor has joined #openscad
howiemnt1 has quit [Remote host closed the connection]
howiemnt has joined #openscad
sculptor has quit [Ping timeout: 252 seconds]
muddy has joined #openscad
snaked has quit [Ping timeout: 260 seconds]
<muddy> Hi I absolute new here , I do not the the format and I want ask about OPENSCad and the Use of Threats for Tubes (3/4" BSPP Threat)  Can anybody give me a little helper
mmu_man has quit [Ping timeout: 276 seconds]
<teepee> hi! I guess the simple answer would be "use a library that supports the threads you need"
<muddy> I tried but I do not see the Thread in the models
<teepee> I've never used real world threads, only printable, so I'm not sure what's best for that
<teepee> most of the time, I'm using: https://github.com/rcolyer/threads-scad
<teepee> I think you would need to get the detailed input data like depth and pitch for this one
<muddy> OK good for you. I want to connect to a tube (no Water pressure. So I test the threads scad
<teepee> the big, probably can do anything would be https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad :)
mmu_man has joined #openscad
<InPhase> The tapered ends featuer in the first one should work well for screwing on a rubber tube.
<InPhase> s/featuer/feature/
<teepee> oh, hello author of the first library I linked :)
* InPhase puts on his fake mustache.
<teepee> I just scrolled through the bosl documentation, that takes about as long as printing something with yours :D
<teepee> but that documentation is extremely nice with all the details and diagrams
<InPhase> BOSL2 does seem very nice. But it has too many features for me to use it. It results in a scenario where the vast majority of things I can implement faster than I can figure out how to do them with BOSL2.
<InPhase> And consequently the remaining features of BOSL2 that would be slower to implement become hard to find. :(
bitbasher has quit [Ping timeout: 260 seconds]
<teepee> I guess if you really dive in and get to know it, it's a bit like magic :)
<teepee> for the stuff I print, I never found the time to do that
<InPhase> Yep. I'm sure I'm missing some nice gems in there. I just need more segmentation and selectivity for my workflow patterns.
<InPhase> lol, yeah.
<InPhase> My personal website still uses php because I made it over a decade ago, it still works, and ... I don't have a reason to do something else.
<InPhase> Maybe I should go remove the .php extensions or something and hide the php background, but whatever. :)
<teepee> it's back to be silently popular via laravel I think, no fuzz but works it seems
<InPhase> I could always make one of those newfangled websites where you scroll vertically to see everything, each element of the vertical scroll looks like an ad for a multi-level marketing scam, and there is no text or searchable information. But I think I'll pass on that strategy.
<teepee> uh, I hate those scroll mis-using sites, that is sooo annoying when randomly things start and stop scrolling
<InPhase> Yep! lol
muddy has quit [Quit: Client closed]
<InPhase> I have been told before that I should update my personal site to look more like that.
<teepee> if you want a job at apple, you should
<InPhase> :)
bitbasher has joined #openscad
howiemnt has quit [Remote host closed the connection]
howiemnt has joined #openscad
snaked has joined #openscad