diff options
author | bubnikv <bubnikv@gmail.com> | 2018-10-26 17:25:47 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-10-26 17:25:47 +0300 |
commit | 135ee60db45cca3da233eaae644d9da5dbc4a67a (patch) | |
tree | 02742eb2e4758903c2726b250030591bdc48ad1d /src/igl/copyleft/cgal/hausdorff.h | |
parent | bc6901891b19c211dc095ff758154276dcc7a007 (diff) | |
parent | 7a5acd96280cc9f420da738124d93cf348741217 (diff) |
Merge branch 'dev_native' of https://github.com/prusa3d/Slic3r into dev_native
Diffstat (limited to 'src/igl/copyleft/cgal/hausdorff.h')
-rw-r--r-- | src/igl/copyleft/cgal/hausdorff.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/igl/copyleft/cgal/hausdorff.h b/src/igl/copyleft/cgal/hausdorff.h new file mode 100644 index 000000000..c377d4576 --- /dev/null +++ b/src/igl/copyleft/cgal/hausdorff.h @@ -0,0 +1,62 @@ +// This file is part of libigl, a simple c++ geometry processing library. +// +// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com> +// +// This Source Code Form is subject to the terms of the Mozilla Public License +// v. 2.0. If a copy of the MPL was not distributed with this file, You can +// obtain one at http://mozilla.org/MPL/2.0/. +#ifndef IGL_COPYLEFT_CGAL_HAUSDORFF_H +#define IGL_COPYLEFT_CGAL_HAUSDORFF_H +#include "../../igl_inline.h" + +#include <Eigen/Dense> +#include "CGAL_includes.hpp" +#include <vector> + +namespace igl +{ + namespace copyleft + { + namespace cgal + { + // Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle + // (V) and a pointset (e.g., mesh, triangle soup) given by a distance function + // handle (dist_to_B). + // + // Inputs: + // V 3 by 3 list of corner positions so that V.row(i) is the position of the + // ith corner + // treeB CGAL's AABB tree containing triangle soup (VB,FB) + // TB list of CGAL triangles in order of FB (for determining which was found + // in computation) + // Outputs: + // l lower bound on Hausdorff distance + // u upper bound on Hausdorff distance + // + template < + typename DerivedV, + typename Kernel, + typename Scalar> + IGL_INLINE void hausdorff( + const Eigen::MatrixBase<DerivedV>& V, + const CGAL::AABB_tree< + CGAL::AABB_traits<Kernel, + CGAL::AABB_triangle_primitive<Kernel, + typename std::vector<CGAL::Triangle_3<Kernel> >::iterator + > + > + > & treeB, + const std::vector<CGAL::Triangle_3<Kernel> > & TB, + Scalar & l, + Scalar & u); + } + } +} + +#ifndef IGL_STATIC_LIBRARY +# include "hausdorff.cpp" +#endif + +#endif + + |