GithubHelp home page GithubHelp logo

poly2tri's Introduction

#####################################################################################
###
### Since there are no Input validation of the data given for triangulation you need 
### to think about this. Poly2Tri does not support repeat points within epsilon.
### 
### * If you have a cyclic function that generates random points make sure you don't 
### add the same coordinate twice.
###
### * If you are given input and aren't sure same point exist twice you need to 
### check for this yourself.
###      
### * Only simple polygons are supported. You may add holes or interior Steiner points
###
### * Interior holes must not touch other holes, nor touch the polyline boundary
###
### * Use the library in this order:
###
### 1) Initialize CDT with a simple polyline (this defines the constrained edges)
### 2) Add holes if necessary (also simple polylines)
### 3) Add Steiner points
### 4) Triangulate
###
### Make sure you understand the preceding notice before posting an issue. If you have 
### an issue not covered by the above, include your data-set with the problem.
###
### The only easy day was yesterday; have a nice day. <Mason Green>
###
######################################################################################

===========================
TESTBED INSTALLATION GUIDE
===========================

------------
Dependencies
------------

  Core poly2tri lib:
  - Standard Template Library (STL)
  
  Testbed:
  - gcc
  - OpenGL
  - GLFW (http://glfw.sf.net)
  - Python
 
waf (http://code.google.com/p/waf/) is used to compile the testbed.   
A waf script (86kb) is included in the repositoty.

----------------------------------------------
Building the Testbed
----------------------------------------------

Posix/MSYS environment:

  ./waf configure
  ./waf build

Windows command line:

  python waf configure
  python waf build

----------------------------------------------
Running the Examples
----------------------------------------------

Load data points from a file:
p2t <filename> <center_x> <center_y> <zoom>

Random distribution of points inside a consrained box:
p2t random <num_points> <box_radius> <zoom>

Examples:

  ./p2t dude.dat 300 500 2
  ./p2t nazca_monkey.dat 0 0 9
  
  ./p2t random 10 100 5.0
  ./p2t random 1000 20000 0.025

poly2tri's People

Contributors

greenm01 avatar

Watchers

 avatar

poly2tri's Issues

Push Java releases to public Maven repo

Is there a particular reason why poly2tri should not be available in public 
Maven repos? Sonatype offers an easy no-effort way for OSS projects: 
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage
+Guide


Original issue reported on code.google.com by [email protected] on 11 Jan 2012 at 10:21

BUG: Polygon constructor doesn't add individual points to points collection

From the code:

    public Polygon( PolygonPoint p1, PolygonPoint p2, PolygonPoint p3 )
    {
        p1._next = p2;
        p2._next = p3;
        p3._next = p1;
        p1._previous = p3;
        p2._previous = p1;
        p3._previous = p2;
    }

This constructor is not adding the points p1, p2 and p3 to the points 
collection, so if you use the polygon later it throws an ArrayOutOfBounds 
because _points is empty.




Original issue reported on code.google.com by [email protected] on 29 Aug 2011 at 5:58

Java: Encoding messed up in source files => Maven build on Linux fails

What steps will reproduce the problem?
1. Clone the repository
2. mvn build
3. Wait ;)

What is the expected output? What do you see instead?
I would like to see "BUILD SUCCESS" but the build is aborted with the error 
message that the encoding could not be mapped to UTF-8.

The build process stops because your name is written in the source file and 
it's not mappable to UTF-8. I will provide the detailed error stack later.

Original issue reported on code.google.com by [email protected] on 25 Apr 2011 at 3:02

Poly2Tri.DelaunayTriangle.Area incorrect?

What steps will reproduce the problem?
1. create a square
    [0]: {X:-3 Y:-10}
    [1]: {X:3 Y:-10}
    [2]: {X:3 Y:10}
    [3]: {X:-3 Y:10}
2. triangulate
3. evaluate area of second triangle

What is the expected output? What do you see instead?
expected 60
actual 0

What version of the product are you using? On what operating system?
c#, windows 7

Please provide any additional information below.

I believe this function is incorrect, it will return 0 where points 0 and 1 are 
on the same X or points 1 and 2 are on the same Y

        public double Area()
        {
            double b = Points[0].X - Points[1].X;
            double h = Points[2].Y - Points[1].Y;

            return Math.Abs((b * h * 0.5f));
        }

Original issue reported on code.google.com by [email protected] on 2 May 2011 at 7:36

Concave forms are not triangulated correctly

I recently discovered a small problem when I tried to triangulate
concave shapes. I don't know if I used your library in a wrong way or if
there's a bug in it.

The situation is the following: I have a concave shape that looks like a
"C", composed of 4 points. I would expect, that two triangles are
returned for this shape: One for the upper half, one for the lower one.
Unfortunately, the two triangles do exceed the natural given form of the
"C" and don't represent the shape correctly.
I created a small test case I attached for you to reproduce this
behaviour. I know this test case is not very good, but it shows the
problem I have.
I also implemented a small extension (AdvancedPolygonPoint) to keep a
unique Id for each TriangulationPoint. It was easier that way to get to
the problem :)

Original issue reported on code.google.com by [email protected] on 4 Jul 2011 at 2:14

Attachments:

Memory leaks

Hello there,

First of all thanks for this nice small lib.
I've checked (the C++) version for memory leaks with valgrind and I think
you probably have some memory leaks in the following methods:

   * p2t::Sweep::NewFrontTriangle
   * p2t::SweepContext::InitEdges
   * p2t::SweepContext::CreateAdvancingFront (most important one)




Original issue reported on code.google.com by [email protected] on 12 Mar 2010 at 6:35

Compilation fails on Mac OS X 10.7

I've tried to compile poly2tri on OS X 10.7 Lion, but it with this error 
message:

ld: library not found for -lOpenGL

I've attached a patch which fixes the problem by using the OpenGL and Cocoa 
frameworks.

Original issue reported on code.google.com by [email protected] on 27 May 2012 at 2:14

Attachments:

Triangulations fails with null pointer exception

What steps will reproduce the problem?

I tried to triangulate a polygon and it failed with a null pointer exception. I 
attached a file which describes the polygon. For the description of the polygon 
i used the simple feature access specification. If you would prefer another 
format I could provide it to you.

Interestingly the triangulation fails only sometimes with a null pointer 
exception. Besides this polygon I run poly2tri on many polygons. And in some 
runs it fails here, other runs are fine. In general I experience problems if 
points of the outer shell and from holes are equal or if two holes (like in 
this case) have an equal point.

What is the expected output? What do you see instead?

This is the nullpointer exception I get:
java.lang.NullPointerException
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:647)
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:632)
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:584)
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:584)
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:349)
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.sweep(DTSweep.java:111)
    at org.poly2tri.triangulation.delaunay.sweep.DTSweep.triangulate(DTSweep.java:72)
    at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:108)
    at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:98)
    at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:67)


What version of the product are you using? On what operating system?
poly2tri 0.1.1 on windows 7

Please provide any additional information below.

I run the debugger and in DTSweep.flipEdgeEvent it seems to me that there is 
missing a neighbor for the current triangle. Because the DelaunayTriangle ot is 
set to null.

Following variables are present:
t = [[1.6474112E8,6.10009088E8], [1.6474112E8,6.09992704E8], 
[1.64839424E8,6.0997632E8]]
p = [1.6474112E8,6.09992704E8]
ep = [1.64724736E8,6.09992704E8]
eq = [1.6474112E8,6.09992704E8]
neighbors[0] = [[1.6474112E8,6.09992704E8], [1.64724736E8,6.09992704E8], 
[1.64839424E8,6.0997632E8]]
neighbors[1] = null
neighbors[2] = [[1.64724736E8,6.09992704E8], [1.6474112E8,6.09992704E8], 
[1.6474112E8,6.10009088E8]]

Original issue reported on code.google.com by [email protected] on 12 Nov 2010 at 10:18

Attachments:

neighbor of neighbor can violate Delaunay, not fixable by flip, since flip only involves immediate neighbor

C# version. shape cut out of a terrain mesh (lots of interior points, on an 
approximately square-gridded mesh, distorted by a geographical projection 
remapping).
Seeing some visual glitches, examining the triangulation, there were some 
visually obvious violations of Delaunay. Added test logic to check "neighbors 
of neighbors" for points that violate Delaunay. Sure enough, such points do 
happen -- I see nothing in poly2tri that guarantees true Delaunay validity -- 
only immediate neighbor triangles are checked. Consider triangle ABC with 
neighbor triangles ABD, BCE, CAF. Consider another point G, which is part of a 
neighbor's neighbor, e.g. BDG. At end of Triangulation I added check whether G 
is within ABC's circumcircle, for all triangles and all neighbor-of-neighbor 
G's (excluding self). Got positive responses (which is bad). I have not reduced 
this down to a simple test case yet, at this time I am simply reporting that 
poly2tri lacks proper safety checks to guarantee true Delaunay validity. ~ 
ToolmakerSteve.

Original issue reported on code.google.com by [email protected] on 16 Mar 2012 at 4:45

Problem getting c++ version working

From testing the javascript version this is exactly what im looking for, but i 
need it in c++ for speed and because thats my programs native code.

I tried using the different c++ versions and got error with all of my polygons 
(stack overflow). When I tried even a basic square I had problems(null 
pointer). I'm wondering if it is because i compiled using VC++ 2008, or am i 
missing a step. 


-------What steps will reproduce the problem?

1. Compile c++ code in VC++ 2008 Pro

--------this fails for me

std::vector<p2t::Point*> polyline;

polyline.push_back(new p2t::Point(-2.0f,-2.0f));
polyline.push_back(new p2t::Point(-2.0f,2.0f));
polyline.push_back(new p2t::Point(2.0f,2.0f));
polyline.push_back(new p2t::Point(2.0f,-2.0f));

p2t::CDT* cdt = new p2t::CDT(polyline);
cdt->Triangulate();

----------

2. Run

3. ....

-------

null pointer exception is thrown (in cdt->Triangulate();) at of one of nodes. 
Sometimes it just crashes without giving me an error.

-------



-----What is the expected output? What do you see instead?

I did it in javascript it works fine(for all my polys), but i cannot get any of 
c++ versions to work.

And For some reason if the square is (-20) to (20) it works but (-2) to (2) 
fails. There are no error using javascript.

---------this works

std::vector<p2t::Point*> polyline;

polyline.push_back(new p2t::Point(-20.0f,-20.0f));
polyline.push_back(new p2t::Point(-20.0f,20.0f));
polyline.push_back(new p2t::Point(20.0f,20.0f));
polyline.push_back(new p2t::Point(20.0f,-20.0f));

p2t::CDT* cdt = new p2t::CDT(polyline);
cdt->Triangulate();


-----What version of the product are you using? On what operating system?

C++ versions in the default clone and the mike... clone. I also tried other 
clones too. The mike... clone catchs the error ant tells me its a null pointer 
exception.

I'm using Visual C++ 2008 Pro
Windows 7 64 bit


-----Please provide any additional information below.

I had to add the definitions constants for M_PI and M_PI_2 to the util.h file 
since its not included in my <math.h>

#define M_PI 3.14159265
#define M_PI_2 6.2831853

Below is the image produced by javascript for one of my polys. It works and 
since the javascript one was derived from the c++ it baffles me that i can get 
it to work. 


Hmmmm... I'm curious if i compile a dll for this in another compiler then i can 
use it.

Thanks for any info in advance.

Original issue reported on code.google.com by [email protected] on 4 Dec 2010 at 9:51

Attachments:

Request: Offer JAR as download

Hi!

This project is very great and I would like to use it in my project. Instead of 
using maven, it would be great if you can offer a JAR file for including it 
into projects.

Thanks in advance!

Greetings, guerda

Original issue reported on code.google.com by [email protected] on 14 Jan 2011 at 7:09

Freeing polyline point list?

I can't find code that deletes the Points allocated for the vector<Point*> sent 
to the constructor CDT::CDT(). 

If we are supposed to manage this memory ourselves (which is logical), the 
testbed also does not free the data at the end of the program. 

Original issue reported on code.google.com by [email protected] on 14 Dec 2011 at 7:29

js version failes to parse this polygon

What steps will reproduce the problem?
1. open http://javascript.poly2tri.googlecode.com/hg/index.html?kjuvj
2. paste 71 161,100 66,280 97,282 223,201 238,75 243 as a poly contour
3. paste 101 102,103 204,205 206,207 108 as a hole
4. zero offsets
5. click "Triangulate!"

What is the expected output? What do you see instead?
triangulated mesh drawn; instead, nothing happens.


What version of the product are you using? On what operating system?
javascript


Please provide any additional information below.
fails on this line:
            if (px == nx) {
                // We might have two nodes with same x value for a short time
                if (point.equals(node.prev.point)) {
because node.prev is null

following fixes it in my as3 port:
            if (px == nx) {
                // We might have two nodes with same x value for a short time
                if (node.prev && point.equals(node.prev.point)) {
                    node = node.prev;
                } else if (node.next && point.equals(node.next.point)) {
                    node = node.next;
                } else if (point.equals(node.point)) {

Original issue reported on code.google.com by [email protected] on 15 Feb 2012 at 11:42

org.poly2tri.polygon.Polygon.getIndex() does not exist.

What steps will reproduce the problem?
1.  poly.getIndex() does not exist in org.poly2tri.polygon.Polygon
2.  i checked source archive and could not find
3.  please provide this method.  The call is from 
org.poly2tri.triangulation.sets.PolygonSet

What is the expected output? What do you see instead?
I have an initial compilation error.

What version of the product are you using? On what operating system?
I checked out current as of yesterday

Please provide any additional information below.
I'm very excited/interested in usage of the Delaunay constrained Triangulation 
that you have provided and look forward to getting it working.

Original issue reported on code.google.com by [email protected] on 16 Jul 2010 at 3:26

Triangulation is wrong.

What steps will reproduce the problem?
{100,50,0},
{200,50,0},
{200,100,0},
{100,100,0},
{150,70,0},

What is the expected output? What do you see instead?
Expected: I should be getting 4 triangles.
Output: It is giving me back 3 triangles.

What version of the product are you using? On what operating system?
The latest code from the repository.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 29 May 2011 at 9:09

Infinite loop crash - self-touching polygon

What steps will reproduce the problem?
1. Triangulate using these vertices: (1033, 309), (1032, 309.14935064935065), 
(1032, 331.55555555555617), (1031.9802955665025, 332), (968, 332), (968, 
318.70779220779224), (879, 332), (1024, 512). This is a self-touching polygon 
(but not intersecting).
2.
3.

What is the expected output? What do you see instead?
Triangles are expected (if poly2tri supports self-touching polygons), but the 
program goes into an infinite loop in FlipEdgeEvent, eventually crashing.

What version of the product are you using? On what operating system?
C++ version.

Please provide any additional information below.
It also crashes for polygons containing collinear edges. 

Original issue reported on code.google.com by [email protected] on 10 Jan 2011 at 7:32

StackOverflowException when triangulating a ConstrainedPointSet

What steps will reproduce the problem?

It is quite complicated to describe but if you make a serializable (to XML)
for Constrained point sets, I can just send you that instead :)


What version of the product are you using? On what operating system?

The Java version


Please provide any additional information below.

The stacktrace:

java.lang.StackOverflowError
    at
org.poly2tri.triangulation.TriangulationUtil.inScanArea(TriangulationUtil.java:1
51)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:643
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:682
)
    at
org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipScanEdgeEvent(DTSweep.java
:806)

and so on....


Original issue reported on code.google.com by [email protected] on 9 Feb 2010 at 12:16

AS3 version simply does not work :)

What steps will reproduce the problem?
1. compile and run attached test
2. click to add points

What is the expected output? What do you see instead?
I expect to see green mesh correctly triangulating blue poly once red hole is 
inside, at least; instead, I see random mesh, sometimes with arbitrary points 
added.

What version of the product are you using? On what operating system?
just cloned as3 repository today (had to comment out few unrelated imports 
before it even compiled)

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 Feb 2012 at 3:16

Attachments:

Null ref exception on simple test input

What steps will reproduce the problem?
1. Triangulate test point set:

0, 0
0, -1
-1, -1
-0.5, -1.2

What is the expected output? What do you see instead?

Get null ref exception in DTSweep Class FinalizationConvexHull method

What version of the product are you using? On what operating system?

C# 2010 feb version with fix for issue #7

Win 7

Please provide any additional information below.

Works very well on large random sets so this is just a 
"boundary condition" kind of issue

Original issue reported on code.google.com by [email protected] on 21 Aug 2010 at 12:54

if points_0 == p1 bad access

What steps will reproduce the problem?
1. Threshold an image from a webcam
2. Apply an OpenCV contours on the image
3. Apply a CDT without holes on the contour output by OpenCV

What is the expected output? What do you see instead?
I can see the triangles until it crashes. No visible reasons. 
On XCode I have an EXC_BAD_ACCESS in shapes.cc

int Triangle::EdgeIndex(const Point* p1, const Point* p2)
{
  if (points_[0] == p1) {
    if (points_[1] == p2) {
      return 2;
    } else if (points_[2] == p2) {
      return 1;
    }
  } else if (points_[1] == p1) {
    if (points_[2] == p2) {
      return 0;
    } else if (points_[0] == p2) {
      return 2;
    }
  } else if (points_[2] == p1) {
    if (points_[0] == p2) {
      return 1;
    } else if (points_[1] == p2) {
      return 0;
    }
  }
  return -1;
}



What version of the product are you using? On what operating system?
Download of November 2011 on OSX (C++)

Please provide any additional information below.
It seems that it crashes when the contours touch the border of the image. 

Original issue reported on code.google.com by [email protected] on 28 Dec 2011 at 3:36

segmentation fault in python version

What steps will reproduce the problem?

from p2t import CDT, Point
contour = [(19.218989151578803, 1.7763568394002505e-15), (19.218989151578803, 
6.0000000000000018), (4.7961634663806763e-14, 6.0000000000000018), 
(4.7961634663806763e-14, 1.7763568394002505e-15), (8.8594945757893644, 
2.2204460492503131e-15), (8.8594945757893644, 2.0000000000000018), 
(10.359494575789364, 2.0000000000000018), (10.359494575789364, 
2.2204460492503131e-15)]
contour_as_p2t_points = [Point(x, y) for x,y in contour]
cdt = CDT(contour_as_p2t_points)
cdt.triangulate()
#=>Segmentation fault


What is the expected output? What do you see instead?
Well, a correct triangulation...

What version of the product are you using? On what operating system?
Latest source for python poly2tri, on Ubuntu 11.04


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 26 Jul 2011 at 12:35

Stack overflow on 204 point simple polygon input (C++)

What steps will reproduce the problem?
1. Triangulate a particular point set

What is the expected output? What do you see instead?
Stack overflow leading to segfault. 

What version of the product are you using? On what operating system?
Most recent code base, Linux 2.6.32-33-generic x86_64. I will test with MinGW 
compiled version soon. 

Please provide any additional information below.

Included file contains a double array where rand_test[2*i] is poly[i].x and 
rand_test[2*i+1] is poly[i].y

I encountered this stack overflow when running a stress test on my convex 
decomposition code. I generated a complex polygon by stringing together 
entirely random points in the range -2000 to 2000 in both x and y, and used a 
custom polygon simplification algorithm to extract the perimeter of the 
polygon. 

If you examine this test case you will notice that it is a completely valid 
polygon without extreme angles anywhere, it just has a few small triangular 
features. In any case there should not be a stack overflow here. Here is 
relevant part of stack trace: 

#93544 0x0000000000427d44 in CDT_testRoutine (data=0x6b3f80, 
    length=408) at Polygon.cpp:318
318     cdt.Triangulate();
(gdb) 
#93543 0x000000000047ff97 in p2t::Sweep::Triangulate(p2t::SweepContext&) ()
(gdb) 
#93542 0x000000000047fddc in p2t::Sweep::SweepPoints(p2t::SweepContext&) ()
(gdb) 
#93541 0x000000000047f5a9 in p2t::Sweep::EdgeEvent(p2t::SweepContext&, 
p2t::Point&, p2t::Point&, p2t::Triangle*, p2t::Point&) ()
(gdb) 
#93540 0x000000000047f18e in p2t::Sweep::FlipEdgeEvent(p2t::SweepContext&, 
p2t::Point&, p2t::Point&, p2t::Triangle*, p2t::Point&)
    ()
(gdb) 
#93539 0x000000000047f18e in p2t::Sweep::FlipEdgeEvent(p2t::SweepContext&, 
p2t::Point&, p2t::Point&, p2t::Triangle*, p2t::Point&)
    ()
(gdb) 
#93538 0x000000000047f18e in p2t::Sweep::FlipEdgeEvent(p2t::SweepContext&, 
p2t::Point&, p2t::Point&, p2t::Triangle*, p2t::Point&)
    ()
(gdb) 
#93537 0x000000000047f18e in p2t::Sweep::FlipEdgeEvent(p2t::SweepContext&, 
p2t::Point&, p2t::Point&, p2t::Triangle*, p2t::Point&)
    ()
(gdb) 

Good luck!

Original issue reported on code.google.com by [email protected] on 19 Dec 2011 at 10:49

Attachments:

Enhancement: Introduce ID for Points

I would like to write an application that uses your library and one little 
"feature" is missing for me.

If I triangulate Points, I would like to give them an unique ID before doing 
so. This helps me to sort them for the further processing.

Would it be possible to introduce an ID field in 
org.poly2tri.geometry.primitive.Point? It should be a long.

Thanks in advance!

Original issue reported on code.google.com by [email protected] on 28 Apr 2011 at 2:44

Am getting "inf" or -0 values for the triangles point ?

Hi,
I am after drawing concave/vex polygons in openGL, and  came across your code, 
which I believe 
might be what I am looking for to break polygons into multiple triangles.

I have the following in my code:

==================
    //Run the polytri to calculate tesslated triangles
    /// Constrained triangles
    vector<Triangle*> triangles;
    vector<p2t::Point*> polyline;
    //For tesselattion cannot have duplicated point = > skip the last
    for (int i = 0; i < (pPolygonPoints->size() -1); ++i)
    {
     polyline.push_back(new Point(*(pPolygonPoints->at(i)->getX()),*(pPolygonPoints->at(i)-
>getY())));
      cout << "gdsPolygonDEBUG: ADDED POINT " << *(pPolygonPoints->at(i)->getX()) << " " << 
*(pPolygonPoints->at(i)->getY())<< flush << endl;
    }

    CDT* cdt = new CDT(polyline);
    cdt->Triangulate();
    triangles = cdt->GetTriangles();
    delete cdt;

    for (int i = 0; i < triangles.size(); i++) {
      Triangle& t = *triangles[i];
      Point& a = *t.GetPoint(0);
      Point& b = *t.GetPoint(1);
      Point& c = *t.GetPoint(2);

      float newX1 = a.x;
      float newY1 = a.y;
      float newX2 = b.x;
      float newY2 = b.y;
      float newX3 = c.x;
      float newY3 = c.y;
      //////////////////////////
      #ifdef gdsPolygonDEBUG
      cout << "gdsPolygonDEBUG: Triangle A : "<< newX1 << " " << newY1 << flush << endl;
      cout << "gdsPolygonDEBUG: Triangle B : "<< newX2 << " " << newY2 << flush << endl;
      cout << "gdsPolygonDEBUG: Triangle C : "<< newX3 << " " << newY3 << flush << endl;
      #endif
      //////////////////////////
    }

==================

When I run, I get the following (note you can see the points I am adding in 
from my classes into 
polyline).

Either the triangle point for "a" come out as inf or -0. Point "a" never seems 
to be getting non-
zero numbers.

Am I using your class incorrectly, or is there as buglet somewhere ?

I hope you can help.

Many thanks in advance

Colin Thomas

===================
gdsPolygonDEBUG: ADDED POINT -1.92 0
gdsPolygonDEBUG: ADDED POINT -1.92 1.92
gdsPolygonDEBUG: ADDED POINT -0.96 1.92
gdsPolygonDEBUG: ADDED POINT -0.96 2.88
gdsPolygonDEBUG: ADDED POINT 5.12 2.88
gdsPolygonDEBUG: ADDED POINT 5.12 -4.16
gdsPolygonDEBUG: ADDED POINT -1.92 -4.16
gdsPolygonDEBUG: ADDED POINT -1.92 -0.96
gdsPolygonDEBUG: ADDED POINT -0.96 -0.96
gdsPolygonDEBUG: ADDED POINT -0.96 0

gdsPolygonDEBUG: Triangle A : 0 0
gdsPolygonDEBUG: Triangle B : -1.92 1.92
gdsPolygonDEBUG: Triangle C : -1.92 0

gdsPolygonDEBUG: Triangle A : 0 0
gdsPolygonDEBUG: Triangle B : -1.92 0
gdsPolygonDEBUG: Triangle C : -0.96 0

gdsPolygonDEBUG: Triangle A : 0 -0
gdsPolygonDEBUG: Triangle B : -0.96 1.92
gdsPolygonDEBUG: Triangle C : -0.96 0

gdsPolygonDEBUG: Triangle A : 0 -0
gdsPolygonDEBUG: Triangle B : -0.96 0
gdsPolygonDEBUG: Triangle C : -0.96 -0.96

gdsPolygonDEBUG: Triangle A : 0 0
gdsPolygonDEBUG: Triangle B : 5.12 -4.16
gdsPolygonDEBUG: Triangle C : 5.12 2.88

gdsPolygonDEBUG: Triangle A : 0 0
gdsPolygonDEBUG: Triangle B : -0.96 -0.96
gdsPolygonDEBUG: Triangle C : -1.92 -4.16

gdsPolygonDEBUG: Triangle A : 0 0
gdsPolygonDEBUG: Triangle B : -1.92 -0.96
gdsPolygonDEBUG: Triangle C : -1.92 -4.16

gdsPolygonDEBUG: Triangle A : 0 -0
gdsPolygonDEBUG: Triangle B : -0.96 2.88
gdsPolygonDEBUG: Triangle C : -0.96 1.92

===================

Original issue reported on code.google.com by [email protected] on 27 Apr 2010 at 6:15

Install Problem on Ubuntu 11.10

Setup:
On a fresh install of Ubuntu 11.10, with apt-get cython and pygame installed. 
Python is 2.7.2
Cython is 0.14.1-6

What is the expected output? What do you see instead?
On build command ('python setup.py build_ext -i' from poly2tri directory), 
expect a flawless install, instead get the error: 

Traceback (most recent call last):
  File "setup.py", line 38, in <module>
    install_requires = ["cython==0.14.1"],
  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 225, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 258, in finalize_options
    ep.load()(self, ep.name, value)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1955, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/.../poly2tri-0.3.3/setuptools_cython-0.2.1-py2.7.egg/setuptools_cython.py", line 21, in <module>
    class build_cython(Cython.Distutils.build_ext, object):
AttributeError: 'module' object has no attribute 'Distutils'

What version of the product are you using?
Problem is the same with the poly2tri and latest code. 


Please provide any additional information below.
Any ideas? Looks like dependency issue. 

Original issue reported on code.google.com by [email protected] on 12 Dec 2011 at 5:58

Ruby Bindings

poly2tri is brilliant.  I've created Ruby bindings, which are located at 
http://github.com/mieko/rbpoly2tri .  It includes the required C++ 
implementation in the package.  It's not amazingly well tested, but most of the 
surface area if covers is pretty well stressed by my application. (AKA, Works 
For Me!)

Assuming poly2tri is still active, I've started making a few memory reduction 
changes (basically, getting rid of unneeded copies).  If someone's around to 
check on them, I'd be happy to create a proper hg branch and isolate just those 
when I have the time.

Thanks,
Mike Owens

Original issue reported on code.google.com by mike%[email protected] on 12 Oct 2010 at 7:50

AS3 port

I have made an AS3 port of your great library.

It would be great if you include it in your repository so more people can use 
and/or improve it.


Original issue reported on code.google.com by soywiz on 30 Dec 2010 at 5:33

Attachments:

Falls on 10000 random points on Win32 on stack overflow:

What steps will reproduce the problem?
1. Under windows 32 with just 10000 random points you get stack overflow

Please provide any additional information below.

Here is my code used:

// PolyDelaunay.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "poly2tri.h"

#include "stdafx.h"
#include "float.h"
#include "time.h"

#include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>

using namespace std;

bool pointSortPredicate(const p2t::Point& a, const p2t::Point& b)
{  
  if (a.x < b.x)
    return true;
  else if (a.x > b.x)
    return false;
  else if (a.y < b.y)
    return true;
  else
    return false;  
};

bool pointComparisonPredicate(const p2t::Point& a, const p2t::Point& b)
{
  return a.x == b.x && a.y == b.y;
}

int _tmain(int argc, _TCHAR* argv[])
{
  size_t numPoints = 10000;
  std::vector<p2t::Point> points;

  for (size_t i = 0; i < numPoints; ++i)
  {
    p2t::Point p;
    p.set(rand(), rand());
    points.push_back(p);
  }

  std::cout << "Number of points: " << numPoints << std::endl;

  std::sort(points.begin(), points.end(), pointSortPredicate);
  std::vector<p2t::Point>::iterator newEnd = std::unique(points.begin(), points.end(), pointComparisonPredicate);
  points.resize(newEnd - points.begin());
  numPoints = points.size();

  std::cout << "Points after unique making: " << numPoints << std::endl;

  /*
  size_t numPoints2 = numPoints * 3;  

  double offset = 1.0e-5;
  for (size_t i = 0; i < numPoints; ++i)
  {
    GEO_Vrtx2D p = points.at(i);
    p.Set(p.GetX() + offset, p.GetY() + offset);
    points.push_back(p);
    p.Set(p.GetX() + offset, p.GetY() + offset);
    points.push_back(p);
  }
  numPoints = numPoints2;
  */

  // Determine min, max
  double minx = DBL_MAX;
  double miny = DBL_MAX;
  double maxx = -DBL_MAX;
  double maxy = -DBL_MAX;

  for (size_t i = 0; i < numPoints; ++i)
  { 
    if (points.at(i).x  < minx)
      minx = points.at(i).x;
    if (points.at(i).x > maxx)
      maxx = points.at(i).x;
    if (points.at(i).y < miny)
      miny = points.at(i).y;
    if (points.at(i).y > maxy)
      maxy = points.at(i).y;
  }

  // Outer rectangle 
  std::vector<p2t::Point*> polyline;
  polyline.push_back(new p2t::Point(minx, miny));
  polyline.push_back(new p2t::Point(maxx, miny));
  polyline.push_back(new p2t::Point(maxx, maxy));
  polyline.push_back(new p2t::Point(minx, maxy));

  clock_t start, end, diff;
  start = clock();

  p2t::CDT* delaunay = new p2t::CDT(polyline);

  // Add points
  for (size_t i = 0; i < numPoints; ++i)
  {
    delaunay->AddPoint(new p2t::Point(points.at(i).x, points.at(i).y));
  }

  delaunay->Triangulate();

  end = clock();

  diff = ((end - start) * 1000) / CLOCKS_PER_SEC;
  std::cout << "Run time: " << diff << std::endl;

  int a;
  cin >> a;

    return 0;
}





Original issue reported on code.google.com by [email protected] on 16 Nov 2011 at 2:10

"Colliniear not supported !" thrown even on non holes polys

I am doing a simple triangulation of  the following poly:
Vector3D(50, 120.5, 0),
Vector3D(37.5, 118.70000457763672, 0),
Vector3D(25, 113.30000305175781, 0),
Vector3D(14.050000190734863, 105.1500015258789, 0),
Vector3D(6.25, 95.25, 0),
Vector3D(1.5500000715255737, 83.5, 0),
Vector3D(0, 70, 0),
Vector3D(1.5500000715255737, 56.45000076293945, 0),
Vector3D(6.25, 44.70000076293945, 0),
Vector3D(14.050000190734863, 34.79999923706055, 0),
Vector3D(25, 26.649999618530273, 0),
Vector3D(37.5, 21.25, 0),
Vector3D(50, 19.450000762939453, 0),
Vector3D(62.5, 21.25, 0),
Vector3D(75, 26.649999618530273, 0),
Vector3D(85.9000015258789, 34.79999923706055, 0),
Vector3D(93.75, 44.70000076293945, 0),
Vector3D(98.4000015258789, 56.45000076293945, 0),
Vector3D(100, 70, 0),
Vector3D(98.4000015258789, 83.5, 0),
Vector3D(93.75, 95.25, 0),
Vector3D(85.9000015258789, 105.1500015258789, 0),
Vector3D(75, 113.30000305175781, 0),
Vector3D(62.5, 118.70000457763672, 0)

What version of the product are you using? On what operating system?
Using JS port

So triangulating it I am getting twice the "Colliniear not supported !"  :(

Original issue reported on code.google.com by [email protected] on 25 May 2012 at 1:47

Stack overflow on iPhone

My polygon attached and also at http://codepad.org/tAMTC5XU

Should look something like http://stuff.brokenbeta.co.uk/brokepolygon.png

poly2tri seems to go down to ~36120 recursion levels then dies. I am using the 
iPhone version which is limited to stack size of 1MB.

Can someone test this and give me any suggestions to reduce stack usage?

Original issue reported on code.google.com by [email protected] on 26 Jan 2012 at 1:23

Attachments:

Compilation of Python extension under GCC 4.6

What steps will reproduce the problem?
1. Trying to build the Python extension using GCC with a version higher than 
4.5.

What is the expected output? What do you see instead?

Expected is the proper building of the extension. Instead the process runs into 
several errors of the following type *error: ‘NULL’ was not declared in 
this scope* leading to gcc failing with exit status 1.

What version of the product are you using? On what operating system?

poly2tri 0.3.3 Python extension compiled with GCC 4.6.2 under MinGW

Please provide any additional information below.

According to 
http://stackoverflow.com/questions/462165/error-null-was-not-declared-in-this-sc
ope this can be traced back to GCC 4.6 no longer accepting the NULL constant. 
To use it the following statement needs to be included:

#include <cstddef>

I did so in sweep_context.h and the extension was built as it should be.

Original issue reported on code.google.com by [email protected] on 9 Mar 2012 at 8:24

EdgeEvent - Point on constrained edge not supported yet

What steps will reproduce the problem?
1. Input data has constraints intersecting points of data not at endpoints

What is the expected output? What do you see instead?
I know its a TODO, but what can be done to handle this :)
'Exception: EdgeEvent - Point on constrained edge not supported yet'

What version of the product are you using? On what operating system?
Latest C# version

Please provide any additional information below.
The library works great by the way! So kudos to the developers. I would just 
love to not get the above exception on our users data.

Original issue reported on code.google.com by [email protected] on 22 Nov 2010 at 10:44

Point's edge_list is not reset in js.poly2tri.SweepContext.prototype.InitEdges or else

What steps will reproduce the problem?
1. reuse same polylines in another SweepContext
2.
3.

What is the expected output? What do you see instead?
triangulation fails; should not, really.

What version of the product are you using? On what operating system?
javascript

Please provide any additional information below.
in test index.html, find these lines:

        // prepare SweepContext
        var swctx = new js.poly2tri.SweepContext(contour);
        for (var idx in holes)
        {
            swctx.AddHole(holes[idx]);
        }

add these lines immediately after:

        js.poly2tri.sweep.Triangulate(swctx);
        swctx = new js.poly2tri.SweepContext(contour);
        for (var idx in holes)
        {
            swctx.AddHole(holes[idx]);
        }

enjoy error alerts :)


Original issue reported on code.google.com by [email protected] on 15 Feb 2012 at 11:08

Installer on C++ version

What steps will reproduce the problem?
1. Install with waf script on ubuntu 11.10


steven@steven-desktop(Feb 12 14:43:08)[~/Documents/poly2tri]
$ ./waf 
  set_options
Waf: Entering directory `/home/steven/Documents/poly2tri/build'
  building
[1/7] cxx: poly2tri/common/shapes.cc -> build/poly2tri/common/shapes.cc.0.o
[2/7] cxx: poly2tri/sweep/cdt.cc -> build/poly2tri/sweep/cdt.cc.0.o
[3/7] cxx: poly2tri/sweep/advancing_front.cc -> 
build/poly2tri/sweep/advancing_front.cc.0.o
[4/7] cxx: poly2tri/sweep/sweep_context.cc -> 
build/poly2tri/sweep/sweep_context.cc.0.o
[5/7] cxx: poly2tri/sweep/sweep.cc -> build/poly2tri/sweep/sweep.cc.0.o
[6/7] cxx: testbed/main.cc -> build/testbed/main.cc.0.o
../testbed/main.cc:42:25: fatal error: test_shapes.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/home/steven/Documents/poly2tri/build'
Build failed
 -> task failed (exit status 1): 
    {task 163708044: cxx main.cc -> main.cc.0.o}
['/usr/bin/g++', '-O3', '-ffast-math', '-DP2T', '../testbed/main.cc', '-c', 
'-o', 'testbed/main.cc.0.o']


It appears that test_shapes.h has been removed but main.cc still references it. 

Original issue reported on code.google.com by [email protected] on 12 Feb 2012 at 7:47

Rounding issues under Python

What steps will reproduce the problem?

>>> from p2t import CDT, Point
>>> contour = 
[(453521.56421354739,5767884.7591257878),(453513.83972662123,5767843.0712512629)
,(453446.3724479521,5767807.8537950916),(453369.60432990646,5767717.0111599602),
(453370.19001821574,5767706.9852263089),(453324.26838960598,5767684.8794395626),
(453316.15682864317,5767682.2142445147),(453310.33114277112,5767686.4557612957),
(453308.08654497867,5767680.5475153625),(453301.09728229989,5767680.8364430135)]
>>> pts = [Point(x, y) for x, y in contour]
>>> cdt = CDT(pts)
>>> triangles = cdt.triangulate()
>>> for t in triangles:
...     print t.a.x, t.a.y, t.b.x, t.b.y, t.c.x, t.c.y
...
453521.5625 5767885.0 453301.09375 5767681.0 453446.375 5767808.0
453301.09375 5767681.0 453310.34375 5767686.5 453446.375 5767808.0
453446.375 5767808.0 453310.34375 5767686.5 453369.59375 5767717.0
453324.28125 5767685.0 453369.59375 5767717.0 453310.34375 5767686.5
...

What is the expected output? What do you see instead?

I'd expect to find the input coordinates as triangulation nodes exactly as 
defined. Instead they appear rounded (or even truncated) to a decimal place 
ending with either 5 or 0.

What version of the product are you using? On what operating system?

poly2tri 0.3.3 from pypi.org on Windows
p2t compiled under mingw using cython 0.15

Please provide any additional information below.

I'm working with real world coordinates featuring a lot of (possible 
meaningless albeit existing) decimal places. When triangulating with poly2tri, 
I'm having a problem with the output as the input coordinates are rounded at 
some certain time during the process. Result is that my triangulation does not 
overlap with the original data - not by a lot, but its annoying nonetheless. I 
somehow suspect this to be a compilation issue but haven't been able to 
pinpoint the problem. Has something like that occurred to you as well?

Original issue reported on code.google.com by [email protected] on 5 Oct 2011 at 9:49

Attachments:

Segfault with Python version


Following input makes Python version segfault:

points = [
    [2.10229524019, -0.760509508136],
    [2.15571376911, -0.752653842118],
    [2.00173917352, 0.294373407871],
    [1.9483206446, 0.286517741853]
]
holes = [[
    [1.9968142935, 0.0247609293562],
    [2.02104796235, 0.0283247041864],
    [2.08803526014, -0.495188920808],
    [2.06380159129, -0.498752695638]
]]

one edge of the hole is very close to contour. I'm not sure whether this input 
is correct but it should not segfault.

Original issue reported on code.google.com by [email protected] on 2 Dec 2010 at 11:51

Incorrect (unsupported?) triangulation for holes not completely inside polygon

What steps will reproduce the problem?
1. Triangulate a simple triangle with a rectangle hole.
The triangle is defined as follows: (384, 640), (256, 512), (384, 512).
The hole: (280, 525), (400, 525), (400, 535), (280, 535).

What is the expected output? What do you see instead?
I expected 5 triangles with all edges (or the part that is inside the polyline) 
of the hole used as constraints. Instead I receive 5 triangles that ignore some 
of the hole edges. 
Is this simply not supported? Does poly2Tri require holes to be completely 
inside the polyline?

What version of the product are you using? On what operating system?
I'm sorry but I can't find the version number in the source code..

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 6 Jan 2011 at 9:20

Incorrect Triangulation of simple 4 point set

What steps will reproduce the problem?
1.Triangulate unconstrained pointset (0 0, 0 1, 1 1, 2 1)

What is the expected output? 

Two triangles

What do you see instead?

1 Triangle, not including all points

What version of the product are you using? 

Poly2Tri C# latest download 2010

On what operating system?

Windows 7

Please provide any additional information below.

If I perturn the last vertex to have a Y of say 2, it works correctly.
If I perturn slightly to say 2.1 it still fails

Original issue reported on code.google.com by [email protected] on 20 Aug 2010 at 6:15

p2t::Point inequility operator is wrong

In the current version (from repository), the != operator is written as follows 
(line 267 in common/shapes.h):

inline bool operator !=(const Point& a, const Point& b)
{
  return a.x != b.x && a.y != b.y;
}

It's not very consistent with the behaviour of == operator:

inline bool operator ==(const Point& a, const Point& b)
{
  return a.x == b.x && a.y == b.y;
}

The inequility should be !(a == b).

Original issue reported on code.google.com by [email protected] on 13 Jan 2012 at 1:27

Early C# Port

Just ported the Java version of this project to C# (after a failed attempt 
at doing so from the C++ version, don't even know what was going wrong 
there).

It is available here: http://github.com/MaulingMonkey/poly2tri-cs

Please note this is a very early port and there are still many rough edges 
and untested bits, subtle differences, and temporary hacks (such as 
everything in evil.cs).  I literally copy & pasted most .java files into 
.cs files, where I did the bare minimum to get things compiling.  For large 
portions of the code I don't even know what's happening, so my ability to 
sanity-check the port is limited.  I hope you'll forgive these mistakes and 
the ones I've forgotten to mention.

That said, it seems to work, which is a plus.

Among other things, I plan to fix up naming, and do things like replace 
getters and setters with proper properties, dead code removal, 
simplification, and so forth.  I'm a fan of simplicity and this is far from 
it.

Original issue reported on code.google.com by [email protected] on 17 Feb 2010 at 12:33

Simple polygons fail triangulation

What steps will reproduce the problem?
----------

Using c++ latest source, attempt to triangulate two simple polygons. It appears 
that when two edges get near (not even very near) to collinear, strange results 
occur. 

Error Case 1:

(-10, -10.6426)
(-28.3133, -5.98394)
(19.8795, 21.6466)
(18.4337, -5.02008)

In EdgeEvent this causes "triangle->NeighborCCW(point);" to return NULL


Error Case 2:

(-4.61211, -11.3371)
(-44.477, -3.90043)
(25.2674, 20.9521)
(23.8216, -5.71459)

In NextFlipPoint this causes "Orientation o2d = Orient2d(eq, op, ep);" to 
return COLLINEAR as op == ep

What version of the product are you using? On what operating system?
---------

Latest source (as at 2010/12/16), Windows XP, VS2005.


Please provide any additional information below.
----------
My reported points start out as floats, so hopefully you can reproduce this on 
different hardware.

Sorry I couldn't run these through the testbed. I tried to get it building but 
couldn't get Python25 to run the waf configure:

C:\DEV\poly2tri>python waf configure
  set_options
  init called
  calling the configuration
Checking for program g++,c++             : ok C:\GCC\g++.exe
 error: Could not determine the compiler type


Original issue reported on code.google.com by [email protected] on 16 Dec 2010 at 8:48

Attachments:

sweep_contex.h needs cstddef for NULL

What steps will reproduce the problem?
1. Try to build with GCC 4.6.1

What is the expected output? What do you see instead?

Expected:
No compiler errors :)

Got:
In file included from ../poly2tri/sweep/sweep_context.cc:31:0:
../poly2tri/sweep/sweep_context.h: In constructor 
‘p2t::SweepContext::Basin::Basin()’:
../poly2tri/sweep/sweep_context.h:105:23: error: ‘NULL’ was not declared in 
this scope
../poly2tri/sweep/sweep_context.h: In member function ‘void 
p2t::SweepContext::Basin::Clear()’:
../poly2tri/sweep/sweep_context.h:111:17: error: ‘NULL’ was not declared in 
this scope
../poly2tri/sweep/sweep_context.h: In constructor 
‘p2t::SweepContext::EdgeEvent::EdgeEvent()’:
../poly2tri/sweep/sweep_context.h:123:34: error: ‘NULL’ was not declared in 
this scope

What version of the product are you using? On what operating system?

hg HEAD.  Ubuntu 10.04, source-built GCC 4.6.1


Please provide any additional information below.

Just toss in a #include <cstddef> at the top of sweep_context.h to fix.

Original issue reported on code.google.com by [email protected] on 5 Aug 2011 at 4:03

Javascript port

Just ported the "April 25, 2010" version of the c++ project to javascript.
I attached the source with a small tester to this issue, plus it's
temporarily available to try out here: http://kl223.selfip.org/poly2tri_test/

The javascript port depends on the namespacedotjs project
(http://kl223.selfip.org/poly2tri_test/).
The port was made overnight, so it might contain errors, but it worked
pretty well for me.

Cheers,
Laszlo Kustra

Original issue reported on code.google.com by [email protected] on 4 May 2010 at 6:33

Attachments:

Simple 2D Delaunaye Triangulation

What steps will reproduce the problem?
1. Create random 2D Point set
2. Perfrom Triangulation


What is the expected output? What do you see instead?
2D Delaunaye Triangulation for given Point Set

What version of the product are you using? On what operating system?
Windows 7, Java, Poly2Tri 0.1.1

Please provide any additional information below.

I´m trying to perform a simple 2D Delaunaye Triangulation with Poly2Tri. In my 
Application I use a set of random distributet 2D Points. When i use the Polygon 
Triangulation I get a NullPtr Exception which is fine, because the Points 
create a self-Intersection Polygon. Using a PointSet for Triangulation i get a 
"incomplete" Triangulation. Is it the case  that Poly2Tri performs a 
3D-Triangulation on my 2D point set ?

This ticket is rather a defect - issue, i want to Ask:
How do i have to use Poly2Tri to Perform a simple 2D Delaunaye Triangulation on 
my 2D Point set ?

Original issue reported on code.google.com by [email protected] on 4 Feb 2012 at 2:31

Unable to import poly2tri.js script in web worker script.

What steps will reproduce the problem?
1. Create Web worker script.
2. Use importScripts() to import poly2tri.js in onmessage() of worker.
3. In chrome (on F12), you can see the error as "Uncaught ReferenceError: 
window is not defined"

What is the expected output? What do you see instead?
Script should get loaded. But failing to load script.

What version of the product are you using? On what operating system?
Windows 7, Google chrome 16.0.912.63 m

Please provide any additional information below.
Please see the below code for main script and worker script.

//main script file.

//callback function for web worker.
function callback(event) {
    console.log(event.data);
}
var w = new Worker('task.js');
w.onmessage = callback;
w.postMessage("Hi"); // call worker.


//task.js file
self.onmessage = function(event) {
    importScripts('poly2tri.js'); // load the poly2tri utility.
    this.postMessage("Hello");
};



Original issue reported on code.google.com by [email protected] on 20 Dec 2011 at 12:39

Python version not available from pypi

Hi all, thanks for great library. I think it would be very convenient if you 
could submit poly2tri to pypi package repository. It's kinda difficult to add 
it as dependency to production environment. pip of course supports mercurial 
repos but still, it would be easier for everyone. Thanks

Original issue reported on code.google.com by [email protected] on 4 Mar 2011 at 2:33

Incorrect error handling of invalid polygons.

- What steps will reproduce the problem?

1. Take 4 points that would work in a clockwise direction, say 1,2,3,4.
2. Feed the CDT a polyline with the order 1,3,4,2 instead. We have 2 edges 
overlapping and therefore not a valid polygon.

No exception thrown or error handling.

- What is the expected output? What do you see instead?

Handle invalid polygons and throw exception or some way of knowing 
triangulation cannot be completed.



- What version of the product are you using? On what operating system?

Downloaded source on Jan 19th. Windows 7




Original issue reported on code.google.com by [email protected] on 2 Feb 2011 at 7:55

AS3 Port gives very unpredictable results when doing holes.

What steps will reproduce the problem?
1.Pass convex poly coordinates
2.Pass holes poly coordinates
3.Triangulate

What is the expected output? What do you see instead?
What I see is sometimes no triangulation happens at all,sometimes the hole area 
gets triangulated and there rest is gone.

What version of the product are you using? On what operating system?
Latest.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 26 Feb 2012 at 1:42

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.