Largest Geodesic Triangle on Mesh

I’m looking for the largest triangle, by area, on a mesh, whose sides are geodesics. Got that? I adapted a script by @AndersDeleuran that uses Kangaroo to create the geodesics but my approach is pretty clunky. From a set of points, I first create geodesics from all pairs of points using Anders’ approach, and then see which ones join into triangles, and then evaluate area.

Is there any way to pull triangles onto the mesh, anchor them at their vertices, and pull all the sides into geodesics in Kangaroo?. When I tried something using my limited Kangaroo knowledge, it just shrunk the triangles, treating them as single curves I guess.

geodesic triangle on mesh.gh (108.0 KB)

Hi Ethan,

This eliminates your surplus step to find the triangles after the Kangaroo simulation has converged.

However, it also results in the individual triangles overlapping, instead of forming a clean, non-intersecting, geodesic line graph on the mesh. If that’s irrelevant to what you want to do, you can proceed from here.

geodesic triangle on mesh_rev-a.gh (122.7 KB)

If you’re not married to this exact point/triangle setup, I’d first project the points to the XY-plane to construct a planar Delaunay triangulation, and then use its topology in the simulation, which leads to non-intersecting triangles that you can then sort by there respective areas.

geodesic triangle on mesh_rev-b.gh (119.7 KB)

It’s up to you. :slight_smile:

2 Likes

My Kangarooing is a bit rusty (and I missed @diff-arch’s solution), but something like this might be a start (i.e. pull triangle meshes onto surface/mesh while minimising their edges with high strength on perimeter edges and low strength on inside edges). You probably want to experiment with the goal strengths a bit.


221220_TrianglesOnSurface_00.gh (96.5 KB)

1 Like

Ah, in that case: Here’s an example extending my definition above with Galapagos to find the largest area mesh. This isn’t ideal due to how this current goal/solve setup requires quite a few iterations to find an equilibrium, but it does appear to work (using a pretty low resolution to speed things up here):


221220_TrianglesOnSurface_01.gh (99.4 KB)

That said, since your initial input is a surface you could just get the geodesics directly, trim the surface, and find the largest area triangle surface like so (i.e. skipping Kangaroo all together)


221220_LargestTriangleOnSurface_00.gh (95.1 KB)

There are probably also more linear solutions that wouldn’t require e.g. Galapagos.

2 Likes

Thank you @diff-arch and @AndersDeleuran! It takes quite a while for Kangaroo to converge, at least on my Smithsonian-worthy machine, which might have put some people off.

I should have made myself much clearer because I do want the largest triangle created from selecting all possible combinations of three points from the five; which means they’d have to overlap when pulled to the mesh. I’m tempted to say that had I tried @diff-arch’s approach of directly inputting triangles as the polylines to Kangaroo but apparently not, because his works; I wish I knew what I did differently, but alas…

Anders, initially, I did work with just a surface, without Kangaroo, but wanted more flexibility. I was attempting to adapt your first solution above to my requirements and then saw your second. I assumed the initial points were given but you’re solving for the three points which give the largest geodesic triangle, an interesting problem in itself, which I’ll keep in mind. I took your def, minus Galapagos, and recast it to look like my original approach, FWIW.


221220_LargestTriangleOnSurface_00-b.gh (98.8 KB)

1 Like