mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
GCodeViewer -> Smoothed solid toolpaths corners
This commit is contained in:
parent
b563010bf1
commit
bf7b952eff
3 changed files with 175 additions and 54 deletions
|
@ -149,14 +149,14 @@ class GCodeViewer
|
|||
// buffer containing data for rendering a specific toolpath type
|
||||
struct TBuffer
|
||||
{
|
||||
enum class EPrimitiveType : unsigned char
|
||||
enum class ERenderPrimitiveType : unsigned char
|
||||
{
|
||||
Point,
|
||||
Line,
|
||||
Triangle
|
||||
};
|
||||
|
||||
EPrimitiveType primitive_type;
|
||||
ERenderPrimitiveType render_primitive_type;
|
||||
VBuffer vertices;
|
||||
IBuffer indices;
|
||||
|
||||
|
@ -167,6 +167,15 @@ class GCodeViewer
|
|||
|
||||
void reset();
|
||||
void add_path(const GCodeProcessor::MoveVertex& move, unsigned int i_id, unsigned int s_id);
|
||||
unsigned int indices_per_segment() const {
|
||||
switch (render_primitive_type)
|
||||
{
|
||||
case ERenderPrimitiveType::Point: { return 1; }
|
||||
case ERenderPrimitiveType::Line: { return 2; }
|
||||
case ERenderPrimitiveType::Triangle: { return 42; } // 3 indices x 14 triangles
|
||||
default: { return 0; }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// helper to render shells
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue