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
J1A8492 has joined #openscad
peepsalot has joined #openscad
J1A84 has quit [Ping timeout: 252 seconds]
teepee has quit [Remote host closed the connection]
retrosenator has quit [Ping timeout: 240 seconds]
rogeliodh has quit [Quit: Ping timeout (120 seconds)]
retrosenator has joined #openscad
teepee has joined #openscad
rogeliodh has joined #openscad
retrosenator has quit [Ping timeout: 246 seconds]
LordOfBikes has quit [Ping timeout: 246 seconds]
retrosenator has joined #openscad
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
LordOfBikes has joined #openscad
<gbruno> [github] ScottNudds opened issue #4269 (Customizer slider control is too small in Windows 10.) https://github.com/openscad/openscad/issues/4269
Claws61821 has joined #openscad
<Claws61821> I've got the hang of iterating nodes, but is there a good way to iterate the *paths* for a polygon?
<retrosenator> eg?
<gbruno> [github] t-paul edited issue #4269 (Customizer slider control is too small in Windows 10.) https://github.com/openscad/openscad/issues/4269
<Claws61821> sorry, "points" not "nodes".
<retrosenator> you want to generate the coordinates
<Claws61821> When you call "polygon" you can use variables to feed it complex generated lists of points using `for`, but I haven't found a way to make it accept iterated lists of paths as opposed to pregenerated lists of paths.
<retrosenator> iterated how? sorry
<retrosenator> i'm trying to understand what is wrong with pregenerated lists
<Claws61821> I want to generate the lists (paths) that tell "polygon" which point-lists of coordinates to call, so that I can generate holes at regular distances as I lengthen the polygon and extruded polyhedron without getting non-manifold errors. Pregenerated path-lists have to be called one at a time and only account for as many paths as you populate by
<Claws61821> hand.
rogeliodh has quit [Ping timeout: 255 seconds]
<Claws61821> I've tried using "for" several times, I've tried using nonary symbols as well. Neither is acceptable code within the "polygon" function
<Claws61821> or rather, they are acceptable within the "points" subsection, but not within "paths"
rogeliodh has joined #openscad
<teepee> not sure what you mean, e.g. this is a polygon square with a smaller square cut out polygon([[8, 8], [8, -8], [-8, -8], [-8, 8], [5, 5], [5, -5], [-5, -5], [-5, 5]], [[0,1,2,3], [7,6,5,4]]);
<Claws61821> in "polygon{... , paths =", I can call vector "paths[0][5]", for example, but I can't call anything like "for (i=[0:cutouts]) paths[0][i]"
<teepee> sure, you just need to add the [ ] around
<Claws61821> I tried that before, but I'll try it again...
<teepee> e.g. echo([for (i = [3:6]) [i, i*2]]);
castawayc has quit [Ping timeout: 260 seconds]
snaked has quit [Read error: Connection reset by peer]
snaked has joined #openscad
castawayc has joined #openscad
<Claws61821> Ah. I misremembered. It *does* allow that, but it then seems to simply ignore them. I went from having four evenly-spaced holes to having none, with no error message. And yes, I flushed the cache.
EkpyroticFrood has quit [Quit: So long, and thanks for all the fish.]
EkpyroticFrood has joined #openscad
<teepee> cutouts may need the ponts in reverse order
<teepee> points too :)
EkpyroticFrood has quit [Client Quit]
EkpyroticFrood has joined #openscad
EkpyroticFrood has quit [Client Quit]
EkpyroticFrood has joined #openscad
<Claws61821> Reversed the point order within each subvector as you suggested, teepee. No change.
<Claws61821> Also tried reversing the order of the subvectors themselves with no change.
<teepee> how big is that code? put it on pastebin?
<Claws61821> about 200 lines all told. one moment please
<Claws61821> the segments in question are lines 55 or 57 (I copied it just now to make the change you recommended) and lines 113-134
<Claws61821> Apologies for the spaghetti mess.
<teepee> ERROR: Unable to convert paths[1][0] = [172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191] to a number in file , line 114
<teepee> looks like things are nested one level too deep
<Claws61821> ...now why didn't it show that on my client after I flushed the cache?
<Claws61821> nevermind, rhetorical question.
<teepee> that might only be in the dev version
<Claws61821> of greater concern, you're seeing an error for only one subvector and not all of them. >> ECHO: [[[112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131], [132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151], [152, 153, 154, 155, 156, 157, 158, 159, 160,
<Claws61821> 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], [172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191]]]
<teepee> no, there's more of those
<Claws61821> oh
<teepee> for [1][0-3]
<Claws61821> Hm... adding one more level, I get one tiny slice of one hole that changes depending on what I set as the second subvector...
ToAruShiroiNeko has quit [Remote host closed the connection]
ToAruShiroiNeko has joined #openscad
<Claws61821> And adding a second variable to `for` ([for (a=[3:-1:0],b=[0:borepathlen-1]) borepath[0][a][b]]) gives me all four holes, but makes them one list and connects them all to eachother which subverts the intent
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
<teepee> i see, you need to unpack just that for part
<teepee> outerpath,each [for (i=[3:-1:0]) borepath[0][i]],centerpath[0]
<teepee> that "each" unwraps the outer list and inserts the parts instead of a nested list
<teepee> echo(list1 = ["a", [for (a = [0:3]) a]], list2 = ["b", each [for (a = [0:3]) a]]);
<teepee> first is a list of length 2, second of length 5
<Claws61821> That did it. Thank you, teepee
<Claws61821> In a different project with the same styling; how would you change this to make multiple subvectors? `borepath = [each [for (a=[0:borecount-1],b=[0:19]) [pathlen+(a*20)+b]]];`
<teepee> not sure I'll understand that before having some sleep ;-)
<Claws61821> XD  fair enough
<teepee> maybe dropping both the "each" and the brackets of the value?
<teepee> as in: echo(list1 = [for (a = [1:3]) [a]], list2 = [for (a = [1:3]) a]);
<Claws61821> `borepath = [for (a=[0:borecount-1],b=[0:19]) pathlen+(a*20)+b];` makes it one single vector...
<teepee> and it should be?
<teepee> borecount subvectors?
<Claws61821> yes
<teepee> I guess you have to write it out with a second for() then
<teepee> [for (a) [for (b) ...]]
<Claws61821> Ah! Thanks again, teepee
Claws61821 has quit [Quit: Client closed]
aiyion has quit [Remote host closed the connection]
aiyion has joined #openscad
ur5us has quit [Ping timeout: 255 seconds]
ur5us has joined #openscad
ur5us_ has joined #openscad
ur5us has quit [Read error: Connection reset by peer]
ur5us__ has joined #openscad
ur5us_ has quit [Ping timeout: 272 seconds]
J1A8492 is now known as J1A84
retrosenator has quit [Read error: Connection reset by peer]