libigl v2.5.0
Loading...
Searching...
No Matches
signed_distance.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8#ifndef IGL_SIGNED_DISTANCE_H
9#define IGL_SIGNED_DISTANCE_H
10
11#include "igl_inline.h"
12#include "AABB.h"
13#include "WindingNumberAABB.h"
14#include "fast_winding_number.h"
15#include <Eigen/Core>
16#include <vector>
17namespace igl
18{
53 template <
54 typename DerivedP,
55 typename DerivedV,
56 typename DerivedF,
57 typename DerivedS,
58 typename DerivedI,
59 typename DerivedC,
60 typename DerivedN>
62 const Eigen::MatrixBase<DerivedP> & P,
63 const Eigen::MatrixBase<DerivedV> & V,
64 const Eigen::MatrixBase<DerivedF> & F,
65 const SignedDistanceType sign_type,
66 const typename DerivedV::Scalar lower_bound,
67 const typename DerivedV::Scalar upper_bound,
68 Eigen::PlainObjectBase<DerivedS> & S,
69 Eigen::PlainObjectBase<DerivedI> & I,
70 Eigen::PlainObjectBase<DerivedC> & C,
71 Eigen::PlainObjectBase<DerivedN> & N);
73 template <
74 typename DerivedP,
75 typename DerivedV,
76 typename DerivedF,
77 typename DerivedS,
78 typename DerivedI,
79 typename DerivedC,
80 typename DerivedN>
82 const Eigen::MatrixBase<DerivedP> & P,
83 const Eigen::MatrixBase<DerivedV> & V,
84 const Eigen::MatrixBase<DerivedF> & F,
85 const SignedDistanceType sign_type,
86 Eigen::PlainObjectBase<DerivedS> & S,
87 Eigen::PlainObjectBase<DerivedI> & I,
88 Eigen::PlainObjectBase<DerivedC> & C,
89 Eigen::PlainObjectBase<DerivedN> & N);
103 template <
104 typename DerivedV,
105 typename DerivedF,
106 typename DerivedFN,
107 typename DerivedVN,
108 typename DerivedEN,
109 typename DerivedEMAP,
110 typename Derivedq>
111 IGL_INLINE typename DerivedV::Scalar signed_distance_pseudonormal(
112 const AABB<DerivedV,3> & tree,
113 const Eigen::MatrixBase<DerivedV> & V,
114 const Eigen::MatrixBase<DerivedF> & F,
115 const Eigen::MatrixBase<DerivedFN> & FN,
116 const Eigen::MatrixBase<DerivedVN> & VN,
117 const Eigen::MatrixBase<DerivedEN> & EN,
118 const Eigen::MatrixBase<DerivedEMAP> & EMAP,
119 const Eigen::MatrixBase<Derivedq> & q);
123 template <
124 typename DerivedP,
125 typename DerivedV,
126 typename DerivedF,
127 typename DerivedFN,
128 typename DerivedVN,
129 typename DerivedEN,
130 typename DerivedEMAP,
131 typename DerivedS,
132 typename DerivedI,
133 typename DerivedC,
134 typename DerivedN>
136 const Eigen::MatrixBase<DerivedP> & P,
137 const Eigen::MatrixBase<DerivedV> & V,
138 const Eigen::MatrixBase<DerivedF> & F,
139 const AABB<DerivedV,3> & tree,
140 const Eigen::MatrixBase<DerivedFN> & FN,
141 const Eigen::MatrixBase<DerivedVN> & VN,
142 const Eigen::MatrixBase<DerivedEN> & EN,
143 const Eigen::MatrixBase<DerivedEMAP> & EMAP,
144 Eigen::PlainObjectBase<DerivedS> & S,
145 Eigen::PlainObjectBase<DerivedI> & I,
146 Eigen::PlainObjectBase<DerivedC> & C,
147 Eigen::PlainObjectBase<DerivedN> & N);
157 template <
158 typename DerivedV,
159 typename DerivedF,
160 typename DerivedFN,
161 typename DerivedVN,
162 typename DerivedEN,
163 typename DerivedEMAP,
164 typename Derivedq,
165 typename Scalar,
166 typename Derivedc,
167 typename Derivedn>
169 const AABB<DerivedV,3> & tree,
170 const Eigen::MatrixBase<DerivedV> & V,
171 const Eigen::MatrixBase<DerivedF> & F,
172 const Eigen::MatrixBase<DerivedFN> & FN,
173 const Eigen::MatrixBase<DerivedVN> & VN,
174 const Eigen::MatrixBase<DerivedEN> & EN,
175 const Eigen::MatrixBase<DerivedEMAP> & EMAP,
176 const Eigen::MatrixBase<Derivedq> & q,
177 Scalar & s,
178 Scalar & sqrd,
179 int & i,
180 Eigen::PlainObjectBase<Derivedc> & c,
181 Eigen::PlainObjectBase<Derivedn> & n);
183 template <
184 typename DerivedV,
185 typename DerivedE,
186 typename DerivedEN,
187 typename DerivedVN,
188 typename Derivedq,
189 typename Scalar,
190 typename Derivedc,
191 typename Derivedn>
193 const AABB<DerivedV,2> & tree,
194 const Eigen::MatrixBase<DerivedV> & V,
195 const Eigen::MatrixBase<DerivedE> & E,
196 const Eigen::MatrixBase<DerivedEN> & EN,
197 const Eigen::MatrixBase<DerivedVN> & VN,
198 const Eigen::MatrixBase<Derivedq> & q,
199 Scalar & s,
200 Scalar & sqrd,
201 int & i,
202 Eigen::PlainObjectBase<Derivedc> & c,
203 Eigen::PlainObjectBase<Derivedn> & n);
212 template <
213 typename DerivedV,
214 typename DerivedF,
215 typename Derivedq>
217 const AABB<DerivedV,3> & tree,
218 const Eigen::MatrixBase<DerivedV> & V,
219 const Eigen::MatrixBase<DerivedF> & F,
221 const Eigen::MatrixBase<Derivedq> & q);
227 template <
228 typename DerivedV,
229 typename DerivedF,
230 typename Derivedq,
231 typename Scalar,
232 typename Derivedc>
234 const AABB<DerivedV,3> & tree,
235 const Eigen::MatrixBase<DerivedV> & V,
236 const Eigen::MatrixBase<DerivedF> & F,
238 const Eigen::MatrixBase<Derivedq> & q,
239 Scalar & s,
240 Scalar & sqrd,
241 int & i,
242 Eigen::PlainObjectBase<Derivedc> & c);
244 template <
245 typename DerivedV,
246 typename DerivedF,
247 typename Derivedq,
248 typename Scalar,
249 typename Derivedc>
251 const AABB<DerivedV,2> & tree,
252 const Eigen::MatrixBase<DerivedV> & V,
253 const Eigen::MatrixBase<DerivedF> & F,
254 const Eigen::MatrixBase<Derivedq> & q,
255 Scalar & s,
256 Scalar & sqrd,
257 int & i,
258 Eigen::PlainObjectBase<Derivedc> & c);
278 template <
279 typename DerivedP,
280 typename DerivedV,
281 typename DerivedF,
282 typename DerivedS>
284 const Eigen::MatrixBase<DerivedP> & P,
285 const Eigen::MatrixBase<DerivedV> & V,
286 const Eigen::MatrixBase<DerivedF> & F,
287 const AABB<DerivedV,3> & tree,
288 const igl::FastWindingNumberBVH & fwn_bvh,
289 Eigen::PlainObjectBase<DerivedS> & S
290 );
302 template <
303 typename Derivedq,
304 typename DerivedV,
305 typename DerivedF>
307 const Eigen::MatrixBase<Derivedq> & q,
308 const Eigen::MatrixBase<DerivedV> & V,
309 const Eigen::MatrixBase<DerivedF> & F,
310 const AABB<DerivedV,3> & tree,
311 const igl::FastWindingNumberBVH & fwn_bvh
312 );
313}
314
315#ifndef IGL_STATIC_LIBRARY
316# include "signed_distance.cpp"
317#endif
318
319#endif
Implementation of semi-general purpose axis-aligned bounding box hierarchy.
Definition AABB.h:30
Class for building an AABB tree to implement the divide and conquer algorithm described in [Jacobson ...
Definition WindingNumberAABB.h:26
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
void signed_distance(const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const SignedDistanceType sign_type, const typename DerivedV::Scalar lower_bound, const typename DerivedV::Scalar upper_bound, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedN > &N)
Computes signed distance to a mesh.
DerivedV::Scalar signed_distance_pseudonormal(const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedFN > &FN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< Derivedq > &q)
Computes signed distance to mesh using pseudonormal with precomputed AABB tree and edge/vertice norma...
DerivedV::Scalar signed_distance_winding_number(const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const igl::WindingNumberAABB< Derivedq, DerivedV, DerivedF > &hier, const Eigen::MatrixBase< Derivedq > &q)
Computes signed distance to mesh using winding number with precomputed AABB.
void signed_distance_fast_winding_number(const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const AABB< DerivedV, 3 > &tree, const igl::FastWindingNumberBVH &fwn_bvh, Eigen::PlainObjectBase< DerivedS > &S)
Calculates signed distance at query points P, using fast winding number for sign.
SignedDistanceType
Types of signing a distance field.
Definition signed_distance.h:21
@ SIGNED_DISTANCE_TYPE_WINDING_NUMBER
Use winding number [Jacobson, Kavan Sorking-Hornug 2013].
Definition signed_distance.h:25
@ SIGNED_DISTANCE_TYPE_UNSIGNED
Unsigned (absolute value)
Definition signed_distance.h:29
@ SIGNED_DISTANCE_TYPE_DEFAULT
Default.
Definition signed_distance.h:27
@ NUM_SIGNED_DISTANCE_TYPE
Total number of signed distance types.
Definition signed_distance.h:33
@ SIGNED_DISTANCE_TYPE_FAST_WINDING_NUMBER
Use Fast winding number [Barill, Dickson, Schmidt, Levin, Jacobson 2018].
Definition signed_distance.h:31
@ SIGNED_DISTANCE_TYPE_PSEUDONORMAL
Use fast pseudo-normal test [Bærentzen & Aanæs 2005].
Definition signed_distance.h:23