From db212698a0a55d8bf986c678fc070f0a61fb79e3 Mon Sep 17 00:00:00 2001 From: aaronkimbrooktec <218adk@gmail.com> Date: Sun, 25 Feb 2024 22:26:57 -0500 Subject: [PATCH] delete unnecessary stuff --- backend/src/cad_to_gcode.cpp | 7 ++---- backend/src/determine_file_type.cpp | 33 ----------------------------- frontend/public/electron.js | 1 - 3 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 backend/src/determine_file_type.cpp diff --git a/backend/src/cad_to_gcode.cpp b/backend/src/cad_to_gcode.cpp index fdf29c7..5b80aca 100644 --- a/backend/src/cad_to_gcode.cpp +++ b/backend/src/cad_to_gcode.cpp @@ -29,17 +29,14 @@ TopoDS_Shape convert_file(const std::string filepath) { int main(int argc, char *argv[]) { try { - // Check if the correct number of arguments are passed if (argc != 3) { std::cerr << "Usage: " << argv[0] << " " << std::endl; - return 1; // Return an error code + return 1; } - // Get file and output path from command line arguments std::string filename = argv[1]; std::string outputPath = argv[2]; - // Assuming the rest of your code goes here TopoDS_Shape shape = convert_file(filename); Handle(Geom_BSplineCurve) bsplineCurve = CreateBSplineFromShape(shape); std::vector tangentVectors = calculate_tangent_vectors(bsplineCurve); @@ -47,7 +44,7 @@ int main(int argc, char *argv[]) { } catch (const std::exception& e) { std::cerr << "Exception caught: " << e.what() << std::endl; - return 1; // Return an error code + return 1; } return 0; diff --git a/backend/src/determine_file_type.cpp b/backend/src/determine_file_type.cpp deleted file mode 100644 index 1ce931d..0000000 --- a/backend/src/determine_file_type.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include -#include -#include -#include -// #include "step_to_topo.cpp" -// #include "iges_to_topo.cpp" -using namespace std; -TopoDS_Shape convert_file(const string filepath) { - std::__fs::filesystem::path p(filepath); - string extension = p.extension().string(); - for (auto& x : extension) { - x = tolower(x); - } - TopoDS_Shape shape = TopoDS_Shape(); - cout << "File extension: " << extension << endl; - if (extension == ".iges" || extension == ".igs") { - cout << "Reading IGES file." << endl; - // TopoDS_Shape shape = read_iges(filepath.c_str()); - return shape; - } else if (extension == ".step" || extension == ".stp") { - cout << "Reading Step file." << endl; - // TopoDS_Shape shape = read_step(filepath.c_str()); - return shape; - } else { - throw std::runtime_error("Error: File type not supported."); - } -} -int main(int argc, char* argv[]) { - string step_file = argv[1]; - TopoDS_Shape shape = convert_file(step_file); - return 0; -} diff --git a/frontend/public/electron.js b/frontend/public/electron.js index 2b59275..f67c310 100644 --- a/frontend/public/electron.js +++ b/frontend/public/electron.js @@ -31,7 +31,6 @@ function createWindow() { filters: [{ name: 'Design Files', extensions: ['iges', 'step', 'igs'] }], }).then(result => { if (!result.canceled && result.filePaths.length > 0) { - // Send the selected file path back to the renderer process event.reply('selected-file', result.filePaths[0]); } }).catch(err => {