STL export should contain single precision floats December 25, 2018 03:05PM |
Registered: 10 years ago Posts: 157 |
Quote
The numerical data in the facet normal and vertex lines are single precision floats, for example, 1.23456E+789.
std::string toString(const Vector3d &v) - return OSS(v[0] << " " << v[1] << " " << v[2]); + return OSS(std::scientific << v[0] << " " << v[1] << " " << v[2]); void append_stl(const PolySet &ps, std:: ostream &output) if (is_finite(normal) && !is_nan(normal)) { - output << normal[0] << " " << normal[1] << " " << normal[2] << "\n"; + output << std::scientific << normal[0] << " " << normal[1] << " " << normal[2] << "\n"; } else { - output << "0 0 0\n"; + output << "0.000000e+00 0.000000e+00 0.000000e+00\n"; }After these changes Wings3D accepts (my very simple) OpenSCAD STL files.
Re: STL export should contain single precision floats December 25, 2018 09:30PM |
Registered: 5 years ago Posts: 16 |
Re: STL export should contain single precision floats December 26, 2018 04:17AM |
Registered: 10 years ago Posts: 157 |