Triangle.NET | NET generates 2D Delaunay triangulations | Animation library

 by   Geri-Borbas C# Version: Current License: No License

kandi X-RAY | Triangle.NET Summary

kandi X-RAY | Triangle.NET Summary

Triangle.NET is a C# library typically used in User Interface, Animation applications. Triangle.NET has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Triangle.NET generates 2D (constrained) Delaunay triangulations and high-quality meshes of point sets or planar straight line graphs. It is a C# port of Jonathan Shewchuk's Triangle software.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Triangle.NET has a low active ecosystem.
              It has 120 star(s) with 38 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 12 open issues and 2 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Triangle.NET is current.

            kandi-Quality Quality

              Triangle.NET has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              Triangle.NET does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              Triangle.NET 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 Triangle.NET
            Get all kandi verified functions for this library.

            Triangle.NET Key Features

            No Key Features are available at this moment for Triangle.NET.

            Triangle.NET Examples and Code Snippets

            No Code Snippets are available at this moment for Triangle.NET.

            Community Discussions

            QUESTION

            Why is Triangle.Net not triangulating these polygons as expected?
            Asked 2020-May-17 at 18:21

            I've been having issues with triangulating certain polygons with holes using Triangle.Net.

            The issue seems to be certain circumstances where I define a hole using a contour and setting hole to 'true' (after first adding the outer contour, hole set to false). Polygon.Add(contour, true);

            Triangle.Net then finds a point inside that hole through Point.FindInteriorPoint and for reasons I don't know sometimes it finds a point that is on the very edge of that hole and the result is the only thing that gets triangulated is the hole, the rest of the polygon is ignored.

            So for example. Two polygons with identical outer contours :

            (3.5, 3.5), (-2.5, 3.5), (-2.5 -0.5), (-4.5, -0.5), (-4.5, -2.5), (3.5, -2.5) Image1

            But one has a hole defined as this contour:

            ...

            ANSWER

            Answered 2020-May-17 at 18:21

            There are two different things going on here and, together, this makes the behavior confusing.

            The first issue is the behavior of FindInteriorPoint. This method has some robustness problems and can find points that are on the contour boundary. I suspect you aren't using this fork of Triangle.NET that contains some robustness improvements that should yield good results especially on these simple cases.

            Now, if you do specify a hole using a point that is on the boundary of the hole, what do we expect will happen? The answer is the results are random/unpredictable. Triangle locates the triangle in the final mesh containing the point identified as a hole and delete all the triangles it is connected to without crossing any constrained segments. Which side (using exact arithmetic) depends on the exact coordinates of the endpoints of the subsegment in the mesh which for a refined mesh will depend on rounding that occurs computing the extra vertices inserted. Your case doesn't have any refinement so the location really is exactly on the the segment. Triangle walks from a starting point towards the hole location until it finds a triangle containing the hole point: the arbitrary location of the starting point determines which side it will reach first and end up choosing. So if you have a different surrounding domain, you get a different (arbitrary) starting point and you can get a different result.

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

            QUESTION

            Triangle.NET - How to add vertex to existing triangulation?
            Asked 2020-Feb-24 at 20:29

            I've looked through what seems like every question and resource there is for Triangle.NET trying to find an answer to how to insert a vertex into an existing triangulation. The closest I've gotten was in the discussion archives for Traingle.Net where someone asked a similar question (discussion id 632458) but unfortunately, the answer was not what I was looking for.

            My goal here is to make a destructible wall in Unity where, when the player shoots the wall, it will create a hole in the wall (like in Rainbow Six Siege).

            Here's what I did for my original implementation:

            1. Create initial triangulation using the four corners of the wall.
            2. When the player shoots, perform a raycast, if the raycast intersects with the wall then add the point of intersection to the polygon variable and re-triangulate the entire mesh using that variable.
            3. Draw new triangulation on the wall as a texture to visualise what's happening.
            4. Repeat.

            As you can see, step 2 is the problem.

            Because I re-triangulate the entire mesh every time the player hits the wall, the more times the player hits the wall the slower the triangulation gets as the number of vertices rises. This could be fine I guess, but I want destructible walls to play a major role in my game so this is not acceptable.

            So, digging through the Triangle.Net source code, I find an internal method called InsertVertex. The summary for this method states:

            Insert a vertex into a Delaunay triangulation, performing flips as necessary to maintain the Delaunay property.

            This would mean I wouldn't have to re-triangulate every time the player shoots!

            So I get to implementing this method, and...it doesn't work. I get an error like the one below:

            NullReferenceException: Object reference not set to an instance of an object TriangleNet.TriangleLocator.PreciseLocate (TriangleNet.Geometry.Point searchpoint, TriangleNet.Topology.Otri& searchtri, System.Boolean stopatsubsegment) (at Assets/Triangle.NET/TriangleLocator.cs:146)

            I have been stuck on this problem for days and I cannot solve it for the life of me! If anyone who is knowledgeable enough with the Triangle.NET library would be willing to help me I would be so grateful! Along with that, if there is a better alternative to either the implementation or library I'm using (for my purpose which I outlined above) that would also be awesome!

            Currently, how I've set up the scene is really simple, I just have a quad which I scaled up and added the script below to it as a component. I then linked that component to a shoot raycast script attached to the Main Camera:

            How the scene is setup.

            What it looks like in Play Mode.

            The exact Triangle.Net repo I cloned is this one.

            My code is posted below:

            ...

            ANSWER

            Answered 2020-Feb-24 at 20:21

            Great news! I've managed to fix the issue. InsertVertex() doesn't actually add the new vertex to the list of vertices! So this means that when it tried to triangulate, it was trying to point to the new vertex but it couldn't (because that vertex wasn't in the list). So, to solve this, I just manually add my new vertex to the list of vertices in the mesh, before calling InsertVertex(). Note: When you do this, you also need to manually set the vertex's id. I set the id to the size of the list of vertices because I was adding all new vertices to the end of the list.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install Triangle.NET

            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/Geri-Borbas/Triangle.NET.git

          • CLI

            gh repo clone Geri-Borbas/Triangle.NET

          • sshUrl

            git@github.com:Geri-Borbas/Triangle.NET.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