- 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/
This commit is contained in:
parent
2660bd1ba6
commit
2bbecf479f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=291926
12 changed files with 279 additions and 0 deletions
|
@ -54,6 +54,7 @@
|
|||
SUBDIR += calcoo
|
||||
SUBDIR += calctool
|
||||
SUBDIR += cantor
|
||||
SUBDIR += carve
|
||||
SUBDIR += cblas
|
||||
SUBDIR += ccmath
|
||||
SUBDIR += cgal
|
||||
|
|
50
math/carve/Makefile
Normal file
50
math/carve/Makefile
Normal file
|
@ -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>
|
2
math/carve/distinfo
Normal file
2
math/carve/distinfo
Normal file
|
@ -0,0 +1,2 @@
|
|||
SHA256 (carve-1.4.0.tgz) = e59d28fd8e1dccb7e069ea8d89566d0073b62ae0b7836c4d872450ded14689d6
|
||||
SIZE (carve-1.4.0.tgz) = 18730114
|
31
math/carve/files/patch-CMakeLists.txt
Normal file
31
math/carve/files/patch-CMakeLists.txt
Normal file
|
@ -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)
|
11
math/carve/files/patch-common_scene.cpp
Normal file
11
math/carve/files/patch-common_scene.cpp
Normal file
|
@ -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);
|
||||
|
22
math/carve/files/patch-glu_triangulator.cpp
Normal file
22
math/carve/files/patch-glu_triangulator.cpp
Normal file
|
@ -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);
|
18
math/carve/files/patch-include_CMakeLists.txt
Normal file
18
math/carve/files/patch-include_CMakeLists.txt
Normal file
|
@ -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)
|
|
@ -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");
|
28
math/carve/files/patch-src_CMakeLists.txt
Normal file
28
math/carve/files/patch-src_CMakeLists.txt
Normal file
|
@ -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)
|
10
math/carve/files/patch-src_extrude.cpp
Normal file
10
math/carve/files/patch-src_extrude.cpp
Normal file
|
@ -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(
|
13
math/carve/pkg-descr
Normal file
13
math/carve/pkg-descr
Normal file
|
@ -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/
|
83
math/carve/pkg-plist
Normal file
83
math/carve/pkg-plist
Normal file
|
@ -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
|
Loading…
Reference in a new issue