Gradient triangular pattern of fixed radiuses

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.

triangles pattern.gh (25.2 KB)

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.


triangles pattern_2024Aug8a.gh (20.5 KB)

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.


triangles pattern_2024Aug8b.gh (19.1 KB)

I think version ‘Aug8b’ looks better?

1 Like

This transform gradient, smooth data into stepped data.

1 Like

triangles pattern Edited v0.gh (37.4 KB)


Honeycam 2024-08-09 08-25-20

2 Likes

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.


triangles pattern_2024Aug8c.gh (23.6 KB)

1 Like

Two things:

  1. more than 3 “fixed radii” (scale factors)
  2. cut holes in surface

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 :bangbang:


triangles pattern_2024Aug9aa.gh (30.7 KB)

P.S. OOPS! Forgot to connect the ‘Steps/Count’ slider to Divide Domain - fixed.

1 Like

Looks like @Ahmed_Alnaseri has bailed out of this thread?

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 slow SrfSplit component.


triangles pattern_2024Aug9b.gh (28.3 KB)

2 Likes

Thank you quan ! Yea I remember that but i couldn’t manage to do it on the triangles

Thank you joseph ! You always reach and enhance what we ask ! Thank you man.

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 :bangbang: 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. :roll_eyes:


triangles pattern_2024Aug9c.gh (33.7 KB)

Looks like a Map Srf fail on the perimeter curve, yet it works on the triangles.

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.


triangles pattern_2024Aug10a.gh (41.7 KB)

The very last thing was to move the LARGE geometry near the origin.

1 Like

Thank you man really appreciate your effort!
and i think i’m in love this piece of code too smart one :smiling_face_with_tear:

Widely useful, eh? Glad you noticed. I have to rediscover these bits periodically.

No need for that Relay, they annoy me. :wink:
So does ‘Bifocals’ (and icons) - ‘Sunglasses’ is much better.

1 Like

Relays sometimes help me to follow the wires fast , but i will keep in mind to delete them when sharing :sweat_smile:

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):

I created this example with a relay; see how highlighting stops there? :frowning:

1 Like