diff options
author | Marius Kintel <marius@kintel.net> | 2012-01-15 17:53:32 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-01-15 17:53:32 (GMT) |
commit | 1cfc8c68a2681211f2d5b29e580f36854769d7f9 (patch) | |
tree | 757af6c79923d737ac576d527a465bb4adb5ac4b /src/import.cc | |
parent | b6714d4b3ce0b1a20b3ba25bbd007d5ced98ff06 (diff) |
Open files which can be binary in binary mode. Hopefully solves problem reading binary STL files reported by nop head
Diffstat (limited to 'src/import.cc')
-rw-r--r-- | src/import.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/import.cc b/src/import.cc index e90965e..266aa4e 100644 --- a/src/import.cc +++ b/src/import.cc @@ -121,7 +121,7 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const if (this->type == TYPE_STL) { handle_dep(this->filename); - std::ifstream f(this->filename.c_str()); + std::ifstream f(this->filename.c_str(), std::ios::in | std::ios::binary); if (!f.good()) { PRINTF("WARNING: Can't open import file `%s'.", this->filename.c_str()); return p; @@ -209,7 +209,7 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const { #ifdef ENABLE_CGAL CGAL_Polyhedron poly; - std::ifstream file(this->filename.c_str()); + std::ifstream file(this->filename.c_str(), std::ios::in | std::ios::binary); file >> poly; file.close(); |