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
ab7606ef
Commit
ab7606ef
authored
Jan 21, 2020
by
Dennis Gläser
Browse files
[occ][brep] add convenience function for read from file
parent
4f9ddd5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
frackit/occ/breputilities.hh
View file @
ab7606ef
...
...
@@ -29,6 +29,7 @@
#include
<vector>
#include
<algorithm>
#include
<stdexcept>
#include
<fstream>
// Handle class used by OpenCascade
#include
<Standard_Handle.hxx>
...
...
@@ -64,6 +65,7 @@
#include
<BRep_Tool.hxx>
#include
<BRepTools.hxx>
#include
<BRepBndLib.hxx>
#include
<BRep_Builder.hxx>
#include
<BRepBuilderAPI_MakeVertex.hxx>
#include
<BRepBuilderAPI_MakeEdge.hxx>
#include
<BRepBuilderAPI_MakeWire.hxx>
...
...
@@ -89,6 +91,18 @@
namespace
Frackit
{
namespace
OCCUtilities
{
/*!
* \brief Return the shape read from a .brep file.
* \param fileName The name of the .brep file
*/
TopoDS_Shape
readShape
(
const
std
::
string
&
fileName
)
{
TopoDS_Shape
domainShape
;
std
::
ifstream
file
(
fileName
);
BRepTools
::
Read
(
domainShape
,
file
,
BRep_Builder
());
return
domainShape
;
}
//! converts a vertex shape into a point
Point
<
double
,
3
>
point
(
const
TopoDS_Vertex
&
v
)
{
return
point
(
BRep_Tool
::
Pnt
(
v
));
}
...
...
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