triangle.net | Snapshot of Christian Woltering 's Triangle.NET | Game Engine library

 by   garykac C# Version: Current License: MIT

kandi X-RAY | triangle.net Summary

kandi X-RAY | triangle.net Summary

triangle.net is a C# library typically used in Gaming, Game Engine, Unity applications. triangle.net has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

With the shutdown of Codeplex in 2017, Christian Woltering's Triangle.NET project was placed in read-only mode and archived.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              triangle.net has a low active ecosystem.
              It has 42 star(s) with 13 fork(s). There are 6 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 1 have been closed. On average issues are closed in 4 days. 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 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

              triangle.net releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            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

            This documention has been transferred from the wiki in the original Codeplex site (with links fixed, et al). (No, I don't know why there are numbering gaps. The "missing" examples are most like elsewhere in the documentation.).
            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/garykac/triangle.net.git

          • CLI

            gh repo clone garykac/triangle.net

          • sshUrl

            git@github.com:garykac/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

            Explore Related Topics

            Consider Popular Game Engine Libraries

            godot

            by godotengine

            phaser

            by photonstorm

            libgdx

            by libgdx

            aseprite

            by aseprite

            Babylon.js

            by BabylonJS

            Try Top Libraries by garykac

            plotto

            by garykacHTML

            clipboard

            by garykacHTML

            spritely

            by garykacC#

            shinjuku

            by garykacPython

            covid19

            by garykacHTML