Open markcmiller86 opened 2 months ago
ASC user would like in the next few months.
The user is Scott McKinely.
And, I have a thought how to do this. Take the intersection of the clip plane with the surface elements. This will define a set of line segments. Each segment is the intersection of the clip plane with one of the elements and each segment can know which element produced it. We know the element connectivity of the surface. So, we transfer that connectivity knowledge to the resulting line segments. The resulting information defines a loop traversal of the points defining the line segments that we can use to define the cap polygon. This works for concave cases fine as long as there are no internal surfaces which the example here (probably poorly selected) does have.
Now that I think about it though, even in parallel decomposed case, after each MPI rank intersects the clip plane with the surface facets, we can make a legitimate case I think that all the resulting line segments can be collected to a single MPI rank. If the surface is water tight, then discovering the correct right-hand-ruled-loop walk of the segments to form the vertices of an uber-polygon end-cap would be fairly straightforward I think.
Can't we even go further, and collect all watertight surfaces and make a polygon for each of them?
Can't we even go further, and collect all watertight surfaces and make a polygon for each of them?
You are talking about a case where the surface object involves multiple disparate pieces to be capped...like maybe the legs of an octopus getting cut? I think under the right conditions that should be doable too. If the line segment data being gathered to one rank carried along the topological relationships of the surface entities from which the line segments came, then very doable.
You are talking about a case where the surface object involves multiple disparate pieces to be capped...like maybe the legs of an octopus getting cut?
Yup.
If the line segment data being gathered to one rank carried along the topological relationships of the surface entities from which the line segments came, then very doable.
I think the way to approach this is to form a graph (or graphs) based on the vertices and edges in the plane where the slice was performed. Then find all chordless cycles in the graphs and create a polygon for each one.
So in the picture you have up above, that approach would yield two polygons, one for the top half and one for the bottom half.
Then find all chordless cycles in the graphs and create a polygon for each one.
What is a "chordless cycle"?
What is a "chordless cycle"?
https://en.wikipedia.org/wiki/Cycle_(graph_theory)#Chordless_cycle
There are algorithms to find all of them. Here is the first result off of duckduckgo: https://stackoverflow.com/questions/4022662/find-all-chordless-cycles-in-an-undirected-graph
Is your feature request related to a problem?
When we clip a solid, volumetric object, we get a nice flat surface where the clip was performed.
When we clip a surface object (e.g. shell surface of a sphere), we wind up seeing inside the clipped object...such as shown in the image below...
ASC users would like the option to "cap" such surfaces when they are clipped. I assume this would be an option on the Clip operator. But, that supports spherical clips and I honestly don't know if "cap"ing on a clipped sphere is necessary (or easy).
The solution is more complicated than introducing a single polygonal facet because the cap may be non-convex. In addition, if the surface is composed of non-triangular facets (e.g. quads) and those quads are not planar, thats an additional complexity.