mirror of https://github.com/vitalif/openscad
fix issue #235
parent
e66e1691a9
commit
6326aab677
|
@ -226,7 +226,6 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const
|
|||
std::string line;
|
||||
std::getline(f, line);
|
||||
while (!f.eof()) {
|
||||
|
||||
std::getline(f, line);
|
||||
boost::trim(line);
|
||||
if (boost::regex_search(line, ex_sfe)) {
|
||||
|
@ -257,7 +256,7 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (binary && !f.eof())
|
||||
{
|
||||
f.ignore(80-5+4);
|
||||
while (1) {
|
||||
|
@ -283,10 +282,12 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const
|
|||
else {
|
||||
file >> poly;
|
||||
file.close();
|
||||
|
||||
p = new PolySet();
|
||||
bool err = createPolySetFromPolyhedron(poly, *p);
|
||||
if (err) delete p;
|
||||
if (err) {
|
||||
delete p;
|
||||
p = NULL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
PRINT("WARNING: OFF import requires CGAL.");
|
||||
|
@ -301,11 +302,17 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const
|
|||
dxf_tesselate(p, dd, 0, Vector2d(1,1), true, false, 0);
|
||||
dxf_border_to_ps(p, dd);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
PRINTB("ERROR: Unsupported file format while trying to import file '%s'", this->filename);
|
||||
}
|
||||
|
||||
|
||||
if (p && p->empty()) {
|
||||
delete p;
|
||||
p = NULL;
|
||||
}
|
||||
|
||||
if (p) p->convexity = this->convexity;
|
||||
return p;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// openscad should exit normally.
|
||||
// it should not crash and/or freeze and/or gobble RAM
|
||||
import("../../stl/empty.stl");
|
||||
import("../../stl/empty2.stl");
|
||||
echo("empty stl test ok");
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
solid OpenSCAD_Model
|
||||
endsolid OpenSCAD_Model
|
||||
|
|
@ -824,7 +824,8 @@ list(APPEND ECHO_FILES ${FUNCTION_FILES}
|
|||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/expression-shortcircuit-tests.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/parent_module-tests.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/children-tests.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/range-tests.scad)
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/range-tests.scad
|
||||
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/empty-stl.scad)
|
||||
|
||||
list(APPEND DUMPTEST_FILES ${FEATURES_FILES} ${EXAMPLE_FILES})
|
||||
list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ECHO: "empty stl test ok"
|
Loading…
Reference in New Issue