vtreem / carve Goto Github PK
View Code? Open in Web Editor NEWCarve is a fast, robust constructive solid geometry library. (fork from https://code.google.com/p/carve/)
License: Other
Carve is a fast, robust constructive solid geometry library. (fork from https://code.google.com/p/carve/)
License: Other
Hi,
I had trouble building this on Ubuntu 15.04 64 bit
$ make
Making all in lib
make[1]: Entering directory '/mnt/data/home/stu/projects/external/Carve/lib'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT aabb.lo -MD -MP -MF .deps/aabb.Tpo -c -o aabb.lo aabb.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT aabb.lo -MD -MP -MF .deps/aabb.Tpo -c aabb.cpp -fPIC -DPIC -o .libs/aabb.o
In file included from /usr/include/c++/4.9/ext/hash_map:60:0,
from ../include/carve/collection/unordered/libstdcpp_impl.hpp:19,
from ../include/carve/collection/unordered.hpp:33,
from ../include/carve/collection.hpp:20,
from ../include/carve/carve.hpp:51,
from ../include/carve/aabb.hpp:19,
from aabb.cpp:22:
/usr/include/c++/4.9/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT aabb.lo -MD -MP -MF .deps/aabb.Tpo -c aabb.cpp -o aabb.o >/dev/null 2>&1
mv -f .deps/aabb.Tpo .deps/aabb.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT carve.lo -MD -MP -MF .deps/carve.Tpo -c -o carve.lo carve.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT carve.lo -MD -MP -MF .deps/carve.Tpo -c carve.cpp -fPIC -DPIC -o .libs/carve.o
In file included from /usr/include/c++/4.9/ext/hash_map:60:0,
from ../include/carve/collection/unordered/libstdcpp_impl.hpp:19,
from ../include/carve/collection/unordered.hpp:33,
from ../include/carve/collection.hpp:20,
from ../include/carve/carve.hpp:51,
from carve.cpp:22:
/usr/include/c++/4.9/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT carve.lo -MD -MP -MF .deps/carve.Tpo -c carve.cpp -o carve.o >/dev/null 2>&1
mv -f .deps/carve.Tpo .deps/carve.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT convex_hull.lo -MD -MP -MF .deps/convex_hull.Tpo -c -o convex_hull.lo convex_hull.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../include -I../include/carve -I../include -g -O2 -MT convex_hull.lo -MD -MP -MF .deps/convex_hull.Tpo -c convex_hull.cpp -fPIC -DPIC -o .libs/convex_hull.o
In file included from /usr/include/c++/4.9/ext/hash_map:60:0,
from ../include/carve/collection/unordered/libstdcpp_impl.hpp:19,
from ../include/carve/collection/unordered.hpp:33,
from ../include/carve/collection.hpp:20,
from ../include/carve/carve.hpp:51,
from ../include/carve/csg.hpp:24,
from convex_hull.cpp:22:
/usr/include/c++/4.9/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
In file included from ../include/carve/mesh.hpp:27:0,
from ../include/carve/csg.hpp:28,
from convex_hull.cpp:22:
../include/carve/rtree.hpp:230:29: error: 'uint32_t' has not been declared
uint32_t dim_mask,
^
In file included from ../include/carve/mesh.hpp:874:0,
from ../include/carve/csg.hpp:28,
from convex_hull.cpp:22:
../include/carve/mesh_impl.hpp:37:17: error: 'ptrdiff_t' does not name a type
typedef ptrdiff_t difference_type;
^
In file included from ../include/carve/csg.hpp:32:0,
from convex_hull.cpp:22:
../include/carve/iobj.hpp:36:9: error: 'intptr_t' does not name a type
intptr_t val;
^
../include/carve/iobj.hpp: In constructor 'carve::csg::IObj::IObj()':
../include/carve/iobj.hpp:39:37: error: class 'carve::csg::IObj' does not have any field named 'val'
IObj() : obtype(OBTYPE_NONE), val(0) { }
^
../include/carve/iobj.hpp: In member function 'size_t carve::csg::IObj_hash::operator()(const carve::csg::IObj&) const':
../include/carve/iobj.hpp:50:26: error: 'const struct carve::csg::IObj' has no member named 'val'
return (size_t)i.val;
^
../include/carve/iobj.hpp: In member function 'size_t carve::csg::IObj_hash::operator()(const std::pair<const carve::csg::IObj, const carve::csg::IObj>&) const':
../include/carve/iobj.hpp:53:32: error: 'const struct carve::csg::IObj' has no member named 'val'
return (size_t)i.first.val ^ (size_t)i.second.val;
^
../include/carve/iobj.hpp:53:55: error: 'const struct carve::csg::IObj' has no member named 'val'
return (size_t)i.first.val ^ (size_t)i.second.val;
^
../include/carve/iobj.hpp: In function 'bool carve::csg::operator==(const carve::csg::IObj&, const carve::csg::IObj&)':
../include/carve/iobj.hpp:71:40: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype == b.obtype && a.val == b.val;
^
../include/carve/iobj.hpp:71:49: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype == b.obtype && a.val == b.val;
^
../include/carve/iobj.hpp: In function 'bool carve::csg::operator!=(const carve::csg::IObj&, const carve::csg::IObj&)':
../include/carve/iobj.hpp:75:40: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype != b.obtype || a.val != b.val;
^
../include/carve/iobj.hpp:75:49: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype != b.obtype || a.val != b.val;
^
../include/carve/iobj.hpp: In function 'bool carve::csg::operator<(const carve::csg::IObj&, const carve::csg::IObj&)':
../include/carve/iobj.hpp:79:64: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype < b.obtype || (a.obtype == b.obtype && a.val < b.val);
^
../include/carve/iobj.hpp:79:72: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype < b.obtype || (a.obtype == b.obtype && a.val < b.val);
^
../include/carve/iobj.hpp: In function 'bool carve::csg::operator<=(const carve::csg::IObj&, const carve::csg::IObj&)':
../include/carve/iobj.hpp:83:64: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype < b.obtype || (a.obtype == b.obtype && a.val <= b.val);
^
../include/carve/iobj.hpp:83:73: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype < b.obtype || (a.obtype == b.obtype && a.val <= b.val);
^
../include/carve/iobj.hpp: In function 'bool carve::csg::operator>(const carve::csg::IObj&, const carve::csg::IObj&)':
../include/carve/iobj.hpp:87:64: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype > b.obtype || (a.obtype == b.obtype && a.val > b.val);
^
../include/carve/iobj.hpp:87:72: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype > b.obtype || (a.obtype == b.obtype && a.val > b.val);
^
../include/carve/iobj.hpp: In function 'bool carve::csg::operator>=(const carve::csg::IObj&, const carve::csg::IObj&)':
../include/carve/iobj.hpp:91:64: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype > b.obtype || (a.obtype == b.obtype && a.val >= b.val);
^
../include/carve/iobj.hpp:91:73: error: 'const struct carve::csg::IObj' has no member named 'val'
return a.obtype > b.obtype || (a.obtype == b.obtype && a.val >= b.val);
^
Makefile:470: recipe for target 'convex_hull.lo' failed
make[1]: *** [convex_hull.lo] Error 1
make[1]: Leaving directory '/mnt/data/home/stu/projects/external/Carve/lib'
Makefile:405: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
The intersection is not discarded using symmetric difference in the intersect app.
I think that SymmetricDifferenceCollector::collect should not have the following code:
else if (face_class == FACE_IN) {
REV(orig_face, vertices, normal, poly_a, face_class, hooks);
}
When I comment these lines out, I get the expected results.
Complete build output is here:
WORK-AROUNDS FOR DESPERATE PEOPLE:
If you really need to build the library - but not the test or example programs, then it can be done
without too much pain.
But everything that uses GLUT/GLUI/GLU/GLOOP or OpenGL calls is hopelessly obsolete. The code in tests and examples make OpenGL calls that haven't been allowed for a decade!
You have to change the top few lines of configure.ac to read:
AC_INIT(README, 1.4.0)
AC_CONFIG_AUX_DIR(build/autoconf)
AC_SUBST(ac_aux_dir)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src])
AM_CONFIG_HEADER(include/carve_config.h include/carve/config.h)
AM_INIT_AUTOMAKE(subdir-objects)
AC_DEFINE_UNQUOTED(CARVE_VERSION, ["${VERSION}"], [Carve version number])
...and to remove every mention of anything GL-related from configure.ac and CMakefile.txt.
Worse:
Carve appears to be using <hash_map>/<hash_set> which have been deprecated in favor of <unordered_map>/<unordered_set> - which produces a bunch of scary compilation warnings...however, it looks like you can ignore them...at least for now.
Other problems relate to accessing "protected" member functions/variables - and I didn't have time to track that down...hence the "EEEEKKK!!!!" line, below.
Adding this at the top of "include/carve/carve.hpp" was also needed to get it all to compile:
#include <bits/types.h>
typedef long int ptrdiff_t ;
typedef __intptr_t intptr_t ;
// Lots of errors due to things being accessed that are "protected"?!?
#define protected public /* (EEEEKKKK!!!!) */
Good Luck!
I get a whole bunch of errors like:
/home/Alexander_Pruss/pypolycsg/third_party/carve/include/carve/geom_impl.hpp:546:40: error: expected ‘,’ or ‘...’ before numeric constant
plane<ndim>::plane(const vector_t &_N, vector_t _p) : N(_N), d(-dot(_p, _N)) {
^
In file included from /home/Alexander_Pruss/pypolycsg/third_party/carve/include/carve/geom.hpp:367:0,
from /home/Alexander_Pruss/pypolycsg/third_party/carve/include/carve/aabb.hpp:21,
from /home/Alexander_Pruss/pypolycsg/third_party/carve/lib/aabb.cpp:22:
The problem seems to be that something that was included has defined _N, and several other variables that start with an underscore, as a numeric constant. Renaming the variables that start with an underscore in include/carve/geom*.hpp fixes the problems and results in a successful build.
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.