tudelft3d / City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
https://github.com/tudelft3d/City3D
GNU General Public License v3.0
223 stars 36 forks source link

[BUG] - CGAL version cannot be >=5.6 #34

Closed mudandstars closed 4 months ago

mudandstars commented 5 months ago

Describe the bug When building with CGAL 5.6, I encounter the following error: "CGAL_triangulation_postcondition’ was not declared in this scope; did you mean ‘CGAL_kernel_postcondition’"

"The errors you're encountering with CGAL_triangulation_postcondition are due to changes in CGAL version 5.6. In this version, package-specific assertions, preconditions, and postconditions, like CGAL_triangulation_assertion, have been removed. Instead, you should use the corresponding CGAL-wide versions such as CGAL_assertion. This is part of the general changes introduced in CGAL 5.6 to standardize these functionalities across the library. For more detailed information, you can refer to the official CGAL 5.6 release notes on their website."

Development/Running environment:

yidahuang commented 5 months ago

Thanks for your feedback, I have just updated it, can u try the new code?

LiangliangNan commented 5 months ago

I see from the log you have multiple versions of CGAL involved in the build, at least in the following locations:

What is the each version number (I guess your first one might be lower than v5.4)? And please make sure you use only one of them (and it must be >= 5.4)

mudandstars commented 5 months ago

Thank you so much - I removed the 5.4 version and only have the 5.6 version (via brew) now. The make process proceeds a little further now

This error comes up now: /home/paul/City3D/code/method/point_set_region_growing.cpp:12:10: fatal error: CGAL/Shape_detection/Region_growing/Region_growing_on_point_set.h: No such file or directory 12 | #include <CGAL/Shape_detection/Region_growing/Region_growing_on_point_set.h> | ^~~~~~~~~~~~~~~ compilation terminated. make[2]: [code/method/CMakeFiles/method.dir/build.make:202: code/method/CMakeFiles/method.dir/point_set_region_growing.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:603: code/method/CMakeFiles/method.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

mudandstars commented 5 months ago

I just resolved this locally by replacing "<CGAL/Shape_detection/Region_growing/Region_growing_on_point_set.h" with "<CGAL/Shape_detection/Region_growing/Point_set.h>"

But now I stumble accross these errors (and more similiar ones): /usr/include/c++/11/bits/stl_algobase.h:1162:29: note: ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ is not derived from ‘const CGAL::Triple<T1, T2, T3>’ 1162 | if (!(__first1 == first2)) | ~~~^~~~~ In file included from /home/linuxbrew/.linuxbrew/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h:20, from /home/linuxbrew/.linuxbrew/include/CGAL/Intersections_3/Bbox_3_Plane_3.h:25, from /home/linuxbrew/.linuxbrew/include/CGAL/intersection_3.h:24, from /home/linuxbrew/.linuxbrew/include/CGAL/Kernel/function_objects.h:30, from /home/linuxbrew/.linuxbrew/include/CGAL/Cartesian/function_objects.h:21, from /home/linuxbrew/.linuxbrew/include/CGAL/Cartesian/Cartesian_base.h:62, from /home/linuxbrew/.linuxbrew/include/CGAL/Simple_cartesian.h:20, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:20, from /home/paul/City3D/code/method/point_set_region_growing.cpp:9: /home/linuxbrew/.linuxbrew/include/CGAL/utility.h:253:1: note: candidate: ‘template<class T1, class T2, class T3, class T4> bool CGAL::operator==(const CGAL::Quadruple<T1, T2, T3, T4>&, const CGAL::Quadruple<T1, T2, T3, T4>&)’ 253 | operator==(const Quadruple<T1, T2, T3, T4>& x, | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/utility.h:253:1: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/fstream:38, from /home/paul/City3D/code/method/point_set_region_growing.cpp:1: /usr/include/c++/11/bits/stl_algobase.h:1162:29: note: ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ is not derived from ‘const CGAL::Quadruple<T1, T2, T3, T4>’ 1162 | if (!(__first1 == first2)) | ~~~^~~~~ In file included from /home/linuxbrew/.linuxbrew/include/CGAL/Number_types/internal/Exact_type_selector.h:25, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_kernel_selector.h:26, from /home/linuxbrew/.linuxbrew/include/CGAL/Filtered_kernel.h:22, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:21, from /home/paul/City3D/code/method/point_set_region_growing.cpp:9: /home/linuxbrew/.linuxbrew/include/CGAL/Lazy_exact_nt.h:599:1: note: candidate: ‘template<class ET1, class ET2> bool CGAL::operator==(const CGAL::Lazy_exact_nt&, const CGAL::Lazy_exact_nt&)’ 599 | operator==(const Lazy_exact_nt& a, const Lazy_exact_nt& b) | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/Lazy_exact_nt.h:599:1: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/fstream:38, from /home/paul/City3D/code/method/point_set_region_growing.cpp:1: /usr/include/c++/11/bits/stl_algobase.h:1162:29: note: ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ is not derived from ‘const CGAL::Lazy_exact_nt’ 1162 | if (!(*first1 == __first2)) | ~~~^~~~~ In file included from /home/linuxbrew/.linuxbrew/include/CGAL/Kd_tree_node.h:22, from /home/linuxbrew/.linuxbrew/include/CGAL/Kd_tree.h:29, from /home/linuxbrew/.linuxbrew/include/CGAL/Shape_detection/Region_growing/Point_set/K_neighbor_query.h:20, from /home/linuxbrew/.linuxbrew/include/CGAL/Shape_detection/Region_growing/Point_set.h:27, from /home/paul/City3D/code/method/point_set_region_growing.cpp:12: /home/linuxbrew/.linuxbrew/include/CGAL/Compact_container.h:806:6: note: candidate: ‘template<class T, class Allocator, class Increment_policy, class TimeStamper> bool CGAL::operator==(const CGAL::Compact_container<T, Allocator, Increment_policy, TimeStamper>&, const CGAL::Compact_container<T, Allocator, Increment_policy, TimeStamper>&)’ 806 | bool operator==(const Compact_container<T, Allocator, Increment_policy, TimeStamper> &lhs, | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/Compact_container.h:806:6: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/fstream:38, from /home/paul/City3D/code/method/point_set_region_growing.cpp:1: /usr/include/c++/11/bits/stl_algobase.h:1162:29: note: ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ is not derived from ‘const CGAL::Compact_container<T, Allocator, Increment_policy, TimeStamper>’ 1162 | if (!(first1 == *first2)) | ~~~^~~~~ In file included from /usr/include/c++/11/bits/ios_base.h:46, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/fstream:38, from /home/paul/City3D/code/method/point_set_region_growing.cpp:1: /usr/include/c++/11/system_error:362:3: note: candidate: ‘bool std::operator==(const std::error_code&, const std::error_code&)’ 362 | operator==(const error_code& __lhs, const error_code& rhs) noexcept | ^~~~ /usr/include/c++/11/system_error:362:32: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const std::error_code&’ 362 | operator==(const error_code& lhs, const error_code& rhs) noexcept | ~~~~^~~ /usr/include/c++/11/system_error:368:3: note: candidate: ‘bool std::operator==(const std::error_code&, const std::error_condition&)’ 368 | operator==(const error_code& lhs, const error_condition& rhs) noexcept | ^~~~ /usr/include/c++/11/system_error:368:32: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const std::error_code&’ 368 | operator==(const error_code& lhs, const error_condition& rhs) noexcept | ~~~~^~~ /usr/include/c++/11/system_error:376:3: note: candidate: ‘bool std::operator==(const std::error_condition&, const std::error_condition&)’ 376 | operator==(const error_condition& lhs, | ^~~~ /usr/include/c++/11/system_error:376:37: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const std::error_condition&’ 376 | operator==(const error_condition& lhs, | ~~~~~^~~ /usr/include/c++/11/system_error:408:3: note: candidate: ‘bool std::operator==(const std::error_condition&, const std::error_code&)’ 408 | operator==(const error_condition& lhs, const error_code& __rhs) noexcept | ^~~~ /usr/include/c++/11/system_error:408:37: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const std::error_condition&’ 408 | operator==(const error_condition& lhs, const error_code& rhs) noexcept | ~~~~~^~~ In file included from /usr/include/c++/11/thread:43, from /home/linuxbrew/.linuxbrew/include/CGAL/config.h:424, from /home/linuxbrew/.linuxbrew/include/CGAL/license/Point_set_processing_3.h:17, from /home/linuxbrew/.linuxbrew/include/CGAL/IO/read_xyz_points.h:15, from /home/paul/City3D/code/method/point_set_region_growing.cpp:8: /usr/include/c++/11/bits/std_thread.h:287:3: note: candidate: ‘bool std::operator==(std::thread::id, std::thread::id)’ 287 | operator==(thread::id x, thread::id y) noexcept | ^~~~ /usr/include/c++/11/bits/std_thread.h:287:25: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘std::thread::id’ 287 | operator==(thread::id x, thread::id y) noexcept | ~~~^~~ In file included from /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex.hpp:33, from /home/linuxbrew/.linuxbrew/include/boost/cstdfloat.hpp:49, from /home/linuxbrew/.linuxbrew/include/boost/multiprecision/detail/float128_functions.hpp:15, from /home/linuxbrew/.linuxbrew/include/boost/multiprecision/detail/fpclassify.hpp:13, from /home/linuxbrew/.linuxbrew/include/boost/multiprecision/detail/default_ops.hpp:15, from /home/linuxbrew/.linuxbrew/include/boost/multiprecision/detail/generic_interconvert.hpp:12, from /home/linuxbrew/.linuxbrew/include/boost/multiprecision/number.hpp:12, from /home/linuxbrew/.linuxbrew/include/CGAL/boost_mp.h:32, from /home/linuxbrew/.linuxbrew/include/CGAL/Number_types/internal/Exact_type_selector.h:27, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_kernel_selector.h:26, from /home/linuxbrew/.linuxbrew/include/CGAL/Filtered_kernel.h:22, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:21, from /home/paul/City3D/code/method/point_set_region_growing.cpp:9: /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp:286:17: note: candidate: ‘bool std::operator==(const std::complex<float128>&, const std::complex<__float128>&)’ 286 | inline bool operator==(const complex& x, const complex& y) { return ((x.real() == y.real()) && (x.imag() == y.imag())); } | ^~~~ /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp:286:88: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const std::complex<__float128>&’ 286 | inline bool operator==(const complex& x, const complex& y) { return ((x.real() == y.real()) && (x.imag() == y.imag())); } | ~~~~~~~~~~~~^ /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp:287:17: note: candidate: ‘bool std::operator==(const std::complex<__float128>&, const float_internal128_t&)’ 287 | inline bool operator==(const complex& x, const BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE& y) { return ((x.real() == y) && (x.imag() == BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE(0))); } | ^~~~ /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp:287:88: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const std::complex<__float128>&’ 287 | inline bool operator==(const complex& x, const BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE& y) { return ((x.real() == y) && (x.imag() == BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE(0))); } | ~~~~~~~~~~~~^ /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp:288:17: note: candidate: ‘bool std::operator==(const float_internal128_t&, const std::complex<__float128>&)’ 288 | inline bool operator==(const BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE& x, const complex& y) { return ((x == y.real()) && (y.imag() == BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE(0))); } | ^~~~ /home/linuxbrew/.linuxbrew/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp:288:88: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const float_internal128_t&’ {aka ‘const __float128&’} 288 | inline bool operator==(const BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE& x, const complex& y) { return ((x == y.real()) && (y.imag() == BOOST_CSTDFLOAT_EXTENDED_COMPLEX_FLOAT_TYPE(0))); } | ~~~~~~~~~~~~^ In file included from /home/linuxbrew/.linuxbrew/include/CGAL/int.h:23, from /home/linuxbrew/.linuxbrew/include/CGAL/number_type_basic.h:56, from /home/linuxbrew/.linuxbrew/include/CGAL/basic.h:28, from /home/linuxbrew/.linuxbrew/include/CGAL/Named_function_parameters.h:16, from /home/linuxbrew/.linuxbrew/include/CGAL/IO/read_xyz_points.h:23, from /home/paul/City3D/code/method/point_set_region_growing.cpp:8: /home/linuxbrew/.linuxbrew/include/CGAL/Modular_arithmetic/Residue_type.h:287:13: note: candidate: ‘bool CGAL::operator==(const CGAL::Residue&, const CGAL::Residue&)’ 287 | inline bool operator == (const Residue& p1, const Residue& p2) | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/Modular_arithmetic/Residue_type.h:287:41: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Residue&’ 287 | inline bool operator == (const Residue& p1, const Residue& p2) | ~~~^~ /home/linuxbrew/.linuxbrew/include/CGAL/Modular_arithmetic/Residue_type.h:289:13: note: candidate: ‘bool CGAL::operator==(const CGAL::Residue&, int)’ 289 | inline bool operator == (const Residue& p1, int p2) | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/Modular_arithmetic/Residue_type.h:289:41: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Residue&’ 289 | inline bool operator == (const Residue& p1, int p2) | ~~~^~ In file included from /home/linuxbrew/.linuxbrew/include/CGAL/Gmp_coercion_traits.h:23, from /home/linuxbrew/.linuxbrew/include/CGAL/Gmpz.h:25, from /home/linuxbrew/.linuxbrew/include/CGAL/Number_types/internal/Exact_type_selector.h:30, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_kernel_selector.h:26, from /home/linuxbrew/.linuxbrew/include/CGAL/Filtered_kernel.h:22, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:21, from /home/paul/City3D/code/method/point_set_region_growing.cpp:9: /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpzf_type.h:552:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpzf&, const CGAL::Gmpzf&)’ 552 | bool operator==(const Gmpzf &a, const Gmpzf &b) | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpzf_type.h:552:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpzf&’ 552 | bool operator==(const Gmpzf &a, const Gmpzf &b) | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpzf_type.h:565:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpzf&, int)’ 565 | bool operator==(const Gmpzf &a, int b) | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpzf_type.h:565:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpzf&’ 565 | bool operator==(const Gmpzf &a, int b) | ~~~~~^ In file included from /home/linuxbrew/.linuxbrew/include/CGAL/Gmp_coercion_traits.h:24, from /home/linuxbrew/.linuxbrew/include/CGAL/Gmpz.h:25, from /home/linuxbrew/.linuxbrew/include/CGAL/Number_types/internal/Exact_type_selector.h:30, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_kernel_selector.h:26, from /home/linuxbrew/.linuxbrew/include/CGAL/Filtered_kernel.h:22, from /home/linuxbrew/.linuxbrew/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:21, from /home/paul/City3D/code/method/point_set_region_growing.cpp:9: /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1222:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, const CGAL::Gmpfr&)’ 1222 | bool operator==(const Gmpfr &a,const Gmpfr &b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1222:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1222 | bool operator==(const Gmpfr &a,const Gmpfr &b){ | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1237:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, long int)’ 1237 | bool operator==(const Gmpfr &a,long b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1237:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1237 | bool operator==(const Gmpfr &a,long b){ | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1252:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, long unsigned int)’ 1252 | bool operator==(const Gmpfr &a,unsigned long b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1252:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1252 | bool operator==(const Gmpfr &a,unsigned long b){ | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1267:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, int)’ 1267 | bool operator==(const Gmpfr &a,int b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1267:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1267 | bool operator==(const Gmpfr &a,int b){ | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1282:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, double)’ 1282 | bool operator==(const Gmpfr &a,double b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1282:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1282 | bool operator==(const Gmpfr &a,double b){ | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1314:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, long double)’ 1314 | bool operator==(const Gmpfr &a,long double b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1314:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1314 | bool operator==(const Gmpfr &a,long double b){ | ~~~~~^ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1330:6: note: candidate: ‘bool CGAL::operator==(const CGAL::Gmpfr&, const CGAL::Gmpz&)’ 1330 | bool operator==(const Gmpfr &a,const Gmpz &b){ | ^~~~ /home/linuxbrew/.linuxbrew/include/CGAL/GMP/Gmpfr_type.h:1330:30: note: no known conversion for argument 1 from ‘const boost::tuples::tuple<CGAL::Point_3, CGAL::Vector_3, int>’ to ‘const CGAL::Gmpfr&’ 1330 | bool operator==(const Gmpfr &a,const Gmpz &b){ | ~~~~~^ make[2]: [code/method/CMakeFiles/method.dir/build.make:202: code/method/CMakeFiles/method.dir/point_set_region_growing.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:603: code/method/CMakeFiles/method.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

LiangliangNan commented 5 months ago

Check your CMake log and let me know the exact version number of your CGAL (not possible to figure out it from the compliation log).

LiangliangNan commented 5 months ago

The CMake log on my machine looks like:

Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.18362.
Found Boost: D:/dev/boost_1_80_0 (found version "1.80.0")  
Found Boost-1.80.
Could NOT find GUROBI (missing: GUROBI_LIBRARIES) 
Visual Leak Detector (VLD) is not found.
Using header-only CGAL
Targeting Visual Studio 16 2019
Target build environment supports auto-linking
Using VC toolset 142.
Generator uses intermediate configuration directory: $(Configuration)
Found Boost: D:/dev/boost_1_80_0 (found suitable version "1.80.0", minimum required is "1.66")  
Boost include dirs: D:/dev/boost_1_80_0
Boost libraries:    
Found CGAL: 5.6
Multi-configuration CMake generator: cannot display flags
Requested component: Core
CGAL_CXX_FLAGS_INIT: 
CGAL_LIBRARIES: CGAL::CGAL_Core;CGAL::CGAL
CGAL_3RD_PARTY_LIBRARIES: 
GMP_INCLUDE_DIR: D:/dev/CGAL-5.6/auxiliary/gmp/include
GMP_LIBRARIES: debug;D:/dev/CGAL-5.6/auxiliary/gmp/lib/libgmp-10.lib;optimized;D:/dev/CGAL-5.6/auxiliary/gmp/lib/libgmp-10.lib
Configuring done

So you can see my CGAL version is 5.6.

mudandstars commented 5 months ago

-- Using header-only CGAL -- Targeting Unix Makefiles -- Using /usr/bin/c++ compiler. -- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so
-- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so
-- Found Boost: /home/linuxbrew/.linuxbrew/lib/cmake/Boost-1.84.0/BoostConfig.cmake (found suitable version "1.84.0", minimum required is "1.66")
-- Boost include dirs: /home/linuxbrew/.linuxbrew/include -- Boost libraries:
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE
-- Using gcc version 4 or later. Adding -frounding-math -- Found CGAL: 5.6 -- Build type: Release -- USING CXXFLAGS = ' -O3 -DNDEBUG' -- USING EXEFLAGS = '-L/home/linuxbrew/.linuxbrew/opt/qt@5/lib ' -- Requested component: Core CGAL_CXX_FLAGS_INIT: CGAL_LIBRARIES: CGAL::CGAL_Core;CGAL::CGAL CGAL_3RD_PARTY_LIBRARIES: GMP_INCLUDE_DIR: /usr/include/x86_64-linux-gnu GMP_LIBRARIES: /usr/lib/x86_64-linux-gnu/libgmp.so -- Found OpenCV: /home/linuxbrew/.linuxbrew/Cellar/opencv/4.9.0_1 (found version "4.9.0") found components: core imgproc CMake Deprecation Warning at code/CLI_Example_1/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at code/CLI_Example_2/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at code/City3D/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Configuring done (0.5s) CMake Warning at code/CLI_Example_1/CMakeLists.txt:10 (add_executable): Cannot generate a safe runtime search path for target CLI_Example_1 because files in some directories may conflict with libraries in implicit directories:

runtime library [libgmpxx.so.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libmpfr.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libgmp.so.10] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libGLU.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib

Some of these libraries may not be found correctly.

CMake Warning at code/CLI_Example_2/CMakeLists.txt:10 (add_executable): Cannot generate a safe runtime search path for target CLI_Example_2 because files in some directories may conflict with libraries in implicit directories:

runtime library [libgmpxx.so.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libmpfr.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libgmp.so.10] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libGLU.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib

Some of these libraries may not be found correctly.

CMake Warning at code/City3D/CMakeLists.txt:49 (add_executable): Cannot generate a safe runtime search path for target City3D because files in some directories may conflict with libraries in implicit directories:

runtime library [libEGL.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libGL.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libgmpxx.so.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libmpfr.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libgmp.so.10] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib
runtime library [libGLU.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/linuxbrew/.linuxbrew/lib

Some of these libraries may not be found correctly.

-- Generating done (0.1s) -- Build files have been written to: /home/paul/City3D/Release

this is the output I see, (plus some "Compatibility with CMake < 3.5 will be removed from a future version of CMake." deprecation warnings beforehand).

LiangliangNan commented 5 months ago

@yidahuang CGAL v5.6 has breaking changes: e.g., the APIs for detecting planes using region rrowing has changes. To be flexible with CGAL versions, you will need to have change the file method\point_set_region_growing.cpp, and consider using the following

#if CGAL_VERSION_NR < 1050601000
        ... // code using CGAL < 5.6, e.g., (5.4, 5.5)
#else 
        ... // code using CGAL >= 5.6
#endif
mudandstars commented 4 months ago

Thank you very much - for my planning: Will you fix this soon (like, this month) or rather later? Depending on this, my personal course of action would change.

I appreciate your help & answers very much - thanks for your work

Paul

LiangliangNan commented 4 months ago

I believe it is already solved. Please try the code (though we will clean the code later).

mudandstars commented 4 months ago

Yes, it is solved. I can now build successfully using CGAL 5.6. Thank you very much!!!

mudandstars commented 4 months ago

I hope I don't bother you too much, but I have a question that I thought best addressed to you:

Can I also directly use .laz / .las data as inputs? If yes, how would I go about it? If no, how do you recommend transforming it?

Thank you so much for your help

LiangliangNan commented 4 months ago

I think the current implementation already supports las/laz formats (loading only), but I am not sure if it restores the original transformation when exporting the reconstructed mesh.

las/laz files normally store huge coordinates, which may cause numerical issues for computation and also rendering problems. So it is commonly translated with respect to any of the points (or any 3D point within the bounding box of the point cloud). After you complete the process, you simply restore an inverse transformation to your result.

Note that City3D is simply a research prototype, and it only demonstrates the core methodologies without paying much attention to processing different file formats.

mudandstars commented 4 months ago

Thank you very much. I successfully transformed my input data to the .ply format. I tried it with two different point resolutions (10cm and 25cm), but I cannot make it work, although the same program runs within 1s for your building sample data. Can you help me out here?

This is my main.cpp (which basically uses your CLI_EXAMPLE_2 for one file that is specified via an cli argument): int main(int argc, char **argv) { if (argc != 2) { std::cerr << "Usage: " << argv[0] << " " << std::endl; return EXIT_FAILURE; }

const std::string input_cloud_file = argv[1];
std::cout << "read input point cloud from file  " << input_cloud_file << std::endl;

// output mesh file name
std::string output_file = input_cloud_file.substr(0, input_cloud_file.find(".ply")) + "_result.obj";
std::string output_file1 = input_cloud_file.substr(0, input_cloud_file.find(".ply")) + "_footprint.obj";

// load input point cloud
std::cout << "loading input point cloud data..." << std::endl;
PointSet *pset = PointSetIO::read(input_cloud_file);
if (!pset)
{
    std::cerr << "failed loading point cloud data from file " << input_cloud_file << std::endl;
    return EXIT_FAILURE;
}
// set the ground height and point density(0.15-0.25)
double ground_height = -5.97;
double density = 0.2;

Reconstruction recon;

// Step 1:  generate the footprint  for  individual buildings
Map *footprint = recon.generate_polygon(pset, ground_height, density);
MapIO::save(output_file1, footprint);

// Step 2: segmentation to obtain point clouds of individual buildings
std::cout << "segmenting individual buildings..." << std::endl;
recon.segmentation(pset, footprint);

// Step 3: extract planes from the point cloud of each building
std::cout << "extracting roof planes..." << std::endl;
recon.extract_roofs(pset, footprint);

// Step 4: reconstruct  the buildings one by one
Map *result = new Map;

ifdef HAS_GUROBI

std::cout << "reconstructing the buildings (using the Gurobi solver)..." << std::endl;
bool status = recon.reconstruct(pset, footprint, result, LinearProgramSolver::GUROBI);

else

std::cout << "reconstructing the buildings (using the SCIP solver)..." << std::endl;
bool status = recon.reconstruct(pset, footprint, result, LinearProgramSolver::SCIP);

endif

if (status && result->size_of_facets() > 0)
{
    if (MapIO::save(output_file, result))
    {
        std::cout << "reconstruction result saved to file " << output_file << std::endl;
    }
    else
        std::cerr << "failed to save reconstruction result to file " << output_file << std::endl;
}
else
    std::cerr << "reconstruction failed" << std::endl;

delete pset;
delete result;

return EXIT_FAILURE;

}

The reconstruction of the footprint.obj for the input point cloud works perfect for your sample data, but does not work well for my data (it just says the entire area is the footprint). You can download my two .ply input point cloud files via this link: https://we.tl/t-HZST4joTbk

This is my stdout (I canceled each process after >10mins of waiting, while the first process succeeded within 1s): (venv) paul@developmentP3:~/City3D$ Release/bin/tetraeder_single_input data/building_instances/0.ply read input point cloud from file data/building_instances/0.ply loading input point cloud data... segmenting individual buildings... extracting roof planes... reconstructing the buildings (using the SCIP solver)... reconstruction result saved to file data/building_instances/0_result.obj (venv) paul@developmentP3:~/City3D$ Release/bin/tetraeder_single_input data/tetraeder/wannestr5_less_points.ply read input point cloud from file data/tetraeder/wannestr5_less_points.ply loading input point cloud data... ^Cpressed CTRL-C 1 times (5 times for forcing termination) segmenting individual buildings... extracting roof planes... ^C (venv) paul@developmentP3:~/City3D$ Release/bin/tetraeder_single_input data/tetraeder/wannestr5_many_points.ply read input point cloud from file data/tetraeder/wannestr5_many_points.ply loading input point cloud data... Cannot set feasibility tolerance to small value 1.62981e-11 without GMP - using 1e-10. Cannot set feasibility tolerance to small value 1.62981e-11 without GMP - using 1e-10. Cannot set feasibility tolerance to small value 1.62981e-11 without GMP - using 1e-10. Cannot set feasibility tolerance to small value 1.62981e-11 without GMP - using 1e-10. Cannot set feasibility tolerance to small value 1.62981e-11 without GMP - using 1e-10. Cannot set feasibility tolerance to small value 1.62981e-11 without GMP - using 1e-10. [solve.c:4633] ERROR: (node 31) unresolved numerical troubles in LP 64 -- aborting [solve.c:4993] ERROR: Error <-6> in function call [scip_solve.c:2780] ERROR: Error <-6> in function call [cons_components.c:743] ERROR: Error <-6> in function call [cons_components.c:785] ERROR: Error <-6> in function call [cons_components.c:2473] ERROR: Error <-6> in function call [cons.c:4072] ERROR: Error <-6> in function call [scip_solve.c:1006] ERROR: Error <-6> in function call [scip_solve.c:1216] ERROR: Error <-6> in function call [scip_solve.c:1216] ERROR: Error <-6> in function call [scip_solve.c:1216] ERROR: Error <-6> in function call [scip_solve.c:1382] ERROR: Error <-6> in function call [scip_solve.c:2493] ERROR: Error <-6> in function call [scip_solve.c:2731] ERROR: Error <-6> in function call segmenting individual buildings... extracting roof planes... reconstructing the buildings (using the SCIP solver)... ^Cpressed CTRL-C 1 times (5 times for forcing termination) ^Cpressed CTRL-C 2 times (5 times for forcing termination) ^Cpressed CTRL-C 3 times (5 times for forcing termination) ^Cpressed CTRL-C 4 times (5 times for forcing termination) ^Cpressed CTRL-C 5 times. forcing termination.

I am very grateful for your help and hope this is the last time I bother you. All the best

Paul

LiangliangNan commented 4 months ago

I see that your point cloud contains points of the ground, and it also contains several buildings in the same point cloud. But the algorithm assumes that each point cloud contains only a single building and is free of background points.

To handle multiple buildings in a point cloud, you need some algorithm or footprint that can assist the algorithm to segment individual buildings.

mudandstars commented 4 months ago

I also have a footprint, but only in .geojson format - here it is for download: https://we.tl/t-PAfL7dF67g

But I cannot make a proper transformation to .obj format using the tools I found online so the reconstruction algorithm using point cloud file and footprint file always fails. Do you have any suggestion for this?

LiangliangNan commented 4 months ago

The only thing you need to ensure is that the footprint needs to be translated using the same transformation as the point cloud. Your question reminds me that in the City3D code, the point cloud is always translated with respect to the first point in the point cloud. See the following lines of code on how this transformation is applied: https://github.com/tudelft3d/City3D/blob/87d4af1ba9080e15bb6a509903043bf295f30bff/code/model/point_set_serializer_las.cpp#L58 and https://github.com/tudelft3d/City3D/blob/87d4af1ba9080e15bb6a509903043bf295f30bff/code/model/point_set_serializer_las.cpp#L84

mudandstars commented 4 months ago

I see - yes I took care to use the same reflection for the transformation. But how can I correctly transform my .geojson file to an .obj file? I could not find a popular/working way without issues. Using .geojson does not work directly, does it? Why did you decide to use .obj format for the footprints?

LiangliangNan commented 4 months ago

In principle, the footprints are just polygons, thus with OBJ format, we were able to reuse existing code to visualize/load/save them.

I think you only need a loader that can help you extract the polygons from the file. I have some code for this purpose: https://github.com/LiangliangNan/Easy3D/blob/main/easy3d/fileio/surface_mesh_io_geojson.cpp

LiangliangNan commented 3 months ago

The CGAL version number used was 1050601000 (to identify v5.6 or lower), which is not correct. This has been fixed in the code.

A similar issue was raised and resolved in #37.