<JordanBrown>
That kind of technique is tempting, but note that something semi-stupid will happen if you give a bad name.
<JordanBrown>
If only we had a clean way to turn names into values with error checking for undefined names.
<JordanBrown>
like, say
<JordanBrown>
inch = 25.4;
<JordanBrown>
$unit = inch
<JordanBrown>
;
<JordanBrown>
In a compiled language, using language symbols to refer to your enumerations is a big win, because the compiler can check for typos.
<JordanBrown>
Unless you want to dynamically define new entries in the table, I wouldn't use strings for this sort of thing.
<JordanBrown>
pca006132 yeah, the default TPU settings for PrusaSlicer were really slow. I tried speeding up, and tweaked some other values, and right now I'm at about 75% of my PLA speed (rather than 25%). I haven't tried bumping it higher. The stock temperature and extrusion multiplier values were way off, stringing hell, and when I dropped the temp 30C and dropped the extrusion multiplier by 25% the strings all went away.
<JordanBrown>
InPhase and you can still be Customizer-friendly by using the [ n: label ] syntax.
<JordanBrown>
polygon is the most flexible, but there may be times when other variations are at least in a sense easier because the program will do the math for you.
<JordanBrown>
And if you mean something more like a truncated pyramid, you can use a scaled linear extrude sort of like that
<JordanBrown>
or polyhedra(), which is complex to use but ultimately flexible.
<Deneb>
nihil: thank you for the cheat sheet! Was looking for something like that!
<InPhase>
Behold, the truncated pyramid: cylinder(r1=10, r2=5, h=5, $fn=4);
<InPhase>
Behold, the even worse code abomination: cylinder(r1=10, r2=5, h=5, $fn=4); linear_extrude(height=5, scale=0.5) square(10*2^0.5, center=true);
<Deneb>
JordanBrown: thank you for those options
<Deneb>
InPhase: thanks also
<Deneb>
did think one could transform a cylinder into a trapezoid!
<JordanBrown>
InPhase: cylinder, yeah, duh.
<JordanBrown>
Deneb creating pyramid-related shapes out of cylinders is a combination of two somewhat unobvious features.
<JordanBrown>
First, when you set $fn on any round thing (circles, cylinders, spheres, et cetera) it controls the number of sides, versus the usual scheme where OpenSCAD makes up its own mind. (Based on some parameters that yield really low resolution and should be updated but that's a different discussion.)
<JordanBrown>
Thus cylinder($fn=4, ...) yields a four-sided cylinder... or what you might call a box.
<JordanBrown>
Second, when you specify d1 and d2 (or r1 and r2), the d1 specifies the diameter at the bottom of the cylinder and d2 specifies the diameter at the top of the cylinder.
<JordanBrown>
But, hint: do *not* use $fn to control things that you really want to be round, especially as a global setting. It tends to produce way too many sides for small round things. Set $fa=2 and $fs=1 and you'll generally be happy.
<nihil>
lies
<nihil>
$fn=8192; at the top of every script
<nihil>
make your CPU earn its keep
<nihil>
no free rides
t4nk_fn has quit [Remote host closed the connection]
t4nk_freenode has joined #openscad
guerd871 has quit [Remote host closed the connection]
<Deneb>
I have $fa=2 and $fn=0.4 as per OpenSCAD tutorial. Tried $fn=8192 just for fun to see what it does and it just crashes OpenSCAD after a few seconds delay....
<nihil>
lol
noonien808310429 has joined #openscad
<InPhase>
WARNING: GeometryEvaluator: Node didn't fit into cache. on the following file for preview: $fn=8192; sphere(10);
<InPhase>
And no displayed result.
<InPhase>
Let's see if Manifold can handle it.
<nihil>
works fine here in manifold
<nihil>
and I just crammed it in an existing thing with a bunch of curves
<nihil>
printing out house numbers
<InPhase>
It finished and printed out the completion noise. But now it's spiking up to like 33GB and thinking hard before it will actually let me see the result on the window.
<InPhase>
Waaaaat.
<InPhase>
There's nothing there.
<nihil>
so four 150mm by 100mm 'ish numbers with lots of round
<InPhase>
With render I got "WARNING: GeometryEvaluator: Node didn't fit into cache." twice, and everything else looked like success, and then it displays nothing.
<nihil>
odd
<InPhase>
Yes.
<nihil>
what version?
<InPhase>
2024.06.16
<nihil>
2024.10.05 here
<InPhase>
teepee: Which weird limit does your intuition say I hit? :)
<nihil>
the "you've listened to nihil too much" limit
<nihil>
I'd imagine
<InPhase>
teepee: This is a dumb thing to try to do, but I should have the right to make $fn=8192 spheres!
<nihil>
hah oops, I did 9182
<nihil>
instead of 8192
<InPhase>
Wild. The exported stl has size 0.
<InPhase>
It just ate the whole item.
<InPhase>
Did I hit the grid limit or something, ruining everything?
<nihil>
ooh
<InPhase>
OH. No, the stl file is not size 0.
<nihil>
I might have angered it
<nihil>
sphere(d=120,$fn=32768);
<InPhase>
The stil file is size 3.2GB, but just took like 60 seconds to save. I didn't realize it was still thinking about it.
<InPhase>
So the problem is only a display issue.
<nihil>
I definitely pissed it off
<nihil>
whole machine is jumpy as fuck
<nihil>
8192 was fine, took a second to preview/render, but worked
<nihil>
32768, no bueno
<nihil>
has to SSH in and kill it
<nihil>
it probably would have finished at some point
<nihil>
but like, need my machine in the next 12hrs