Code Monkey home page Code Monkey logo

Comments (9)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
C++ version BTW.

Original comment by [email protected] on 2 Feb 2011 at 7:58

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Currently the lib assumes that the user has validated the input to be a simple 
polygon.

I'm looking into a way to just throw an exception in cases where constraints 
intersect during the triangulation.


Original comment by [email protected] on 3 Feb 2011 at 9:15

  • Changed state: Started

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I believe the C# port has some excellent pre-processing functions to help 
simplify the initialization/validation process. I'm in the process of updating 
the C++ code, and will incorporate into the library soon.

Original comment by [email protected] on 5 Mar 2011 at 1:56

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024

Original comment by [email protected] on 8 Mar 2011 at 2:29

  • Changed state: Accepted

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Sorry I completely forgot about this issue, have been busy with other stuff.

My first brain storm on this would be the following:
To throw an exception when we have intersecting constraints this should be all 
we need to do. (Not tested)

When enforcing a constraint on the triangulation we trace the constraint thru 
current triangulation and flip triangles. We could easily test if one of the 
edges we cross already are a constrained edge and throw an exception.

I would implement this as follows:
In void Sweep::FlipEdgeEvent(..)
Adding this as first thing to do in that method

    if( t.getConstrainedEdgeAcross(p) )
    {
        throw new RuntimeException( "Input Error: Intersecting Constraints" );
    }

should be enough to catch all constraint intersections due to self intersecting 
input.

with a reservation for not having tested it yet :)



Original comment by [email protected] on 8 Mar 2011 at 3:11

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
There is no such method in the Triangle class as we speak.
The only 2 I can see are:

- bool GetConstrainedEdgeCCW(Point& p);
- bool GetConstrainedEdgeCW(Point& p);

Original comment by [email protected] on 8 Mar 2011 at 4:37

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Oh. sorry. I'm working with the Java version so didn't know that.

    public boolean getConstrainedEdgeAcross( TriangulationPoint p )
    {
        if( p == points[0] )
        {
            return cEdge[0];
        }
        else if( p == points[1] )
        {
            return cEdge[1];
        }
        return cEdge[2];
    }

Original comment by [email protected] on 8 Mar 2011 at 4:43

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Seems to work like a charm, thanks!

Original comment by [email protected] on 8 Mar 2011 at 7:11

from poly2tri.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024

Original comment by [email protected] on 10 Mar 2011 at 7:04

  • Changed state: Done

from poly2tri.

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.