Improvements for precision handling

This commit is contained in:
Thomas Krijnen
2015-01-06 14:09:28 +00:00
parent 1c757c351b
commit 9780c047e9
2 changed files with 15 additions and 2 deletions
+5 -1
View File
@@ -242,12 +242,16 @@
context = subcontext->ParentContext();
}
double precision = 1.e-5;
double precision = 1.e-6;
if (context->hasPrecision()) {
precision = context->Precision();
}
std::pair<std::string, double> length_unit = kernel.initializeUnits(project->UnitsInContext());
precision *= length_unit.second;
// Some arbitrary factor that has proven to work better for the models in the set of test files.
precision *= 10.;
kernel.setValue(IfcGeom::Kernel::GV_PRECISION, precision);
IfcGeom::BRepElement<double>* brep = kernel.create_brep_for_representation_and_product<double>(settings, representation, product);