BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.9k stars 129 forks source link

Compiling with 64-bit indices fails delauney3D with error "cannot convert argument 2 from 'int *' to 'const GEO::signed_index_t *'" #117

Closed MrGaribaldi closed 1 year ago

MrGaribaldi commented 1 year ago

Hello,

And thank you for a very interesting library!

I'm testing it out on a large terrain tile with 225 million vertices requiring 64-bit indices.

Changing the relevant option in CMake, and I get the following errors:

~/geogram/src/lib/geogram/delaunay/delaunay_triangle.cpp:165:13
~/geogram/src/lib/geogram/delaunay/delaunay_triangle.cpp:127:13: error: cannot initialize a parameter of type 'const GEO::signed_index_t *' (aka 'const long *') with an lvalue of type 'int *'
            triangle_out_.trianglelist, triangle_out_.neighborlist
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
~/geogram/src/lib/geogram/delaunay/delaunay.h:671:35: note: passing argument to parameter 'cell_to_v' here
            const signed_index_t* cell_to_v, const signed_index_t* cell_to_cell
                                 ^

This is using Revision: 6405fee3bd7a100e73134062d4a0c0b973c23dda Author: Bruno Levy Bruno.Levy@inria.fr Date: 09-Nov-23 10:57:28

Tested on windows 11 with

Microsoft Visual Studio Community 2019
Version 16.11.10
VisualStudio.16.Release/16.11.10+32126.315
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA598
Microsoft Visual C++ 2019

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

And OpenSuse Leap 15.4, clang version 15.0.7 Target: x86_64-suse-linux Thread model: posix

BrunoLevy commented 1 year ago

Hello,

The optional support for Shewchuk's triangle software is incompatible with GARGANTUA mode (64-bit indices), To compile in GARGANTUA mode: 1) copy geogram/cmake/options/CMakeOptions.txt.Gargantua to geogram/CMakeOptions.txt 2) configure and build as usual

and what if I need both 64-bits and a constrained Delaunay triangulation ? you can use the new CDT2d class instead.