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
Guest63 has joined #openscad
Guest63 has quit [Client Quit]
fling has quit [Ping timeout: 255 seconds]
<JordanBrown[m]> J2211: Indeed. Must look those up for my Craftbot+.
<J2211> 2500 .. seems ok
<JordanBrown[m]> teepee InPhase: almost done with replacement artwork, but must break for the evening.
<J2211> voron running 10 000
<gbruno> [github] kwikius synchronize pull request #4367 (ModuleLiterals: making openSCAD modules first class.) https://github.com/openscad/openscad/pull/4367
fling has joined #openscad
fling_ has joined #openscad
fling has quit [Ping timeout: 255 seconds]
<gbruno> [github] kwikius edited issue #4349 (Feature Request : Module literal) https://github.com/openscad/openscad/issues/4349
fling_ is now known as fling
califax has quit [Remote host closed the connection]
califax has joined #openscad
fling has quit [Ping timeout: 255 seconds]
fling_ has joined #openscad
fling_ is now known as fling
Non-ICE has quit [Read error: Connection reset by peer]
Non-ICE has joined #openscad
<linext> anyone know where the snowman is from?
<linext> i think i pulled it from the old examples
<teepee> I don't remember a snowman in the examples
LordOfBikes has quit [Ping timeout: 256 seconds]
<linext> hmmm..
<linext> i didn't come up with him
<linext> here's the original code: https://www.3dcustomizer.net/paste/879AFC3D
<linext> the file was named snowman.scad, maybe from thingiverse?
<linext> ah, yes, it came from https://cdn.thingiverse.com/assets/4b/d7/59/df/ed/snowman.scad according to chrome downloads
<othx> linext linked to "Snowman by AlbyAlby" on thingiverse => 1 IRC mentions
<teepee> aha, and the thingiverse license box is utter nonsense :(
LordOfBikes has joined #openscad
<InPhase> teepee: You mean the way everything has two contradictory licenses?
<teepee> unless you actually license -NC-ND
<teepee> assuming that's just a static text
<InPhase> Well I'm not a lawyer, but that bottom part doesn't sound binding.
<InPhase> If the top part says what the author licensed the work under, then the bottom part declaring that by downloading we agree to a license without specifying what work it applies to and without getting our agreement is nonsense.
<InPhase> The only thing that matters is what license was applied by the author to the work.
<teepee> I'm not sure about that, I think -NC-ND might compatible so they might be able to relicense?
<teepee> not that this makes sense of course
fling has quit [Remote host closed the connection]
<InPhase> NC-ND is an additional restriction not applied by the author, but was probably slapped on there in an attempt to discourage all those sites that are harvesting thingiverse content and putting it up on their own sites.
<InPhase> But thingiverse has no legal standing to go after those sites for content that is not their own.
fling has joined #openscad
<teepee> lets hope so
<InPhase> teepee: My own stuf is marked "Creative Commons - Public Domain Dedication" license on thingiverse, and then they have that same static text under it stating "Attribution - Non Commercial - No Derivatives". They have no legal standing to enforce that on my content. And I would have words with them if I found out they were suing someone over content I made that I have told people they can have.
<InPhase> They'd probably end up paying opponent legal fees in such a lawsuit.
<InPhase> Again, not a lawyer, but it seems like total nonsense. Authors hold all the legal cards in this area, up until they assign those rights to someone else.
TheAssassin has quit [Ping timeout: 255 seconds]
TheAssassin has joined #openscad
* teepee crosses fingers
<gbruno> [github] t-paul pushed 1 modifications (Support multiple (max. 5) source and print files, add info field.) https://github.com/openscad/openscad.github.com/commit/37162ce686878645691c97485189167cb3386611
<teepee> yay! back to working state \o/
<teepee> ok, new index.js format, multiple source and printer files supported :)
<teepee> plus info box
J221147 has joined #openscad
J2211 has quit [Ping timeout: 260 seconds]
Guest16 has joined #openscad
<Guest16> hi
<teepee> hello Guest16
<Guest16> Does anyone have good book recs for graphics programming? I'm web developer and would like to specialize and contribute to this project
<teepee> graphics has lots of meanings in that regard? what specifically? more like GPU stuff OpenGL and the like, or the Geometry, Algorithm part of things?
<Guest16> i think the latter (Geometry/Algorithm), unless you think I'm asking the wrong question
<InPhase> Guest16: So a big chunk of the geometry and algorithm code behind OpenSCAD is tapped from the CGAL library.
<InPhase> Guest16: The people behind this library take a very mathematician view of things, and often appear to be tracking recent advancements that are more at the level of journal articles than books.
<InPhase> We do some custom bits in-house for this, scattered throughout the code. Usually it's done by someone who hunts around for a good algorithm.
ur5us has joined #openscad
<InPhase> Or occasionally someone who just thinks of one.
<Guest16> Much appreciated, I'll definitely bookmark CGAL and dig in some more.
<InPhase> Most of the OpenSCAD code handles things like the programming language / interpreter, the interfaces, the support for the many file formats, and converting the results of running the interpreter into a sequence of calls to the right libraries to produce the right geometric operations, and turn this into a mesh output.
<Guest16> Any tips for getting to know the source code more, things to pay attention to? Libraries to be wary of and double click into?
<teepee> my strategy in such cases is finding a small topic and follow that along
<InPhase> Well if you're genuinely interested in contributing, there's a standard path for this. Step 1, is follow the instructions in the readme to get a copy building on your computer. Once you do, browse the issue list on github and look for something marked "low hanging fruit" that interests you.
<teepee> I've changed that to the default name used on github :)
<teepee> "good first issue" I think
* teepee goes checking
<InPhase> The "low hanging fruit" ones were judged by someone as probably simple enough for someone unfamiliar with the codebase to figure out and fix. And nothing gets you going faster than actually fixing something successfully. Then you're familiar with at least one part of the code, and have the full contribution process down.
<InPhase> Okay, "Good First Issue" now instead of "low hanging fruit". :)
<InPhase> Although, sadly, I liked "low hanging fruit" better. But I suppose "Good first issue" is less of an idiom.
<teepee> those tend to be more GUI issues though as those have a higher chance of being small
<teepee> both seem a bit awkward ;-)
<Guest16> nonetheless, definitely looks like a good place for me to check out, thank you!
<teepee> for someone having a good programming background, there's also the option to see if there's some pull request with an interesting topic that may need some love
<InPhase> Ah yes, the old "abandoned pull request" problem.
<InPhase> But if you see an abandoned pull request, talk about it with us first. There might be a reason it got abandoned.
<teepee> like via google summer of code we have a shader branch allowing users to select different shaders
<teepee> yes, good point, having a chat before a deep dive is always a good idea
<InPhase> Guest16: Good general advice is to discuss any changes that aren't really simple before diving into the work. We're pretty good about giving feedback and advice, and can help with context. There are a lot of moving parts in a program like this, so it's easy to trip over an invisible problem.
Sauvin has quit [Remote host closed the connection]
<InPhase> Guest16: So getting someone as a sounding board first helps make sure things are going to go in a good direction.
Sauvin has joined #openscad
<Guest16> much appreciated! I have to sign off for tonight but when I pick a PR can I just shoot a message here when I have questions?
<InPhase> teepee: Is that even still an issue? https://github.com/openscad/openscad/issues/378
<InPhase> teepee: I thought we long ago fixed up those descriptions.
<InPhase> Guest16: Yep.
<teepee> oh, look, passing the parameters in the right order makes the fractal to actually look like a julia set :D
<teepee> oh, hmm, I'm not sure.
<InPhase> Guest16: When you are able to stick around for a reply, IRC here is a great place to get timely interactive feedback.
<InPhase> teepee: Good luck figuring out the bounty. I bet that was edited a lot of times since 2013. ;)
<InPhase> I made at least one edit! But to a description I thought was mostly complete.
<teepee> there is at least some longer discussion than I remember reading last time
<Guest16> InPhase, sounds good. First time using IRC, my apologies in advance if I didn't have the manerisms down yet. catch you guys later :)
Guest16 has quit [Quit: Client closed]
<InPhase> teepee: It seems to mention a longer mailing list discussion.
<InPhase> teepee: Of course "optimal resolution" is the wrong goal. That would be $fs with no $fa limit at all, and would computationally explode on people.
<InPhase> There is a reason for what we do there. :)
<teepee> I would not count exploding as optimal
<InPhase> Perhaps the documentation is still missing a discussion of those issues. Maybe it isn't obvious.
<InPhase> Especially if you're not used to thinking about computational complexity.
<InPhase> Anyway, I should be asleep.
<teepee> indeed, me too
<InPhase> Reddit says we got 380 views on the subreddit post I made. Not sure how many of those are humans. But there might be a good number of eyeballs that track that subreddit, even if few people talk there.
<InPhase> (about the calendar)
fling has quit [Ping timeout: 255 seconds]
<teepee> oh, nice. I did not check reddit for a while
<teepee> lots of activity on the mastodon post, even though it was the very first one of the account
<teepee> not much on twitter
<teepee> I guess everyone is just browsing elon now
NogetDigitalt has joined #openscad
DigitaltNoget has joined #openscad
fling has joined #openscad
NogetDigitalt has quit [Quit: Leaving]
DigitaltNoget has quit [Quit: Leaving]
fling_ has joined #openscad
fling has quit [Ping timeout: 255 seconds]
fling_ is now known as fling
<teepee> probably not an easy print https://imgur.com/C47gIoF :)
fling has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 255 seconds]
TheAssassin has quit [Quit: No Ping reply in 180 seconds.]
TheAssassin has joined #openscad
fling has joined #openscad
othx has quit [Ping timeout: 256 seconds]
othx has joined #openscad
fling has quit [Ping timeout: 255 seconds]
fling has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee has joined #openscad
fling has quit [Ping timeout: 255 seconds]
<JordanBrown[m]> teepee InReach ^
fling has joined #openscad
teepee_ has joined #openscad
<JordanBrown> Er, InPhase ^
<JordanBrown> InReach is my satellite tracker :-)
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
fling has quit [Ping timeout: 255 seconds]
fling has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
be7b5 has joined #openscad
fling has quit [Ping timeout: 255 seconds]
teepee has quit [Read error: Connection reset by peer]
TheAssassin has quit [Ping timeout: 255 seconds]
TheAssassin has joined #openscad
teepee has joined #openscad
fling has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
fling has quit [Ping timeout: 255 seconds]
fling has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
fling has quit [Ping timeout: 255 seconds]
Guest5992 has joined #openscad
Guest5992 has quit [Quit: Client closed]
califax has quit [Remote host closed the connection]
califax has joined #openscad
Guest4 has joined #openscad
califax has quit [Ping timeout: 255 seconds]
Guest4 has quit [Quit: Client closed]
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
GNUmoon has quit [Remote host closed the connection]
teepee has quit [Ping timeout: 255 seconds]
teepee has joined #openscad
califax has joined #openscad
<J221147> https://chat.openai.com/chat  can write C scripts
<J221147> so  only a question of time when it can write scad code
<InPhase> JordanBrown: Nice. :)
<InPhase> J221147: Has anyone tried to see if it can already write OpenSCAD code?
<J221147> no account .. but it in theory it could be possible, someone said it used a lib from git
<InPhase> Maybe it would be kind enough to make us a calendar entry!
<J221147> but i assume it is not trained for 3D understanding
<J221147> even if it give us just a cube()  that would impress me
J221147 is now known as J22
fling has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
teepee has quit [Remote host closed the connection]
fling has quit [Ping timeout: 255 seconds]
teepee has joined #openscad
califax has quit [Remote host closed the connection]
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
califax has joined #openscad
<teepee> J22: https://twitter.com/wstrinz/status/1599131482768887808 the "can almost generate openscad"
<teepee> JordanBrown: nice, that's with the openclipart input?
<JordanBrown[m]> Yes.
<J22> wow
<JordanBrown[m]> So totally IP-safe.
<J22> still need to learn the overlap rule Ü
<teepee> awesome, yes, those are CC0 too, so I like to still credit via URL but in theory not even that is needed
<teepee> that's the problem, I'm not yet convinced it's really *learning*, it's just mushing stuff together
<teepee> which probably works fuzzy enough for images, but for CAD that seems not enough
<JordanBrown[m]> But is it enough for 3D art?
<J22> that is what GPT 3/4 does  it recombine ..  but  that is what we do when we speak .. i thing real originality is pretty rare
<teepee> true, but we *know* *why* we combine stuff for CAD
<J22> well it  knows too because it got an input that it try to match
<teepee> yes, but there's no reasoning why or understanding what's going on I assume
<J22> not like it be like .. nah i have headache.. maybe tomorow
<teepee> which you can attribute with pictures to "haha funny"
<teepee> that does not work for precise things
<J22> the question is do we understand why we do things or what is really going on?  because most of it is an illusion
<J22> i assume it will fail with request like " code for a way to compress gas that never existed before "
<J22> or it just starting to misunderstand you intentionally
Guest6150 has joined #openscad
<J22> but it is a chat .. so https://imgur.com/a/YhrVo7S
Guest6150 has quit [Client Quit]
<J22> so if someone sign up we can get an SCADvent door from an AI .. quite apealing
<teepee> not really with even still not clear how copyright works for that
<J22> oh  thought you said it is CC0
<teepee> J22: that was about the design JordanBrown posted. he got no feedback regarding the original SVG he used from that art/make site
<teepee> so looking through opencliparts there a nice replacement now which is CC0
<teepee> J22: oh, and you can now give multiple source/print files to the index.js file (up to 5 each) - although giving 10 will probably totally mess up the layout
<teepee> and and info field which is put at the bottom
<teepee> src: 'single-file.scad'
<teepee> or
<teepee> src: ['first.scad', 'second.scad']
<teepee> only for "src" and "bin", "img" is still just a single one
<J22> cool
<J22> Input and Output are collectively “Content.” As between the parties and to the extent permitted by applicable law, you own all Input, and subject to your compliance with these Terms, OpenAI hereby assigns to you all its right, title and interest in and to Output.
<J22> sounds like you can put any license on the output you want
TheAssassin has quit [Quit: No Ping reply in 180 seconds.]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
TheAssassin has joined #openscad
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
<teepee> and where's the training data coming from? all those image AIs just scraped the internet
<J22> yes and a court decided that this is legal even when the images have IP on it
<J22> still interesting if they scrap code that is not free
<teepee> I doubt that's finally settled, if you can just use any IP by randomly shoving it through something you call AI, that's not going to make people happy
<teepee> even most free code has license "restrictions" which is the discussion about the github stuff as it may generate portions of code it scraped
<JordanBrown[m]> Is anybody familiar with the SVG import and how it decides how many segments to put into a curve? Docs say that $fn et al control, but they seemed to give very little control.
<teepee> at this point you can only increase resolution
<teepee> this is relatively new, previously there was no control at all, so this was a compromise to not break too much designs
<teepee> but I guess at some point we just need to allow normal control
<teepee> the easiest way with full control is segmenting the SVG in inkscape
<JordanBrown[m]> I don't understand. If you have a curve in the SVG, it's only got four control points. How OpenSCAD turns that into straight lines is up to the importer.
<JordanBrown[m]> Eww. That would make it impossible to edit.
<JordanBrown[m]> Well, strictly, impractical.
<teepee> yes, and the old code had some fixed value which was changed to use $fX but limited on the low end to the previously fixed value
<J22> https://www.reuters.com/legal/legalindustry/art-artificial-intelligence-recent-copyright-law-development-2022-04-22/    .. As AI is not a person - no copyright is possible so no infringement - Ü  lets see how that turns out
<JordanBrown[m]> Ah, so you can only increase resolution *over the previous default*. Got it. I was not understanding how you could increase resolution over what's in the SVG, because there *is* no resolution in the SVG.
<J22> JordanBrown[m] all SVG curves will be transformed into polygons
<JordanBrown[m]> Yes. The question is how many segments those polygons will have.
<teepee> yep, that's what I meant, you can't go lower resolution that that old fixed code
<JordanBrown[m]> Thanks. It was just taking longer than I liked to F6 and so I was looking for a way to reduce the resolution.
<J22> you can use inkscape to simplify or refine the curve and turn into straight segments .. then this is what  scad import without change
<JordanBrown[m]> Yeah, but once you do that you wouldn't want to edit it.
<J22> only if you have surplus time
<JordanBrown[m]> The guy who contributed that SVG https://openclipart.org/artist/GDJ has averaged over twelve contributions per day since 2015.
<JordanBrown[m]> Admittedly many of them are mechanically derived.
<JordanBrown[m]> teepee what's the process for contributing this to the SCADvent repo?
<teepee> I think you can easily go back to curves in inkscape with some function I forgot the name of
<teepee> JordanBrown: each design needs to be in a separate folder, it must have an image and scad file, it now can have multiple input files, it can have multiple "print" files
<teepee> all the meta data goes into index.js
<teepee> it can have an info text, e.g. it could now link to the source file on openclipart
<teepee> the formatting of the index.js needs to be fixed for the lines with setDay as those are grepped for the folder name
be7b5 has quit [Quit: harbour-communi 0.11]
<JordanBrown[m]> Is there a preferred form for the image? In particular, is there a preferred OpenSCAD color scheme for taking the picture?
<teepee> hmm, yes, let me check, I asked that a couple of days ago too :)
<teepee> DeepOcean
teepee has quit [Remote host closed the connection]
<JordanBrown[m]> preferred image size?
<JordanBrown[m]> I see that the one that I happen to be looking at from 2021 is 900x900.
<J22> yeah or 4/3  900× 675
snaked has quit [Ping timeout: 268 seconds]
<InPhase> lol. The AI missed the overlap rule.
teepee has joined #openscad
<teepee> argh, disconnected :(
<teepee> <teepee> square shape works best I think the resolution of the existing images is about 800 to 1024 squared
<teepee> <teepee> J22: while I did fail to tweet/toot/whatever all the doors, I did have to post your eyes animation, that is too cool to not show it to the lazy people too who don't go to the calendar :)
* teepee shakes fist at the router and reboots it ;-)
teepee has quit [Ping timeout: 255 seconds]
<JordanBrown[m]> Is there an irrational 1900s-era prejudice against spaces in file names?
califax has quit [Remote host closed the connection]
califax has joined #openscad
teepee has joined #openscad
<J22> teepee  thanks
Guest61 has joined #openscad
Guest61 has quit [Client Quit]
<JordanBrown[m]> I suggest that I push my files without putting them into index.js, so that you can take a look before they get made "real". Is that OK?
<JordanBrown[m]> teepee^
<teepee> you can add the index too, it's not automatically deployed currently
<teepee> I do have to sync the files over to the server
<JordanBrown[m]> Can src take a list?
<teepee> yes, src and bin can take a list, maximum for both is 5 but I guess with more than 5 total the layout gets a bit messy
<J22> src: ['first.scad', 'second.scad']
<J22> only for "src" and "bin", "img" is still just a single one
<J22> (copy)
<JordanBrown[m]> Pushed, take a look.
<InPhase> Oh, right. This is the one that requires master branch.
<InPhase> JordanBrown[m]: Hmm... The bottom of Santa is a bit messier than the top.
<JordanBrown[m]> teepee InPhase want me to do anything with either Life or Tic-tac-toe?
<JordanBrown[m]> You mean the Z-fighting?
<InPhase> Yep.
<InPhase> There's hefty z-fighting. I tested a render as well to see if it would fail out from the z-fighting. It completed, although left a hole in him around the mouth.
epony has quit [Quit: QUIT]
<InPhase> That could impact anyone who attempts to print this model. The hole goes straight through.
<JordanBrown[m]> Hmm? The mouth is pretty deep but does not go all the way through.
<InPhase> Also, one of the ears appears to not actually be attached in the manifold sense.
<InPhase> But I suppose that's floats being floats, given what you have done. Let me test a super small offset.
<JordanBrown[m]> It's unlikely to be floats. Indeed, when I look closely at the render I see a few micro gaps. I'll fix those.
<InPhase> Well, offset(0.1) on each import does not end well. "ERROR: Rendering cancelled by exception Unauthorized intersections of constraints"
<InPhase> I did not expect that.
<JordanBrown[m]> I don't know what that means :-)
<InPhase> I don't either, but it sure sounds bad. ;)
<JordanBrown[m]> I mean *I* authorized those intersections.
<JordanBrown[m]> Most of the pieces overlap, but a few butt up against one another, and where they butt up against one another there might be micro gaps.
<InPhase> Yeah. It would be ideal to have a generalized solution for that. I've tried now a few variations of offset. None worked yet.
<InPhase> Oh... Oddly, offset(0.2) offset(-0.1) worked
<InPhase> That was a rather random attempt on my part.
<InPhase> I was just wondering if maybe there were random features needing erased.
<gbruno> [github] thehans opened issue #4432 (linear_extrude regression for `slices=0`) https://github.com/openscad/openscad/issues/4432
<InPhase> Feel free to take that as the solution if you like it.
<JordanBrown[m]> Nah, I'd rather fix the SVG to eliminate the gaps.
<InPhase> Sure.
<JordanBrown[m]> I already cleaned up the curves a lot; there were a lot of degenerate segments.
<JordanBrown[m]> and probably five times as many nodes as necessary.
<JordanBrown[m]> But then again I like clean Bézier curves.
<JordanBrown[m]> and I like them to be minimal. So, e.g., the lips are now four nodes, and the mouth proper is three.
GNUmoon has joined #openscad
peepsalot has quit [Quit: Connection reset by peep]
ur5us has joined #openscad
<JordanBrown[m]> I knew about the Z-fighting, but figured that there were two applications: looking at the image, and printing, and for neither of them did the Z-fighting matter. But I have fixed it by having the "base" be red, and everything else sits atop the base.
<JordanBrown[m]> I did check a render before pushing, and in fact have a copy printing at the moment.
<JordanBrown[m]> But I can easily believe that there are lurking degenerate nodes that can cause indigestion.
<JordanBrown[m]> I'll do some tests with offset to see if I can find any more.
Bocaneri has joined #openscad
Bocaneri is now known as Guest3282
Sauvin has quit [Killed (NickServ (GHOST command used by Guest3282))]
Guest3282 is now known as Sauvin
peepsalot has joined #openscad
<InPhase> JordanBrown[m]: Ah, I see in the svg that you used inkscape. I was as a follow-up wondering how you went about marking the parts. :)
fling has joined #openscad
<JordanBrown[m]> Did you read the comments in the SCAD file?
<InPhase> Read the entire instructions? Unlikely.
<InPhase> I stopped before "How I did this"
<InPhase> JordanBrown[m]: Oh. I guess you need to reread the comments too. It stops at "can be used to take any 2D "
<InPhase> You probably wanted to finish that thought. :)
J2227 has joined #openscad
<JordanBrown[m]> Oops.
<InPhase> But yeah, I see now how it ties together. That affords a good bit of control, and ties the two tools together nicely.
<JordanBrown[m]> I've actually used this technique for "real" work. Some of my tool holders started out life as a scan of a tool, then traced in Inkscape, and some of them wanted multiple levels.
J22 has quit [Ping timeout: 260 seconds]
<peepsalot> Can we define a DSL for argument validation on builtin functions and modules?
<InPhase> JordanBrown[m]: Now I'm also wondering why we don't parse those "fill" colors when importing svg.
<InPhase> JordanBrown[m]: That would further utilize the information already in the svg file.
<peepsalot> kind of like the tooltips we already show in editor, but more detailed. containing info about argument positioning, names, default value, but also valid types and valid ranges
<peepsalot> so internally each builtin has a string defined with all this information encoded. then one function could be written to parse that string, and handle input validation + warnings
<peepsalot> maybe also show that full info in the tooltip, if it can fit...
<peepsalot> might require newline per parameter
<InPhase> peepsalot: I reread that a couple times, but I'm still not seeing quite what you mean.
<peepsalot> like this linear_extrude slices=0 issue. you were talking about clamping the value to 1 and i think that's reasonable. but what if someone puts in a non-number?
<peepsalot> i would think ideally we issue a type warning
<peepsalot> rather than fail silently
<JordanBrown[m]> No shadow that time.
<peepsalot> so i got to thinking about parameter validation in general for builtins besides linear_extrude, if we can have a way to specify all that info about function signatures
<JordanBrown[m]> I'd probably think about it the other way 'round, having the component specify a structure and the infrastructure derive a string.
snaked has joined #openscad
<peepsalot> i guess a tooltip style string could tell type and range info in an inline comment
<peepsalot> without any sort of strict specification (like a formal grammar), it seems like a lot of quasi-duplicated code and having each builtin doing its own ad-hoc thing to validate inputs
<JordanBrown[m]> yes, and while some (e.g. linear_extrude) have some reason to do their own thing, most do not.
<JordanBrown[m]> Commonizing that stuff would be good, though there are subtle compatibility risks.
<JordanBrown[m]> InPhase pushed a cleaned up version.
<JordanBrown[m]> Ah, forgot to rebuild the PNG and 3MF. Doing that. (Not that anybody would notice.)
<peepsalot> InPhase: still clear as mud?
<JordanBrown[m]> Rebuilt, re-pushed.
<peepsalot> right now argument validation is basically undefined behavior
califax has quit [Remote host closed the connection]
fling has quit [Ping timeout: 255 seconds]
<JordanBrown[m]> doesn't mean nobody depends on it :-(
teepee has quit [Quit: bye...]
califax has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
fling has joined #openscad
teepee has joined #openscad
<InPhase> peepsalot: Sorry, I got distracted putting up Christmas lights.
<InPhase> peepsalot: Hmm, that sort of argument validation...
<InPhase> peepsalot: It's made tricky when we often accept multiple types.
<InPhase> And sometimes in paired ways.
DanielEzell has joined #openscad
<InPhase> peepsalot: Maybe I'll bounce it back this way. What would you do if you wanted to empower users to do the same in custom modules and functions?
<DanielEzell> Hello all. I've been using OpenSCAD for a while and I have a puzzle I'm unable to solve. I'm exploring modular arithmetic and I want to place a sphere at every point where (x mod z = y mod z) but instead of spheres I'm getting cylinders, and rendering flattens the whole thing down.
<DanielEzell> for (x = [-50:50],
<DanielEzell> y = [-50:50],
<DanielEzell> z = [-50:50])
<DanielEzell>     if ((x % z) == (y % z)) translate([x,y,z])circle(d = .1);
<DanielEzell> shoot. I put circle
<DanielEzell> ha!
<DanielEzell> fixed it
<DanielEzell> That was fun.
<DanielEzell> Anyway, enjoy getting your mind blown looking at that graph
<DanielEzell> for (x = [-50:50],
<DanielEzell> y = [-50:50],
<DanielEzell> z = [-50:50])
<DanielEzell>     if ((x % z) == (y % z)) translate([x,y,z])sphere(d = .1);
<teepee> :) things happen
fling has quit [Ping timeout: 255 seconds]
<DanielEzell> bye all
DanielEzell has left #openscad [#openscad]
<teepee> bye
fling has joined #openscad
<teepee> JordanBrown: pushed to the secret URL
<JordanBrown[m]> teepee does that mean that it's "live"?
<JordanBrown[m]> Still behind a closed door, of course, but ready to come out?
<teepee> that too, but via that URL the door is unlocked
<teepee> the public URL has it still locked
<JordanBrown[m]> I don't know that URL. You could private-message it to me.
<teepee> top of the README in the repo
<JordanBrown[m]> Cool!
<JordanBrown[m]> (And now I have to resist looking at the others.)
<peepsalot> InPhase: some kind of comment annotations
RoyK has quit [Ping timeout: 248 seconds]
<JordanBrown[m]> teepee Any interest in either Life or Tic-Tac-Toe? InPhase seemed interested in them for their "not a traditional OpenSCAD application" aspect, but I can't say that either is very Christmassy.
RoyK has joined #openscad
<peepsalot> InPhase: something like: function foo(x=12 /* (Number)[0:] */);
<peepsalot> would mean that x has to be a number and non-negative
<teepee> my fractals are not really christmas themed either
<teepee> I don't thing we would be able to get all doors chistmas themed, so that's fine
<teepee> think*
<teepee> the tic-tac-toe is interesting, but the interactivity is maybe not ideals for the calendar, the game-of-life works nicely as animated gif
<JordanBrown[m]> peepsalot would have to play with the parser but it might be OK to have the type be an actual keyword optionally in front of the name.
<JordanBrown[m]> But note that types can be quite complex - it's a list, but what dimensionality and containing what types?
<peepsalot> yeah i know there's still a lot of corner cases that are not covered by that example.
<JordanBrown[m]> Value restrictions OTOH I'd be inclined to leave to asserts.
<teepee> why "comment" annotations, we can have *real* ones ;-)
<peepsalot> it would definitely be tricky to show all possible valid inputs, especially with conditionally-valid arguments (e.g. `r` and `d` can't both be specified)
<JordanBrown[m]> Yes.
RoyK has quit [Remote host closed the connection]
<JordanBrown[m]> But you could have r1 and d2...
<peepsalot> i mean there would probably still need to be a bit of custom code for handling extra restrictions, but I think overall something like that would still reduce the amount of code dedicated to taking in parameters
<JordanBrown[m]> Maybe helpers like "all of these must be defined", "must define exactly one of these", "must define zero or one of these", et cetera.
<JordanBrown[m]> Though the obvious implementations would lose the names of the offending variables.
<peepsalot> the tooltips already do handle multiple call signature variations though, one per line like cylinder(
<peepsalot> so maybe r and d was not a good example, but i'm sure there are plenty other more complicated cases
<peepsalot> Like I can't even remember what the current situation is with linear_extrude and the "file" param
<peepsalot> so special handling there might be inevitable, but i think the vast majority of inputs could be handled generically
<JordanBrown[m]> are you thinking more of builtins or user-defined stuff?
<peepsalot> i mean primarily for builtin stuff, but i wouldn't be against some way to let users have the same functionality
<peepsalot> JordanBrown[m]: and InPhase specifically asked about the user-defined case earlier
<JordanBrown[m]> Both are interesting but I think the answers are very different.
teepee has quit [Remote host closed the connection]
teepee has joined #openscad