I have a 2D image that i want to use to cut into a 3D mesh while leaving it closed (basically cut straight through it, and close it by generating vertices in both places it cut, front and back, to close the hole). The shape i'm cutting through is a manifold and i'm wondering if there's an easy & fast way to do it considering the shape is very high resolution (3K texture).

  • The 2D Shape in the image is closed but complex (probably thouthand of points vectorized)
  • The target mesh is a closed mesh, the odd case of intersecting with an edge of the mesh can be ignored in my case so the shape will either not intersect at all or intersect with 2 points (front and back of the mesh).

I guess i could simply vectorize the shape and then create a mesh from that and do a mesh-mesh intersection but i'm wondering if there's an easier / faster way to do it directly from the source texture.

  • \$\begingroup\$ How precise does your cutting need to be with regards to the shape of the "cutter"? One thing you could do to reduce complexity is to generate a simpler mesh for the 2d by sampling the texture radially to find the furthest point from the center. For example, start at 0 (say straight up), sample the distance to the center and add as point to new mesh, move 45 degrees sample, repeat. As for the cutting, if you allow some inaccuracy you just do a check that the size of the simple 2d mesh is big enough, and just do a plane intersection? \$\endgroup\$ – MistaGiggles Jul 3 '15 at 13:35
  • \$\begingroup\$ @MistaGiggles It needs to be very precise, most likely close to 1 vertex per pixel in the original texture's shape. And the point where it intersect has to be very precise (i'm not looking for a yes/no answer to does it intersect, but for where to outline the mesh). This doesn't need to be realtime at all and will run on a pretty massive server, i'm just wondering if i missed something obvious i could do that would be more efficient than generating a mesh and doing a mesh-mesh colision \$\endgroup\$ – Ronan Thibaudau Jul 3 '15 at 13:38
  • \$\begingroup\$ If your accuracy is that fine grained, you may benefit from doing the cut in voxel space. The method I'm imagining would be to voxelise the mesh to the precision you need (you can treat the texture data as voxel data directly), perform a subtraction on the voxel data and tesselate back to a mesh. The reason I suggest this is that the mesh->voxel and voxel->mesh operations are highly parallelisable and would allow you to take advantage of a lot of processing power. \$\endgroup\$ – MistaGiggles Jul 3 '15 at 14:09
  • \$\begingroup\$ Sounds too complex and i definately don't have the voxel knowledge to do this. I'm hoping for something simpler than my original solution, not more complex as i have to do it all (third party libraries are a no-no) \$\endgroup\$ – Ronan Thibaudau Jul 3 '15 at 14:14

Does it need to truly "Cut out" the mesh", or just look cut out? You don't mention the scenario so I'm going to assume that simply "looking cut out" would be adequate, and I'll assume this is something that happens during Runtime and not something that is compiled in.

So, going with the assumption that it only needs to look this way, not affect the mesh itself:

I would use a special Alpha texture that is applied to the model in the shape that you desire, then apply it to the model in the same way you would apply a Blood Splotch. Treat this alpha the way you'd like (which may simply be to act "Clear".)

I do anticipate some odd work around looking at it from an angle, but I don't know what you're trying to accomplish yet. Hopefully this gives you a different approach to the problem and gets you into a helpful head-space.

  • \$\begingroup\$ I actually need to cut it, the goal is to change the actual mesh for further processing, it’s not rendered on screen at any time. \$\endgroup\$ – Ronan Thibaudau May 7 '18 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.