VS2012 C++有沒有Delaunay Triangulation的代碼/庫?我希望有些東西不需要使用第三部分的二進制文件。VS2012 C++的Delaunay Trangulation?
我已經嘗試了其中的很多(Triangle,A Delaunay triangulation function in C,poly2tri,Geom Fade 2D)。它們中的許多隻是不容易使用,否則與vs2012不兼容;
任何人有什麼建議嗎?非常感謝
編輯:問題與三角:
有一個三角形網格生成(Shewchuk,CMU),「三角」,這是由人推薦,因爲它很輕。它是用C編寫的,但是我不能在我的VS2012 C++項目中使用它。我正在使用x64平臺編譯它。我在Windows 7 64位。
基本上,我將triangle.c編譯爲所描述的makefile。因此,會生成一個triangle.o。我然後 1.添加triangle.o作爲我的解決方案中的附加依賴項, 2.在我的項目中添加triangle.c和triangle.h。 3.changed triangle.c在C/C++編譯頭選項,爲「不使用預編譯頭」
然後我得到了這樣的錯誤噸的:
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'
我實際上使用了s-hull,它似乎工作,雖然它在點數變大的時候會有例外,比如1024.你有S-hull的經驗嗎?如果是這樣,你認爲它與Triangle相比如何?據我所知,Triangle的問題是編譯錯誤,其中有很多錯誤。 – Ono
我添加了一些信息,所以你可以看到我的Triangle問題。如果您需要更多信息,請與我們聯繫。謝謝。 – Ono
我沒有一臺可以方便使用的Windows機器(已經轉移到Linux和MacOSX很長一段時間),但我會做一個瘋狂的猜測 - triangle.h是否具有C++兼容性頭文件保護? http://stackoverflow.com/questions/3789340/combining-c-and-c-how-does-ifdef-cplusplus-work –