//
#include "STLParser.h"
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
//Parse section
//read fuction
TriangleSoup STLParser::read(const std::string& filename)
{
std::ifstream stlfilereader;
stlfilereader.open(filename);
if (!stlfilereader) {
std::cout << "Not found";
}
std::string ignore;
stlfilereader >> ignore >> ignore;//sorry
while (true) {
stlfilereader >> ignore >> ignore; // ignore our normal
float normal[3];
stlfilereader >> normal[0] >> normal[1] >> normal[2]; // read and save data after that
stlfilereader >> ignore >> ignore; // ignore outer loop
for (size_t i = 0; i < 3; ++i) // read the three vertices and our face
{
}
stlfilereader >> ignore >> ignore; // endloop // endfacet
}
stlfilereader.close();
return TriangleSoup();
}
//write fuction
void STLParser::write(const TriangleSoup& triangleSoup, const std::string& filename)
{
}