-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Related to #213 - remaining tasks for CDTTriangleSplitter.
Related to #51
Perform Clipping in a Common Frame #244
Currently clipping happens in two different frames (first frame A then frame B), which can result in different floating point error scales being used. Ideally the clipping would be done in a consistent frame.
Reuse Clipping Edges #242
During the "accumulation" phase for detecting triangle / triangle intersections we get the intersection edges but we discard them and regenerate them (two more times) during the split stage. Instead we could cache and reuse them for a possible performance benefit.
Handle Coplanar Triangles More Intelligently #245
Related to the "reduce raycasting" task above, coplanar triangles are determined to be included or not based on raycasting, which is error prone, and can possibly be inadvertantly included and processed twice (once for brush A, once for brush B). Instead we should save that resulting clipped triangles are derived from a coplanar intersection and only process these in the appropriate brush. Triangle sidedness from the clipping step can be used to determine whether triangles are inside or outside a coplanar polygon.
This may be able to replace the "triangleConnectivity" graph with a list of "states" that a triangle is in ("INSIDE", "OUTSIDE", "ALIGNED_COPLANAR", "INVERTED_COPLANAR").
Other
- Setting translation to 0.69 in the coplanar example with the legacy splitter results in some missing triangles?
- Improve half edge generation robustness
- Investigate appending "split" vertices indexed by a half edge so we can make sure the sibling triangle receives the split.
- Add tests, close other issues
- Investigate other solutions for clipping. Other CDT? Earcut?
Performance / Memory
- Check if more data needs to be pooled / reused
- Check if data is being recalculated multiple times unnecessarily
- See if we can adjust loop nesting
- Check "hierarchy.html" performance. See if we can improve CDT traversal timing
- Perform operations in a more optimal way
Later
Reduce Raycasting
Rather than using raycasting to determine "inside" or "outside" for clipped polygons we can use the side of a clipping triangle that a resulting triangle lies on to determine "sidedness". This will remove the need for a lot of raycasting.
This may prove to be particularly difficult, though, with "just touch" sharp edges.
Retain Half Edge Structure During Construction
Constructing the half edge data structure is a significant portion of the processing time which can be particularly noticeable during recursive operations (see geometry html example).
Include inferring half edges at boundaries between separate meshes.