cart: empty [ Login ]

Occlusion clipping

1 
Spring Air
9/15/2023 2:53 PM
I was just wondering if this library has a built-in way of handling occlusion clipping. For example, let's say I have one or more "meshes" that consist of a bunch of closed Polyline4Ds, which represent faces. Is there a way to use BlinnClipper4D and/or ZeeuwClipper3D to handle occlusion between faces? I'm essentially trying to create an internal 3D representation of an object, which I'd like to be able to apply various view projections to. (Plan view, section view, etc.) I was thinking that the clipping would result in something like a new set of polylines, which may be the same as the original line but with a projection applied to the vertices, or split into multiple polylines to indicate that it's partly underneath another face, or omitted entirely if it's completely underneath another face. I'd then use the output to generate some DxfPolylines for the actual DWG.
Wout
9/15/2023 3:05 PM
Hi, At the moment there's no 3D polygon intersection functionality in CadLib. It would be a useful feature though. - Wout
Wout
9/17/2023 2:30 PM
Actually, you could use ZeeuwNonDestructivePolylineClipper3D for this. You can clip a polyline against a polygon, and it will return which sections of the polyline are clipped away. However, there's no ready made structure that reduces the number of clip tests that has to be performed, but if it's a small number of faces, you could brute force test against all faces. I'd create/store one clipper per face, instead of creating one clipper per clip test, as creating a clipper already is expensive. If there are many faces involved, you will probably have to order the faces by depth in a binary search tree so you can quickly exclude a number of faces from clip testing. - Wout
Spring Air
9/20/2023 8:11 PM
Thanks, I'll give it a try!
1