GCodeViewer -> Export of extrude toolpaths to obj files

This commit is contained in:
enricoturri1966 2020-07-03 12:17:12 +02:00
parent feb4857cf8
commit 0b1086f390
6 changed files with 300 additions and 10 deletions

View file

@ -108,6 +108,7 @@ class GCodeViewer
struct RenderPath
{
Color color;
size_t path_id;
std::vector<unsigned int> sizes;
std::vector<size_t> offsets; // use size_t because we need the pointer's size (used in the call glMultiDrawElements())
};
@ -201,7 +202,6 @@ class GCodeViewer
// memory
long long results_size{ 0 };
long long vertices_gpu_size{ 0 };
long long indices_size{ 0 };
long long indices_gpu_size{ 0 };
long long paths_size{ 0 };
long long render_paths_size{ 0 };
@ -231,7 +231,6 @@ class GCodeViewer
void reset_sizes() {
results_size = 0;
vertices_gpu_size = 0;
indices_size = 0;
indices_gpu_size = 0;
paths_size = 0;
render_paths_size = 0;
@ -397,6 +396,8 @@ public:
bool is_legend_enabled() const { return m_legend_enabled; }
void enable_legend(bool enable) { m_legend_enabled = enable; }
void export_toolpaths_to_obj(const char* filename) const;
private:
void init_shaders();
void load_toolpaths(const GCodeProcessor::Result& gcode_result);