The commit rB6f63417b500d that made exact boolean work on meshes with holes (like Suzanne) unfortunately dramatically slowed things down on other non-manifold meshes that don't have holes and didn't need the per-triangle insideness test. This adds a hole_tolerant parameter, false by default, that the user can enable to get good results on non-manifold meshes with holes. Using false for this parameter speeds up the time from 90 seconds to 10 seconds on an example with 1.2M triangles.
52 lines
1.8 KiB
C++
52 lines
1.8 KiB
C++
/*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
/** \file
|
|
* \ingroup bmesh
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
bool BM_mesh_boolean(BMesh *bm,
|
|
struct BMLoop *(*looptris)[3],
|
|
const int looptris_tot,
|
|
int (*test_fn)(BMFace *f, void *user_data),
|
|
void *user_data,
|
|
const int nshapes,
|
|
const bool use_self,
|
|
const bool keep_hidden,
|
|
const bool hole_tolerant,
|
|
const int boolean_mode);
|
|
|
|
bool BM_mesh_boolean_knife(BMesh *bm,
|
|
struct BMLoop *(*looptris)[3],
|
|
const int looptris_tot,
|
|
int (*test_fn)(BMFace *f, void *user_data),
|
|
void *user_data,
|
|
const int nshapes,
|
|
const bool use_self,
|
|
const bool use_separate_all,
|
|
const bool hole_tolerant,
|
|
const bool keep_hidden);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|