0

Is there any code/library of Delaunay Triangulation for VS2012 C++? I would expect something light, without using third part binaries.

I have tried many of them (Triangle, A Delaunay triangulation function in C, poly2tri,Geom Fade 2D ). Many of them are just not easy to use, otherwise not compatible with vs2012;

Anyone has any suggestions? Thanks a lot

EDIT: Problem with Triangle:

There is a triangular mesh generator (Shewchuk, CMU), "Triangle", that are recommended by people due to its lightweight. It is written in C. However I cannot use it in my VS2012 C++ project. I am compiling it using x64 platform. I am on Windows 7 64-bit.

Basically, I compile the triangle.c as the makefile described. So, a triangle.o is generated. I then 1.added triangle.o as additional dependencies in my solution, 2.added triangle.c and triangle.h in my project . 3.changed triangle.c in C/C++ precompiled header option, to "not using precompiled header"

Then I got tons of errors like this:

1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(430): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(430): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(497): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(497): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(498): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(498): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(2517): warning C4391: 'SHORT _InterlockedIncrement16(volatile SHORT *)' : incorrect return type for intrinsic function, expected 'short'
Ono
  • 1,357
  • 3
  • 16
  • 38

1 Answers1

1

I haven't used VS for quite a few years, but last time I did it was happily linking my application with Triangle, and we were quite satisfied with the results.

What are the compatibility problems you are seeing?

Francesco Callari
  • 11,300
  • 2
  • 25
  • 40
  • I actually used the s-hull, and it seems working, although it gives exceptions when number of the points get large, like 1024. Do you have experience with s-hull? If so, how does it compare against Triangle in your opinion? The problem with Triangle as far as I tried was compile errors, tons of them. – Ono Feb 13 '14 at 19:00
  • I added a little information so you can see perhaps my problem with Triangle. Let me know if you need more information. Thanks. – Ono Feb 13 '14 at 19:02
  • I don't have a Windows machine handy (have moved to Linux & MacOSX for quite while), but I'll make a wild guess - does triangle.h have a C++ compatibility header guard? http://stackoverflow.com/questions/3789340/combining-c-and-c-how-does-ifdef-cplusplus-work – Francesco Callari Feb 13 '14 at 20:29
  • It did not change anything. I still got tons of errors. really confused on how to compile triangle with VS2012. – Ono Feb 15 '14 at 22:03