Mesh cutter

Hi,

I’m currently developing a dynamic water system, but I made a break to develop this tool. It allows you to cut a mesh along a plane by giving a normal vector and a point. Here’s a screenshot:

I have some problems with normals but I hope to solve them shortly. If you want to test it you can download it: https://drive.google.com/file/d/0B0h3CZpUUUCwMmo5cmRhNjNKOW8/view?usp=sharing (left shift to drop a cube, space to cut)

I want to release it on the asset store but I don’t know what price would be appropriate. I don’t think that it’s really optimized or well coded, but it works.

it’s hard to tell, since these are only cubes. but if it works, it’s usable.
the plane is finite, right?
the cut pieces look like as if they would be welded together after the cut, but other than that, the demo looks ok.

Why the plane should be finite? To cut a gameObject you have to do something like Cut(gameObject), in the demo this fonction is call on all the gameObjects in the scene.

Here’s a new demo, with multithreading, no more black faces and other meshs than cube: https://drive.google.com/file/d/0B0h3CZpUUUCwbGEyZkJsbU56dkk/view?usp=sharing

then it’s okay, if you can define the gameobject to be cut.

but it looks like in this demo only one cut is possible (in the previous demo there was more cuts) and
looks like too many cut-points (vertices and triangles) are generated, but it could be that these shapes are high-poly. I dont see if the quality setting would change them to lower numbers/less tris.
also, these are still basic shapes. does it work with any shaped mesh?

Multiple cuts restored.

The number of vertices and triangles added is as low as possible, but what generate the most of triangles is fill the cut face: that’s why I added a new option to choose to generate these triangles or not.

These shapes are the Unity basic shapes, so I added the possibility to spawn cars (lot of vertices, so be careful don’t spawn 10 000 cars).

The quality influence the precision of the cut; for a x quality, the precision is approximately: (distance between 2 vertices)/2^x

I’ve also added submesh support, with a thread for each submesh, basic uv support and I fixed the cut position.

The new demo, that I hope is one of the last: https://drive.google.com/file/d/0B0h3CZpUUUCwWEptLUcyVlJjd2M/view?usp=sharing

yeah, I think it’s better (strange thing is I could cut the the car on my slower comp but not on the other)

here I uploaded some models if you want to test it with a reasonable polycount:

Thanks for this models! They allowed me to see another problem of my script, the non-support of parents structure.
I would be far from my computer during at least 2 weeks, so don’t expect any answer during this time.