Git Product home page Git Product logo

unitylightsaber's People

Contributors

thavenn avatar tvtig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

unitylightsaber's Issues

Maintaining the texture after the cut

I am using this code in my project and it helped a lot! Just a minor issue that if the original mesh has a texture, it won't stay at the same place after the slice. Is it possible to solve without adding too much code? Thank you!

removing indexOf immensily improves performance for complex meshes

First of all, I would like to thank you for creating this and uploading it to github.

I've been playing around with this, and it turns out there are unnecessary IndexOf calls (vertIndex var can just be meshTriangles[i], [i+1] and so on) which take a lot of execution time (around 70% of it) - it would be nice to change that in source repo for any other people trying it in the future.

int vert1Index = Array.IndexOf(meshVerts, vert1);

int vert2Index = Array.IndexOf(meshVerts, vert2);

int vert3Index = Array.IndexOf(meshVerts, vert3);

Additionally, I believe replacing

triangles.Add(vertices.IndexOf(vertex));

with triangles.Add(vertices.Count - 1); also helps.

Add a open source license maybe?

If you intend for others to be able to use this, you'll need to use a license, otherwise it goes under copyright law. So if you want it to be usable by others consider adding a Open Source License like MIT License, or similar.

Here are a few to choose from: https://opensource.org/licenses

Slicing problems

Hello,

Thank you for this, it's great!
I've been trying to use it in a simpler way (i.e. not using a light saber, just creating my own plane), but I run into some weird behavior. I'm slicing a very thin wall with a horizontal plane:

Plane pl = new Plane(new Vector3(0.0f, 1.0f, 0.0f), new Vector3(6.0f, 3.0f, 7.5f)); GameObject[] slices = Slicer.Slice(pl, hit.transform.gameObject);

The slicing seems to be fine, except that one of the 2 new parts is wrongly placed, as illustrated below.

This is the original wall:
image

And these are the slices:
image

Furthermore, there is no Mesh component in the inspector, is that normal?
image

Well, anyways thanks a lot ;)

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.