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
<Virindi> perhaps the problem is something else?
<Virindi> like perhaps a missing ; on the line above
<InPhase> souvlakeeb: And if you're a terminal navigator, the script here could be customized for emacs variants if you prefer being evil: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#I_don't_like_the_editor,_can_I_use_my_favourite_editor_instead?
<Virindi> just note that variables cannot really be reassigned like with a typical language, but if you use one variable in computing another variable then it must appear before
<souvlakeeb> Okay found it, I was calling the variable with a typo!
<Virindi> I am not a fan of the attempts to make it seem 'functional' but hey, that is just me :)
<souvlakeeb> Hey pretty neat InPhase!
<InPhase> Virindi: It's pretty functional. Functions are at least 1.25 class citizens!
<souvlakeeb> Wait functional as in scad is modeled after functional languages, as opposed to imperative?
<Virindi> then why can you not declare variables which depend on each other out of order :P
<Virindi> yes.
<InPhase> souvlakeeb: It's a form of declarative functional language.
<souvlakeeb> interesting
<Virindi> the practical effect is that variables can only be assigned once and you can't do stuff like loop and update a variable every loop
<Virindi> instead you can use recursion etc
<souvlakeeb> Hmm, I could see how that could be a hinderence. If I wanted to put the holes in a loop and keep translating over by += 5
<Virindi> nah
<Virindi> perhaps I stated that confusingly, sorry
<Virindi> when you do a for(), the loop variables change of course
<Virindi> you just cannot assign outside variables from inside the loop
<souvlakeeb> Interesting. For the record I have never used a functional language. I just know of them.
<Virindi> so for example in your case you could do something like
<Virindi> for (i=[0:4])
<Virindi> translate([i*5,0])
<Virindi> cube(.....);
<souvlakeeb> Off topic but I take it you guys like things like latex and maybe even asciidoctor for documents and slides?
<InPhase> souvlakeeb: It's not actually a limitation in what can be done, it just calls for different structures to do certain things. But it offers benefits from having no mutated state, so it becomes pretty clear to track what will affect each routine.
<souvlakeeb> Hmm, thank you for that.
<InPhase> souvlakeeb: Yeah, LaTeX is my preferred document generation system for pretty much the same reason OpenSCAD is my preferred 3D modeling approach. Abstraction with code is powerful and scales well. :)
<souvlakeeb> Yea I figured. I like to tell my computer exactly what to do, not fight with it and it's mouse.
<InPhase> Except that LaTeX can be a bit more of an unwieldy beast. I could happily switch to a less convoluted programmatic document generator, but there is none with any prominence and comparable power that I know of.
<souvlakeeb> I don't love latex slide output, but asciidoctor has been doing okay for me for that.
<souvlakeeb> Yea, latex is widely used and accepted. Anytime I don't need to use it though, I love asciidoctor, although I can't say I love that it's programmed in Ruby.
<souvlakeeb> Super simple syntax and pretty clean output and defaults.
<souvlakeeb> I use this for slides:
<souvlakeeb> But there's this too, although I stay away from javascript:
<InPhase> It looks like asciidoctor used to by Python and then went Ruby, which is a weird choice.
<InPhase> s/to by/to be/
<souvlakeeb> lol never seen that correction before. I like
<souvlakeeb> I recall something like that for speed and apparently they reached their goal
<souvlakeeb> I wouldn't mind using the python version if it has the same features.
<souvlakeeb> keep me posted if you track it, or an alternative down
<InPhase> Yeah, it looks like it wouldn't fit my needs for most things anyway, so a dead end I guess. I do a lot of scientific writing, so there are just too many features needed for that.
<InPhase> But nice to know there's an effort at alternatives.
<InPhase> Just like it's nice to know there's an effort at OpenSCAD alternatives even if they can't catch up. ;) *cough* juri_ *cough*
<souvlakeeb> lol!
<souvlakeeb> Yea same here with the scientific writing. I use latex for all of that. What do you do for slides?
<Virindi> I thought everyone just gave up and wrote their own framework that generates openscad code from "real code" :)
<Virindi> it can get quite frustrating how openscad is ALMOST a programming language but just barely not
<InPhase> souvlakeeb: I have some customized beamer styles and add-on styles to help with my typical needs.
<InPhase> Virindi: Well I wrote a CSV parser in OpenSCAD, so I think that proves it is a programming language.
<Virindi> I'm sure it is also way more confusing than it would be in an 'imperative' language :P
<Virindi> for me, that is not practical
<souvlakeeb> You have my vote for imperative too
<Virindi> possible, but not practical
<InPhase> Virindi: The csv parser function was only one line! https://github.com/thehans/funcutils/blob/master/string.scad#L55
<Virindi> 25000000 characters long? :D
<InPhase> Virindi: It's the string to float parser that was a little convoluted...
<souvlakeeb> Hey in the spirit of sharing, and being that we're all nutjobs, have you guys been exposed to the Vimium browser extension?
<Virindi> sorry but huge messes of nested conditions are not an efficient way of writing logic :)
<InPhase> Virindi: However, a full-featured string to float parser in imperative code is not pretty either.
GNUmoon has quit [Remote host closed the connection]
TheAssassin has quit [Remote host closed the connection]
<InPhase> Virindi: It's just usually a built-in feature, so one ignores the mess.
<InPhase> Virindi: But I took it as a challenge to see if it could be done in at least a reasonably simple manner.
<Virindi> right, that proves exactly my point. If it has to be a challenge, then it is not the greatest in terms of being practical
<InPhase> Virindi: Such is the nature of a domain-specific language going out of its domain. :)
<Virindi> thus everyone using $THEIR_FAVORITE_LANGUAGE to generate openscad
TheAssassin has joined #openscad
GNUmoon has joined #openscad
<Virindi> seems analogous to makefiles and automake
<InPhase> Well the real limitation in OpenSCAD is on purpose, and one we intentionally refuse to change. It's that OpenSCAD has zero features that make it a security risk to run shared code.
<InPhase> All those features that make something a security risk can open up a lot of more flexible usages, like reading in files, saving files, and so on. But then you obliterate the 3D model sharing community around OpenSCAD.
<InPhase> So there's no csv parser built in because there's no ability to load a csv file. ;)
<InPhase> So all sorts of people DO make code generators in other languages that come with these features / problems. But large communities are unlikely to arise around those approaches because you cannot have the same sort of broad trust in the files.
<InPhase> I think it's a good thing that people do it, because there's a time and place for such things. But it's not hitting the same sort of core purpose.
TheAssassin has quit [Quit: No Ping reply in 180 seconds.]
<InPhase> The imperative vs not thing is never really a limitation. It takes a modest amount of code and a pretty formulaic approach to change most imperative things to something that works fine in OpenSCAD. That's just a question of familiarity with those approaches.
<souvlakeeb> Hell yea guys!!!
<souvlakeeb> hole = 14;
<souvlakeeb> num_holes = 4;
<souvlakeeb> / spacing around each hole plus additional space on each end
<souvlakeeb> spacing = 5;
<souvlakeeb> num_spacings_width = (num_holes + 1) + 2;
<souvlakeeb> num_spacings_height = 2;
<souvlakeeb> width = (num_spacings_width * spacing) + (num_holes * hole);
<souvlakeeb> height = hole + (num_spacings_height * spacing);
<souvlakeeb> difference() {
<souvlakeeb>     square([width, height]);
<souvlakeeb>     edge_spacing = 2 * spacing;
<souvlakeeb>     for (iter = [0:3]) {
<souvlakeeb>         x_translation = (hole + spacing) * iter;
<souvlakeeb>         translate([edge_spacing + x_translation, 5]) square([hole, hole]);
<souvlakeeb>     }
<souvlakeeb> }
TheAssassin has joined #openscad
<souvlakeeb> It is very cool to me that we can share files by sharing text
<InPhase> souvlakeeb: https://bpa.st instead of paste directly into channel.
<souvlakeeb> https://bpa.st/QX3A
<souvlakeeb> Thanks for the tip! Doesn't look like they have SCAD highlighting
<souvlakeeb> Any way to round the edges of the outer rectangle?
<InPhase> souvlakeeb: offset(2) square(5);
<InPhase> souvlakeeb: And add at the top of your program: $fa=1; $fs=0.4;
<souvlakeeb> What does that add to the top stuff do?
<InPhase> If you want to round without expanding... something like: offset(2) offset(-2) square([10, 5]);
<souvlakeeb> The offset seems to work, but it puts the left edge over the y axis (to the left)
<souvlakeeb> Oh I guess that's the expanding I'm seeing
<InPhase> souvlakeeb: $fa=1 says round large circles to 1 degree, and $fs=0.4 says round small circles to every 0.4mm if you're using the standard 1 unit = 1mm convention.
<souvlakeeb> hmm, lemme try that without the offset
<InPhase> Setting both of those values gives you a flexible and sensible edge/polygon count for different sized objects.
ur5us has quit [Ping timeout: 248 seconds]
<InPhase> souvlakeeb: Probably you're going to also want to know about linear_extrude if you haven't seen it yet.
<InPhase> souvlakeeb: Your object is 2D, and it looks like a thing you'll want to make 3D. :)
<souvlakeeb> I'm sending to laser cutting so 2D is what I want. Thank you though I definitely will need that eventually
<InPhase> souvlakeeb: And a bug fix... for (iter = [0:num_holes-1])
<souvlakeeb> I'm not finding documentation on offset. The two "cancelling" offsets you sent works, but I don't know why
<souvlakeeb> good catch!
<InPhase> souvlakeeb: https://openscad.org/cheatsheet/ Click "offset"
<souvlakeeb> Thank you!
<souvlakeeb> I was searching the wikibook
<souvlakeeb> Oh, I think I was searching the tutorial that's why
<InPhase> It might not have made it into the tutorial.
<souvlakeeb> Wow, okay I think I get what's happening. It expands it and rounds the edges then the second call shrinks it back and the edges stay rounded
<souvlakeeb> Is that the best way to round edges? I feel like that's a hack
<souvlakeeb> round corners is probably more accurate
<InPhase> Other way around actually. It shrinks it (going right to left) then it expands it and rounds the edges.
<souvlakeeb> The positive value is first
<souvlakeeb> unless functional gets interpretted in reverse?
<InPhase> The one closest to the square is applied first.
<InPhase> Then the next one to the left is applied to the result of the offset that was applied to the square.
<souvlakeeb> Ah!
<souvlakeeb> Thank you very much this is extremely helpful!
<souvlakeeb> Another bug
<souvlakeeb> ;
<souvlakeeb>         translate([edge_spacing + x_translation, 5])
<souvlakeeb> s/5/spacing
<InPhase> Here's the full pattern of offsets: https://bpa.st/U4PQ
<InPhase> The last two are identical in effect, but it's helpful to try to wrap your head around why. :)
<InPhase> Well, almost identical.
<InPhase> Technically there are slight differences in the smoothness of the inner and outer curvatures, but you have to be paying attention to notice it.
<souvlakeeb> Over my head for right now, but saved the code for review
<souvlakeeb> Thank you!
<souvlakeeb> What field are you in?
<InPhase> I'm a programmer and physics PhD working in neuroscience at the moment.
<InPhase> OpenSCAD is my relaxing hobby.
<souvlakeeb> Nice! I'm a computer scientist working on my PhD in Cybersecurity.
<souvlakeeb> Wow and all you have to save at the end is a text file.
<souvlakeeb> Amazing! Slim!
<souvlakeeb> So offset is the best practice for rounding corners?
<InPhase> It depends on what you want to round, really. It is for when you want to round every corner of a thing.
<InPhase> Also that offset(-2) trick fails hard if the target has any features 4 or fewer units wide.
<InPhase> Sometimes you round by hull() applied to sets of circles. This for example lets you put different roundness at different parts, or do one part rounded one part square.
rawgreaze has quit [Quit: ZNC 1.8.2 - https://znc.in]
rawgreaze has joined #openscad
rawgreaze has quit [Changing host]
rawgreaze has joined #openscad
rawgreaze has quit [Remote host closed the connection]
rawgreaze has joined #openscad
rawgreaze has joined #openscad
rawgreaze has quit [Changing host]
<InPhase> souvlakeeb: Here's an illustration of several rounding strategies mashed into one object: $fa=1; $fs=0.4; rotate_extrude(angle=270) hull() { translate([15, 0]) rotate(90) circle(10); translate([25, 0]) rotate(90) offset(2) offset(-2) circle(10, $fn=6); }
<InPhase> souvlakeeb: And one flexible (but sometimes slow) 3D rounding strategy: $fa=1; $fs=0.4; minkowski() { sphere(2); difference() { cube(10); translate([4, -1, 4]) cube(7); } }
<InPhase> souvlakeeb: When you're dealing with basic shapes, there are some standardized approaches you can use: https://github.com/rcolyer/smooth-prim And when you're not, you can go crazy like: https://github.com/rcolyer/plot-function and https://github.com/rcolyer/closepoints and https://github.com/UBaer21/UB.scad
<InPhase> souvlakeeb: Since you are CS working on a PhD I will trust you to be able to dissect the parts of that pile you are interested in. :)
<InPhase> One breaks out pieces of complicated scad code and looks at them in isolation to see the construction process like with any other code.
ur5us has joined #openscad
<souvlakeeb> In case anyone's following, this is how the code ended up. Needed to make adjustments to meet SendCutSend minimum dimensions, and making two versions with different spacings: https://bpa.st/5H7A
<souvlakeeb> Awesome InPhase! Thanks for the great resources and outstanding help. This has been a pleasure!
<InPhase> souvlakeeb: Your corners will be prettier post-lasercut if you use those $fa/$fs variables. You should zoom in to see the effects it has on those.
<InPhase> A laser cut should have sufficient precision that this will make a subtle visible difference and a definite tactile difference in the result.
<souvlakeeb> You're the best! I just came back to fuss about that! I wasn't grasping that it applied. I understood it to only apply to circles, and discounted that circles are evidently used in the corner rounding.
souvlakeeb has quit [Quit: Client closed]
rkb97 has quit [Read error: Connection reset by peer]
J1A844028 has joined #openscad
J1A8440 has quit [Ping timeout: 252 seconds]
califax has quit [Remote host closed the connection]
califax has joined #openscad
toluene has quit [Ping timeout: 246 seconds]
toluene has joined #openscad
ur5us has quit [Ping timeout: 272 seconds]
foul_owl has quit [Ping timeout: 244 seconds]
foul_owl has joined #openscad
GNUmoon has quit [Remote host closed the connection]
GNUmoon has joined #openscad
ur5us has joined #openscad
<gbruno> [github] frazar closed issue #4288 (CGAL error when using `projection(cut=true)`) https://github.com/openscad/openscad/issues/4288
ur5us has quit [Ping timeout: 248 seconds]
J1A844028 is now known as J1A84
<Scopeuk> looks like its "open" as in anyone can buy the right to work with it
Fyr has joined #openscad
<Fyr> guys, where can I see gallery of things made with OpenSCAD?
<J1A84> !gallery
<J1A84> gallery?
<Fyr> empty
<Scopeuk> J1A84, I've no idea why the bot didn't kick in
<Fyr> it's the first thing I tried to open.
<Scopeuk> Fyr its not empty for me, thats very strange
<J1A84> we also  have the advent calender
<Fyr> oh
<Fyr> ublock blocks almost everything.
<Fyr> that's why the page was empty.
<Scopeuk> its possible its cross origin (everything gets loaded from hosting git hub pages etc)
<J1A84> Fyr  you probably have more success searching in thingiverse or printables
pah has quit [Ping timeout: 256 seconds]
<teepee> galerry needs javascript
<teepee> the gallery too :)
<teepee> I have ublock + privacy badger and it still shows fine
<Fyr> thanks!
pah_ has joined #openscad
pah_ has quit [Ping timeout: 256 seconds]
lastrodamo has joined #openscad
foul_owl has quit [Ping timeout: 268 seconds]
pah has joined #openscad
GNUmoon has quit [Ping timeout: 268 seconds]
pah_ has joined #openscad
pah has quit [Ping timeout: 240 seconds]
foul_owl has joined #openscad
pah has joined #openscad
pah_ has quit [Ping timeout: 268 seconds]
GNUmoon has joined #openscad
<teepee> oof,, why are all debian based nightly builds broken now :(
teepee has quit [Remote host closed the connection]
pah has quit [Ping timeout: 240 seconds]
teepee has joined #openscad
Fyr has quit [Quit: Client closed]
pah has joined #openscad
pah_ has joined #openscad
pah has quit [Ping timeout: 240 seconds]
J1A84 has quit [Quit: Client closed]
J1A84 has joined #openscad
J1A84 has quit [Quit: Client closed]
J1A84 has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
noonien9 has joined #openscad
noonien has quit [Ping timeout: 244 seconds]
noonien9 is now known as noonien
teepee_ has joined #openscad
teepee has quit [Ping timeout: 268 seconds]
teepee_ is now known as teepee
J1A84 has quit [Quit: Client closed]
J1A84 has joined #openscad
neur0 has quit [Remote host closed the connection]
fling has quit [Ping timeout: 268 seconds]
Junxter has joined #openscad
fling has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
<teepee> aha, we are back to green now \o/
<J1A84> great!  ..  and what caused it?
<teepee> OBS added a new feature for the debian build process, accepting different source packages
<teepee> so it started failing as the format was not defined.
<J1A84> always easy if you know why Ü
<teepee> so basically I just needed to a add a single line "Format: 1.0" to the package description
<teepee> I suppose it was mandatory before but the OBS stuff just did not care
<Scopeuk> did it at least give a reasonable error message?
<teepee> I did see some failure messages before, but that was just for one distro.
<J1A84> problem solving is not really about solving the problem but of knowing and understanding the problem
<teepee> the merge yesterday then resulted in about 30 error mails at once :D
<teepee> Scopeuk: nope, but the source code is on github ;-)
<J1A84> spammed by  code error
<teepee> yeah, that *really* makes it obvious there's a more general issue
<teepee> not as bad as a collegue a couple of years ago where some build or automatic test did go crazy and sent multiple thousands of error mails
<teepee> resulting in a temporary frozen inbox as that was when they used google for business mail
<J1A84> that could lead to a problem .. ( i know about two exchange servers that pingponged  out of office replies)
<Scopeuk> I had a colleague who got caught in a loop, version control sent an issue email to an out of office engineer, the out of office response triggered a this is not a monitored account email from version control and then two systems argued until the network stopped
<teepee> ah, neat, mail multiplication by error
<Scopeuk> I've seen a corperate email server brought down by reply all too, someone sent an email to all users rather than all (some small user group) users and 20k people hit reply all "did you mean to send this to me"
<teepee> yeah, classic
<teepee> "take me off that list !!!1!11!!"
<J1A84> didn't NVIDIA had this lately on github when someone included all group in a msg
<teepee> I did not hear about this, but I guess it's certainly possible
<J1A84> https://github.com/EpicGames/Signup/pull/24  ..  ah yes  " I think you just notified 398463 members."
<teepee> ah, a developer selling through epic game store, I think it's optional to give out the mail address
<teepee> nice performance test
<teepee> neat, there's also directly some of those "remove me" messages
<teepee> lol, all those helpful replies again did trigger 400k notifications
<J1A84> and github has a "mute this" function
<J1A84> i wonder how well github servers handled that
<teepee> still some people are terrible: "Lock it. Lock it now. This is the friendliest message I'm going to send, while I look for ways to get OP banned from Github for gross social misconduct."
<J1A84> i assume this could lead to blacklisting the mx
<teepee> why? because some honest mistake? block them, ban them, for life!!!
<J1A84> nuke it from orbit .. the only way to be safe
<othx> J1A84 linked to YouTube video "Nuke the entire site fom orbit" => 1 IRC mentions
J1A84 has quit [Quit: Client closed]
J1A84 has joined #openscad
TheAssassin has quit [Quit: No Ping reply in 180 seconds.]
KimK has quit [Ping timeout: 272 seconds]
TheAssassin has joined #openscad
peepsalot has quit [Remote host closed the connection]
linext_ has quit [Read error: Connection reset by peer]
peepsalot has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 268 seconds]
teepee_ is now known as teepee
_xxoxx has joined #openscad
_xxoxx has quit [Remote host closed the connection]
Junxter has quit [Ping timeout: 256 seconds]
little_blossom has quit [Ping timeout: 240 seconds]
J1A84 has quit [Quit: Client closed]
J1A84 has joined #openscad
little_blossom has joined #openscad
ur5us has joined #openscad
lastrodamo has quit [Quit: Leaving]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 268 seconds]
teepee_ is now known as teepee
J1A84 has quit [Quit: Client closed]
J1A84 has joined #openscad
Friithian has joined #openscad