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).
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…
Thanks @dale !
The last time I looked for this it wasn’t accessible from GH… years have passed … 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.
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;
}