Replies: 1 comment 9 replies
-
I think of this as two different features used together:
|
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In addition to 3D boolean operations, my program needs to do some 2D work (actually in UV coordinates of 3D surfaces). Here we intersect and mark a 2D 'SubSurface' in a surface.
Here are two examples, a UV ellipse on the upper surface of a wing and a control surface that is on the upper and lower surfaces of the trailing edge of the wing.
Instead of a traditional Boolean operation, I calculate the intersection to 'impress' the second onto the first. In this case, the first is a mesh and the second is 'just' a polyline.
In the current world (where my CSG engine doesn't care about manifolds except for inside/outside detection) we do this by expressing the first mesh in UVZ (where Z=0) like a sheet of dough. We then make a cookie cutter mesh out of the UV polyline by extruding it in the Z direction from [-1,1] and connecting the points to a simple mesh. We then intersect these two UVZ meshes, we interpolate the XYZ points. We color the triangles as inside/outside the cutting polyline.
I don't do all this in XYZ because when the UV subsurface intersects only the upper or lower surface, it wouldn't be possible to construct the cutting surface in a way that it is guaranteed to not intersect the opposite surface. By un-rolling to a sheet of dough and using a cookie cutter approach, we can avoid those problems.
Is there a clever way to work in 2D in Manifold?
My current thoughts are:
Proceed substantially as I currently do, but extend my sheet of dough to form a volume manifold. Likewise extend the cookie cutter to form an enclosed volume manifold. Perform the intersection algorithms required to get both the 'inside' and 'outside' surfaces. (hopefully use Manifold's interpolation, but revert to the existing interpolation if required).
Attempt to use Clipper2. From what I can tell, it works exclusively with polylines (not meshes). So I would either need to treat the mesh as a large number of independent triangles, or as a large number of independent edges. In either case, this seems like I would need to implement my own spatial search (quadtree) to accelerate the process as Clipper isn't really set up to handle bulk requests in this way.
Write a new from-scratch 2D mesh-polyline intersection algorithm. I hate to go this way, but it seems like a substantially simpler problem than general 3D booleans and it might not be 'too bad'. A complete algorithm should be able to be based on 'only' a robust 2D line-line intersection algorithm.
Something else.
Beta Was this translation helpful? Give feedback.
All reactions