I am trying to create a curve/polyline outline around a set of points (the blue line in the screenshot)
I have attempted to do this by using Delaunay edges which draws lines between each of the points but I can not seem to get an outline around all of it.
But if you can optain the right mesh out of your collection (this could be quite tricky mind) then the naked edges (i.e. mesh face edges that are connected to a single face) are the segments of the polyline that you are after: use the join Curves component on them (or use the MShadow against a suitable plane).
Plus if your collection is exactly as shown (i.e portions of a rectangular grid) then you can get what you want by excluding faces (on a Delauney mesh) that have edges greater than the diagonal length OR using other ways without a mesh … but I’m not sure how to achieve this without code (but that is a personal opinion).
Anyway: see attached that is the fastest way to cut the mustard - via a del mesh - on that matter … but is pure C# code (the bad news).
draw_line_around_points_2019Nov25a_V2.gh (236.5 KB)
Surprisingly, CullPt is really slow. Made a pseudo “CullPt” funcion and removed duplicated segments… it is somewhat faster overall…
Added the purple group to move nested curves (“regions”) to the same branch as their parent so that Boundary surface works correctly to show the holes.
Also converted all the polylines to NURBS curves to smooth the edges.
I integrated your optimization into this file, @maje90. It appears to yield identical results as RUnion and is certainly faster. Unfortunately, two of the four holes disappear when I use it!? I can’t see why but left it disabled for now.
This works 10-15% faster (does the Del mesh inside C#) plus it can - as an option - advise you upon the L value to use.
On an I9 or some Ryzen 9 expect ~300 milliseconds for 50K points (a bit pathetic but anyway).
NOTE: As always it works only against a rectangular collection (for the general case you’ll need a proper Concave Hull C#). Does NOT make a check on planarity (for speed) and a check of a Plane fitted to points (for speed).