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
samuraihelmet has joined #openscad
samuraihelmet has quit [Quit: Client closed]
<JordanBrown[m]> On a different subject... I have a build that implements most of the object/geometry-as-data/module-reference stuff that we've discussed - in fact, it implements two different variations. What would be the best way to work through the open issues around which variation to use? The biggest *difficult* issue is how you can take a geometry-as-data value and bring it into the model. The obvious answer, that in statement context an
<JordanBrown[m]> expression that evaluates to a geometry value is added to the model, has a lot of syntactic trouble.
galaxy_knuckles is now known as escobear
snaked has quit [Ping timeout: 260 seconds]
epony has joined #openscad
ur5us has joined #openscad
Guest48 has joined #openscad
<Guest48> Hi Everyone.  Is this the right place to post for help on how to achieve things in OpenSCAD?  I've read the tutorials and am trying to transition from FreeCAD to OpenSCAD, but can't see how I might generate some complex shapes.
<teepee> Guest48: yep, ask away :)
<teepee> JordanBrown[m]: I guess a PR would be easiest to comment on, but if you don't feel like creating one, a branch in your repo should work fine too
<JordanBrown[m]> My immediate reaction is that a PR is for when I think it's almost ready to merge, but indeed that might be the best place for a discussion.
<teepee> you can matk as Draft to make it clear it's not considered ready
<Guest48> How would you go about creating a cylinder with a fillet on the end.  The end would still need to be flat and the fillet should be tangential to both the barrel of the cylinder and the end.  In FreeCAD I could either create the cylinder and use the Fillet tool on the edge, or create a sketch of a rectangle except with one corner rounded and then
<Guest48> revolve that around the axis.  Can't quite see how to do it in OpenSCAD.
<JordanBrown[m]> Creating a rectangle with a rounded corner and feeding it rotate_extrude() would work.
<JordanBrown[m]> that it, feeding it *to* rotate_extrude
<JordanBrown[m]> (Boy, typo city today, sigh.)
<teepee> yep, that, or use a library like BOSL2 which has tons of such primitives
<JordanBrown[m]> BOSL2 does indeed have tons of cool stuff like that. Here's one from first principles: https://bpa.st/T65Q
<Guest48> Ahh, thanks.  I've got some more learning to do now.  Much appreciated.
<JordanBrown[m]> It's a very powerful way of thinking about design, but it does take some getting used to.
<JordanBrown[m]> Fillets are particularly hard, because in general they are a non-obvious combination of two shapes.
<JordanBrown[m]> I believe there are some mathematically correct general solutions based on Minkowski sums, but Minkowski sums are *very* slow.
<JordanBrown[m]> But for that particular case, working from first principles, you're probably working with a rotate_extrude of a square with a circle cut away from it.
Guest48 has quit [Ping timeout: 260 seconds]
fling has quit [Write error: Connection reset by peer]
aiyion has quit [Write error: Connection reset by peer]
aiyion has joined #openscad
fling has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
califax has quit [Remote host closed the connection]
califax has joined #openscad
TheAssassin has quit [Ping timeout: 255 seconds]
TheCoffeMaker has joined #openscad
TheAssassin has joined #openscad
<linext> is it possible to access a 2D array using two numbers?
<JordanBrown[m]> a[i][j] ?
<linext> board = [["","",""],["","",""],["","",""]];
<linext> board[0][0] = "X";
<JordanBrown[m]> You can't *assign* into an array, no matter what the dimensions.
<JordanBrown[m]> You can't assign into any existing OpenSCAD values.
aiyion1 has joined #openscad
aiyion has quit [Ping timeout: 255 seconds]
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
gknux has quit [Quit: ....and i am outta here....]
escobear is now known as gknux
califax has quit [Remote host closed the connection]
TheAssassin has quit [Remote host closed the connection]
aiyion1 has quit [Remote host closed the connection]
TheCoffeMaker has quit [Ping timeout: 256 seconds]
gknux has quit [Quit: ....and i am outta here....]
GNUmoon has quit [Remote host closed the connection]
fling has quit [Remote host closed the connection]
GNUmoon has joined #openscad
aiyion1 has joined #openscad
fling has joined #openscad
TheAssassin has joined #openscad
califax has joined #openscad
TheCoffeMaker has joined #openscad
gknux has joined #openscad
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
ur5us has quit [Ping timeout: 252 seconds]
LordOfBikes has quit [Ping timeout: 260 seconds]
snaked has joined #openscad
othx has quit [Ping timeout: 260 seconds]
othx has joined #openscad
LordOfBikes has joined #openscad
<linext> anyone want to play some openscad tic-tac-toe? https://www.3dcustomizer.net/create/customization/86
<linext> i wrote it entirely in the web-based monaco editor
<linext> press reload to start a new game
ur5us has joined #openscad
snaked has quit [Ping timeout: 268 seconds]
califax has quit [Ping timeout: 255 seconds]
<linext> make sure to turn off "Rotate Model" and turn on "Lock Camera/Position" in Viewer Settings
GNUmoon has quit [Ping timeout: 255 seconds]
califax has joined #openscad
GNUmoon has joined #openscad
snaked has joined #openscad
teepee has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
<InPhase> linext: Wait. You didn't implement the AI for the second player.
GNUmoon has quit [Remote host closed the connection]
<Friithian> it's hard to have an AI with tic-tac-toe, bit too solved for that
GNUmoon has joined #openscad
<InPhase> Friithian: That is the only thing that would make it even possible in OpenSCAD, because we have no retained state. ;)
<InPhase> When you make your second move, it will have no memory of making its first move.
teepee has joined #openscad
<JordanBrown[m]> Hmm. You could use the customizer and the human for state.
<JordanBrown[m]> Customizer has 9 variables, each set to "empty", "X", or "O".
<JordanBrown[m]> F5, program tells you where it wants to move.
<JordanBrown[m]> You flip that variable in the customizer, flip your variable in the customizer, and F5.
<JordanBrown[m]> Auto refresh could look at how many Xs and how many Os there are, and know whether to prompt you to move or tell you what its move is.
<Friithian> I think it possible with no retained state, you just have… a lot of models
ur5us has quit [Ping timeout: 260 seconds]
<JordanBrown[m]> Here... I threw together a Nim / Battle of Numbers game. Follow the instructions in the console.
<JordanBrown[m]> With auto preview turned on.
califax has quit [Remote host closed the connection]
califax has joined #openscad
<JordanBrown[m]> Playing against it is a little weird, but it knows how to play and will win if it can.
<JordanBrown[m]> Just pretend you are playing against somebody with no hands, so you have to make their move for them.
<JordanBrown[m]> Oh, I suppose it would be good if I gave the link, eh?
<JordanBrown[m]> https://bpa.st/VBIQ
J1A8446 has joined #openscad
J1A84 has quit [Ping timeout: 260 seconds]
<InPhase> I started writing out the tic-tac toe solutions for an OpenSCAD AI, but that got boring real fast.
<JordanBrown[m]> I'm sure there are algorithms that are not brute force.
<InPhase> I think it's doable but there's a good bit of drudgery in writing it all out.
<InPhase> Well it would be a simple binary lookup table in the end.
<InPhase> Generating it is quite dry though. :)
<InPhase> There should be only 126 entries
<JordanBrown[m]> Without reading it in detail, I think it considers a move and plays out all possible games that follow from that move.
<InPhase> Our requirement is different if you don't have state. Given a set of x positions, generate all the o positions from the past moves before we got there plus the new one.
<JordanBrown[m]> Hmm. Can you really do that?
<JordanBrown[m]> Order matters.
<JordanBrown[m]> I think.
<InPhase> I think it might not, but I didn't get far enough to prove it.
<JordanBrown[m]> But you could have the input be a list of the five player moves.
<InPhase> There are some additional unintuitive constraints based on the fact that the x moves can't be on top of past o moves. (We assume the player isn't cheating.)
<JordanBrown[m]> The player can cheat by changing history :-)
<InPhase> Yes, and then they deserve an inconsistent history. ;)
ur5us has joined #openscad
GNUmoon has quit [Ping timeout: 255 seconds]
GNUmoon has joined #openscad
<JordanBrown[m]> This seems to be a workable game: https://bpa.st/RWXA
<JordanBrown[m]> It lets you play first. Set one of the board squares to 1, and tab. (Or F5 if no auto preview.)
<JordanBrown[m]> First time it seems to take a long time thinking, ~45s on my system.
<JordanBrown[m]> Maybe not that long. That was when I was having it move first.
<JordanBrown[m]> But I think it caches across games; it doesn't seem to really "think" most of the time.
<JordanBrown[m]> Oh, no, my error. It wasn't printing diag output, but it seems that either I deleted the diag output or I accidentally undid it when I killed it when it was running too long.
<JordanBrown[m]> it's just way, way faster when you make the first move. Because, I think, at that point there are 9x fewer games to consider.
<JordanBrown[m]> Slightly improved. Now lets you decide who should go first.
<JordanBrown[m]> https://bpa.st/L3IA
<JordanBrown[m]> It's actually surprisingly playable.
ur5us has quit [Ping timeout: 260 seconds]
<JordanBrown[m]> One thing that's interesting is that it assumes that the human plays optimally, and that assumption sometimes makes it play sub-optimally.
<JordanBrown[m]> You can cheat: you don't have to put its move where it tells you to. It will then pick the best play from that point.
<JordanBrown[m]> Minor tweak: when all moves are equivalent, pick one at random. Makes it more interesting. https://bpa.st/6YPA
<JordanBrown[m]> That's all for tonight :-)
ur5us has joined #openscad
fling has quit [Ping timeout: 255 seconds]
fling has joined #openscad
fling has quit [Ping timeout: 255 seconds]
hyperair has joined #openscad
fling has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
castaway has joined #openscad
ur5us has quit [Ping timeout: 260 seconds]
la1yv_a has joined #openscad
la1yv has quit [Ping timeout: 260 seconds]
la1yv_a is now known as la1yv
<gbruno> [github] MichaelAtOz edited issue #3786 (Retina/hi-dpi toolbar icons) https://github.com/openscad/openscad/issues/3786
Junxter has joined #openscad
Junxter has quit [Quit: Leaving]
GNUmoon has quit [Remote host closed the connection]
GNUmoon has joined #openscad
GNUmoon has quit [Remote host closed the connection]
califax has quit [Write error: Connection reset by peer]
aiyion1 has quit [Write error: Connection reset by peer]
TheAssassin has quit [Read error: Connection reset by peer]
califax has joined #openscad
TheAssassin has joined #openscad
aiyion1 has joined #openscad
aiyion1 has quit [Remote host closed the connection]
aiyion1 has joined #openscad
GNUmoon has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
crazy_imp has quit [Ping timeout: 260 seconds]
teepee has joined #openscad
crazy_imp has joined #openscad
pah is now known as pa
<JordanBrown[m]> I suppose it would be better if the version that I gave out didn't use experimental features that only I have.
<JordanBrown[m]> New version in a few mins.
GNUmoon has quit [Remote host closed the connection]
GNUmoon has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
<JordanBrown[m]> https://bpa.st/RVHA
<JordanBrown[m]> One improvement would be, for no-win cases, to pick the move that puts the loss off the longest, in the hope that the human will make a mistake before then.
<JordanBrown[m]> I think that could be done by increasing the score for each move until the result. That is, a loss in one move would get a score of -10, a loss in two moves would get a score of -9, et cetera. But I don't feel like figuring out the details right now.
califax has quit [Remote host closed the connection]
califax has joined #openscad
<InPhase> How do I make the computer go?
<JordanBrown[m]> You have the customizer up?
<JordanBrown[m]> You have it set to automatic preview?
<InPhase> Yeah, I set my x.
<InPhase> Moved one grid to 1 and got an x.
<JordanBrown[m]> Console should say "who should go first?"
<InPhase> I set that to human.
<InPhase> But there is no O.
<InPhase> Only my X in the middle.
<InPhase> Oh, I fill in from the echo?
<InPhase> That was scrolled off window.
<JordanBrown[m]> Console should say (after a few seconds) "I move to XXX"
<JordanBrown[m]> You have to make its move for it.
<InPhase> Yep. This functions as a game. :)
<InPhase> Only mildly tedious to enter the computer's moves. It's functional.
<JordanBrown[m]> Like I said, surprisingly playable.
<JordanBrown[m]> Use the arrow buttons to make the moves; then you don't have to do anything to make it notice them.
<JordanBrown[m]> Put it in the pile of "unexpected things you can write in OpenSCAD" :-)
<JordanBrown[m]> I was thinking about writing chess or checkers.
<JordanBrown[m]> Probably not trying to write anything like a real AI, but at least have it make legal moves.
<InPhase> It clearly plays optimally, and for a nice touch randomizes between equivalent outcome moves.
<InPhase> I was able to win only by mis-entering one of its moves.
<JordanBrown[m]> Yes, if you read my monologue from last night you will see that I added that feature. I got bored with it always playing the same.
<JordanBrown[m]> Right.
<JordanBrown[m]> Which can yield a kind of interesting behavior that I mentioned last night: if it's going to lose, sometimes it won't block an obvious player win.
<InPhase> Ah, missed that section of chat.
<InPhase> You could weight delayed losses as better, increasing the chance of a mistake.
<InPhase> It can weight delayed wins as equivalent, assuming it won't make mistakes.
<JordanBrown[m]> Yes. (See this morning's monologue :-)
<InPhase> Okay, Mr. I Thought of Everything. ;)
<JordanBrown[m]> :-)
<JordanBrown[m]> There was nobody to talk to, so I had to think of everything first :-)
<InPhase> The sufferings of life.
<InPhase> linext: You should take a look at JordanBrown[m]'s update when you get back: https://bpa.st/RVHA
<InPhase> JordanBrown[m]: Now... Computer vs computer with $t timesteps?
<JordanBrown[m]> :-)
<InPhase> JordanBrown[m]: Since you have randomness, we should get a diverse set of draws, right?
<InPhase> Perhaps hard-code the first move to choose one at random, to speed it up, since clearly it will choose from any of 9 squares.
<JordanBrown[m]> Hmm. True. But maybe not right if you weigh by when the win/loss happens. And of course if you want to take advantage of mistakes you don't take a side space.
<InPhase> Well, only take advantage of delays if a loss scenario can be forced.
<InPhase> Oh, and maybe... Always reduce the number of ways the opponent can win.
<InPhase> So if it's setup into a fork, it should always close one fork.
<InPhase> One of the forked paths.
<JordanBrown[m]> Uh huh. I spent enough time on this last night and this morning. Your turn to have some fun :-)
<JordanBrown[m]> My new cabinetry got installed yesterday so I need to get serious about designing tool holders for my new tool drawer.
<InPhase> Have fun. :)
<InPhase> I also have a list of other things I'm looking to do today.
<linext> i see
<linext> the reason why I created the example was to show how real-time rendering of parameters works on 3dcustomizer.net
<linext> it is possible to have a computer player, and randomly decided who goes first with my example
<linext> i just didn't want to dig into it that much
linext has quit [Read error: Connection reset by peer]
linext has joined #openscad
califax has quit [Remote host closed the connection]
<linext> time for me to clone and improve some customizers on thingiverse
<JordanBrown[m]> Caution for copyright issues.
<linext> not copy the code, but the ideas
<linext> i think i'll add a feature where if the font is in google web fonts and is shareable, my app will auto-download it
califax has joined #openscad
Junxter has joined #openscad
snaked has quit [Ping timeout: 256 seconds]
<teepee> hmm, we did not have a mandelbrot script yet? that needs to be fixed I guess https://imgur.com/a/Lx9Rz3D
<teepee> J1A8446: what's that color scheme you use? DeepOcean?
<J1A8446> öh öh
<J1A8446> jupp
<teepee> cool, I guess it will look better overall if the backgrounds are mostly same
<J1A8446> mandelbrot .. could use the blockheight as result (color) and have it 3D
<J1A8446> oh you already did
<J1A8446> nice Ü
<teepee> yep :)
othx has quit [Ping timeout: 256 seconds]
othx has joined #openscad
<teepee> strange github does not like the track.png but it does show in the calendar
ur5us has joined #openscad
<linext> i'm noticing a weird bug
milza has quit [Quit: milza]
<linext> trying to make the font word pen, but not using the 8-bit mcad font
milza has joined #openscad
<linext> openscad is having trouble cutting a cube through the text
<linext> hmmm...
<linext> it works if i start with 2D shapes, and make the cutouts, then turn them into several layers of 3d shapes
Junxter has quit [Read error: Connection reset by peer]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
snaked has joined #openscad
califax has quit [Quit: ZNC 1.8.2 - https://znc.in]
califax has joined #openscad
castaway has quit [Ping timeout: 256 seconds]
<linext> i was thinking about the retro pen
<othx> linext linked to "Retro Font Word Pen by BrandonW6" on thingiverse => 3 IRC mentions
<linext> i think i'll round the edges, or make the text completely rounded
<linext> similar to how my bracelet maker works: http://jbcse.com/opensu/breakitbracelet/customize
<gbruno> [github] MichaelAtOz edited issue #3726 (Lost translation) https://github.com/openscad/openscad/issues/3726
hrberg has quit [Ping timeout: 246 seconds]
hrberg has joined #openscad
hrberg has quit [Ping timeout: 260 seconds]
<JordanBrown[m]> linext when you say that OpenSCAD is having trouble cutting a cube through text, exactly what do you mean?
Junxter has joined #openscad
hrberg has joined #openscad