Comments (9)
C++ version BTW.
Original comment by [email protected]
on 2 Feb 2011 at 7:58
from poly2tri.
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.
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.
Original comment by [email protected]
on 8 Mar 2011 at 2:29
- Changed state: Accepted
from poly2tri.
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.
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.
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.
Seems to work like a charm, thanks!
Original comment by [email protected]
on 8 Mar 2011 at 7:11
from poly2tri.
Original comment by [email protected]
on 10 Mar 2011 at 7:04
- Changed state: Done
from poly2tri.
Related Issues (20)
- CMake build script
- Inconsistent behavior with holes that share a point HOT 17
- add typedef for "double"
- add typedef for std::vector<Point*>, std::vector<Triangle*> and other containers
- Triangulate crashes in sweep.cc:703 HOT 3
- java version compile error HOT 3
- Polygon.getHoles() missing HOT 5
- poly2tri crashes on a very simple geometry HOT 1
- crash with attached polygon HOT 2
- Crash when triangulating a polygon HOT 1
- crash with square polygon HOT 1
- Java source unbuildable in 1.7+
- Build failed when compliling with -we4715
- Java findbugs - nullcheck of value previously dereferenced HOT 1
- [java] Tessellation with hole error HOT 4
- Polygon with hole HOT 10
- [java] Missing triangle in non-constrained delaunay HOT 3
- Problem building library
- the EPSILON value is not exported in the python/cython version HOT 1
- Compilation fails with MSVC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poly2tri.