I tried tackling this today. It was my first script. I believe it can be much simpler - by the end I took some odd turns with culling the initial grid to achieve a diagonal grid. I considered “Diaggrid” but I wanted the option to adjust the rotation. Still struggling to get the normals of the cylinder voids to orient themselves well.
Would appreciate anyone taking a look and offering any suggestions!
I didn’t want to rewrite most of your code but am not that comfortable with Split Tree(which I left in place for the ‘Filtered Points’ group) but felt that it would be easier to scrap the ‘Filtered Normals’ group, combine the two sets of points and get surface normals all over again (white group).
I got to this by considering that rotating points or surface frames only works on round things. So I thought about adjusting seams on contour lines but soon realized that rotated ellipses alone provide staggered separation of holes. The Python ‘SDiff’ is slow on this though, taking 1.2 minutes.
I’m going to study your simplifications. The twisted one looks incredible.
My next research phase is looking at how to provide rotational parameters to augment the normal of the perforating extrusion. Interested in seeing how each perforated hole can only be visible from a special angle, and becomes more tunnel like when the tube becomes thicker.
Just playing around. Get an idea, implement it, rinse, wash, repeat.
The “big idea” on this one is to get staggered holes on a shape that isn’t round or twisted… The “trick” is to divide each horizontal curve (used to loft the “vase”) by twice as many points as I really want, then cull every other point while alternating the ‘True/False’ cull pattern on each row. Works a treat!
When I tried a thicker shell, the capped “rods” that make the holes did not penetrate the outer shell. So I coupled the “Thickness” slider to an Amplitude component for the normal vectors that do the extrude and modified the expression on the Move ‘T’ input.
I noticed that the holes appear farther apart on the smaller radius bulges and realized that I’m offsetting the lofted surface outward instead of inward. This makes the holes evenly spaced on the inside only.
If I offset inwards instead, some holes are likely to intersect before reaching the inner surface, which isn’t ideal and might cause the Python ‘BooleanDifference’ to fail? This model increases the number of rows (‘Height Density’ slider) from 30 to 40, which contributes to the issue and slows the “SDiff”.
@Joseph_Oster Your use of the Merge/Repeat node confounded me at first…but now I’m starting to understand. (Rotate first index X, Rotate second index 0, repeat) So simple. For some reason the term “Merge” makes me think that the result would be additive, not alternating.
Merge does the deceptively simple job of combining branches from multiple data trees. It gives the same result as connecting multiple wires to the same input but with the distinct advantage of being able to specify the sequence of wires.
Depending on which wire is connected first, second and third (etc.), you can get the same result but using Merge makes that sequence unambiguous.
It’s deceptive in the sense that when data trees don’t match, the results may not be what you expect, though they are predictable. Sometimes ‘Simplify’ or Suirify(or Flatten) can resolve differences so data trees merge as you want.
If changing that doesn’t help, I don’t know what to say? Maybe @kev.r can help? Welcome to the tower of Babel world that McNeel has produced for us. If you connect a text panel to the Python ‘out’ output, you might see an error message?
If you look at the output of the Cap component, with Tree/List Viewer by @Joseph_Oster (thanks for this great tool Joseph, I use it frequently) you will see that the last branch is a duplicate of the first branch.
That probably happens because the start and end points of the curves are the same, causing two rods in the same place where only one is needed? It occurred to me that might be a problem but only after the fact, and it worked for me.
Thank you for the fix and for the excellent Python component! Cheers.
Thanks again Kevin for spotting and fixing this duplicate branch problem. At the time I replied, I was too distracted to look at the code. Now that I have reviewed all the GH models I posted yesterday, it appears to be only the cylinder models that are affected?
Starting with the twisted ellipse (Perforate_vase_2021_Jul9a.gh), the rest of them look OK because they use a different method to get the points. @mendler, do they work for you?
Here are three fixed versions of ‘Perforate_Cylinder’ that include a copy of ‘Tree/List Viewer’. Glad to hear you find that tool useful, I use it every day.