Create mesh from points

I have this set of points (different Z value) and i need to create a mesh that doesnt go outside the blue line (just graphical to show the border, doesnt exist in rhino).

I used Delaunay mesh but that shows the mesh like this:

Mesh from points.gh (61.8 KB)

1 Like

It’s difficult to generalize the problem with a single case in our hands.
The fastest solution in this cases is to work manually!!
Do the delaunay mesh, bake it, and delete the unwanted faces… 20 seconds of work if you are slow.

OR

Create the polyline manually and feed it to grasshoppper and build a logic there.

But…
In this specific case, it seems the outline you want is roughly made only by orthogonal segments.
So we can cull the tilted segments with a tolerance (the slider) and then… with a just-made c# script we can access the Curve Boolean function (like the Rhino command) to get the external outline, and so cull the faces of the mesh…


Mesh from points.gh (70.0 KB)


Thanks @dale !
The last time I looked for this it wasn’t accessible from GH… years have passed …
2022-06-09 15_33_18-Window
Curve Boolean.gh (2.5 KB)
Curve Boolean function is really powerful, I think it should totally be a GH built-in function, accessible for everyone. :smiley:

 private void RunScript(List<Curve> C, List<Point3d> P, Plane Pl, ref object R)
  {
    if(!Pl.IsValid) Pl = Plane.WorldXY;
    Rhino.Geometry.CurveBooleanRegions regions;
    // First attempt
    regions = Rhino.Geometry.Curve.CreateBooleanRegions(C, Pl, P, true, this.RhinoDocument.ModelAbsoluteTolerance);
    if(regions.RegionCount > 0){
      // some region found thanks to the input point
    }else{
      // no region found, point outside all possible regions or no point was given, using the alternative method with no points for the whole region
      regions = Rhino.Geometry.Curve.CreateBooleanRegions(C, Pl, true, this.RhinoDocument.ModelAbsoluteTolerance);
    }
    List<Curve> crv = new List<Curve>();
    for(int i = 0;i < regions.RegionCount;i++){
      crv.AddRange(regions.RegionCurves(i));
    }
    R = crv;
  }

https://mcneel.myjetbrains.com/youtrack/issue/RH-68960

– Dale

1 Like