Pentagonal icositetrahedron

Thanks for dabbling. This should give me some things to kick around!! Looks like there will be some caffeine and late nights in my future.

I’m not remotely concerned about fps with 24 pixels, which gives me some freedom to implement different patterns in different coordinate systems, and if the pattern is non-cartesian just hardcode a second map structure within each pattern. It’s not terribly portable but this is a unique structure that will have non-portable patterns anyway. I can write a python script or something to calculate coordinate and just copy/paste a block structure into each pattern.

So going to higher pixel counts “solves” some of these issues but also just makes it a generic sphere. Which is still delightful. But tosses a bit of the unique geometry out the window.

I have two short term options to solve this for the next project - each face should have 5 pixels instead of one with interior 3d printed walls for isolation. Then I have 24x5 = 120 leds in a sphere. And each face of the pyramid is a unique color, instead of the entire pyramid.

Or, I can go for the pentagonal hexecontahedron, 60 faces, 1 led per face, or 5 led for face with pyramids and 60x5 = 300 led. This probably eliminates the possibility of portable and power unless I go with very low brightness, but maybe I want to do that anyway - who wants 300 fully lit LED in your face? It’s essentially the same tradeoff as higher density led strips. What you sometimes want is the smooth animation not the higher brightness.

I’ve only been fiddling with this code for 5 days and my wife just asked why the 3d printer isn’t busy making noise and what is the next structure going to be. :rofl::rofl::rofl: She’s such a jerk sometimes.

EDIT: Incidentally, the 192 led sphere that Chris made here: 3D printed ball - Show and Tell - ElectroMage Forum shows the point at which higher density LED polyhedra start to look and behave like a sphere from a pattern perspective. I guess it’s somewhere between 100 and 200 leds. You can still see in Chris’ build that lines are choppy and low-res.

1 Like

Ironically this sort of “tolerance” check is one of the things I’m planning to add to my “generic” library list, to make it a single true/false function.
Used often and it’s an awkward construct (double ifs usually or sometimes &&)

I was thinking of within(x, low, high), as a clearer naming though, but tolerance is absolutely what it is, so maybe two different functions, one with one value [tolerance], one with a range[within], to allow asymmetrical ranges.

I read this if(abs) idiom as 1 dimensional hit testing. 2d and 3d hit testing is interesting and useful too! Both as a radial distance and as a boundary rectangle or cube. Rectangles are nice because you avoid costly multiplication and square root. Squares are even better. And for most led resolution is fine.

@zranger1 code sure looks like a hittest to check if (x,y) is within a square of w,h = 2*tolerance centered on (0.5,xVal), but I come from a graphics/UI toolkit background where this kind of thing is common:

if (hittest(point, rect))

Now… you don’t have structures in blaze-js, but basically that is what is happening here I think?

if (hittest(x, y, xVal-tolerance, 0.5-tolerance, tolerance * 2, tolerance * 2))

where params are x, y, rectX, rectY, rectWidth, rectHeight

idk if this is any more comprehensable lol and often you don’t want a binary if, but rather some variable like brightness based off distance. :thinking:

1 Like

RE: Comparison tolerance: It is indeed hit testing here. This idiom is also commonly used as 1/2 stroke width for drawing resolution independent figures in the render2D/3D() functions. And as @aaroneous mentioned, if you keep the value and scale pixel brightness by decreasing distance, it can also provides reasonably good antialiasing.

It’s also common to hook it to a UI slider so the user can adjust line thickness for their display as needed.

1 Like