I suddenly ran out of ideas. Starting from a fairly evenly distributed bunch of (planar) points, is there anyone out there having good ideas about a strategy for removing some of the points “inside” the cloud. What I want is to keep a band of points along the outer boundaries of the pointcloud.
A working solution would have to be able to get its way around the boundary also if it makes a turn into a “keyhole” (or “tunnel”) into the cloud (constrained by a minimum gap size as to avoid narrow inward “spikes”).
I need to come up with a C# algorithm, so any ideas illustrating a working strategy would be gold.
I would have no other input data than the cloud itself, and a desired width of that “blue band” of points to keep, [Edit:] so I wouldn’t have any curve boundary etc to know where to cull. It must all be derived from the cloud itself.
At first glance I didn’t really grasp how the definition works which you posted, but I’ll have a closer look asap. Thank you for posting!
I managed to get a “concave mesh” (white group) and perimeter boundary around the point cloud. I left out the Graph Mapper from the other model that causes the gradient effect and cull all the points within ‘edge_L’ distance from the perimeter.
I didn’t mean to leave two ‘edge_L’ sliders in the model (copy/paste) but if you adjust the first one in the white group and hide the Join boundary curve, you can include that single point all by itself.
No problem. I would expect that, since if that value is divided by three it would be close to edge-length of the triangles (if I understood it correctly) and if edge-len is too short it’s no wonder if the algoritm caves in on itself.
I’m working on a C# component doing the magic as in your Gh definition. See upload below.
I have a question about the Polyline component. For some reason, the Polyline component produces a different result than what I can achieve using C# code to create the same Polyline. The difference appears when the input option Closed is set to Invert, or “True” (Closed = true). I marked this setting with a red ring in Fig 1. The difference in output is marked in Fig 2 below.
My Q: So what is it that causes the “closed” option to give the different result? I just can’t figure it out (so I could mimic it in C# code), because the closed result is the desired result.
Fig 1. A C# version (white ring) along with the original strategy (Gh definition) by @Joseph_Oster:
Fig 2. Different “Naked Edge” result for “closed” Polyline compared to C# created ditto. I marked some examples. The yellow line is the desired result from the Gh Polyline component with “closed” = true:
I added to the Gh definition a Sort component to ensure that only the longest Naked Edge is used for the final point culling.
Notice also that after adding a wire to any C# Component output, the Gh definition must be recomputed for the component to become aware of the change (it then know’s it needs to internally
process the desired output data, which is my optimization trick to skip processing such data which isn’t asked for).
I haven’t looked at your code but without the ‘Closed (C)’ set to True, only two of the three points will be connected. When all three points (vertices of a mesh face) are connected, a triangle is formed and it’s the sum of all three edge lengths that determines “large” faces from small ones. The CullF component then culls (filters) only the small faces with ‘Pattern (P)’ inverted, ignoring the large faces and leaving the “concave mesh”.
Glad you like it.
P.S. I don’t understand why Sort is added? Unless you end up with multiple mesh boundaries? I’m unable to examine your code at the moment.
P.P.S. Oh wait, you are using a value of nine and getting two boundaries; I warned against using values less than 9.5 to avoid that problem.
OK, I see what’s going on. If you disable 'Closed (C)' in my GH version, the boundary matches yours.
Correct. You might want to enable preview on MEdges(Mesh Edges) to see the mesh faces. And I understand why you used Sort. I just avoided that problem by keeping the slider value at 9.5 or above. Cheers.