Giter Site home page Giter Site logo

Comments (6)

OzKitsune avatar OzKitsune commented on July 23, 2024

I also can't cut complex objects. Probably there is an overflow somewhere or something.

The toast is also not cut
image

from ezy-slice.

DavidArayan avatar DavidArayan commented on July 23, 2024

I've just taken a look at this and its weird. Whatever is issue it seems to be a problem during the hull-generator phase where the vertices and indices of the re-constructed objects are all messed up. I'll keep looking to see if there is something i've missed... there might be some assumptions during the re-construction phase that i've forgotten about.

Also keep in mind that the slicer only works for Convex 3D Objects, the Toast is technically concave so even if the slice went through, you'd get artefacts around the cross section. You also might want to optimise that Toast, this is an O(n*log(n)) algorithm so it'll be quite slow for a 500k poly model.

from ezy-slice.

OzKitsune avatar OzKitsune commented on July 23, 2024

I solved the problem! It was indexFormat (by default 16 bit) which is not enough for large polygon models. I added for myself to Slicer.cs after
298 Mesh newMesh = new Mesh();
next code:
newMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;

Perhaps somewhere need to add a check for the number of vertices to select the index format.

P.S. Toast was sliced.
image

from ezy-slice.

DavidArayan avatar DavidArayan commented on July 23, 2024

Great fix @OzKitsune ! I didn't realise that Unity uses 16 bit indices by default and thought its all 32 bit. 32 bit would double the storage requirement per index but I don't think thats a huge concern for modern hardware including mobile.

I'm happy to accept this fix as a pull request if you'd like to submit one?

from ezy-slice.

OzKitsune avatar OzKitsune commented on July 23, 2024

@DavidArayan sure, created a request.

from ezy-slice.

DavidArayan avatar DavidArayan commented on July 23, 2024

@OzKitsune Thank you for the pull request. It has been merged with master branch. Cheers!

from ezy-slice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.