SFCGAL is a C++ wrapper library around CGAL with the aim of supporting ISO 191007:2013 and OGC Simple Features for 3D operations.
Please refer to the project page for an updated installation procedure.
NOTE: repository has moved to gitlab.
MOVED TO GITLAB: https://gitlab.com/sfcgal/SFCGAL. A wrapper around CGAL that intents to implement 2D and 3D operations on OGC standards models
Home Page: https://sfcgal.org
License: Other
SFCGAL is a C++ wrapper library around CGAL with the aim of supporting ISO 191007:2013 and OGC Simple Features for 3D operations.
Please refer to the project page for an updated installation procedure.
NOTE: repository has moved to gitlab.
Reading on the web file globbing with GLOB_RECURSE is considered evil for this reason.
GLOB on single directories would be fine. In case recursion wants be mantained the cmake generated .cpp file must be removed from sources list like I do here: https://github.com/giohappy/SFCGAL/blob/fix_cmake_globbing/viewer/CMakeLists.txt#L16
In case it is ok for you I will submit a pull, but imho using per directory globbing should be cleaner
I’ve try to update the version of SFCGAL provided by MacPorts to 1.1.0, but the compilation fails in GeometrySet.cpp.
I’m appending a log of the errors clang produces. Sorry, I don’t program in C++ anymore, so my help is rather limited here.
Thanks!
To compile with the viewer I had to add this cmake module manually, with the following content:
OSG_FIND_PATH (OSGQT osgQt/GraphicsWindowQt)
OSG_FIND_LIBRARY(OSGQT osgQt)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgQt DEFAULT_MSG
OSGQT_LIBRARY OSGQT_INCLUDE_DIR)
I am currently unable to install SFCGAL I keep receiving the following error: error: using ‘typename’ outside of template
here is a screen dump:
[root@chief SFCGAL-1.0]# cmake .
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Setting build type to 'Release' as none was specified.
-- Boost_USE_STATIC_LIBS=OFF
-- Boost_USE_MULTITHREAD=ON
Boost found.
Found Boost components:
date_time;thread;system;serialization
-- Found GMP: /usr/include
-- GMP_INCLUDE_DIRS = /usr/include
-- GMP_LIBRARIES = /usr/lib64/libgmp.so
-- Found MPFR: /usr/include
-- MPFR_INCLUDE_DIRS = /usr/include
-- MPFR_LIBRARIES = /usr/lib64/libmpfr.so
-- Found CGAL: /usr/local/include (Required is at least version "4.1")
-- CGAL 4.3 found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dpacifico/Downloads/SFCGAL-1.0
[root@chief SFCGAL-1.0]# make
Scanning dependencies of target SFCGAL
[ 1%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/PreparedGeometry.cpp.o
[ 2%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/GeometryCollection.cpp.o
[ 3%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/TriangulatedSurface.cpp.o
In file included from /home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/Point.h:27,
from /home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/TriangulatedSurface.h:36,
from /home/dpacifico/Downloads/SFCGAL-1.0/src/SFCGAL/TriangulatedSurface.cpp:21:
/home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/detail/TypeForDimension.h:135: error: using ‘typename’ outside of template
/home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/detail/TypeForDimension.h:139: error: using ‘typename’ outside of template
/home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/detail/TypeForDimension.h:143: error: using ‘typename’ outside of template
/home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/detail/TypeForDimension.h:147: error: using ‘typename’ outside of template
/home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/detail/TypeForDimension.h:151: error: using ‘typename’ outside of template
/home/dpacifico/Downloads/SFCGAL-1.0/include/SFCGAL/detail/TypeForDimension.h:155: error: using ‘typename’ outside of template
make[2]: *** [src/CMakeFiles/SFCGAL.dir/SFCGAL/TriangulatedSurface.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/SFCGAL.dir/all] Error 2
make: *** [all] Error 2
[root@chief SFCGAL-1.0]#
Would a patch adding a parameter to omit lines that touch the input polygon boundary from StraightSkeleton output be accepted ? It'd be aimed at providing an approximate "MedialAxis" implementation.
Passing a string like "POINT(0 0)POINT(1 0)" to io::readWkt does not trigger any error.
The second point is silently discarded.
\cc @vmora
Is there a reason why lwgeom_sfcgal already includes the code for triangulate_2dz but it is not (yet) exported with with sfcgal.sql?
The viewer can not be linked to QT4 on Ubuntu 13.04 (raring).
On a i386 system :
Linking CXX executable viewer-SFCGALd
/usr/bin/ld: CMakeFiles/viewer-SFCGAL.dir/src/SFCGAL/viewer/plugins/PSQLPlugin.cpp.o: undefined reference to symbol '_ZN8QVariantD1Ev'
/usr/bin/ld: note: '_ZN8QVariantD1Ev' is defined in DSO /usr/lib/i386-linux-gnu/libQtCore.so.4 so try adding it to the linker command line
/usr/lib/i386-linux-gnu/libQtCore.so.4: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [viewer/viewer-SFCGALd] Error 1
make[1]: *** [viewer/CMakeFiles/viewer-SFCGAL.dir/all] Error 2
make: *** [all] Error 2
On a x86_64 system :
Linking CXX executable viewer-SFCGAL
/usr/bin/ld: CMakeFiles/viewer-SFCGAL.dir/include/SFCGAL/viewer/plugins/moc_PSQLPlugin.cxx.o: undefined reference to symbol «_ZN7QObject10childEventEP11QChildEvent»
/usr/bin/ld: note: «_ZN7QObject10childEventEP11QChildEvent» is defined in DSO /usr/lib/x86_64-linux-gnu/libQtCore.so.4 so try adding it to the linker command line
/usr/lib/x86_64-linux-gnu/libQtCore.so.4: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [viewer/viewer-SFCGAL] Error 1
make[1]: *** [viewer/CMakeFiles/viewer-SFCGAL.dir/all] Error 2
make: *** [all] Error 2
Building SFCGAL with boost 1.48 on Ubuntu 12.04 produces an undefined reference. When I comment out these two lines from vtk.h it works for me:
#include <boost/test/unit_test.hpp>
using namespace boost::unit_test;
output when linking with "-z defs":
CMakeFiles/SFCGAL.dir/algorithm/difference.cpp.o:difference.cpp:function boost::unit_test::singleton<boost::unit_test::unit_test_log_t>::instance(): error: undefined reference to 'vtable for boost::unit_test::unit_test_log_t'
collect2: error: ld returned 1 exit status
Allow the C API to use methods without validity check.
Clients (PostGIS) should be able to choose at runtime what variant to call
The current master has an unneeded dependency on osg.
GEOS implementation provide two extra features:
-> Tolerance value to snap input vertices together
-> ability to choose output type among (COLLECTION of POLYGON, LINESTRING, TIN)
Aim is to have the same with SFCGAL
cf http://postgis.net/docs/manual-dev/ST_DelaunayTriangles.html
"Geometry sets" are used to compute boolean operations on geometries. Geometries are first decomposed into "primitives", that CGAL knows, then the computation takes place and then the resulted geometry set is "recomposed" to a geometry.
Some corner cases have implied strange design choices. For instance, polygon in 3D are decomposed by triangulation into 3D triangles. But these 3D triangles are all on the same plane. This information is useful for recomposition. There is then a flag associated to geometry primitives (IS_PLANAR). There should be better way to carry this information ...
Is it expected for "make test" to run a single, failing test ?
[/usr/src/sfcgal/SFCGAL(master)] make test
Running tests...
Test project /usr/src/sfcgal/SFCGAL
Start 1: style-test
1/1 Test #1: style-test .......................***Failed 6.17 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 6.17 sec
The following tests FAILED:
1 - style-test (Failed)
Errors while running CTest
make: *** [test] Error 8
Enhancement request:
I probably don't know my cmake well enough but I was somehow expecting that if SFCGAL installed to /usr/local (bin, lib) that docs would find their way to /usr/local/share/sfcgal
As I say, I am probably wrong in my approach and need to pass a to make doc.
Actually, looks like one needs to modify the cmake_install.cmake in the SFCGAL-1.0.4/doc dir. Any guidance on this for /html /latex and /images appreciated
I find the sfcgal only check the library path /usr/lib, I install my CGAL on /usr/local/lib
Looking at the StraightSkeleton for the input reported in ticket #80 reveals a robustness issue that results in a piece of skeleton falling outside the input polygon, see:
The artifact goes away if the input polygon is first translated to have 0,0 as its lowest-left point and the output skeleton is translated back to its original position, see:
The skeleton computed with "extact construction" kernel is otherwise visually equal to the one computed with the improved robusness (shifting). Running the translation doesn't significantly affect performances.
Maybe this issue should be reported upstream to CGAL..
I'm getting a strange warning message while compiling GDAL SVN. There is no GDAL configure option for SFCGAL and yet SFCGAL gets linked into GDAL. Here is the info:
$ gdalinfo --version
GDAL 1.11dev, released 2013/04/13
$ sfcgal-config --version
1.0.3
*** Warning: Linking the executable gdalbuildvrt against the loadable module
*** libSFCGAL.so is not portable!
libtool: link: g++ .libs/gdalbuildvrt.o -o .libs/gdalbuildvrt /home/bob/dev/gis/gdal/.libs/libgdal.so -L/usr/local/lib -L/usr/lib -L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -larmadillo -lpoppler -lwebp -lodbc -lodbcinst -lkmldom -lkmlbase -lkmlengine -lkmlconvenience -lminizip -luriparser /usr/lib/x86_64-linux-gnu/libexpat.so -lxerces-c -ljasper -lnetcdf -lhdf5 /usr/lib/libmfhdfalt.so /usr/lib/libdfalt.so /usr/lib/x86_64-linux-gnu/libgif.so /usr/local/lib/libgeotiff.so -ljpeg /usr/lib/x86_64-linux-gnu/libtiff.so -lgta -lpng -lpq -llzma -lrt /usr/local/lib/libspatialite.so -ldl /usr/local/lib/libfreexl.so -lz /usr/local/lib/liblwgeom.so /usr/local/lib/libSFCGAL.so /usr/local/lib/libproj.so -lm -lpthread /usr/lib/x86_64-linux-gnu/libjson.so /usr/local/lib/libgeos_c.so /usr/local/lib/libgeos.so /usr/lib/x86_64-linux-gnu/libsqlite3.so -lpcre /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so -ljvm -lxml2
Reading the code, it seems that for A-B, the parts of A that do not collide (bbox) B, are not included in the result.
Make unit test and fix.
I get the following SFCGAL/algorithm/connection.cpp:43:9: error: use of undeclared identifier 'BOOST_ASSERT_MESSAGE'
I am using SFCGAL 1.0.5 and Boost 1.48 on RHEL 6.
I have tried adding #include <boost/assert.hpp>
to connection.h and changing BOOST_ASSERT_MESSAGE
TO BOOST_ASSERT
but neither appears to work so I've had to comment this line out to build, which isn't ideal.
I noticed that CGAL is distributed with GPL3+ license (http://www.cgal.org/license.html) while SFCGAL, being a wrapper (thus a derivate) is distributed with GPL2+.
GPL3 being incompatible with GPL2 I think it would make more sense to directly distribute SFCGAL as GPL3+
SFCGAL 1.0.3 not compatible with CGAL 4.3 due some API changes (new intersection API).
Polygons with holes are not handled properly.
Hi all,
I'm experimenting with the great SFCGAL library via Python ctypes. First of all, thanks for your great work on this library guys :-)
Now, I'm trying to write a WKT string out of a created Geometry and due to ctypes I can only do so via the C API. There is one method for writing WKT called "sfcgal_geometry_as_text()".
I've seen in the code that this method more or less delegates to the SFCGAL::Geometry->asText() method. However, the only parameter of that function, "numDecimals", is not exposed via the C API function. Hence, the default value -1 is always used, which apparently sets the WktWriter to use the CGAL "exact" mode.
For a simple input POINT(1.234, 3.456) I get this strange WKT:
POINT(694680242521899/562949953421312 7782220156096217/2251799813685248)
This ... well ... seems to be very exact indeed :-) and resolves to the correct floats when calculated.
However, as you might guess I'd like to see a "normal" floating point output here, not those integer fractions.
Is my assumption correct, that this is indeed caused by the CGAL "exact" mode?
And if so, is there any way to set the "numDecimal" parameter over the C API and ctypes?
If not, could you please add the numDecimal parameter to the C API function?
Many thanks in advance for your advice.
Cheers,
Matthias
We have the test
is_in_poly( pit->primitive() ) != CGAL::ON_UNBOUNDED_SIDE
were is_in_poly is an instance of CGAL::Point_inside_polyhedron_3
Looking at the Point_inside_polyhedron_3 code, the return value of the operator() is a bool, not a value from Bounded_side
Trying to prepare a rpm package for openSUSE & Co I've found that the libsfcgal goes to _prefix/lib
It's always doable to move it manually during the packaging process but I would prefer to have it as option or correct default.
For example tbonfort has added this code in CMakeFileList.txt for mapserver 6.4
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(_LIBDIR_DEFAULT "lib")
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT CMAKE_CROSSCOMPILING
AND NOT EXISTS "/etc/debian_version")
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
message(AUTHOR_WARNING
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
"Please enable at least one language before including GNUInstallDirs.")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_LIBDIR_DEFAULT "lib64")
endif()
endif()
endif()
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
endif()
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
If you agree with the idea, I can try to create a proper patch
Investigate the use of 2D polygon partitioning and hole connection (http://doc.cgal.org/latest/Partition_2/index.html, http://doc.cgal.org/latest/Boolean_set_operations_2/group__boolean__connect__holes.html) and other triangulation methods (ear clipping)
To reproduce it from PostGIS:
SET postgis.backend='sfcgal';
SELECT '#1957', ST_Distance(ST_Makeline(ARRAY['POINT(1 0)'::geometry]), 'POINT(0 0)'::geometry);
Should be robust enough to not crash with:
cmake didn't complain, but I probably have an old CGAL:
[ 1%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Coordinate.cpp.o
In file included from /usr/src/sfcgal/SFCGAL/include/SFCGAL/numeric.h:27:0,
from /usr/src/sfcgal/SFCGAL/include/SFCGAL/Coordinate.h:29,
from /usr/src/sfcgal/SFCGAL/src/SFCGAL/Coordinate.cpp:21:
/usr/src/sfcgal/SFCGAL/include/SFCGAL/Kernel.h:37:10: error: ‘Gmpq’ in namespace ‘CGAL’ does not name a type
In file included from /usr/src/sfcgal/SFCGAL/include/SFCGAL/Coordinate.h:29:0,
from /usr/src/sfcgal/SFCGAL/src/SFCGAL/Coordinate.cpp:21:
/usr/src/sfcgal/SFCGAL/include/SFCGAL/numeric.h:54:2: error: ‘Gmpz’ in namespace ‘CGAL’ does not name a type
/usr/src/sfcgal/SFCGAL/include/SFCGAL/numeric.h:58:2: error: ‘Gmpz’ in namespace ‘CGAL’ does not name a type
/usr/src/sfcgal/SFCGAL/include/SFCGAL/numeric.h:62:2: error: ‘Gmpz’ in namespace ‘CGAL’ does not name a type
because we try to access empty coord
The latest release advertised in NEWS file is 1.0.5, but latest release is 1.1.0 according to https://github.com/Oslandia/SFCGAL/releases
"check" is the GNU standard target for running testsuites...
We should not blindly recompose TIN, we need to check connected components first (a fix is coming)
First, I make the soft link
root@wemet:~/SFCGAL# ln -s /usr/local/lib/libCGAL.so /usr/lib/libCGAL.so
then I use cmake:
root@wemet:~/SFCGAL# cmake .
-- Boost_USE_STATIC_LIBS=OFF
-- Boost_USE_MULTITHREAD=ON
-- Boost version: 1.49.0
-- Found the following Boost libraries:
-- date_time
-- thread
-- system
-- serialization
-- GMP_INCLUDE_DIRS = /usr/include
-- GMP_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmp.so
-- MPFR_INCLUDE_DIRS = /usr/include
-- MPFR_LIBRARIES = /usr/lib/x86_64-linux-gnu/libmpfr.so
-- CGAL 4.3 found
-- Configuring done
-- Generating done
-- Build files have been written to: /root/SFCGAL
the I try to build the files and the error happens
root@wemet:/SFCGAL# make/SFCGAL#
Scanning dependencies of target SFCGAL
[ 1%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Grid.cpp.o
[ 2%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/PreparedGeometry.cpp
.o
[ 3%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/capi/sfcgal_c.cpp.o
[ 4%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Surface.cpp.o
[ 5%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Polygon.cpp.o
[ 6%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Point.cpp.o
[ 7%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/GeometryVisitor.cpp.
o
[ 9%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Envelope.cpp.o
[ 10%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Geometry.cpp.o
[ 11%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/MultiSolid.cpp.o
[ 12%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/numeric.cpp.o
[ 13%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Coordinate.cpp.o
[ 14%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/TriangulatedSurface.
cpp.o
[ 15%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/MultiLineString.cpp.
o
[ 17%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/triangulate/triangul
ate2DZ.cpp.o
[ 18%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/triangulate/triangul
atePolygon.cpp.o
[ 19%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/BoundaryVi
sitor.cpp.o
[ 20%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/collection
ToMulti.cpp.o
[ 21%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/tesselate.
cpp.o
[ 22%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/collect.cp
p.o
[ 23%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/translate.
cpp.o
[ 25%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/Consistent
OrientationBuilder.cpp.o
[ 26%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/distance.c
pp.o
[ 27%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/intersecti
on.cpp.o
[ 28%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/collection
Extract.cpp.o
[ 29%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/offset.cpp
.o
[ 30%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/connection
.cpp.o
[ 31%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/distance3d
.cpp.o
/root/SFCGAL/src/SFCGAL/algorithm/distance3d.cpp: In function 'squared_distance_
t SFCGAL::algorithm::squaredDistanceSegmentTriangle3D(const Segment_3&, const Tr
iangle_3&)':
/root/SFCGAL/src/SFCGAL/algorithm/distance3d.cpp:709:44: error: 'CGAL::cpp11::re
sult_of<CGAL::Lazy_construction_variant<CGAL::Epeck, CGAL::CommonKernelFunctors:
:Intersect_3<CGAL::Simple_cartesian<CGAL::Interval_nt > >, CGAL::CommonKe
rnelFunctors::Intersect_3CGAL::Simple_cartesian<CGAL::Gmpq > >(CGAL::Triangle_
3CGAL::Epeck, CGAL::Segment_3CGAL::Epeck)>::type' has no member named 'empty
'
/root/SFCGAL/src/SFCGAL/algorithm/distance3d.cpp: In function 'squared_distance_
t SFCGAL::algorithm::squaredDistanceTriangleTriangle3D(const Triangle_3&, const
Triangle_3&)':
/root/SFCGAL/src/SFCGAL/algorithm/distance3d.cpp:767:55: error: 'CGAL::cpp11::re
sult_of<CGAL::Lazy_construction_variant<CGAL::Epeck, CGAL::CommonKernelFunctors:
:Intersect_3<CGAL::Simple_cartesian<CGAL::Interval_nt > >, CGAL::CommonKe
rnelFunctors::Intersect_3CGAL::Simple_cartesian<CGAL::Gmpq > >(CGAL::Triangle_
3CGAL::Epeck, CGAL::Triangle_3CGAL::Epeck)>::type' has no member named 'empt
y'
make[2]: *** [src/CMakeFiles/SFCGAL.dir/SFCGAL/algorithm/distance3d.cpp.o] Error
1
make[1]: *** [src/CMakeFiles/SFCGAL.dir/all] Error 2
make: *** [all] Error 2
root@wemet:
Hi,
I'm trying to use ST_StraigthSkeleton for building roofs and I figured that one has to find the shortest distance trough the skeleton to get the proper height for roof ridges. Looking into CGAL the vertices provide a time value which seems provides the information. Would it be possible to have a ST_StraightSkeleton3D which provides time as z or m dimension?
http://doc.cgal.org/latest/Straight_skeleton_2/classStraightSkeletonVertex__2.html
(An example for a complex hipped roof build with SFCGAL :)
http://opensciencemap.org/~jeff/test/#scale=17,rot=326,tilt=57,lat=48.855,lon=2.312)
The garden-test-SFCGAL
test segfaults on OSX 10.10 with:
$ clang -v
Apple LLVM version 6.1.0 (clang-602.0.48) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
compiled with cgal 4.5.2. The backtrace is:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028
0x00000001000ebb6e in CGAL::import_from_polyhedron_subset<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >, CGAL::Combinatorial_map<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int>, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > >, std::__1::__list_iterator<CGAL::internal::In_place_list_const_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Epeck> > > >, std::__1::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Epeck> > > > > >, void*>, CGAL::internal_IOP::Non_intersection_halfedge<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::map<CGAL::internal::In_place_list_const_iterator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > >, std::__1::allocator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > > > >, CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > >, std::__1::allocator<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > > >, CGAL::Default, CGAL::Default>, false>, CGAL::internal_IOP::Compare_address<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<std::__1::pair<CGAL::internal::In_place_list_const_iterator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > >, std::__1::allocator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > > > > const, CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > >, std::__1::allocator<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > > >, CGAL::Default, CGAL::Default>, false> > > > > ()
(gdb) bt
#0 0x00000001000ebb6e in CGAL::import_from_polyhedron_subset<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >, CGAL::Combinatorial_map<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int>, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > >, std::__1::__list_iterator<CGAL::internal::In_place_list_const_iterator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Epeck> > > >, std::__1::allocator<CGAL::HalfedgeDS_in_place_list_face<CGAL::I_Polyhedron_facet<CGAL::HalfedgeDS_face_base<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Plane_3<CGAL::Epeck> > > > > >, void*>, CGAL::internal_IOP::Non_intersection_halfedge<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::map<CGAL::internal::In_place_list_const_iterator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > >, std::__1::allocator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > > > >, CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > >, std::__1::allocator<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > > >, CGAL::Default, CGAL::Default>, false>, CGAL::internal_IOP::Compare_address<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<std::__1::pair<CGAL::internal::In_place_list_const_iterator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > >, std::__1::allocator<CGAL::HalfedgeDS_in_place_list_halfedge<CGAL::I_Polyhedron_halfedge<SFCGAL::detail::Halfedge_with_mark<CGAL::HalfedgeDS_list_types<CGAL::Epeck, CGAL::I_Polyhedron_derived_items_3<SFCGAL::detail::Items_with_mark_on_hedge>, std::__1::allocator<int> > > > > > > const, CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > >, std::__1::allocator<CGAL::Dart<3u, CGAL::Combinatorial_map_storage_1<3u, CGAL::internal_IOP::Item_with_points_and_volume_info<CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >, std::__1::allocator<int> > > >, CGAL::Default, CGAL::Default>, false> > > > > ()
#1 0x00000001000e5585 in CGAL::Node_visitor_refine_polyhedra<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >, CGAL::Default, CGAL::Default, CGAL::Default, CGAL::Default>::finalize<CGAL::internal_IOP::Triangle_segment_intersection_points<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >, CGAL::Epeck, CGAL::internal_IOP::Predicates_on_constructions, true> > ()
#2 0x00000001000dc97e in CGAL::Polyhedron_corefinement<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >, CGAL::Epeck, CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> > >::operator()<CGAL::Emptyset_iterator, std::__1::back_insert_iterator<std::__1::vector<std::__1::pair<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >*, int>, std::__1::allocator<std::__1::pair<CGAL::Polyhedron_3<CGAL::Epeck, SFCGAL::detail::Items_with_mark_on_hedge, CGAL::HalfedgeDS_default, std::__1::allocator<int> >*, int> > > > > ()
#3 0x0000000100264a06 in SFCGAL::algorithm::_intersection_solid_solid ()
#4 0x00000001002446d3 in CGAL::Box_intersection_d::modified_two_way_scan<std::__1::__wrap_iter<CGAL::Box_intersection_d::Box_with_handle_d<double, 3, SFCGAL::detail::PrimitiveHandle<3>*, CGAL::Box_intersection_d::ID_FROM_HANDLE>*>, std::__1::__wrap_iter<CGAL::Box_intersection_d::Box_with_handle_d<double, 3, SFCGAL::detail::PrimitiveHandle<3>*, CGAL::Box_intersection_d::ID_FROM_HANDLE>*>, SFCGAL::algorithm::intersection_cb<3>, CGAL::Box_intersection_d::Predicate_traits_d<CGAL::Box_intersection_d::Box_traits_d<CGAL::Box_intersection_d::Box_with_handle_d<double, 3, SFCGAL::detail::PrimitiveHandle<3>*, CGAL::Box_intersection_d::ID_FROM_HANDLE> >, true> > ()
#5 0x0000000100243bc1 in CGAL::Box_intersection_d::segment_tree<std::__1::__wrap_iter<CGAL::Box_intersection_d::Box_with_handle_d<double, 3, SFCGAL::detail::PrimitiveHandle<3>*, CGAL::Box_intersection_d::ID_FROM_HANDLE>*>, std::__1::__wrap_iter<CGAL::Box_intersection_d::Box_with_handle_d<double, 3, SFCGAL::detail::PrimitiveHandle<3>*, CGAL::Box_intersection_d::ID_FROM_HANDLE>*>, SFCGAL::algorithm::intersection_cb<3>, double, CGAL::Box_intersection_d::Predicate_traits_d<CGAL::Box_intersection_d::Box_traits_d<CGAL::Box_intersection_d::Box_with_handle_d<double, 3, SFCGAL::detail::PrimitiveHandle<3>*, CGAL::Box_intersection_d::ID_FROM_HANDLE> >, true> > ()
#6 0x000000010024341a in SFCGAL::algorithm::intersection<3> ()
#7 0x0000000100240253 in SFCGAL::algorithm::intersection3D ()
#8 0x0000000100240d7c in SFCGAL::algorithm::intersection3D ()
#9 0x000000010001a7fb in main ()
(gdb)
I mentioned this in PostGIS ticket - http://trac.osgeo.org/postgis/ticket/2333
The issues still persists in 1.0.5. Even though its mingw I'm trying to compile on, I read on the GMP or was it MPFR that this is an issue on other platforms. So might be more because I have custom paths for GMP/MPFR why I notice this.
Linking CXX shared library libSFCGAL.dll
c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(init2.o):init2.c:(.text+0x70): undefined reference to `__gmp_get_memory_functions'
c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(clear.o):clear.c:(.text+0x1e): undefined reference to `__gmp_get_memory_functions'
c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(div.o):div.c:(.text+0x234): undefined reference to `__gmpn_divrem'
c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(round_prec.o):round_prec.c:(.text+0xa76): undefined reference to `__gmp_get_memory_functions'
c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(mulders.o):mulders.c:(.text+0x5c2): undefined reference to `__gmpn_divrem'
c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(mulders.o):mulders.c:(.text+0x94c): undefined reference to `__gmpn_divrem'
c:/ming64gcc48/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/ming64gcc48/projects/CGAL/rel-mpfr-3.1.2w64gcc48/lib/libmpfr.a(mulders.o): bad reloc address 0x0 in section `.pdata'
collect2.exe: error: ld returned 1 exit status
To fix the issue, I always have to edit the src/CMakeLists.txt
changing the order of GMP and MPFR changes so MPFR gets checked before GMP like so:
if( ${SFCGAL_WITH_MPFR} )
target_link_libraries( SFCGAL ${MPFR_LIBRARIES} )
endif( ${SFCGAL_WITH_MPFR} )
if( ${SFCGAL_WITH_GMP} )
target_link_libraries( SFCGAL ${GMP_LIBRARIES} )
endif( ${SFCGAL_WITH_GMP} )
I've noticed that changing the ABI of the core library, while retaining API compatibility, raises errors on building the benchmarks. Evidently they do not get rebuilt when the core library headers are changed.
Forcing a rebuild they do get the new definitions and build correctly.
Add st_volume to postgis
http://www.sfcgal.org/
The website says SFCGAL is distributed as LGPLv2, the link takes you to LGPLv3.
Commit ca98cdf changed all to LGPLv2+
SET postgis.backend = 'sfcgal';
SELECT
'ST_ConcaveHull Lines 0.80 holes', ST_Intersection(geom,ST_ConcaveHull(
geom, 0.80, true) ) = geom As encloses_geom,
ST_Area(ST_ConcaveHull(geom, 0.80, true)) < ST_Area(ST_ConcaveHull(geom, 0.80)) As reached_target
FROM ST_GeomFromText('MULTILINESTRING((106 164,30 112,74 70,82 112,130 94,
130 62,122 40,156 32,162 76,172 88),
(132 178,134 148,128 136,96 128,132 108,150 130,
170 142,174 110,156 96,158 90,158 88),
(22 64,66 28,94 38,94 68,114 76,112 30,
132 10,168 18,178 34,186 52,184 74,190 100,
190 122,182 148,178 170,176 184,156 164,146 178,
132 186,92 182,56 158,36 150,62 150,76 128,88 118))') As geom;
SET postgis.backend='sfcgal';
SELECT ST_Extrude(foo1.the_geom, 0.5, 0.5, 0.5) As result
FROM ((SELECT ST_Translate(the_geom,-72.2, 41.755) As the_geom
FROM (VALUES ( ST_GeomFromEWKT(
'SRID=4326;PolyhedralSurface(
((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))
)') ) ,
( ST_GeomFromEWKT(
'SRID=4326;PolyhedralSurface(
((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)) )') ) ) As foo(the_geom) ) ) As foo1 LIMIT 3;
The implementation of Covers() is very naive. It is used internally to "cleanup" geometries after splitting them into geometry sets.
There must be ways to have a better covers implementation, especially one that do not use constructions, but only predicates
I'm getting errors during the compilation under SLES 11 SP3 which I would like to fix.
Here's the full build log. Any ideas ?
I'm inserting all the patches in master since 1.0.4
[ 112s] ----------------------------------------------------------------- [ 112s] I have the following modifications for sfcgal.spec: [ 112s] ----------------------------------------------------------------- [ 112s] ----- building sfcgal.spec (user abuild) [ 112s] ----------------------------------------------------------------- [ 112s] ----------------------------------------------------------------- [ 113s] + exec rpmbuild --define 'jobs -j1' -ba --define '_srcdefattr (-,root,root)' --nosignature --define '_build_create_debug 1' /usr/src/packages/SOURCES/sfcgal.spec [ 113s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.10068 [ 113s] + umask 022 [ 113s] + cd /usr/src/packages/BUILD [ 113s] + cd /usr/src/packages/BUILD [ 113s] + rm -rf SFCGAL-1.0.4 [ 113s] + /usr/bin/gzip -dc /usr/src/packages/SOURCES/v1.0.4.tar.gz [ 113s] + tar -xf - [ 113s] + STATUS=0 [ 113s] + '[' 0 -ne 0 ']' [ 113s] + cd SFCGAL-1.0.4 [ 113s] ++ /usr/bin/id -u [ 113s] + '[' 399 = 0 ']' [ 113s] ++ /usr/bin/id -u [ 113s] + '[' 399 = 0 ']' [ 113s] + /bin/chmod -Rf a+rX,u+w,g-w,o-w . [ 113s] + echo 'Patch #1 (0001-Small-typo-changed-requiered-to-required.patch):' [ 113s] Patch #1 (0001-Small-typo-changed-requiered-to-required.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + echo 'Patch #2 (0002-Add-VERSION-and-SOVERSION-properties.patch):' [ 113s] Patch #2 (0002-Add-VERSION-and-SOVERSION-properties.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + echo 'Patch #3 (0003-Add-detection-of-lib-lib64-directory.patch):' [ 113s] Patch #3 (0003-Add-detection-of-lib-lib64-directory.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + echo 'Patch #4 (0004-Replace-lib-by-CMAKE_INSTALL_LIBDIR-in-installation-.patch):' [ 113s] Patch #4 (0004-Replace-lib-by-CMAKE_INSTALL_LIBDIR-in-installation-.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + echo 'Patch #5 (0005-Added-FindPostgreSQL.cmake-macros.patch):' [ 113s] Patch #5 (0005-Added-FindPostgreSQL.cmake-macros.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + echo 'Patch #6 (0006-fixed-unfindable-postgres-header-cmake-variable.patch):' [ 113s] Patch #6 (0006-fixed-unfindable-postgres-header-cmake-variable.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + echo 'Patch #7 (0007-fixes-polygon-triangulation.patch):' [ 113s] Patch #7 (0007-fixes-polygon-triangulation.patch): [ 113s] + patch -p1 --fuzz=0 -s [ 113s] + exit 0 [ 113s] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.51236 [ 113s] + umask 022 [ 113s] + cd /usr/src/packages/BUILD [ 113s] + /bin/rm -rf /var/tmp/sfcgal-1.0.4-build [ 113s] ++ dirname /var/tmp/sfcgal-1.0.4-build [ 113s] + /bin/mkdir -p /var/tmp [ 113s] + /bin/mkdir /var/tmp/sfcgal-1.0.4-build [ 113s] + cd SFCGAL-1.0.4 [ 113s] + mkdir _build [ 113s] + pushd _build [ 113s] /usr/src/packages/BUILD/SFCGAL-1.0.4/_build /usr/src/packages/BUILD/SFCGAL-1.0.4 [ 113s] ++ /usr/bin/pg_config --includedir [ 113s] ++ /usr/bin/pg_config --libdir [ 113s] + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SKIP_RPATH=ON -DCMAKE_NO_BUILTIN_CHRPATH=ON '-DCMAKE_C_FLAGS_RELEASE=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -g -DNDEBUG' '-DCMAKE_CXX_FLAGS_RELEASE=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -g -DNDEBUG' -DCMAKE_MODULE_LINKER_FLAGS_RELEASE= -DCMAKE_SHARED_LINKER_FLAGS_RELEASE= -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_GMP_ENABLE_CXX=ON -DSFCGAL_CHECK_VALIDITY=TRUE -DSFCGAL_BUILD_VIEWER=ON -DPOSTGRESQL_INCLUDE_DIR=/usr/include/pgsql -DPOSTGRESQL_LIBRARIES=/usr/lib/postgresql91/lib64 -DSFCGAL_BUILD_EXAMPLES=ON .. [ 113s] -- The C compiler identification is GNU 4.3.4 [ 113s] -- The CXX compiler identification is GNU 4.3.4 [ 113s] -- Check for working C compiler: /usr/bin/cc [ 113s] -- Check for working C compiler: /usr/bin/cc -- works [ 113s] -- Detecting C compiler ABI info [ 113s] -- Detecting C compiler ABI info - done [ 114s] -- Check for working CXX compiler: /usr/bin/c++ [ 114s] -- Check for working CXX compiler: /usr/bin/c++ -- works [ 114s] -- Detecting CXX compiler ABI info [ 114s] -- Detecting CXX compiler ABI info - done [ 114s] -- Boost_USE_STATIC_LIBS=OFF [ 114s] -- Boost_USE_MULTITHREAD=ON [ 114s] -- Boost version: 1.49.0 [ 114s] -- Found the following Boost libraries: [ 114s] -- program_options [ 114s] -- chrono [ 114s] -- filesystem [ 114s] -- timer [ 114s] -- date_time [ 114s] -- thread [ 114s] -- system [ 114s] -- serialization [ 114s] -- Found GMP: /usr/include [ 114s] -- GMP_INCLUDE_DIRS = /usr/include [ 114s] -- GMP_LIBRARIES = /usr/lib64/libgmp.so [ 114s] -- Found MPFR: /usr/include [ 114s] -- MPFR_INCLUDE_DIRS = /usr/include [ 114s] -- MPFR_LIBRARIES = /usr/lib64/libmpfr.so [ 114s] -- Found CGAL: /usr/include (Required is at least version "4.1") [ 114s] -- CGAL 4.3 found [ 114s] -- Found osgDB: /usr/lib64/libosgDB.so [ 114s] -- Found osgUtil: /usr/lib64/libosgUtil.so [ 114s] -- Found osg: /usr/lib64/libosg.so [ 114s] -- Found OpenThreads: /usr/lib64/libOpenThreads.so [ 114s] -- Found OpenSceneGraph: /usr/lib64/libosgDB.so;/usr/lib64/libosgUtil.so;/usr/lib64/libosg.so;/usr/lib64/libOpenThreads.so (found version "3.2.0") [ 114s] -- Looking for Q_WS_X11 [ 114s] -- Looking for Q_WS_X11 - found [ 114s] -- Looking for Q_WS_WIN [ 116s] -- Looking for Q_WS_WIN - not found [ 116s] -- Looking for Q_WS_QWS [ 116s] -- Looking for Q_WS_QWS - not found [ 116s] -- Looking for Q_WS_MAC [ 116s] -- Looking for Q_WS_MAC - not found [ 116s] -- Found Qt4: /usr/bin/qmake (found version "4.6.3") [ 116s] -- Found osgQt: /usr/lib64/libosgQt.so [ 116s] -- Found osgViewer: /usr/lib64/libosgViewer.so [ 116s] -- Found osgGA: /usr/lib64/libosgGA.so [ 116s] -- Found OpenSceneGraph: /usr/lib64/libosgDB.so;/usr/lib64/libosgUtil.so;/usr/lib64/libosg.so;/usr/lib64/libOpenThreads.so;/usr/lib64/libosgQt.so;/usr/lib64/libosgViewer.so;/usr/lib64/libosgGA.so;optimized;/usr/lib64/libosgDB.so;debug;/usr/lib64/libosgDB.so;optimized;/usr/lib64/libosgUtil.so;debug;/usr/lib64/libosgUtil.so;optimized;/usr/lib64/libosg.so;debug;/usr/lib64/libosg.so;/usr/lib64/libOpenThreads.so (found version "3.2.0") [ 116s] -- Enabled PostgreSQL: /usr/include/pgsql, /usr/lib/postgresql91/lib64 [ 116s] -- Configuring done [ 116s] -- Generating done [ 116s] CMake Warning: [ 116s] Manually-specified variables were not used by the project: [ 116s] [ 116s] CMAKE_C_FLAGS_RELEASE [ 116s] CMAKE_GMP_ENABLE_CXX [ 116s] CMAKE_MODULE_LINKER_FLAGS_RELEASE [ 116s] CMAKE_NO_BUILTIN_CHRPATH [ 116s] [ 116s] [ 116s] -- Build files have been written to: /usr/src/packages/BUILD/SFCGAL-1.0.4/_build [ 116s] + make VERBOSE=1 -j2 [ 116s] /usr/bin/cmake -H/usr/src/packages/BUILD/SFCGAL-1.0.4 -B/usr/src/packages/BUILD/SFCGAL-1.0.4/_build --check-build-system CMakeFiles/Makefile.cmake 0 [ 116s] /usr/bin/cmake -E cmake_progress_start /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/CMakeFiles /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/CMakeFiles/progress.marks [ 116s] make -f CMakeFiles/Makefile2 all [ 116s] make[1]: Entering directory `/usr/src/packages/BUILD/SFCGAL-1.0.4/_build' [ 116s] make -f src/CMakeFiles/SFCGAL.dir/build.make src/CMakeFiles/SFCGAL.dir/depend [ 116s] make[2]: Entering directory `/usr/src/packages/BUILD/SFCGAL-1.0.4/_build' [ 116s] cd /usr/src/packages/BUILD/SFCGAL-1.0.4/_build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /usr/src/packages/BUILD/SFCGAL-1.0.4 /usr/src/packages/BUILD/SFCGAL-1.0.4/src /usr/src/packages/BUILD/SFCGAL-1.0.4/_build /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src/CMakeFiles/SFCGAL.dir/DependInfo.cmake --color= [ 116s] Dependee "/usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src/CMakeFiles/SFCGAL.dir/DependInfo.cmake" is newer than depender "/usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src/CMakeFiles/SFCGAL.dir/depend.internal". [ 116s] Dependee "/usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src/CMakeFiles/SFCGAL.dir/depend.internal". [ 116s] Scanning dependencies of target SFCGAL [ 116s] make[2]: Leaving directory `/usr/src/packages/BUILD/SFCGAL-1.0.4/_build' [ 116s] make -f src/CMakeFiles/SFCGAL.dir/build.make src/CMakeFiles/SFCGAL.dir/build [ 120s] make[2]: Entering directory `/usr/src/packages/BUILD/SFCGAL-1.0.4/_build' [ 120s] /usr/bin/cmake -E cmake_progress_report /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/CMakeFiles [ 120s] /usr/bin/cmake -E cmake_progress_report /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/CMakeFiles 1 [ 120s] [ 0%] [ 1%] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Solid.cpp.o [ 120s] cd /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src && /usr/bin/c++ -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DCGAL_INTERSECTION_VERSION=1 -DSFCGAL_BUILD_SHARED -DSFCGAL_EXPORTS -Wall -Wextra -Wno-long-long -pedantic -Wpointer-arith -Wcast-align -Wcast-qual -Wno-overloaded-virtual -Wformat=2 -Winit-self -Wmissing-include-dirs -Wwrite-strings -Wno-error=undef -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -g -DNDEBUG -fPIC -I/usr/src/packages/BUILD/SFCGAL-1.0.4/include -I/usr/src/packages/BUILD/SFCGAL-1.0.4/patches/CGAL-4.3 -o CMakeFiles/SFCGAL.dir/SFCGAL/Solid.cpp.o -c /usr/src/packages/BUILD/SFCGAL-1.0.4/src/SFCGAL/Solid.cpp [ 120s] Building CXX object src/CMakeFiles/SFCGAL.dir/SFCGAL/Point.cpp.o [ 120s] cd /usr/src/packages/BUILD/SFCGAL-1.0.4/_build/src && /usr/bin/c++ -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DCGAL_INTERSECTION_VERSION=1 -DSFCGAL_BUILD_SHARED -DSFCGAL_EXPORTS -Wall -Wextra -Wno-long-long -pedantic -Wpointer-arith -Wcast-align -Wcast-qual -Wno-overloaded-virtual -Wformat=2 -Winit-self -Wmissing-include-dirs -Wwrite-strings -Wno-error=undef -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -g -DNDEBUG -fPIC -I/usr/src/packages/BUILD/SFCGAL-1.0.4/include -I/usr/src/packages/BUILD/SFCGAL-1.0.4/patches/CGAL-4.3 -o CMakeFiles/SFCGAL.dir/SFCGAL/Point.cpp.o -c /usr/src/packages/BUILD/SFCGAL-1.0.4/src/SFCGAL/Point.cpp [ 122s] In file included from /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/Point.h:27, [ 122s] from /usr/src/packages/BUILD/SFCGAL-1.0.4/src/SFCGAL/Point.cpp:21: [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:135: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:139: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:143: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:147: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:151: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:155: error: using 'typename' outside of template [ 122s] In file included from /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/Point.h:27, [ 122s] from /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/PolyhedralSurface.h:30, [ 122s] from /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/Solid.h:32, [ 122s] from /usr/src/packages/BUILD/SFCGAL-1.0.4/src/SFCGAL/Solid.cpp:21: [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:135: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:139: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:143: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:147: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:151: error: using 'typename' outside of template [ 122s] /usr/src/packages/BUILD/SFCGAL-1.0.4/include/SFCGAL/detail/TypeForDimension.h:155: error: using 'typename' outside of template [ 123s] make[2]: *** [src/CMakeFiles/SFCGAL.dir/SFCGAL/Point.cpp.o] Error 1 [ 123s] make[2]: *** Waiting for unfinished jobs.... [ 123s] make[2]: *** [src/CMakeFiles/SFCGAL.dir/SFCGAL/Solid.cpp.o] Error 1 [ 123s] make[2]: Leaving directory `/usr/src/packages/BUILD/SFCGAL-1.0.4/_build' [ 123s] make[1]: *** [src/CMakeFiles/SFCGAL.dir/all] Error 2 [ 123s] make[1]: Leaving directory `/usr/src/packages/BUILD/SFCGAL-1.0.4/_build' [ 123s] make: *** [all] Error 2 [ 123s] error: Bad exit status from /var/tmp/rpm-tmp.51236 (%build) [ 123s] [ 123s] [ 123s] RPM build errors: [ 123s] Bad exit status from /var/tmp/rpm-tmp.51236 (%build) [ 126s] [ 111.150587] reboot: Power down
Test the case where a non-convex volume intersects a convex volume where the result should be 2 volumes. In Intersection3d.cpp we only take the first volume, I suspect a bug.
I think it's a bug in CGAL but i'm not sure.
this query :
select ST_StraightSkeleton(ST_GeomFromText('POLYGON((1347259.25 7184745.94,1347273.17 7184758.16,1347280.39 7184749.95,1347278.04 7184747.88,1347281.66 7184743.76,1347284.01 7184745.83,1347293.5 7184735.05,1347279.61 7184722.85,1347269.29 7184734.6,1347270.35 7184735.51,1347267.31 7184738.96,1347266.22 7184738.01,1347259.25 7184745.94),(1347267.31 7184738.96,1347269.31 7184736.7,1347272.57 7184739.55,1347270.56 7184741.83,1347267.31 7184738.96))'))
makes postgresql crash
I'm using postgresql 9.4 with PostGIS 2.1.7 and sfcgal 1.1.0 with cgal 4.6
server process (PID 2621) was terminated by signal 11: Segmentation fault
Our triangulation seem to sometime outputs strange polygons.
It may be linked to the way the plane of projection is computed (strange normal computation).
To be investigated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.