From fd1ac5533f265e4707411c8b6bcfeb33309ffaa0 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 23 Aug 2024 14:31:27 +0200 Subject: [PATCH] Add Z coordinate for GCodePath points --- cura/plugins/slots/comb/v0/comb.proto | 4 ++-- cura/plugins/v0/mesh.proto | 8 ++------ cura/plugins/v0/point2d.proto | 8 ++++++++ cura/plugins/v0/point3d.proto | 9 +++++++++ cura/plugins/v0/polygons.proto | 13 +++++-------- cura/plugins/v0/toolpaths.proto | 6 +++--- 6 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 cura/plugins/v0/point2d.proto create mode 100644 cura/plugins/v0/point3d.proto diff --git a/cura/plugins/slots/comb/v0/comb.proto b/cura/plugins/slots/comb/v0/comb.proto index 1b1c591..c5e2268 100644 --- a/cura/plugins/slots/comb/v0/comb.proto +++ b/cura/plugins/slots/comb/v0/comb.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package cura.plugins.slots.comb.v0; -import "cura/plugins/v0/polygons.proto"; import "cura/plugins/v0/toolpaths.proto"; +import "cura/plugins/v0/point2d.proto"; service CombModifyService { rpc Call(CallRequest) returns (CallResponse) {} @@ -17,4 +17,4 @@ message CallRequest { message CallResponse { cura.plugins.v0.TravelPath travel = 1; -} \ No newline at end of file +} diff --git a/cura/plugins/v0/mesh.proto b/cura/plugins/v0/mesh.proto index 777db01..c852006 100644 --- a/cura/plugins/v0/mesh.proto +++ b/cura/plugins/v0/mesh.proto @@ -2,11 +2,7 @@ syntax = "proto3"; package cura.plugins.v0; -message Point3D { - float x = 1; - float y = 2; - float z = 3; -} +import "cura/plugins/v0/point3d.proto"; message Triangle { Point3D p1 = 1; @@ -16,4 +12,4 @@ message Triangle { message Mesh { repeated Triangle triangles = 2; -} \ No newline at end of file +} diff --git a/cura/plugins/v0/point2d.proto b/cura/plugins/v0/point2d.proto new file mode 100644 index 0000000..e77cca2 --- /dev/null +++ b/cura/plugins/v0/point2d.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + +package cura.plugins.v0; + +message Point2D { + float x = 1; + float y = 2; +} diff --git a/cura/plugins/v0/point3d.proto b/cura/plugins/v0/point3d.proto new file mode 100644 index 0000000..11d1869 --- /dev/null +++ b/cura/plugins/v0/point3d.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package cura.plugins.v0; + +message Point3D { + float x = 1; + float y = 2; + float z = 3; +} diff --git a/cura/plugins/v0/polygons.proto b/cura/plugins/v0/polygons.proto index cc91da6..c92bcff 100644 --- a/cura/plugins/v0/polygons.proto +++ b/cura/plugins/v0/polygons.proto @@ -2,13 +2,10 @@ syntax = "proto3"; package cura.plugins.v0; -message Point2D { - sint64 x = 1; - sint64 y = 2; -} +import "cura/plugins/v0/point3d.proto"; message OpenPath { - repeated Point2D path = 1; + repeated Point3D path = 1; } message OpenPaths { @@ -16,11 +13,11 @@ message OpenPaths { } message ClosedPath { - repeated Point2D path = 1; + repeated Point3D path = 1; } message FilledPath { - repeated Point2D path = 1; + repeated Point3D path = 1; } message Polygon { @@ -51,4 +48,4 @@ message HolePolyTreeNode { message ClosedPolyTreeNode { OpenPath outline = 1; PolyTreeRoot children = 2; -} \ No newline at end of file +} diff --git a/cura/plugins/v0/toolpaths.proto b/cura/plugins/v0/toolpaths.proto index 941abb4..c543d98 100644 --- a/cura/plugins/v0/toolpaths.proto +++ b/cura/plugins/v0/toolpaths.proto @@ -2,14 +2,14 @@ syntax = "proto3"; package cura.plugins.v0; -import "cura/plugins/v0/polygons.proto"; +import "cura/plugins/v0/point3d.proto"; message TravelPath { - repeated Point2D points = 1; + repeated Point3D points = 1; } message ExtrusionJunction { - Point2D point = 1; + Point3D point = 1; uint32 width = 2; }