mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
OBJ precision and log messages
* Fixes #68: Increase precision in OBJ files (regression in commit 43f5d44)
* Add some verbose logging of a few geometry errors
This commit is contained in:
committed by
Thomas Krijnen
parent
01269e5dd5
commit
414d7bb810
@@ -79,6 +79,8 @@ void WaveFrontOBJSerializer::write(const IfcGeom::TriangulationElement<real_t>*
|
|||||||
? o->name() : o->unique_id()));
|
? o->name() : o->unique_id()));
|
||||||
obj_stream << "g " << name << "\n";
|
obj_stream << "g " << name << "\n";
|
||||||
obj_stream << "s 1" << "\n";
|
obj_stream << "s 1" << "\n";
|
||||||
|
|
||||||
|
obj_stream << std::setprecision(std::numeric_limits<double>::digits10);
|
||||||
|
|
||||||
const IfcGeom::Representation::Triangulation<real_t>& mesh = o->geometry();
|
const IfcGeom::Representation::Triangulation<real_t>& mesh = o->geometry();
|
||||||
|
|
||||||
|
|||||||
@@ -241,7 +241,10 @@ namespace IfcGeom {
|
|||||||
kernel.setValue(IfcGeom::Kernel::GV_PRECISION, 1.e-5);
|
kernel.setValue(IfcGeom::Kernel::GV_PRECISION, 1.e-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (representations->size() == 0) return false;
|
if (representations->size() == 0) {
|
||||||
|
Logger::Message(Logger::LOG_ERROR, "No geometries found");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
representation_iterator = representations->begin();
|
representation_iterator = representations->begin();
|
||||||
ifcproducts.reset();
|
ifcproducts.reset();
|
||||||
@@ -625,6 +628,7 @@ namespace IfcGeom {
|
|||||||
try {
|
try {
|
||||||
next_serialization = new SerializedElement<P>(*next_shape_model);
|
next_serialization = new SerializedElement<P>(*next_shape_model);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
Logger::Message(Logger::LOG_ERROR, "Getting a serialized element from model failed.");
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
} else if (!settings.get(IteratorSettings::DISABLE_TRIANGULATION)) {
|
} else if (!settings.get(IteratorSettings::DISABLE_TRIANGULATION)) {
|
||||||
@@ -635,10 +639,12 @@ namespace IfcGeom {
|
|||||||
next_triangulation = new TriangulationElement<P>(*next_shape_model, current_triangulation->geometry_pointer());
|
next_triangulation = new TriangulationElement<P>(*next_shape_model, current_triangulation->geometry_pointer());
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
Logger::Message(Logger::LOG_ERROR, "Getting a triangulation element from model failed.");
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Logger::Message(Logger::LOG_ERROR, "No shape models found.");
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user