All Projects → hugoscurti → Mesh Cutter

hugoscurti / Mesh Cutter

Licence: mit
Simple mesh cutting algorithm that works on simple 3d manifold objects with genus 0

Projects that are alternatives of or similar to Mesh Cutter

3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+4835.86%)
Mutual labels:  unity, gamedev
Swissarmylib
Collection of helpful utilities we use in our Unity projects.
Stars: ✭ 154 (-35.02%)
Mutual labels:  unity, gamedev
Projectfieldwarning
Project: Field Warning is a community-made RTS game centered around lethal regiment and division-scale warfare.
Stars: ✭ 86 (-63.71%)
Mutual labels:  unity, gamedev
Beaverandfairies
Stars: ✭ 14 (-94.09%)
Mutual labels:  unity, gamedev
Addressableassetswebinar
Stars: ✭ 171 (-27.85%)
Mutual labels:  unity, gamedev
Evolutionary Neural Networks On Unity For Bots
Neural networks + Genetic algorithm on unity
Stars: ✭ 38 (-83.97%)
Mutual labels:  unity, gamedev
Self Driving Vehicle
Simulation of self-driving vehicles in Unity. This is also an implementation of the Hybrid A* pathfinding algorithm which is useful if you are interested in pathfinding for vehicles.
Stars: ✭ 112 (-52.74%)
Mutual labels:  unity, gamedev
Regoap
Generic C# GOAP (Goal Oriented Action Planning) library with Unity3d examples
Stars: ✭ 600 (+153.16%)
Mutual labels:  unity, gamedev
Rimlight
Customizable rimlight shader for Unity that includes pulsation and noise scrolling. Give your scenes that extra oomph!
Stars: ✭ 170 (-28.27%)
Mutual labels:  unity, gamedev
Awesome Opensource Unity
a list of curated opensource Unity packages for future proof Game Developers
Stars: ✭ 161 (-32.07%)
Mutual labels:  unity, gamedev
Voxelengine unity
Voxel engine made in C# for Unity
Stars: ✭ 25 (-89.45%)
Mutual labels:  unity, gamedev
Unity Shaders
✨ Shader demo - More than 300 examples
Stars: ✭ 198 (-16.46%)
Mutual labels:  unity, gamedev
Radialprogressbar
Customizable radial progress bar shader for Unity3D. Allows you to set arc range, minimum and maximum colors, textures, radius, and a few more things. Create HP Bars, Speedometers, rank progress, etc!
Stars: ✭ 714 (+201.27%)
Mutual labels:  unity, gamedev
Unity Package Tools
A set of developer tools to make it easier to create and distribute packages for the native Unity Package Manager.
Stars: ✭ 44 (-81.43%)
Mutual labels:  unity, gamedev
Gameproject3
游戏服务器框架,网络层分别用SocketAPI、Boost Asio、Libuv三种方式实现, 框架内使用共享内存,无锁队列,对象池,内存池来提高服务器性能。还包含一个不断完善的Unity 3D客户端,客户端含大量完整资源,坐骑,宠物,伙伴,装备, 这些均己实现上阵和穿戴, 并可进入副本战斗,多人玩法也己实现, 持续开发中。
Stars: ✭ 655 (+176.37%)
Mutual labels:  unity, gamedev
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (-58.65%)
Mutual labels:  unity, gamedev
Anything about game
A wonderful list of Game Development resources.
Stars: ✭ 541 (+128.27%)
Mutual labels:  unity, gamedev
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+2175.53%)
Mutual labels:  unity, gamedev
Netstack
Lightweight toolset for creating concurrent networking systems for multiplayer games
Stars: ✭ 157 (-33.76%)
Mutual labels:  unity, gamedev
Deadsimple Pixel Perfect Camera
An exceedingly easy-to-use pixel perfect orthographic camera script for 2D scenes in Unity. Punch in a few specs and you've got a working pixel perfect camera. It's that easy.
Stars: ✭ 186 (-21.52%)
Mutual labels:  unity, gamedev

Mesh Cutter

A proof-of-concept Unity project for a mesh cutting algorithm. This is a simple implementation of an algorithm that splits in 2 any 3d manifold objects with genus 0. The split is done using a plane defined by the line drawn by the user and a depth in the same direction as the camera facing forward (i.e. when we draw a line, we don't see the generated plane since it's perfectly aligned with the camera and the line)

Implementation

For each object tagged as sliceable:

  • We create 2 new meshes : a positive mesh, which is on the positive side of the slice plane, and a negative mesh, which is on the other side.

  • We go through each triangle of the mesh and, if it intersects the plane, we separate it into 3 triangles : 2 on the bigger side of the cut and 1 on the other side (we assume that it can't be cut perfectly in 2 triangles). If the triangle doesn't intersect with the plane, we simply store it in its respective mesh (positive or negative). We also keep a list of the newly created vertices, which will all lie on the boundary of the meshes.

  • We then create new triangles to form the boundary face (the new face generated by the cut). There is currently 2 different ways of generating the boundary face (generating a center vertex, or creating triangles fans by iterating through sorted pairs of vertices), but both of them works mostly only for a convex polygon.

  • Finally we create new objects for the new meshes and push them apart by a small value (indicated by the separation property in the MouseSlice script)

Examples

Here are a few examples of simple shapes being cut.

Cylinder Refractive Sphere Toonlit Suzanne

Note

  • The material used for the sphere is GlassRefractive from Unity's Standard Assets
  • The material used for Suzanne monkey is ToonLit from Unity's Standard Assets
  • Those materials are used in the project's scenes, but are not included in this repo. If you want to experiment with them, import the following folders from the Standard Assets:
    • Effects/GlassRefraction
    • Effects/ToonShading
    • Prototyping/Materials
    • Prototyping/Textures

Future work

Here are some of the things that could be worked on or improved:

  • Use a new submesh to add a sliced surface so that we can set a separate material for it.

  • Smooth-shading on the sliced boundary is not preserved since we compute

  • Handling cuts on manifold objects of genus 1 and above. This would mostly imply detecting the number of boundaries made by cutting the object and associating vertices with their respective boundaries;

  • Handling non-convex sliced polygons on the surface generated by the slice. The algorithm used right now works mostly for convex polygons. Using a better triangulation algorithm could help (e.g. ear-clipping triangulation);

  • Optimize the cutting algorithm. It could be interesting to treat triangles as part of a face, such that when we cut through a face, we could recompute triangles based on the face's shape so that we get an efficient number of triangles. This would also help generate better boundaries;

  • Using Unity's Job System to parallelize the cutting process (since the algorithm is relatively slow);

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].