Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tools
frackit
Commits
e4fdc870
Commit
e4fdc870
authored
Jan 20, 2020
by
Dennis Gläser
Browse files
[occ][brep] add convenience function for fuse
parent
4a8eb499
Changes
1
Hide whitespace changes
Inline
Side-by-side
frackit/occ/breputilities.hh
View file @
e4fdc870
...
...
@@ -55,6 +55,7 @@
// Algorithm for boolean operations on shapes
#include
<BRepAlgoAPI_BuilderAlgo.hxx>
#include
<BRepAlgoAPI_Fuse.hxx>
#include
<BRepAlgoAPI_Common.hxx>
#include
<BRepAlgoAPI_Cut.hxx>
...
...
@@ -365,11 +366,31 @@ namespace OCCUtilities {
fragments
.
SetFuzzyValue
(
eps
);
fragments
.
Build
();
if
(
!
fragments
.
IsDone
())
throw
std
::
runtime_error
(
std
::
string
(
"Could not perform
segment
fragmentation"
));
throw
std
::
runtime_error
(
std
::
string
(
"Could not perform fragmentation"
));
return
fragments
.
Shape
();
}
//! Convenience function to get the shape resulting from the union of a set of objects
template
<
class
ctype
>
TopoDS_Shape
fuse
(
const
std
::
vector
<
TopoDS_Shape
>&
objects
,
ctype
eps
)
{
TopTools_ListOfShape
shapes
;
for
(
const
auto
&
shape
:
objects
)
shapes
.
Append
(
shape
);
BRepAlgoAPI_Fuse
fuse
;
fuse
.
SetRunParallel
(
false
);
fuse
.
SetArguments
(
shapes
);
fuse
.
SetTools
(
shapes
);
fuse
.
SetFuzzyValue
(
eps
);
fuse
.
Build
();
if
(
!
fuse
.
IsDone
())
throw
std
::
runtime_error
(
std
::
string
(
"Could not perform union"
));
return
fuse
.
Shape
();
}
/*!
* \brief Determines the overlap edges between two sets of edges.
* \param edges1 the first set of edges
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment