Skip to content
GitLab
Menu
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
73ccd2b8
Commit
73ccd2b8
authored
May 26, 2020
by
Dennis Gläser
Browse files
[python][occ] add bounding box getter function
parent
a0ba3fa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
frackit/python/occutilities/breputilities.hh
View file @
73ccd2b8
...
...
@@ -135,6 +135,10 @@ namespace OCCUtilities {
return
result
;
}
template
<
class
ShapeWrapper
,
class
ctype
>
Box
<
ctype
>
getBoundingBox
(
const
ShapeWrapper
&
wrappedShape
)
{
return
Frackit
::
OCCUtilities
::
getBoundingBox
(
wrappedShape
.
get
());
}
ShapeWrapper
readShape
(
const
std
::
string
&
fileName
)
{
return
ShapeWrapper
(
Frackit
::
OCCUtilities
::
readShape
(
fileName
));
}
...
...
@@ -228,8 +232,18 @@ void registerBRepUtilities(pybind11::module& module)
// register read-in of shapes from a file
module
.
def
(
"readShape"
,
&
OCCUtilities
::
readShape
,
"Reads in the shapes from a file"
);
// register
write func
tion for wrapped shapes
// register
bounding box computa
tion
s
for wrapped shapes
using
namespace
OCCUtilities
;
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
ShapeWrapper
,
ctype
>
,
"returns the bounding box of a wrapped shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
VertexWrapper
,
ctype
>
,
"returns the bounding box of a wrapped vertex shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
EdgeWrapper
,
ctype
>
,
"returns the bounding box of a wrapped edge shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
WireWrapper
,
ctype
>
,
"returns the bounding box of a wrapped wire shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
FaceWrapper
,
ctype
>
,
"returns the bounding box of a wrapped face shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
ShellWrapper
,
ctype
>
,
"returns the bounding box of a wrapped shell shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
SolidWrapper
,
ctype
>
,
"returns the bounding box of a wrapped solid shape"
);
module
.
def
(
"getBoundingBox"
,
&
OCCUtilities
::
getBoundingBox
<
CompoundWrapper
,
ctype
>
,
"returns the bounding box of a wrapped compound shape"
);
// register write function for wrapped shapes
module
.
def
(
"write"
,
&
OCCUtilities
::
write
<
ShapeWrapper
>
,
"writes a wrapped shape to a BRep file"
);
module
.
def
(
"write"
,
&
OCCUtilities
::
write
<
VertexWrapper
>
,
"writes a wrapped vertex shape to a BRep file"
);
module
.
def
(
"write"
,
&
OCCUtilities
::
write
<
EdgeWrapper
>
,
"writes a wrapped edge shape to a BRep file"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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