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
snaked has quit [Quit: Leaving]
Guest88 has joined #openscad
<peeps[win]> teepee, the bundled test suite is still broken (afaik from the addition of python venv right after I got them working) 23% tests passed, 1253 tests failed out of 1617
<peeps[win]> was there anything in particular you wanted tested?
<teepee> peeps[win]: just that it works at all, like I often use the CSG example and the old-exampe024 menger sponge
<teepee> I'm getting a fail in the stl test which probably is due to face ordering stuff they did in Manifold
<teepee> I suppose we can just globally enable the STL sorting code which is still marked experimental
Guest88 has quit [Quit: Client closed]
<peeps[win]> hmm, doing some manual testing of CSG.scad and its not looking good. first try i did F5, then F6 and it seemed to work with immediate bell. then trying F6 again gave an error in console. then opening a new instance and going straight to F6 seems to just crash. seems very inconsistent behavior
<peeps[win]> latest try seems hung at 83/1000
<peeps[win]> (all with manifold enabled)
<peeps[win]> this is on windows 10 fwiw. no win 11 here
<peeps[win]> ERROR: Rendering cancelled by exception Vec out of range
<peeps[win]> WARNING: No top level geometry to render
<teepee> hmm, there's an issue which said 2nd render fails already with the master version
<peeps[win]> that is the error i occasionally see in console
<teepee> yeah, the Vec out of range I got for the menger spongs with value 5 too
<teepee> before 3 and 4 worked
<teepee> well, I guess it's an issue, but probably not directly related to messing with the build stuff
<peeps[win]> vec out of range was on CSG.scad, and then again with example006 (dice)
<teepee> hmm :(
<teepee> looks like that needs a bit more inspection
<teepee> in general they changed to use TBB directly which is good, but it needed some extra work due to most of our systems use older TBB versions
<teepee> thankfully it's updated in Manifold, so we don't need to run around and build TBB everywhere
<teepee> the auto-build on MXE did fail spectacularily with a gcc crash
<peeps[win]> another random outcome I just encountered: https://imgur.com/a/hfquRDt
snaked has joined #openscad
<peeps[win]> i actually tried "CANCEL to debug", but nothing seemed to happen. I don't think that's ever worked on my system though, not sure what its even supposed to open for that
<teepee> not sure if that needs application support. i only know debuggers somehow register in the system to get notified. long time ago I had to mess with WinDBG
mmu_man has quit [Ping timeout: 245 seconds]
<teepee> lol: access.log.7.gz:25.140.7.228 - - [22/Aug/2023:20:46:27 +0000] "GET /tests/travis-1482_report.html HTTP/1.1" 404 153 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15 (Applebot/0.1; +http://www.apple.com/go/applebot)" "-"
<teepee> apple did index our ancient test fail fils from Travis :)
<teepee> I hope they did not feed those into Siri
<peeps[win]> lol, weird. do we need a robots.txt added somewhere?
<teepee> yeah, just doing that, I created an empty one first, but just now added MS/OpenAI and Google
<teepee> looks like there's also Petalbot, never heard of that one
<teepee> the link indicates it's Huwai and their AI stuff
<teepee> need to get used to applying changes via ansible :)
<teepee> whops, and also checking in the changes
J23k55 has joined #openscad
J23k87 has quit [Ping timeout: 246 seconds]
snaked has quit [Quit: Leaving]
LordOfBikes has quit [Ping timeout: 240 seconds]
snaked has joined #openscad
LordOfBikes has joined #openscad
SD21 has joined #openscad
<SD21> Im trying to do a bottm indentation to just label my sample which will be 3d printed, here is my code, am i missing something? https://3dcustomizer.net/paste/C31952E0
<teepee> SD21: you need to swap the module calls to: linear_extrude() text();
<teepee> only 1 semicolon at the end. it's like a chain of calls, the semicolon is only after the last one
<peeps[win]> WARNING: Ignoring unknown module 'seed' in file , line 2
<teepee> this should give a warning about mixing 2d and 3d objects
<teepee> oh, there's also a translate() in there
<peeps[win]> translate([0,0, -4]) linear_extrude(height=2) text( "416U 110",size=2);
<teepee> as that is 3d, it would be translate() linear_extrude() text()
<SD21> new issue, my text is inverted, is there a quick invert method?
<teepee> 2d mirror should work I think
<SD21> is that function I can surround the text  fucntion with?
<teepee> mirror([0,1,0]) text()
<SD21> thx, Teepee always comin clutch
SD21 has quit [Quit: Client closed]
<teepee> to reduce flickering in preview mode, you can do the translate a bit further down, e.g. 2.1 and add the .1 to the line....
<teepee> or not :(
<teepee> also, crap. elon found that "Welcome to Twitter text" in empty lists :/
fling has quit [Ping timeout: 246 seconds]
fling has joined #openscad
drfff has joined #openscad
J23k4 has joined #openscad
J23k55 has quit [Ping timeout: 246 seconds]
drkow has joined #openscad
drfff has quit [Ping timeout: 246 seconds]
fling has quit [Ping timeout: 246 seconds]
fling_ has joined #openscad
fling_ is now known as fling
fling has quit [Ping timeout: 246 seconds]
qeed_ has quit [Quit: qeed_]
fling has joined #openscad
qeed has joined #openscad
peeps has joined #openscad
peeps[work] has quit [Ping timeout: 246 seconds]
hyvoid has joined #openscad
J23k22 has joined #openscad
J23k4 has quit [Ping timeout: 246 seconds]
J23k22 has quit [Quit: Client closed]
J23k22 has joined #openscad
snaked has quit [Ping timeout: 248 seconds]
stefanct has quit [Ping timeout: 246 seconds]
mmu_man has joined #openscad
L29Ah has quit [Ping timeout: 246 seconds]
stefanct has joined #openscad
clemens3 has quit [Quit: WeeChat 2.7]
drfff has joined #openscad
clemens3 has joined #openscad
drkow has quit [Ping timeout: 244 seconds]
<gbruno> [github] jmerc77 opened issue #4729 (directly access points and faces from modules) https://github.com/openscad/openscad/issues/4729
Guest91 has joined #openscad
Guest91 has quit [Client Quit]
e2k_ is now known as e2k
snaked has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
fling has quit [Ping timeout: 246 seconds]
snaked has quit [Quit: Leaving]
<juri_> twitter has been doing a great job of showing what the ruling class has in mind for enshittification of internet services.
<juri_> and redit...
fling has joined #openscad
mmu_man has quit [Ping timeout: 246 seconds]
L29Ah has joined #openscad
L29Ah has quit [Read error: Connection reset by peer]
L29Ah has joined #openscad
qeed has quit [Remote host closed the connection]
qeed has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 246 seconds]
teepee_ is now known as teepee
L29Ah has left #openscad [#openscad]
L29Ah has joined #openscad
erectus has quit [Remote host closed the connection]
GNUmoon has quit [Remote host closed the connection]
erectus has joined #openscad
GNUmoon has joined #openscad
hisacro has quit [Ping timeout: 240 seconds]
<gbruno> [github] t-paul closed issue #4729 (directly access points and faces from modules) https://github.com/openscad/openscad/issues/4729
hisacro has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 246 seconds]
teepee_ is now known as teepee
<gbruno> [github] t-paul closed issue #4700 (Add "copy" argument to `mirror` and other transforms) https://github.com/openscad/openscad/issues/4700
<juri_> my speaker's notes were not supposed to be visible. can i die now? :)
<teepee> permission NOT granted
<teepee> who specifically should not read those?
<juri_> well, they have formatting errors...
<juri_> after all, they were just notes to me, so i could remember what to discuss on the slides.
<J23k22> speaker notes should visible if someone only get the slides without the video/presenter  - but guess this is not the case here
<J23k22> (or the mic break - Ü)
<juri_> yeah. that was after quite the trouble getting the presentation to display at all.
<J23k22> it seems they messed up aranging the video with the slides - as the controls are in the image not just the slide - looks like the full double monitor was recorded
<juri_> yeah. loaner laptop.
<juri_> like i said, huge mess. :)
<J23k22> probably not easy to fix without creating it new from the speaker video and cropping the slides input .. sorry nobody noticed this earlier
<juri_> or re-timing the slides from the source, but.. yeah, it's fine.
<juri_> I'm just glad i got the information out. this is the presentation i wanted to see so badly when i started writing a slicer.
<ndnihil> anyone thought to have a module able to return a value?
<ndnihil> foo=mymodule(5,10);
<ndnihil> that sort of thing, so your module can do its thing, and also return a value you can use later for reference
<ndnihil> currently doing it with one module and one function
<ndnihil> but thought it might be nice to simplify
<J23k22> you can get a value as $special into the children but not out of the scope or to parents .. but there is
<ndnihil> I think I'm going to have to split this all back out anyway
<ndnihil> for some reason it's not wanting to animate
<ndnihil> worked fine when it was all separate
<ndnihil> module mymodule(a,b,c){}, where c is just a digit that represents which of the complimentary parts you want it to output
<ndnihil> instead separate modules for each of the parts
<J23k22> using if(c==1)cube();    should work fine (i am using an option switch all the time)
<J23k22> you can paste!  it  if you need someone to look at it
<J23k22> 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
J23k22 has quit [Quit: Client closed]
J23k22 has joined #openscad
<ndnihil> oh, except the 2 option was removed
<ndnihil> because no return
<othx> ndnihil linked to YouTube video "Eccentric Cycloidal Gear in OpenSCAD" => 1 IRC mentions
<ndnihil> previous version with everything in separate modules animated fine
<ndnihil> could just be me halfassing something, I'm on conference calls all day and dicking with this in the middle of them
SD210 has joined #openscad
<SD210> im doing psychoiphysics experimients with 3d prints and randomness is very important, how can I make my random seed hella random? can i use firmware bits or current date and time or somthing?
<J23k22> sd210 rands can use rands as seed
<SD210> like: randSeed = floor(rands(1,999999,1)[0];
<SD210> seed(randSeed);
<SD210> ?
<J23k22> no need for floor .. however  can't see a need for this.
<J23k22> if you need different seeds  then you can use a seed array  for the different rands
<J23k22> seeds = rands(-999,999,10,seed); value=  rands (0,1,1,seeds[0])[0];
<J23k22> ndnihil you can also use  if(whichone==0 || whichone==2)  and get rid of the else
mmu_man has joined #openscad
<ndnihil> SD210: get yourself a geiger counter with serial output and use background radiation as your source of random
<ndnihil> have done it, works well
<ndnihil> I believe it's also how nist, sandia, etc.. do it
<J23k22> use a camera and and noise  ( or a lava lamp)  but feeding into scad will work only via command line
<SD210> to append an array is += not supported?
<SD210>     random_coords += [min_spacing, 0];
<SD210> im confused how to do break statments
<SD210> break; doesnt work?
<teepee> there is no break statement
<teepee> and you can't reassign, not with a = a + 1 or with +=
SD210 has quit [Quit: Client closed]
<ndnihil> all we need is a migration, keep the GUI that reloads from file, and convert OpenSCAD the language to OpenSCAD.pm the perl module
<ndnihil> it would be godlike
<juri_> welcome to #implicitcad. :)
<teepee> implicitcad.pm ?
<juri_> eeeeew. well, i suppose, it's possible.
<teepee> juri_: reading your statement above, you don't mind if I post the talk on the openscad mastodon?
<juri_> haskell ports well.
<ndnihil> if you say something about javascript, I'm going to kick you out of every channel you've followed me to
<juri_> teepee: not at all. :)
<teepee> sorry, not twitter regardless of how it's called now
<ndnihil> X is just twitter in drag
<juri_> "hey, everyone, look at what the crazy haskell lady is doing!"
<ndnihil> like, it's 2023, it can identify as 'X' all it wants, but we all know it has a beak under that skirt
* juri_ facepalms.
<teepee> it actually has a blue bird in my browser, I try to ignore all things elon best as possible
<teepee> including refusing to create any extra content except really necessary
<ndnihil> yeah, IRC is enough "social media" for me
<ndnihil> typically a migh higher quality of degenerates
<teepee> i'm ok with mastodon
<ndnihil> s/migh/much/
<ndnihil> I think I clicked on a mastodon thing once
<ndnihil> and a lemmy
<teepee> crazy thing is german gov running a mastodon server, gets my honest thumbs up :)
<teepee> I even got a reply from the security guys at BSI
<juri_> Interesting. :)
<ndnihil> hrm
<ndnihil> looking at your implicitcad examples, I do like your approach to fillets
<ndnihil> union(r=3) { square(20); translate([10,10]) square(20);
<ndnihil> teepee: should add that to openscad
<juri_> it's a plus, but as a minus, WE can't do a shell.
<teepee> yes, please
<juri_> it's a math-system problem.
<ndnihil> math is the root of many problems
<ndnihil> juri_: you should fix the kalli1.faikvm.com 404 situation
<juri_> yeah, i should.
<juri_> doing a lot, lately.
<ndnihil> even better, instead of fragmenting the programatic CAD landscape
<ndnihil> join forces
<ndnihil> openscadimplicitly
<ndnihil> juri and kintel sitting in a tree, C-A-D-'d-i-n-g
<juri_> I think we'll end up with a standardized language. right now, i'm making another mutant, because implicitcad isn't enough.
<ndnihil> perl my man
<ndnihil> it's the future
<ndnihil> as well as the past
<ndnihil> and the current
<ndnihil> and some other stuff too
<ndnihil> and it'll piss off the python kiddies just enough for hilarity to ensue
<teepee> perl6 or raku?
<ndnihil> perl 5
<teepee> so no future?
<ndnihil> perl5 will be valid long after I'm dead
<ndnihil> that's all that matters
SD210 has joined #openscad
<SD210> hey, Imhaving an issue where maybe my cones arent being translated appropriatley or somthing because the render displays only a single cone : https://3dcustomizer.net/paste/A6E7C984
<InPhase> Uhm, are you also getting the 50 million "ignoring unknown variable x/y" messages?
<teepee> where's that code coming from there's lots of stuff in there that's not openscad
<teepee> like while()
<teepee> and no reassignment like valid_position = true
<InPhase> Yeah, this is full of a lot of syntactical errors that would need addressed before fixing the geometry.
<teepee> there's no seed() and no rand()
<InPhase> SD210: Wait... Did GPT4 help write this?
<SD210> i tried addresing thoes x and y errors by making the x and y vars global
<teepee> yeah, that would be my assumption too
<ndnihil> teepee: add exec() or system() to the feature request list
<teepee> already on it
<ndnihil> sweet
<teepee> the one with title "never going to happen" :)
<ndnihil> lol
<teepee> I mean we will have python at some point, so if you need to poke the system, that would be the way to do it
<ndnihil> ugh
<ndnihil> anything by python
<ndnihil> forth, do it in forth
<ndnihil> just not python
<ndnihil> er, anything but python
<SD210> sorry im  a little ocnfused, so maybe the errors are coming from the while loop? the reassignment of valid_position?
<InPhase> SD210: Let's start with how did you create this code, and where did you get the idea for things like writing "while" or calling a rand function, or calling seed?
<InPhase> SD210: What are you using for your source material for deciding how to write this? The problem is starting there.
<InPhase> linext: lol. What are you running, a bitcoin miner on 3dcustomizer.net? It just started eating 2.7 cpus worth of processor power in chrome to display a pastebin result...
<linext> huh
<teepee> SD210: there is no while() loop, there is also no rand() function. some lines miss the ";" at the end
<teepee> InPhase: maybe trying to render via WASM?
<linext> InPhase, what's the link? it renders on the client so maybe you're the one running a BTC miner
<SD210> im trying to remake similar items from https://journals.physiology.org/doi/full/10.1152/jn.00564.2017
<SD210> i am not familiar with openSCAD and know a little bit of programing, so thats why im having issues where maybe im using syntax and methods that would work in C++ or somthing else but not valid for openSCAD. Im also using chat gpt to help pick up on some mistakes and writing the ideas out which could also be a point of error. I was able to get a
<SD210> lower boundary, min_spacing paramter working: https://3dcustomizer.net/paste/BA0F3829
<teepee> cheetsheet?
<teepee> cheatsheet?
<othx> cheatsheet is https://www.openscad.org/cheatsheet/ for the release version and https://www.openscad.org/cheatsheet/snapshot.html for the development snapshot versions
<SD210> THX
<peeps> chatgpt is not very competent in openscad from what I've seen
<InPhase> tutorial?
<othx> tutorial is The OpenSCAD tutorial is a great place to learn how to create designs in OpenSCAD, and can be found at: https://en.wikibooks.org/wiki/OpenSCAD_Tutorial
<juri_> chatgpt is very interesting. i use it as a debate partner, when writing HSlice.
<linext> i haven't merged the "manifold" version yet because dschroer didn't update his WASM yet for it
<juri_> it's hard to find a human you can discuss a math problem with for 8 hours, who will not run away screaming.
<linext> he said maybe sometime this fall he'll update it and then 3dcustomizer.net will be faster
<InPhase> SD210: What would be a good idea, is looking at the tutorial (link that othx just showed) to get a better sense of how to do things, and picking commands to use out of there and out of the manual. If it's not in the manual, in the tutorial, or in the cheatshet, don't use it. :)
<InPhase> SD210: chatgpt is truly abysmal at OpenSCAD to the point of some catastrophic incompetence, and you're only going to hurt yourself trying to fix its mistakes. Some languages it can handle okay, but for this, it's pretty terrible.
<teepee> chatgpt is worse than a bunch of apes trying to type Shakespeare with respect to generating OpenSCAD code
<teepee> it just invents code structure that never was valid
<InPhase> SD210: Like, I have trouble looking at the code you presented and figuring out even what it was supposed to be, which is why I haven't offered specific fixing steps. It is not speaking the right language with this code, and the structure is pretty nonsensical.
<linext> here's something i sell that designed in openscad: https://www.ebay.com/itm/285260022017
<linext> InPhase, it took 49 seconds on my PC
linext has left #openscad [Leaving]
<InPhase> SD210: Like there's a whole section there on trying to numerically generate the points of a cube manually with polyhedron. I don't even want to go through the effort of checking to see if the faces are oriented rightside out or inside out on that. We have a cube built-in!
<InPhase> SD210: That's like 20 lines of confusing code that never needed to be there.
linext has joined #openscad
<linext> this takes about 3 seconds: https://ochafik.com/openscad/
<SD210> im an engineer working with a collaborating lab which is why i chose to write put the box like that, to give more freedom to the psychophycists to alter the plat form based on the structure of their epxerimient but the primary issue im facing is the minimum spacing code seems to work: https://3dcustomizer.net/paste/BA0F3829
<SD210> but when i try to set a max_spacing for the upper bound limit.
<InPhase> SD210: Also the program starts off incorrectly attempting to seed a random number generator with a function call that doesn't exist, but it seeds with... a random generated by the only random number generator we actually have, which is randomly seeded by default and better than would be done by the code there. None of this needed to be there. I bet your solution to the problem in question would be a
<InPhase> handful of lines if you sorted out how to do it from the manual and tutorial.
<SD210> are you saying the way i did the random seed might mess up later code that look not related?
<InPhase> SD210: I'm saying it's completely invalid, but even if it were valid, would be a bad way to do it.
<InPhase> SD210: Do you notice the warnings when you preview this? Warning means "error" in OpenSCAD. Never leave a warning unfixed.
<InPhase> Some languages, warnings are ignorable. In OpenSCAD only structural syntax errors list as true "errors", but warnings are "this is invalid code", not "you might want to fix it".
<InPhase> Unfixed warnings can quickly cascade into a completely invalid geometry with undef propagation.
<SD210> i saw the += is not good with openSCAD so i reffered back to the cheat sheet and saw the concat() works, i do not see seed in the cheat sheet so I put together something based on other peoples code, what is a better way to seed if the way im doing it is completley invalid
<InPhase> The concat is invalid.
<InPhase> It doesn't work like that.
<SD210> so...
<InPhase> SD210: OpenSCAD is a functional declarative language, not an imperative language.
<InPhase> cone_positions = []; This makes an empty list. It is always an empty list, and will never change.
<SD210> thats not a way to intialize a list with a global scope?
<InPhase> cone_positions = concat(cone_positions, [[x + min_spacing, y]]); This makes a NEW variable usable inside the for loop, in that iteration only, which has the same name and shadows the other one. It disappears after each iteration of the for loop completes.
<SD210> so instead say cone_positions = cpne_positions + .....?
<InPhase> No, cone_positions never changes.
<InPhase> It's declarative. As soon as you declare its value, it's done. You can't modify the value of something you already declared. If you want to build up a list of things, you have to build them up with either a list comprehension, or use functional recursion, or something like that.
<InPhase> All variable are single-valued.
<InPhase> SD210: Take a look at this OpenSCAD code, and before you try to run it, try to guess what it will output. Then after you have your guess, run it and see the real output: https://bpa.st/WYVPE
<InPhase> SD210: I bet you will be surprised, because you are working with the wrong mental model for variables. :)
<SD210> ohh ok, weird thx that changes how i look at the vars now, this is different from my programing expeiurrnces in other lamguages
<InPhase> SD210: And you see how even the order doesn't matter in this instance?
<SD210> x = 5;
<SD210> for (i=[1,2,3,4,5]) {
<SD210>   echo(x);
<SD210>   y = x+i;
<SD210>   echo(y);
<SD210> }
<SD210> u need to declare a new var, so that im not changing the one i alredy declared
<SD210> ?
<InPhase> You can't change the one already declared anyway.
<InPhase> You can only shadow it.
<InPhase> But you can shadow it out of order.
<InPhase> If you go back to my original example and add echo(x); to the bottom after the for loop, you'll still get 5!
<SD210> yes, so when i have my array list of cone positions, I need to make a copy of it and then Not change the list but add to a new list in order to append? instead of using the concat?
<InPhase> It's impossible to build up a list iteratively inside of a for loop like that.
<InPhase> There's just no way to do it.
<InPhase> That's imperative thinking.
<InPhase> It needs to either be a list comprehension, which declares a list as an evaluated comprehension, or a recursive function, which builds up a list either as it recurses or as it returns.
<InPhase> You can also build up lists with recursive modules, but that's less often useful.
<SD210> that sucks :? lol okay, so the work around i did with the echo x was make a new var y and echo that, so if I want to "change" the position of a cone I need to build up a shadowd list recursivley : https://3dcustomizer.net/paste/BA0F3829 ?
<SD210> sorry im not that familar with CS terminology
<InPhase> SD210: One example: https://bpa.st/6YGHC
<InPhase> SD210: Now you have all the cone positions generated up front, and all you have to do is loop over those. Like, for (p = cone_position) { .... }
<InPhase> positions
<InPhase> SD210: That's syntactically similar to Python list comprehensions.
<InPhase> SD210: And it complies with declarative value requirements. cone_positions does not change.
<SD210> okay i see, ill try rq
<SD210> I apreciate it OG
<InPhase> SD210: If you need behavior that is much more like imperative type thinking, then you use a tail recursive function, and be explicit about the scope changes: https://bpa.st/NVTDW
<InPhase> SD210: That approach is far more flexible, and you can track arbitrary state iteratively as you go along the recursion.
<InPhase> SD210: And as it processes, all values are still declarative and single valued within each scope. Changes happen across the scope boundaries as it recurses.
<InPhase> linext: So, how many of those thumb bars have you actually sold now across your many thumb bar models that you made?
<linext> 200+
<InPhase> Impressive.
<linext> usaully 1 or 2 per day
<InPhase> Not enough to be rich, but definitely enough to compensate for the time you spent doing it right.
<linext> if i can get on amazon or run my own web store, i could probably do better
<linext> zapwizard.com has some nice examples
<InPhase> Did something hinder you from getting on amazon?
<InPhase> A lot of worse quality stuff is sure on Amazon!
<InPhase> You could even bulk ship to Amazon and have them do delivery.
<InPhase> You're in the price range of that being reasonable with their fees I think.
<J23k22> SD210 that looks like  so version of my grater https://www.printables.com/model/456801-grater
<SD210> JakeSays did u have a minimum and maximum constraint code? thats what im having issue with rn https://3dcustomizer.net/paste/BA0F3829
<SD210> im new to openSCAD and inPhase was helping me understand how its different than other languages. Im having trouble with my translates I think
<SD210> oh shit it workeded  thanks alot mr InPhase
<SD210> is there somthing else i might be doing ineffecently that i missed from shiting to declaritve style programing: https://3dcustomizer.net/paste/A6E7C984 ?
<SD210> shifting* lol
<InPhase> Either works.
<InPhase> And is that the right link? That regressed back to your while code with invalid x and y.
<InPhase> SD210: Also, you need to take the translate on your text line and change that -2 to -2.01
<InPhase> (Looking at the link right before your last.)
<InPhase> SD210: See the "difference" section here which has a bolded "Note:" that you need to read about the overlap rule. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#difference
<SD210> InPhase the issue I was having with this code: https://3dcustomizer.net/paste/BA0F3829   is the minmimum distancing im trying to achive, i tried putting really small and really big values and noticed it did not change the density of cones
<SD210> i know that code doesnt do that but I was trying to get it to work with declarative understanding and got stuck
<InPhase> SD210: https://bpa.st/DWZJE The secret is to get used to what recursive functions can do for you.
<InPhase> SD210: Note that this is a slightly sloppy routine that will run forever without stopping if you input the wrong parameters, because I have no check for failure to find a place to put the next cone.
<InPhase> SD210: You might want some sort of attempt counter and fail out if it can't fill it with any more.
<InPhase> SD210: Like, if you iterated 10 times more than the total number of cones, you're failing.
<SD210> yes i C what u mean
<InPhase> But I will leave implementing that check as an exercise. :) Try to follow the example.
<SD210> thanks
<SD210> jsut to make sure i understand the syntax, the ? is bascially like an single sided if statment?
<InPhase> That's the ternary conditional operator, cond ? iftrue : iffalse common to a lot of other languages, and is like an if statement except one that selects a value rather than selects what to do next.
<InPhase> It's just that if you use it in a recursive function, selecting a value ALSO selects what to do, if the values recurse.
qeed_ has joined #openscad
<InPhase> Note that there is formally a 1:1 mapping between imperative iteration and recursive functions. One can always be made into the other with a pretty formulaic transformation.
<InPhase> It's worth getting familiar with that transformation pattern, and then you can map your imperative instincts over.
qeed has quit [Ping timeout: 248 seconds]
<InPhase> The primary difference is that recursive functions are more explicit about what state is being maintained/tracked between each iteration.
<SD210> yes the transformation part is where i need to build my skills, idetifying what logic makes sense in imparative vs delcaratiove