<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>
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
<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
<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>
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]