diff options
author | gahr <gahr@FreeBSD.org> | 2012-02-20 18:56:06 +0800 |
---|---|---|
committer | gahr <gahr@FreeBSD.org> | 2012-02-20 18:56:06 +0800 |
commit | 6c41e33897e27b0f4711a3acea0ccf717ece7492 (patch) | |
tree | 89463089a7e883436a3d6a1e2b09f097e78af33d /math | |
parent | 0580e895378f1ee37dae0c3bc0832260d73e999e (diff) | |
download | freebsd-ports-gnome-6c41e33897e27b0f4711a3acea0ccf717ece7492.tar.gz freebsd-ports-gnome-6c41e33897e27b0f4711a3acea0ccf717ece7492.tar.zst freebsd-ports-gnome-6c41e33897e27b0f4711a3acea0ccf717ece7492.zip |
- New port: math/carve
Carve is a C++ library designed to perform boolean operations between two
arbitrary polygonal meshes. The standard union and intersection operations
are supported, as are symmetric and asymmetric difference. It is also
possible to implement custom operations using Carve, allowing results to be
formed from any combination of inputs.
Carve supports a variety of inputs, including both closed and open surfaces,
faces with arbitrary edge counts and datasets with multiple disjoint,
embedded or touching surfaces. Carve can also interpolate arbitrary values
across faces, meaning that CSG operations need not discard colour, texture
coordinates or other data.
WWW: http://code.google.com/p/carve/
Diffstat (limited to 'math')
-rw-r--r-- | math/Makefile | 1 | ||||
-rw-r--r-- | math/carve/Makefile | 50 | ||||
-rw-r--r-- | math/carve/distinfo | 2 | ||||
-rw-r--r-- | math/carve/files/patch-CMakeLists.txt | 31 | ||||
-rw-r--r-- | math/carve/files/patch-common_scene.cpp | 11 | ||||
-rw-r--r-- | math/carve/files/patch-glu_triangulator.cpp | 22 | ||||
-rw-r--r-- | math/carve/files/patch-include_CMakeLists.txt | 18 | ||||
-rw-r--r-- | math/carve/files/patch-lib_intersect_classify_common_impl.hpp | 10 | ||||
-rw-r--r-- | math/carve/files/patch-src_CMakeLists.txt | 28 | ||||
-rw-r--r-- | math/carve/files/patch-src_extrude.cpp | 10 | ||||
-rw-r--r-- | math/carve/pkg-descr | 13 | ||||
-rw-r--r-- | math/carve/pkg-plist | 83 |
12 files changed, 279 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile index a84eec3af590..b96acdc0102a 100644 --- a/math/Makefile +++ b/math/Makefile @@ -54,6 +54,7 @@ SUBDIR += calcoo SUBDIR += calctool SUBDIR += cantor + SUBDIR += carve SUBDIR += cblas SUBDIR += ccmath SUBDIR += cgal diff --git a/math/carve/Makefile b/math/carve/Makefile new file mode 100644 index 000000000000..228573e5d27e --- /dev/null +++ b/math/carve/Makefile @@ -0,0 +1,50 @@ +# New ports collection Makefile for: carve +# Date created: 16 November 2011 +# Whom: gahr +# +# $FreeBSD$ +# + +PORTNAME= carve +PORTVERSION= 1.4.0 +CATEGORIES= math +MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} +EXTRACT_SUFX= .tgz + +MAINTAINER= gahr@FreeBSD.org +COMMENT= A fast, robust constructive solid geometry library + +LIB_DEPENDS= boost_filesystem.4:${PORTSDIR}/devel/boost-libs + +OPTIONS= GUI "Enable GUI" off + +USE_CMAKE= yes +CMAKE_OUTSOURCE=yes +USE_GL= glut +USE_LDCONFIG= yes + +LICENSE= GPLv2 + +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib + +.include <bsd.port.options.mk> + +.if defined(WITH_GUI) +LIB_DEPENDS+= glui:${PORTSDIR}/devel/glui +PLIST_SUB+= GUI="" +CMAKE_ARGS+= -DCARVE_WITH_GUI:BOOL=true +.else +CONFIGURE_ARGS+=--with-gui=no +PLIST_SUB+= GUI="@comment " +CMAKE_ARGS+= -DCARVE_WITH_GUI:BOOL=false +.endif + +post-install: + ${LN} -sf libcarve.so.${PORTVERSION} ${PREFIX}/lib/libcarve.so.${PORTVERSION:R:R} +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/carve.pdf ${DOCSDIR} +.endif + +.include <bsd.port.mk> diff --git a/math/carve/distinfo b/math/carve/distinfo new file mode 100644 index 000000000000..6474e04bab0a --- /dev/null +++ b/math/carve/distinfo @@ -0,0 +1,2 @@ +SHA256 (carve-1.4.0.tgz) = e59d28fd8e1dccb7e069ea8d89566d0073b62ae0b7836c4d872450ded14689d6 +SIZE (carve-1.4.0.tgz) = 18730114 diff --git a/math/carve/files/patch-CMakeLists.txt b/math/carve/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..c6b4903b9cae --- /dev/null +++ b/math/carve/files/patch-CMakeLists.txt @@ -0,0 +1,31 @@ +--- CMakeLists.txt.orig 2011-08-26 22:17:26.000000000 +0200 ++++ CMakeLists.txt 2012-02-17 18:00:25.000000000 +0100 +@@ -33,7 +33,7 @@ + set(HAVE_BOOST_UNORDERED_COLLECTIONS FALSE) + + if(CARVE_SYSTEM_BOOST) +- find_package(BOOST 1.40) ++ find_package(Boost 1.40) + if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) + message(STATUS "Using system boost") +@@ -94,8 +94,8 @@ + add_definitions(-DGLUI_USE_STATIC_LIB) + add_definitions(-DGLEW_STATIC) + endif(WIN32) +- add_subdirectory(external/GLEW) +- add_subdirectory(external/GLUI) ++ #add_subdirectory(external/GLEW) ++ #add_subdirectory(external/GLUI) + + endif(NOT OPENGL_FOUND) + +@@ -110,6 +110,8 @@ + ) + include_directories(${carve_BINARY_DIR}/include) + ++configure_file( ${CMAKE_SOURCE_DIR}/include/carve/cmake-config.h.in ${CMAKE_SOURCE_DIR}/include/carve/config.h) ++ + add_subdirectory(lib) + add_subdirectory(include) + add_subdirectory(common) diff --git a/math/carve/files/patch-common_scene.cpp b/math/carve/files/patch-common_scene.cpp new file mode 100644 index 000000000000..4b1bdc8c498c --- /dev/null +++ b/math/carve/files/patch-common_scene.cpp @@ -0,0 +1,11 @@ +--- common/scene.cpp.orig 2011-12-01 12:05:53.000000000 +0100 ++++ common/scene.cpp 2011-12-01 12:05:22.000000000 +0100 +@@ -412,7 +412,7 @@ + GLUI_Master.set_glutKeyboardFunc(s_key); + GLUI_Master.set_glutSpecialFunc(NULL); + GLUI_Master.set_glutMouseFunc(s_click); +- GLUI_Master.set_glutMotionFunc(s_drag); ++ //GLUI_Master.set_glutMotionFunc(s_drag); + + g_rightPanel = GLUI_Master.create_glui_subwindow(g_mainWindow, GLUI_SUBWINDOW_RIGHT); + diff --git a/math/carve/files/patch-glu_triangulator.cpp b/math/carve/files/patch-glu_triangulator.cpp new file mode 100644 index 000000000000..4eccd17262ba --- /dev/null +++ b/math/carve/files/patch-glu_triangulator.cpp @@ -0,0 +1,22 @@ +--- src/glu_triangulator.cpp.orig 2011-11-16 11:53:05.000000000 +0100 ++++ src/glu_triangulator.cpp 2011-11-16 11:55:12.000000000 +0100 +@@ -111,7 +111,7 @@ + size_t f = 0; + while (f < faces.size()) { + carve::poly::Face<3> *face = faces[f]; +- if (face->vertices.size() == 3) { ++ if (face->nVertices() == 3) { + ++f; + continue; + } +@@ -123,8 +123,8 @@ + gluTessBeginPolygon(tess, (void *)this); + gluTessBeginContour(tess); + +- for (size_t i = 0; i < face->vertices.size(); ++i) { +- gluTessVertex(tess, (GLdouble *)face->vertices[i]->v.v, (GLvoid *)face->vertices[i]); ++ for (size_t i = 0; i < face->nVertices(); ++i) { ++ gluTessVertex(tess, (GLdouble *)face->vertex(i)->v.v, (GLvoid *)face->vertex(i)); + } + + gluTessEndContour(tess); diff --git a/math/carve/files/patch-include_CMakeLists.txt b/math/carve/files/patch-include_CMakeLists.txt new file mode 100644 index 000000000000..97ced68c0727 --- /dev/null +++ b/math/carve/files/patch-include_CMakeLists.txt @@ -0,0 +1,18 @@ +--- include/CMakeLists.txt.orig 2012-02-17 18:09:09.000000000 +0100 ++++ include/CMakeLists.txt 2012-02-17 18:09:18.000000000 +0100 +@@ -3,6 +3,7 @@ + DESTINATION "${CMAKE_INSTALL_PREFIX}/include" + FILES_MATCHING + PATTERN "*.hpp" ++ PATTERN "*.h" + PATTERN "internal" EXCLUDE + REGEX "external/boost" EXCLUDE + ) +@@ -11,6 +12,7 @@ + DESTINATION "${CMAKE_INSTALL_PREFIX}/include" + FILES_MATCHING + PATTERN "*.hpp" ++ PATTERN "*.h" + PATTERN "internal" EXCLUDE + ) + endif(CARVE_SYSTEM_BOOST) diff --git a/math/carve/files/patch-lib_intersect_classify_common_impl.hpp b/math/carve/files/patch-lib_intersect_classify_common_impl.hpp new file mode 100644 index 000000000000..0a54405bf2ea --- /dev/null +++ b/math/carve/files/patch-lib_intersect_classify_common_impl.hpp @@ -0,0 +1,10 @@ +--- lib/intersect_classify_common_impl.hpp.orig 2011-12-06 12:41:50.000000000 +0100 ++++ lib/intersect_classify_common_impl.hpp 2011-12-06 12:41:59.000000000 +0100 +@@ -250,6 +250,7 @@ + std::cerr << "d = " << d << std::endl; + #endif + fc = d < 0 ? FACE_IN : FACE_OUT; ++ break; + } + default: + CARVE_FAIL("unhandled switch case -- should not happen"); diff --git a/math/carve/files/patch-src_CMakeLists.txt b/math/carve/files/patch-src_CMakeLists.txt new file mode 100644 index 000000000000..3cd8c7363f5d --- /dev/null +++ b/math/carve/files/patch-src_CMakeLists.txt @@ -0,0 +1,28 @@ +--- src/CMakeLists.txt.orig 2011-08-26 22:17:26.000000000 +0200 ++++ src/CMakeLists.txt 2012-02-17 11:06:58.000000000 +0100 +@@ -1,7 +1,7 @@ + include_directories("${carve_SOURCE_DIR}/include") + include_directories("${carve_SOURCE_DIR}/external/GLOOP/include") +-include_directories("${carve_SOURCE_DIR}/external/GLEW/include") +-include_directories("${carve_SOURCE_DIR}/external/GLUI/include") ++#include_directories("${carve_SOURCE_DIR}/external/GLEW/include") ++#include_directories("${carve_SOURCE_DIR}/external/GLUI/include") + include_directories("${carve_SOURCE_DIR}/common") + include_directories(${OPENGL_INCLUDE_DIR}) + +@@ -20,7 +20,7 @@ + if(CARVE_WITH_GUI) + add_executable (view view.cpp) + target_link_libraries(view carve_fileformats carve_misc carve_ui carve gloop_model glui ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES}) +- install(TARGETS view RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") ++ install(TARGETS view RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/carve") + endif(CARVE_WITH_GUI) + + add_executable (triangulate triangulate.cpp) +@@ -43,5 +43,5 @@ + + foreach(tgt intersect triangulate convert) + install(TARGETS ${tgt} +- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") ++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/carve") + endforeach(tgt) diff --git a/math/carve/files/patch-src_extrude.cpp b/math/carve/files/patch-src_extrude.cpp new file mode 100644 index 000000000000..8618cb8fe5c5 --- /dev/null +++ b/math/carve/files/patch-src_extrude.cpp @@ -0,0 +1,10 @@ +--- src/extrude.cpp.orig 2011-12-01 11:57:16.000000000 +0100 ++++ src/extrude.cpp 2011-12-01 11:59:06.000000000 +0100 +@@ -31,6 +31,7 @@ + #include "write_ply.hpp" + + #include <iostream> ++#include <stdexcept> + + template<unsigned ndim> + carve::geom::vector<ndim> lerp( diff --git a/math/carve/pkg-descr b/math/carve/pkg-descr new file mode 100644 index 000000000000..abd5a8248a27 --- /dev/null +++ b/math/carve/pkg-descr @@ -0,0 +1,13 @@ +Carve is a C++ library designed to perform boolean operations between two +arbitrary polygonal meshes. The standard union and intersection operations are +supported, as are symmetric and asymmetric difference. It is also possible to +implement custom operations using Carve, allowing results to be formed from any +combination of inputs. + +Carve supports a variety of inputs, including both closed and open surfaces, +faces with arbitrary edge counts and datasets with multiple disjoint, +embedded or touching surfaces. Carve can also interpolate arbitrary +values across faces, meaning that CSG operations need not discard colour, +texture coordinates or other data. + +WWW: http://code.google.com/p/carve/ diff --git a/math/carve/pkg-plist b/math/carve/pkg-plist new file mode 100644 index 000000000000..c85252940234 --- /dev/null +++ b/math/carve/pkg-plist @@ -0,0 +1,83 @@ +%%GUI%%bin/carve/view +bin/carve/intersect +bin/carve/triangulate +bin/carve/convert +lib/libcarve.so.1.4.0 +lib/libcarve.so.1.4 +lib/libcarve.so.1 +lib/libcarve.so +include/carve/aabb.hpp +include/carve/carve.hpp +include/carve/cbrt.h +include/carve/classification.hpp +include/carve/collection.hpp +include/carve/collection/unordered.hpp +include/carve/collection/unordered/boost_impl.hpp +include/carve/collection/unordered/fallback_impl.hpp +include/carve/collection/unordered/libstdcpp_impl.hpp +include/carve/collection/unordered/std_impl.hpp +include/carve/collection/unordered/tr1_impl.hpp +include/carve/collection/unordered/vcpp_impl.hpp +include/carve/collection_types.hpp +include/carve/colour.hpp +include/carve/config.h +include/carve/convex_hull.hpp +include/carve/csg.hpp +include/carve/csg_triangulator.hpp +include/carve/debug_hooks.hpp +include/carve/djset.hpp +include/carve/edge_decl.hpp +include/carve/edge_impl.hpp +include/carve/face_decl.hpp +include/carve/face_impl.hpp +include/carve/faceloop.hpp +include/carve/geom.hpp +include/carve/geom2d.hpp +include/carve/geom3d.hpp +include/carve/gnu_cxx.h +include/carve/heap.hpp +include/carve/input.hpp +include/carve/interpolator.hpp +include/carve/intersection.hpp +include/carve/iobj.hpp +include/carve/kd_node.hpp +include/carve/math.hpp +include/carve/math_constants.hpp +include/carve/matrix.hpp +include/carve/octree_decl.hpp +include/carve/octree_impl.hpp +include/carve/pointset.hpp +include/carve/pointset_decl.hpp +include/carve/pointset_impl.hpp +include/carve/pointset_iter.hpp +include/carve/poly.hpp +include/carve/poly_decl.hpp +include/carve/poly_impl.hpp +include/carve/polyhedron_base.hpp +include/carve/polyhedron_decl.hpp +include/carve/polyhedron_impl.hpp +include/carve/polyline.hpp +include/carve/polyline_decl.hpp +include/carve/polyline_impl.hpp +include/carve/polyline_iter.hpp +include/carve/rescale.hpp +include/carve/spacetree.hpp +include/carve/tag.hpp +include/carve/timing.hpp +include/carve/tree.hpp +include/carve/triangulator.hpp +include/carve/triangulator_impl.hpp +include/carve/util.hpp +include/carve/vcpp_config.h +include/carve/vector.hpp +include/carve/vertex_decl.hpp +include/carve/vertex_impl.hpp +include/carve/win32.h +include/carve/xcode_config.h +%%PORTDOCS%%%%DOCSDIR%%/carve.pdf +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm include/carve/external +@dirrm include/carve/collection/unordered +@dirrm include/carve/collection +@dirrm include/carve +@dirrm bin/carve |