-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi ! i am having an issue with a stl file of a 2d square plate of 72 triangles and 216 vertices i am trying to use the c++ header only as mentioned in the c++ example but i get the following error :
terminate called after throwing an instance of 'std::runtime_error'
what(): File is too small to be a valid STL file.
Aborted (core dumped)
i am using the following code :
`#include
#include // std::ifstream
#include<string.h>
#include "../lib/stl.h"
// char filename[] = "square_plate.stl";
// char filename[] = "plat100x100.stl";
char filename[] = "square_plate.stl";
int main(){
std::ifstream file(filename, std::ios::binary);
if(!file.is_open()){
std::cerr << "Error: Unable to open file '" << filename << "'" << std::endl;
}
// Deserialize the triangles in either binary or ASCII format
std::cout << "\n\nthis is the code \n\n";
std::vector<openstl::Triangle> triangles = openstl::deserializeStl(file);
file.close();
const auto& [vertices, faces] = convertToVerticesAndFaces(triangles);
return 0;
}
`
Best regards
Metadata
Metadata
Assignees
Labels
No labels