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
teepee has joined #openscad
epony has quit [Ping timeout: 268 seconds]
epony has joined #openscad
TheCoffeMaker has joined #openscad
LordOfBikes has quit [Ping timeout: 272 seconds]
tcurdt has quit [Quit: bye]
TheCoffeMaker has quit [Quit: So long and thanks for all the fish]
TheCoffeMaker has joined #openscad
LordOfBikes has joined #openscad
tcurdt has joined #openscad
<linext> hey teepee, i turned you into an admin for 3dcustomizers.net in case you want to fix other users' designs
<linext> it'll kick in after a few days when i update the code
<teepee> oh, scary :)
<InPhase> Opening a betting pool for the first date on which teepee breaks everything. ;)
J226297 has joined #openscad
tcurdt has quit [Quit: bye]
<ali1234> day 8 and day 15 show the image from the day before when you open the "big" view
<ali1234> oh, this is because the gif takes ages to load :)
J2262 has quit [Ping timeout: 260 seconds]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
Junxter has joined #openscad
tcurdt has joined #openscad
<InPhase> ali1234: Someone needs fiber. :)
<InPhase> teepee: Nice. I just noticed your Fortress of Solitude for day 16.
<InPhase> teepee: Also, nice flame animation.
x__ has quit [Ping timeout: 255 seconds]
Guest57 has joined #openscad
Guest57 has quit [Client Quit]
_xxoxx has joined #openscad
Junxter has quit [Ping timeout: 260 seconds]
x__ has joined #openscad
<gbruno> [github] jordanbrown0 opened issue #4450 (s = join([s1, s2, ...], sep) - concatenate an array of strings, optionally with a separator) https://github.com/openscad/openscad/issues/4450
<JordanBrown[m]> teepee InPhase: I just pushed a draft of Life to SCADvent. I need to pick the exact settings for the video and create it, but some code/prose review would be nice.
califax has quit [Remote host closed the connection]
califax has joined #openscad
Lagopus` has quit [Changing host]
Lagopus` has joined #openscad
tcurdt has quit [Quit: bye]
<JordanBrown[m]> Hey, teepee, you guys awake yet?
x__ has quit [Ping timeout: 260 seconds]
x__ has joined #openscad
<J226297> time is right ..
<J226297> (noonish)
<JordanBrown[m]> J226297: That's UB, right?
<J226297> Yes Ü
J226297 is now known as J22
<JordanBrown[m]> Why does your username change all the time? Means I can't set up a sticky PM session.
<J22> It is that funny Webclient that adds numbers almost every reconnect
tcurdt has joined #openscad
_xxoxx has quit [Read error: Connection reset by peer]
<JordanBrown[m]> Did you get the PM I sent?
<JordanBrown[m]> J22^
<J22> no
<JordanBrown[m]> fudge
<J22> hmm  "You must log into your NickServ account to message this user"  when try to msg you
<JordanBrown[m]> If you build my experimental at https://github.com/jordanbrown0/openscad/tree/module_literal_v3 (which includes some stuff based on kwikius's module literals work, but I didn't happen to use that here) then you can run a first draft potential SCADvent 2023 entry at https://bpa.st/LS3KW
<JordanBrown[m]> Whether or not you build it, you might be interested in looking at that program. It uses a couple of potentially cool experimental features.
<JordanBrown[m]> { a: 1, b: 2 } is a JavaScript-style object literal.
<JordanBrown[m]> {{ ... }} is what I call a geometry literal... puts some OpenSCAD geometry into a value that you can then put in a variable, return from a function, put in an array, et cetera.
<JordanBrown[m]> Thus, for instance, boxcar.length is the length of a boxcar, and boxcar.model is the boxcar model.
<JordanBrown[m]> and caboose(color) returns a similar object for a caboose of the specified color.
<J22> https://twitter.com/317070  Jonas Degrave build a simulated VM into GPT chat
<JordanBrown[m]> that's... mildly terrifying.
ccox_ has joined #openscad
ccox has quit [Ping timeout: 256 seconds]
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #openscad
x__ has quit [Ping timeout: 260 seconds]
x__ has joined #openscad
tcurdt has quit [Ping timeout: 265 seconds]
<teepee> JordanBrown: Life works great
tcurdt has joined #openscad
x__ has quit [Ping timeout: 260 seconds]
tcurdt has quit [Quit: bye]
TheAssass1n is now known as TheAssassin
tcurdt has joined #openscad
Guest23 has joined #openscad
<Guest23> Hello all
<Guest23> im getting a parse error here can anyone help?
<Guest23> / Translate and rotate the shapes to the desired position
<Guest23> translate([0, 0, 1.5])
<Guest23> {
<Guest23>     rotate([0, 0, 45])
<Guest23>     {
<Guest23>         body;
teepee_ has joined #openscad
<teepee_> Guest23: looks ok to me, depending on what "body;" is
<teepee_> maybe share a running snippet via a paste site
<teepee_> paste?
<othx> paste is https://www.3dcustomizer.net/paste for .scad files, https://bpa.st for text, https://pasteboard.co/ or https://imgur.com/ for images
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
<Guest23> / Define the basic body shape
<Guest23> torso = cylinder(r=1, h=3);
<Guest23> arm1 = cube(size=[0.5,1,1]);
<Guest23> arm2 = cube(size=[0.5,1,1]);
<Guest23> leg1 = cube(size=[1,1,2]);
<Guest23> leg2 = cube(size=[1,1,2]);
<Guest23> / Define the details
<Guest23> head = sphere(r=1);
<Guest23> eye1 = sphere(r=0.2);
<Guest23> eye2 = sphere(r=0.2);
<Guest23> nose = cone(r=0.5, h=1);
<Guest23> mouth = cube(size=[1,0.5,0.5]);
<Guest23> hair = cylinder(r=1, h=2);
<Guest23> / Combine the shapes using Boolean operations
<Guest23> body = torso + arm1 + arm2 + leg1 + leg2;
<Guest23> face = head - eye1 - eye2 - nose - mouth;
<Guest23> / Translate and rotate the shapes to the desired position
<Guest23> translate([0, 0, 1.5])
<Guest23>         }
<Guest23>     }
<Guest23> }
<teepee> pasting lots of lines does not really work via IRC
<teepee> you can put it for example on https://www.3dcustomizer.net/paste and paste the link here
<Guest23> sorry.. he said paste..
<teepee> "paste site" yeah, maybe we need a more obvious name for those :)
<Guest23> i am a guest after all lmao
<teepee> that's totally fine, guests are welcome even without login
<teepee> head = sphere(r=1);
<teepee> this type of code is not yet supported, it's something that hopefully will happen at some point but right now you can't assign geometry
<teepee> what you can do is defining modules
<teepee> module head() { sphere(r = 1); }
<teepee> and use it later as just head();
<teepee> it looks like that syntax came from a slightly different program? e.g. one of the python wrappers or maybe OpenJSCAD - the JavaScript one?
<Guest23> here is my other puzzle i'll get back to you on the frist.
<teepee> whops, firefox crashed. I guess after downloading updates one should restart it directly :)
<teepee> 2nd one has bits missing at the end
<JordanBrown[m]> teepee, InPhase: here's a video of that draft 2023 entry: https://imgur.com/a/PYPsrhx
<teepee> aww, that is cute
<teepee> fwiw, I've created a 2023 repo :)
<JordanBrown[m]> The implementation has some kind of interesting uses of objects and geometry literals.
<teepee> also currently running your life script trying to see how webp will cope with the data
<JordanBrown[m]> I don't know webp.
<JordanBrown[m]> As an example, here's the definition of the track:
<JordanBrown[m]> track = [
<JordanBrown[m]> straight(30),
<JordanBrown[m]> straight(120),
<JordanBrown[m]> curve(30,90),
<JordanBrown[m]> ...
<teepee> I just used the cmdline InPhase posted, not sure what I used last year, but something similar
<teepee> ah, yes, turtle style track
<JordanBrown[m]> straight() and curve() are functions that return objects that describe the track segment, giving a model for the track, translate/rotate to the endpoint, and length along the segment.
<JordanBrown[m]> This is the train:
<teepee> doing something like that without recursion is certainly going to help lots of people who don't want to deal with recursion
<JordanBrown[m]> Well, there's recursion to lay the track, and more recursion to create the train. (And in fact laying the train requires both recursing through the train and recursing through the track.)
<JordanBrown[m]> It might be possible to do something with C-style for in a list comprehension to avoid the recursion, but both of them need to add up entries in the array to get cumulative sums.
<JordanBrown[m]> I don't immediately see how you could do something like this conveniently without either geometry values or module references.
<JordanBrown[m]> You could do without objects, by using lists with well-known indexes to simulate them.
<JordanBrown[m]> but to make the definition of the train be simple like that, you need a way to package up both the model for the car and the dimensions of the car.
<JordanBrown[m]> Extra credit if you find the geometry error that makes it significantly simpler.
milza has joined #openscad
pie__ has quit []
pie_ has joined #openscad
pie_ has quit [Client Quit]
<teepee> img2webp -v -loop 0 -d 100 -lossy -q 30 -m 4 block* block* block* blinker* blinker* blinker* glider* rpentomino* gosperglidergun* -o Life.webp
<JordanBrown[m]> How big is the resulting file?
<JordanBrown[m]> The .gif that I sent earlier was ~470K.
<JordanBrown[m]> (The Life one, that is. The train one is 6M.)
milza has quit [Quit: milza]
<teepee> 300k
<teepee> pushed to the webserver so you can see it in real life :)
pie_ has joined #openscad
<teepee> and I'd say it looks very cool even in the tiny door
<JordanBrown[m]> Wow, sure does.
<JordanBrown[m]> Though I would have the blinker and glider run a lot slower.
<teepee> should be relatively easy to do duplicating the images in the conversion list
<JordanBrown[m]> My idea was to have the first couple of figures run slowly enough that you could sort of see what was happening, and then speed up for the R pentomino and glider gun where you more want to see how the overall shape evolves.
<JordanBrown[m]> When I built my video with ImageMagick, I had it run each of them at a different frame rate.
<teepee> let me try to emulate that
<JordanBrown[m]> The webp version of the train video is 3.5M (vs 6M for .gif).
<JordanBrown[m]> You can look at mkvids.sh for the speeds I was using, though there's nothing magic about them.
<JordanBrown[m]> I need to make the train understand how to go around the loop.
<JordanBrown[m]> And I'd like to figure out how to have switches, but then there'd be the question of how to control them. (Customizer!)
<JordanBrown[m]> But because of the nature of OpenSCAD animation, where it has to start from zero each time, if you were running an animation and then threw a switch, the train would jump to the point where it would have been if that switch had *always* been thrown that way.
<teepee> as we have data structures now, we maybe can have a = animation_status() returning more stuff like also a monotone increasing value
<teepee> basically what shadertoy has :)
<teepee> not sure about some sort of state though
<teepee> the script does "set delay 1x10"? what does that mean? not seeing this in the documentation
<JordanBrown[m]> 10 FPS.
califax has quit [Remote host closed the connection]
califax has joined #openscad
<teepee> so with -d 100 I should get 10FPS with img2webp too
<JordanBrown[m]> not that I really understand ImageMagick.
<teepee> and just repeat images to get roughly the same from your example
<JordanBrown[m]> I just cobbled together bits from examples.
<JordanBrown[m]> What I meant with respect to the "as if the switch was always thrown that way" was...
<JordanBrown[m]> say you have a switch that can be thrown left or right.
<JordanBrown[m]> the switch is thrown left, and now you're calculating a frame that has the train past the switch.
<JordanBrown[m]> all is good.
<JordanBrown[m]> But now you throw the switch to the right, and generate another frame that has the train past the switch.
<JordanBrown[m]> That new frame has no memory of the old world, the world where the train went left.
<JordanBrown[m]> It knows only that the switch is set to the right, and so that's where it puts the train.
<teepee> [575 frames, 286312 bytes]
<JordanBrown[m]> Do you want to use your video, or have me create one?
<JordanBrown[m]> If yours, it would be best to either delete my mkvid*.sh scripts or modify them to do what you did.
<JordanBrown[m]> Looks great. Do you want either the R or the gun to run a bit longer?
tcurdt has quit [Quit: bye]
<JordanBrown[m]> They're both OK, but they're not using the whole world.
<teepee> sure, we have scripts :)
<JordanBrown[m]> The values from my scripts were just first stabs.
Guest63 has joined #openscad
<JordanBrown[m]> I was about to ask whether you regenerated the frames, but of course you did - I didn't give you mine.
<JordanBrown[m]> Note that ImageMagick will generate webp, so if you wanted to just use my scripts you could.
<JordanBrown[m]> just s/gif/webp/
<teepee> for img2webp we have some useful compression parameters already, so that's probably easiest
<JordanBrown[m]> As you prefer.
<teepee> lets see how long it runs on my ancient server
othx has quit [Ping timeout: 252 seconds]
othx has joined #openscad
<J22> Guest23  is that code from GPT (chat AI) ?
<JordanBrown[m]> teepee animating with that Life program is, alas, quadratic in the number of generations.
<teepee> lol, Twitter going full korean prince now https://help.twitter.com/en/rules-and-policies/social-platforms-policy
<JordanBrown[m]> Yeah, no joke. Sigh. I expected better.
<teepee> that really is bullshit to the extreme
<teepee> so I guess I'll take it out of the bio if the account is still open
<JordanBrown[m]> I mean, it makes sense sort of from a competitive standpoint… unless you stop being the major player, in which case it hurts you.
<teepee> with the introduction "Twitter is where the public conversation is happening" that's really just billionaire ego
<Scopeuk> got to love the exception for "except advertising/spam/scams" they pay us and get a free pass thats in there
<teepee> I really wonder if he got andrew lee as PR / strategy lead now
jwash has joined #openscad
linext has quit [Quit: Leaving]
<jwash> Hi everyone, I'm making a box for an arcade joystick. See how there are groups of buttons for the button layout, start buttons, and joystick mount. How do I make the joystick mount group, button group, and start button group act as groups so that i can move them at the same time with one translate command? https://hastebin.com/olagozinex.yaml
<jwash> my goal is to make each hole relate to eachother, then to allow the whole group of holes to be translated around the object
<teepee> jwash: the minimal version is just union()
<teepee> but in this case a slightly more complex way could be useful, specifically doing the positioning and the actual object sparately
<teepee> let me find an example
<jwash> yes, thanks
<jwash> was putting the text of the model the best way to get help?
<teepee> yep, sharing the code always is a good option
<teepee> check pilar_pos() on line 120
<jwash> ok
<teepee> the trick here is the special children() which is not a specific geometry but something you can give to that pilar_pos() as "parameter"
<teepee> pilar_pos() cylinder();
<teepee> pilar_pos() cube();
<teepee> it will do the relative translates and generate the 4 replicas of that parameter whatever it is
<jwash> i'm attempting to understand, i'll come back in a bit with more questions
<jwash> i'll play around with the code for a bit
<jwash> so this person defined all the variables above
Guest63 has quit [Quit: Client closed]
<teepee> that makes them available in the customizer
<teepee> you don't need to do it this way if you are going for a very specific design
<teepee> full disclaimer, it's my code :)
<teepee> and it does exist in real life form too https://imgur.com/a/h4gWWCL
<jwash> so i see the pilar module, how does the children() in the pilar_pos module interact here
<jwash> that's what i'm not understanding
<jwash> how does pilar_pos know to work on the pilar module
<teepee> it's a slightly strange way of passing a value into the module
<ali1234> i like to use this method too
<teepee> it's like translate(..) cube()
<teepee> cube() is passed as parameter to translate()
<jwash> how is the pilar module linked to pilar_pos
<teepee> if you write pilar_pos() pilar();
<teepee> basically everywhere where pilar_pos() says "children()" it will replace with the pilar() parameter
<jwash> is that because it removes the "_pos" from pilar_pos?
<jwash> when I use children()
<ali1234> no
<teepee> no, it's really just the children() doing it
<teepee> maybe have a look at the example shipped with openscad, it might be a bit simpler as there's not so much other code
<ali1234> you know how for example difference works?
<jwash> ok
<ali1234> i mean, syntactically
linext has joined #openscad
<teepee> Examples->Advanced->children
<ali1234> you say difference() { <then a list of things> }
<jwash> yes
<ali1234> those things are "children" of the difference() operation
<jwash> ahh
<ali1234> when you write your own module like pilar_pos() you can give it children, and then do whatever you want with those children
<ali1234> so there is no link between pilar_pos() and pilar() other than one being a child due to the way the code is written. they could be named anything and it would work the same
<linext> drag-and-drop support has been added to https://www.3dcustomizer.net/create/playground and https://www.3dcustomizer.net/paste
<ali1234> you could also write it as pilar_pos() { pilar(); } (and also you could put more stuff in there)
<linext> dragging a .scad file onto the editor loads it
<ali1234> but the basic point here is that pilar_pos() makes N copies of pilar() and positions them where the pilars should go
<JordanBrown[m]> Here's a simple-ish example: https://bpa.st/7XAWS
<ali1234> so you could give it pilar() to make the pilars, or you could instead give it pilar_cutout() and then difference with the result to make holes
<ali1234> but whatever you give it, those things always end up in the same place
<ali1234> so if you have 6 identical buttons (and 6 identical holes) it is a real time save
<JordanBrown[m]> the module takes its first child, colors it red, its second child, colors it white and moves it over a bit, then takes its third child and colors it blue and moves it over a bit more.
<ali1234> ^ this example is a bit more advanced. for something like a button panel with repeated identical elements you don't need to treat the children separately like this
<ali1234> i don't think i have ever done it and i've made a whole handheld game console case
x__ has joined #openscad
<JordanBrown[m]> there are innumerable uses for children... i was trying to demo how the feature works in a simple way.
<JordanBrown[m]> here's another simple example: https://bpa.st/5ROE2
<ali1234> i have that one in just about everything i make
<ali1234> along with one that does four offsets in a row
<JordanBrown[m]> Yeah, it’s handy.
<J22> using special variables you can even change children
<J22> module M(s=1)for($i=[0:4])translate([$i*s,0])children(); M(5)cylinder($i+1,d=2);
<InPhase> JordanBrown[m]: Nice. I like the railroad video. :)
<teepee> real59m33.823s
<J22> timer 1h
<gbruno> [github] t-paul pushed 1 additions 2 modifications (News about Mastodon account.) https://github.com/openscad/openscad.github.com/commit/cc2d4e38836681c0de959450ba60de69bb902b30
<teepee> there we go, we need much more fediverse I suppose
<gbruno> [github] t-paul pushed 1 modifications (Minor clarification.) https://github.com/openscad/openscad.github.com/commit/1de972bc3bd8b8c929912b08294804752055af48
tcurdt has joined #openscad
<JordanBrown[m]> the train now has switches...
<JordanBrown[m]> and can make it past the loop point.
<JordanBrown[m]> but doing turn-arounds would be hard; the track data structures are oriented one-way.
<JordanBrown[m]> teepee desaster -> disaster
<teepee> that's fine, something for 2024 :)
<JordanBrown[m]> To repeat, the train is *not* a 2022 entry... hopefully 2023. It depends on my experimental features.
<teepee> yep, good goal to get those things in for 2023 :)
<teepee> ok, Life updated
<JordanBrown[m]> cool, thanks
<JordanBrown[m]> teepee did you get my typo note desaster -> disaster?
<teepee> yep, gbruno ^
<JordanBrown[m]> ah, indeed. automatically ignored it :-)
<JordanBrown[m]> module stop() {}
<JordanBrown[m]> makes the customizer stop looking at variables
<JordanBrown[m]> but module stop();
<JordanBrown[m]> does not.
<JordanBrown[m]> now the train needs climbs and descents so that it can have bridges...
<JordanBrown[m]> and multiple trains running at once.
<teepee> full simulation mode :)
<JordanBrown[m]> but mostly it needs better car models and a Christmas tree.
<JordanBrown[m]> I'm not sure whether to leave the cars kind of cartoon-y, or go for more complete modeling.
<teepee> cartoon style might also mean easier printable?
<JordanBrown[m]> I wasn't really thinking in terms of printability, but yeah, find detail is hard.
<JordanBrown[m]> s/find/fine/
<teepee> I always thought it would be awesome to have a clalendar with lots of printed parts that give some final object like a toy train with tracks or so
<JordanBrown[m]> Yes, though I am not sure that this is that. That needs real-world mechanical stuff like jigsaw connections between the pieces and between the cars. This doesn't; those things would only make things harder and wouldn't work well anyway.
<JordanBrown[m]> But maybe the same basic cars could have "printable mode" and "runnable mode".
<JordanBrown[m]> It's too bad this guy doesn't use OpenSCAD. His designs are incredible: https://www.thingiverse.com/kabrumble/designs
<JordanBrown[m]> And this animated train could maybe consume those printable car designs...
<JordanBrown[m]> Also right now my train is either scaled in 1m/unit or in 1:1000 scale, depending on how you want to look at it. Neither is particularly good for printing.
<JordanBrown[m]> OTOH, for printable stuff it would be cool if the model was more or less scale-insensitive, so that you could print a car at Z, N, HO, O, G, or full scale.
<JordanBrown[m]> Time for me to go. Later. teepee, thanks for the work on Life.
<teepee> just 2 doors to go :)
<teepee> so we probably will make it
othx has quit [Ping timeout: 272 seconds]
othx has joined #openscad
robert7 has quit [Quit: Bye]
robert7 has joined #openscad
castaway has quit [Ping timeout: 272 seconds]
J22 has quit [Ping timeout: 260 seconds]
J22 has joined #openscad
tcurdt has quit [Quit: bye]
Guest23 has quit [Quit: Client closed]
othx has quit [Ping timeout: 246 seconds]
othx has joined #openscad
<linext> so i did more work on drag-and-drop for 3dcustomizer.net: https://www.3dcustomizer.net/tests/drag-and-drop-file-upload.php
<linext> images are easy to preview
<linext> i might add previews for .STL
<linext> for images, it can handle jpeg, png, gif, svg, bmp, webp
<InPhase> teepee: I'm still planning on caterpillar. Just scrambling a bit here with other life things. But not far to go on it yet.
tcurdt has joined #openscad
<teepee> InPhase: awsome, I'm thinking of moving the last two to 23/24 so it could go to 21st
<teepee> absolute worst case we can still publish it separately
<gbruno> [github] kwikius opened issue #4451 (Feature request: Module expressions for more expressive code with less typing) https://github.com/openscad/openscad/issues/4451
<jwash> have you guys printed a Game Boy Advance case? I was looking at the Slab on thingiverse but it requires a custom pcb for the buttons. what handheld stuff have you made?
<teepee> nothing handheld as such so far
<jwash> you said you did some video game stuff right? what did you print?
<teepee> video game stuff?
<jwash> i'm wrong
<jwash> i'm making an arcade stick enclosure today, i thought you did something similar before
<teepee> I do like retro games and old computers so there might be comments in that regard, but nothing printed as handheld
<teepee> yes, enclosures :)
<jwash> what have you made?
<jwash> i've done a bunch of controller panels, this is the first time 3d printing one