Skip to content
Snippets Groups Projects

De/Serialization for wavefront object files

Merged Ludwig Jaeck requested to merge serialization into main
All threads resolved!
1 file
+ 2
4
Compare changes
  • Side-by-side
  • Inline
@@ -22,11 +22,9 @@ namespace {
std::ostream& serialize_as_wavefront(std::ostream& out, const ff::Polyhedron* polyhedron)
{
out << std::setprecision(10);
out << "o 1"
<< "\n";
out << "o 1 \n";
for (auto vertice : polyhedron->vertices())
out << "v"
<< " " << vertice.x() << " " << vertice.y() << " " << vertice.z() << "\n";
out << "v " << vertice.x() << " " << vertice.y() << " " << vertice.z() << "\n";
out << "usemtl Default\n";
for (auto& poly : polyhedron->topology().faces) {
Loading