Hi ,
I’ve attached a sketch photo where I’m attempting to create a pattern of triangles influenced by their distance from a curve. My goal is to achieve a gradient transition of the triangles based on this distance.
The question I have is: Is there a way to lock the scale node ? Specifically, like to know if it’s possible to constrain the scaling to only 3 specific values while taking into account the distance from the curve.
Any guidance or tips on how to achieve this would be greatly appreciated.
I really tried to understand all your code, and to some extent, I think I did. But in the end, I threw most of it away for something easier for me to understand.
I create the TriGrid directly on the surface and cull triangles (and their center points) that don’t have all three of their vertices on the surface. (yellow group) As I type this, I wonder if it would have been better to scale them first before culling? Easy enough to modify. (see below)
The three scale factors are set in the blue group. The middle value is the Average of max and min. The largest triangles are closest to the attractor edge but that can be easily reversed.
Instead of one edge, the attractor curve could be a wavy line down the center, of course.
NOTE: As I typed this I refactored to scale first before culling, as suggested above. In the process, I discovered something interesting and important. When culling first, as above, the TriGrid can extend far above the surface with no effect on the bounds of Crv CP ‘D’ (Distance). However, the same is not true below when scaling first, so the ‘Ey’ value of TriGrid must be constrained to barely cover the surface with triangles. Ideally, ‘Ex’ and ‘Ey’ would be derived automagically from surface dimensions.
Added yellow group to derive TriGrid inputs ‘Ex’ and ‘Ey’ from surface dimensions. Like version ‘Aug8b’, this version scales first before culling. Also added a wavy curve on the surface to use as an attractor, and reversed Merge output so small triangles are closest to the attractor and large triangles are furthest away.
Previous versions handled three sizes well enough using Average of min and max for the middle value, but what if you want four or more? Range does that.
I also added a purple group to cut triangular holes in the surface but it’s slow (4.2 seconds) so added a Data Dam to isolate SrfSplit. Unfortunately, the data dam is useless when opening the file and always executes anyway - a SERIOUS ANNOYANCE
Thanks to some assistance from @baileydw in another thread, I’ve explored the idea of mapping these triangles to a twisted surface. Might be hard to grasp this image but will be more clear if you look at the GH file. Note the slowSrfSplit component.
The post you marked as “Solution” above only demonstrated a flaw in Map Srf that I later solved in the other thread. I’ll repeat that post below:
Aha One of the many things I tried before starting this thread was transferring the four vertices of the trapezoid to the twisted surface, with the intention of using CrvSrf(Curve On Surface) to connect them. It didn’t work with the original loft but works on the NetSurf. See orange group. Result looks good to me, though a very convoluted way to get there.
Hope this isn’t too much… Refactored this code to make it more useable, in part by placing the Data Dam(red group) at the very end, after all interactive parameters.
Usage Notes:
Initial layout happens flat including triangles (TriGrid size slider), attractors (two provided) and scaling (scale range and ‘Steps’).
On the right side of the GH canvas is a Value List switch between ‘Flat Srf’ and ‘Twisted Srf’ (‘FT’ in blue group at the top), an ‘Angle’ slider at the bottom and the Data Dam.
When I click on any component, I see a highlighted version of the wires connected to it. But relays stop the highlight, which gets tedious. Example (without a relay):