Mesh and surface intersection/overlap

Morning community,
I am back with an interesting question (well at least for me :slight_smile:).
I have a mesh imported using the meshtoolikt (it is an OBJ file) which represents a geo model exported from leapfrog. The idea is to slice this mesh usin the Mesh.Intersect node and produce a set of closed polycurves. In some areas the slice will produce more than one polycuve and those will present in mainly two different options:

  • 2 or more separated closed curves
  • 2 or more concentric closed curves (those will represent holes in that specific material)

What I need is to intersect those areas with another area to get how much square meters ot are overlapping (imagine to calculate the amount of excavation for a tunnel)

Now the question:
I can create surfaces out of the produced polycurves but Dynamo will not understand to remove concentric loops from the external one, unless I have to decide which one is the cutting tool for the surface (without mentioning the performances in creating these surfaces). I can go down the path of writing my own “polyogn cutter” using some clever algorithm but, before I start doing that, is there anyone that has a different idea? Am I missing something?

In GH it takes literally less than a second to do the full operation for 1.2km of tunnel but I have the rest of my workflow already in Dynamo and, before starting to move the entire set of custom nodes already built to GH, I want to ask for suggestions. There must be a better way!

And to close up about performances and strange behaviours:

@solamour I believe this is something the team needs to investigate further.

1 Like

@Cesare_Caoduro3 Include the perimeter curves and Surface.TrimWithEdgeLoops will work just fine

No meshes involved, but the below file with two punctures within each surface executes almost instantaneously

trim.dyn (13.8 KB)

Thanks, on the paper it works if you use simple curves and if you know which one is the outer shape (which is not always the bigger) but, as you can see from my images it doesn’t work on a real case scenario, and the surface solution is not feasible considering the time to calculate only 1 of the possible thousands sections along the alignment.

Cesare Caoduro

@Cesare_Caoduro3 If possible, please share a small sample of the object to be cut and profile.
Would be good to explore your issue.

Here one of the mesh examples. You can try to cut any area where you can see internal holes (predominantly around the origin area).

Here the Link

The file doesn’t seem in order (or am I doing something wrong?)

Apologies night time over here, the mesh is very far from the origin so just try to move it closer.


1 Like

Created a bounding Box and obtained the cut out area.

mesh.dyn (9.6 KB)

There is an issue with Surface.TrimWithEdgeLoops which makes it inconvenient to create the reverse (openings as surfaces and empty background)

msh1 = Dynamo.Mesh.Remesh(Dynamo.Mesh.Translate(Dynamo.Mesh.ImportFile(fil), -399000, -801000, 0));

//Slice intervals
intr = 250;

//Bounding Cuboid
bcb1 = Cuboid.ByCorners(Point.ByCoordinates(0,0,-100),Point.ByCoordinates(1500,3000,100));

//Cutting Planes
pln1 = Plane.ByOriginNormal(Point.ByCoordinates(0,0..3000..intr),Vector.YAxis());

msk1 = List.Contains(DSCore.Object.IsNull(msh1.Intersect(pln1<1>))<1>,true);
slc1 = List.Clean(List.Flatten(msh1.Intersect(pln1<1>)<1>,-1),false)<1>;
slc2 = List.Flatten(List.FilterByBoolMask(bcb1.Intersect(pln1),msk1)["out"],-1);
crv1 = PolyCurve.ByJoinedCurves(slc2.PerimeterCurves());
crv2 = List.Flatten(List.AddItemToFront(crv1<1>,slc1<1>)<1>,-1);
slc3 = slc2.TrimWithEdgeLoops(crv2);

//Cross Sectional Areas (Hollow)
cra1 = slc2.Area - slc3.Area;
1 Like

Thanks for your help @Vikram_Subbaiah. It does actually gave me some idea on how to manage it but, it comes with other issues :slight_smile:
Yet I can’t understand why the polycurve is not on the same plane of the intersections with the mesh, considering they are produce by the same cut plane.

Even better with the circle

Posted this issue at