I have a problem:
I’d like to create an efficient definition, that I can use to create 2D patterns of following kind:
So, the idea is to have circles (or other closed curves) in a grid, and have them trim each other in a way that makes them seem like overlapping each other. Or, like if you have surfaces (or surfaces with curves) scattered on top of each other in Rhino, and have a top view of it. I’d want exactly what you see in the top view, but so that everything that is behind another surface, is trimmed away in an efficient way.
I have managed to get right kind of results, but with too much computing, with a definition like this:
- Create 2D grid.
- Move the points in increasing increments in Z-axis, so that the next point is a bit higher. (Or in any order as long as every point is in it’s own, unique height.)
- Make the curves, or surfaces, in these points:
- Make corresponding, high enough cylinders in these same points
- Trim the curves / surfaces with the cylinders using “Trim with Breps”
- Project the resulting curves / surfaces to the world XY-plane.
The definition works fine, is intuitive to use and gives right kind of results… but is extremely slow / crashes in bigger grids.
I figure there must be very a lightweight way of doing this, but I just can’t get my way to it. I have tried to, for example:
- Create 2D grid
- Make the circles (with offsets) in the grid.
- Check with “Proximity 2D” component which points are close to the one having the object to be trimmed…
…etc. but I don’t understand well enough the data trees etc. to be able to pick the right circles to trim with etc. I have tried, but it just escapes me.
I figure that to keep the tool intuitive, it could be useful to keep the Z-axis as part of the game, meaning scattering the objects (lines, surfaces…) along Z-axis in their grid points. But how to get them, how would I say… “trim down” each other, if you get what I mean? And should there be the “Proximity 2D” component used somehow in order to not to have soon-too-vast “every object is checked against every other object” for intersections?
Any help would be greatly appreciated!
P.S. My “working” definition had severe limitations, and I managed to break it too, so it’s not much of a help for anyone. I’ll just attach the basic grid and really a stump of a definition, which will reduce some work, if anyone wants to take a look on this. It has everything else, except the logic, how to “trim down”.
Circles_scattered_around.gh (25.3 KB)