Triangulator | An implementation of ear clipping triangulation in C

 by   nickgravelyn C# Version: Current License: MIT

kandi X-RAY | Triangulator Summary

kandi X-RAY | Triangulator Summary

Triangulator is a C# library. Triangulator has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Triangulator is an implementation of Dave Eberly's ear clipping algorithm as described here: The project allows you to simply input a list of vertices and get back the required vertices (in order) and indices needed to construct a VertexBuffer and IndexBuffer for rendering the particular shape. The library is able to cut holes inside of polygons without error (the only caveat to this is that the library assumes that the hole to be cut lies completely within the shape so erroneous data given as a hole will result in invalid output data). Note: Triangulator is set up to write a good amount of verbose output in Debug mode. This will affect performance. For optimal performance, make sure you are building the library in Release mode or modify the source to remove the logging functionality.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Triangulator has a low active ecosystem.
              It has 27 star(s) with 6 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              Triangulator has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Triangulator is current.

            kandi-Quality Quality

              Triangulator has 0 bugs and 0 code smells.

            kandi-Security Security

              Triangulator has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Triangulator code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Triangulator is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Triangulator releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Triangulator
            Get all kandi verified functions for this library.

            Triangulator Key Features

            No Key Features are available at this moment for Triangulator.

            Triangulator Examples and Code Snippets

            No Code Snippets are available at this moment for Triangulator.

            Community Discussions

            QUESTION

            Unity Mesh Renderer generating polygons on the wrong side
            Asked 2020-Feb-24 at 02:55

            So I need to generate a polygon using the Unity Mesh component that has n number of vertices. I am using a custom Triangulate() function that is able to find the indices for the mesh.triangles.

            The problem is that based on the vertices I feed that function, the polygon generates on the wrong side and sometimes is not visible to the camera (unless I flip the camera to the other side).

            Now I know this has to do with Unity's clockwise winding order, but how can I make sure the polygon is always generated on the correct side, no matter the vertices I feed it? Or could there be a way to know on which side the mesh generated so I can adjust the camera accordingly?

            The Triangulator function I use

            ...

            ANSWER

            Answered 2020-Feb-24 at 02:55

            This is the normal vector n of a triangle:

            The visibility of the triangle is based on its normal. The math that calculates the light that hits the triangle, is reflected and goes to your eyes (Unity camera) uses the normal of the triangle for that. Basically, if that vector n points towards your eyes it means you can see [part of] the light that hits that surface.

            To know if you can see the triangle, you need to know if the normal points to you. Without going further with the math, the normal is given by calculating the cross product of the vectors defined by the vertices of the triangle.

            For example, a triangle A-B-C can be defined by the vectors AB and BC (not related with the figure above). Or you can invert the "direction" of this triangle and define it AC and CB. The normal of AB/BC has one direction and the normal of AC/CB has the opposite direction, because of ... math - if you google this stuff you can learn why, there are tons of tutorials.

            So I wrote all this to tell something you already know: the order of the vertices defines the visibility. But that's because it defines the direction of the normal. Now take a look at this code:

            Source https://stackoverflow.com/questions/60355412

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Triangulator

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/nickgravelyn/Triangulator.git

          • CLI

            gh repo clone nickgravelyn/Triangulator

          • sshUrl

            git@github.com:nickgravelyn/Triangulator.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link