From 955721f89cde7190da69787eca324dbc300bbabc Mon Sep 17 00:00:00 2001 From: Joacim Breiler Date: Sun, 14 Jan 2024 14:52:06 +0100 Subject: [PATCH] Fix for not assuming that origin position is 0,0,0 This fix will make the UGS fetch the first point from the controller and display it in the visualizer. --- .../gcode/GcodeState.java | 2 +- .../gcode/processors/ArcExpander.java | 10 +- .../gcode/processors/RunFromProcessor.java | 36 +++-- .../model/GUIBackend.java | 66 ++++---- .../visualizer/GcodeViewParse.java | 2 +- .../gcode/GcodeParserTest.java | 62 +++---- .../gcode/fixtures/FixturesTest.java | 23 ++- .../gcode/processors/ArcExpanderTest.java | 151 ++++++++++-------- .../gcode/processors/RotateProcessorTest.java | 17 +- .../processors/RunFromProcessorTest.java | 75 ++++++++- .../gcode/util/GcodeParserUtilsTest.java | 4 +- .../resources/gcode/circle_test.nc.processed | 45 +----- .../fixtures/arc/G18_G2_one_arc.input.nc | 2 +- .../fixtures/arc/G18_G3_one_arc.input.nc | 2 +- .../gcode/fixtures/arc/Helix.input.nc | 2 +- .../gcode/fixtures/arc/arc_feed.input.nc | 2 +- .../outArc/G17_G2_one_arc.parsed_output.nc | 99 ++++++------ .../outArc/G17_G2_one_arc.stream_output.nc | 101 ++++++------ .../outArc/G17_G3_one_arc.parsed_output.nc | 99 ++++++------ .../outArc/G17_G3_one_arc.stream_output.nc | 101 ++++++------ .../outArc/G18_G2_one_arc.parsed_output.nc | 3 +- .../outArc/G18_G2_one_arc.stream_output.nc | 5 +- .../outArc/G18_G3_one_arc.parsed_output.nc | 3 +- .../outArc/G18_G3_one_arc.stream_output.nc | 5 +- .../outArc/G19_G2_one_arc.parsed_output.nc | 3 +- .../outArc/G19_G2_one_arc.stream_output.nc | 5 +- .../outArc/G19_G3_one_arc.parsed_output.nc | 3 +- .../outArc/G19_G3_one_arc.stream_output.nc | 5 +- .../arc/outArc/Helix.parsed_output.nc | 2 +- .../arc/outArc/Helix.stream_output.nc | 2 +- .../arc/outArc/arc_feed.parsed_output.nc | 2 +- .../arc/outArc/arc_feed.stream_output.nc | 2 +- .../arc/outArc/circle_test.parsed_output.nc | 45 +----- .../arc/outArc/circle_test.stream_output.nc | 47 +----- .../G17_G2_one_arc.parsed_output.nc | 10 +- .../G17_G2_one_arc.stream_output.nc | 10 +- .../G17_G3_one_arc.parsed_output.nc | 10 +- .../G17_G3_one_arc.stream_output.nc | 10 +- .../G18_G2_one_arc.parsed_output.nc | 2 +- .../G18_G2_one_arc.stream_output.nc | 2 +- .../G18_G3_one_arc.parsed_output.nc | 2 +- .../G18_G3_one_arc.stream_output.nc | 2 +- .../arc/outArcCoarse/Helix.parsed_output.nc | 2 +- .../arc/outArcCoarse/Helix.stream_output.nc | 2 +- .../outArcCoarse/arc_feed.parsed_output.nc | 2 +- .../outArcCoarse/arc_feed.stream_output.nc | 2 +- .../G17_G2_one_arc.parsed_output.nc | 99 ++++++------ .../G17_G2_one_arc.stream_output.nc | 101 ++++++------ .../G17_G3_one_arc.parsed_output.nc | 99 ++++++------ .../G17_G3_one_arc.stream_output.nc | 101 ++++++------ .../G18_G2_one_arc.parsed_output.nc | 3 +- .../G18_G2_one_arc.stream_output.nc | 5 +- .../G18_G3_one_arc.parsed_output.nc | 3 +- .../G18_G3_one_arc.stream_output.nc | 5 +- .../G19_G2_one_arc.parsed_output.nc | 3 +- .../G19_G2_one_arc.stream_output.nc | 5 +- .../G19_G3_one_arc.parsed_output.nc | 3 +- .../G19_G3_one_arc.stream_output.nc | 5 +- .../arc/outArcMesh/Helix.stream_output.nc | 2 +- .../arc/outArcMesh/arc_feed.stream_output.nc | 2 +- .../outArcMesh/circle_test.parsed_output.nc | 43 +---- .../outArcMesh/circle_test.stream_output.nc | 45 +----- .../nbm/visualizer/RendererInputHandler.java | 2 +- .../visualizer/renderables/GcodeModel.java | 83 +++++++--- 64 files changed, 820 insertions(+), 878 deletions(-) diff --git a/ugs-core/src/com/willwinder/universalgcodesender/gcode/GcodeState.java b/ugs-core/src/com/willwinder/universalgcodesender/gcode/GcodeState.java index 2b3b5bcaf6..b7c5760ae6 100644 --- a/ugs-core/src/com/willwinder/universalgcodesender/gcode/GcodeState.java +++ b/ugs-core/src/com/willwinder/universalgcodesender/gcode/GcodeState.java @@ -80,7 +80,7 @@ public GcodeState() { this.feedRate = 0; this.spindleSpeed = 0; - this.currentPoint = new Position(0, 0, 0, Units.MM); + this.currentPoint = new Position(Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Units.MM); } public GcodeState copy() { diff --git a/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/ArcExpander.java b/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/ArcExpander.java index 0616945e02..0792e4ab79 100644 --- a/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/ArcExpander.java +++ b/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/ArcExpander.java @@ -44,9 +44,9 @@ This file is part of Universal Gcode Sender (UGS). * @author wwinder */ public class ArcExpander implements CommandProcessor { - final private boolean convertToLines; - final private double length; - final private DecimalFormat df; + private final boolean convertToLines; + private final double length; + private final DecimalFormat df; @Override public String getHelp() { @@ -105,6 +105,10 @@ public List processCommand(String command, GcodeState state) throws Gcod start, end, ps.center(), ps.isClockwise(), ps.getRadius(), 0, this.length, new PlaneFormatter(ps.getPlaneState())); + if (points.isEmpty()) { + return results; + } + // That function returns the first and last points. Exclude the first // point because the previous gcode command ends there already. points.remove(0); diff --git a/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessor.java b/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessor.java index 57fd3c8e03..df1c001ee8 100644 --- a/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessor.java +++ b/ugs-core/src/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessor.java @@ -20,19 +20,19 @@ This file is part of Universal Gcode Sender (UGS). import com.google.common.collect.ImmutableList; import com.willwinder.universalgcodesender.gcode.GcodeParser; +import static com.willwinder.universalgcodesender.gcode.GcodePreprocessorUtils.normalizeCommand; import com.willwinder.universalgcodesender.gcode.GcodeState; import com.willwinder.universalgcodesender.gcode.util.GcodeParserException; import com.willwinder.universalgcodesender.model.Position; +import org.apache.commons.lang3.StringUtils; import java.util.Collections; import java.util.List; -import static com.willwinder.universalgcodesender.gcode.GcodePreprocessorUtils.normalizeCommand; - public class RunFromProcessor implements CommandProcessor { private int lineNumber; private GcodeParser parser; - private Double clearanceHeight = 0.0; + private Double clearanceHeight = 0.0d; /** * Truncates gcode to the specified line, and rewrites the preamble with the GcodeState. @@ -67,11 +67,27 @@ public List processCommand(String command, GcodeState state) throws Gcod return ImmutableList.of(command); } - private ImmutableList getSkippedLinesState(String command) { + private List getSkippedLinesState(String command) { Position pos = parser.getCurrentState().currentPoint; - String moveToClearanceHeight = "G0Z" + clearanceHeight; - String moveToXY = "G0X" + pos.x + "Y" + pos.y; - String plunge = "G1Z" + pos.z; + + String moveToClearanceHeight = ""; + if (!Double.isNaN(pos.z)) { + moveToClearanceHeight = "G0Z" + clearanceHeight; + } + + String moveToXY = "G0"; + if(!Double.isNaN(pos.x)) { + moveToXY += "X" + pos.x; + } + + if(!Double.isNaN(pos.y)) { + moveToXY += "Y" + pos.y; + } + + String plunge = ""; + if (!Double.isNaN(pos.z)) { + plunge = "G1Z" + pos.z; + } GcodeState s = parser.getCurrentState(); String normalized = command; @@ -98,14 +114,16 @@ private ImmutableList getSkippedLinesState(String command) { // Append normalized command normalized - ); + ).stream() + .filter(line -> !StringUtils.isEmpty(line)) + .toList(); } private ImmutableList skipLine(String command) throws GcodeParserException { createParser(); parser.addCommand(command); Position pos = parser.getCurrentState().currentPoint; - clearanceHeight = Math.max(clearanceHeight, pos.z); + clearanceHeight = Math.max(clearanceHeight, Double.isNaN(pos.z) ? 0 : pos.z); return ImmutableList.of(); } diff --git a/ugs-core/src/com/willwinder/universalgcodesender/model/GUIBackend.java b/ugs-core/src/com/willwinder/universalgcodesender/model/GUIBackend.java index 36fb197858..1a00999d90 100644 --- a/ugs-core/src/com/willwinder/universalgcodesender/model/GUIBackend.java +++ b/ugs-core/src/com/willwinder/universalgcodesender/model/GUIBackend.java @@ -20,11 +20,11 @@ This file is part of Universal Gcode Sender (UGS). import com.google.common.io.Files; import com.willwinder.universalgcodesender.IController; -import com.willwinder.universalgcodesender.gcode.ICommandCreator; import com.willwinder.universalgcodesender.gcode.DefaultCommandCreator; import com.willwinder.universalgcodesender.gcode.GcodeParser; import com.willwinder.universalgcodesender.gcode.GcodeState; import com.willwinder.universalgcodesender.gcode.GcodeStats; +import com.willwinder.universalgcodesender.gcode.ICommandCreator; import com.willwinder.universalgcodesender.gcode.processors.CommandProcessor; import com.willwinder.universalgcodesender.gcode.processors.CommentProcessor; import com.willwinder.universalgcodesender.gcode.processors.DecimalProcessor; @@ -102,6 +102,18 @@ public GUIBackend(UGSEventDispatcher eventDispatcher) { // GUI API // ///////////// + /** + * This allows us to visualize a file without loading a controller profile. + */ + private static void initializeWithFallbackProcessors(GcodeParser parser) { + // Comment processor must come first otherwise we try to parse codes + // out of the comments, like an f-code when we see "(feed rate is 100)" + parser.addCommandProcessor(new CommentProcessor()); + parser.addCommandProcessor(new WhitespaceProcessor()); + parser.addCommandProcessor(new M30Processor()); + parser.addCommandProcessor(new DecimalProcessor(4)); + } + @Override public void addUGSEventListener(UGSEventListener listener) { eventDispatcher.addListener(listener); @@ -227,18 +239,6 @@ public void applySettings(Settings settings) throws Exception { } } - /** - * This allows us to visualize a file without loading a controller profile. - */ - private static void initializeWithFallbackProcessors(GcodeParser parser) { - // Comment processor must come first otherwise we try to parse codes - // out of the comments, like an f-code when we see "(feed rate is 100)" - parser.addCommandProcessor(new CommentProcessor()); - parser.addCommandProcessor(new WhitespaceProcessor()); - parser.addCommandProcessor(new M30Processor()); - parser.addCommandProcessor(new DecimalProcessor(4)); - } - @Override public void sendGcodeCommand(String commandText) throws Exception { sendGcodeCommand(false, commandText); @@ -316,6 +316,11 @@ public Position getWorkPosition() { return controller != null ? controller.getControllerStatus().getWorkCoord() : new Position(0, 0, 0, Units.MM); } + @Override + public void setWorkPosition(PartialPosition position) throws Exception { + controller.setWorkPosition(position); + } + @Override public Position getMachinePosition() { return controller != null ? controller.getControllerStatus().getMachineCoord() : new Position(0, 0, 0, Units.MM); @@ -347,17 +352,6 @@ private File getTempDir() { return tempDir; } - @Override - public void setGcodeFile(File file) throws Exception { - unsetGcodeFile(); - - logger.log(Level.INFO, "Setting gcode file. {0}", file.getAbsolutePath()); - - this.gcodeFile = file; - eventDispatcher.sendUGSEvent(new FileStateEvent(FileState.OPENING_FILE)); - processGcodeFile(); - } - @Override public void unsetGcodeFile() throws Exception { if (gcodeStream != null) { @@ -466,6 +460,17 @@ public File getGcodeFile() { return this.gcodeFile; } + @Override + public void setGcodeFile(File file) throws Exception { + unsetGcodeFile(); + + logger.log(Level.INFO, "Setting gcode file. {0}", file.getAbsolutePath()); + + this.gcodeFile = file; + eventDispatcher.sendUGSEvent(new FileStateEvent(FileState.OPENING_FILE)); + processGcodeFile(); + } + @Override public File getProcessedGcodeFile() { logger.log(Level.FINEST, String.format("Getting processed gcode file (%s).", this.processedGcodeFile)); @@ -649,15 +654,15 @@ public void toggleCheckMode() throws Exception { this.controller.toggleCheckMode(); } + /////////////////////// + // Utility functions // + /////////////////////// + @Override public void issueSoftReset() throws Exception { this.controller.issueSoftReset(); } - /////////////////////// - // Utility functions // - /////////////////////// - @Override public void requestParserState() throws Exception { this.controller.viewParserState(); @@ -716,11 +721,6 @@ public ICommandCreator getCommandCreator() { return controller.getCommandCreator(); } - @Override - public void setWorkPosition(PartialPosition position) throws Exception { - controller.setWorkPosition(position); - } - @Override public void setWorkPositionUsingExpression(final Axis axis, final String expression) throws Exception { Units preferredUnits = getSettings().getPreferredUnits(); diff --git a/ugs-core/src/com/willwinder/universalgcodesender/visualizer/GcodeViewParse.java b/ugs-core/src/com/willwinder/universalgcodesender/visualizer/GcodeViewParse.java index 38ae350c2a..a38353f4c0 100644 --- a/ugs-core/src/com/willwinder/universalgcodesender/visualizer/GcodeViewParse.java +++ b/ugs-core/src/com/willwinder/universalgcodesender/visualizer/GcodeViewParse.java @@ -125,7 +125,7 @@ public List toObjFromReader(IGcodeStreamReader reader, GcodeParser gp = getParser(); // Save the state - Position start = new Position(gp.getCurrentState().getUnits()); + Position start = new Position(Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, gp.getCurrentState().getUnits()); double spindleSpeed = 0; while (reader.getNumRowsRemaining() > 0) { diff --git a/ugs-core/test/com/willwinder/universalgcodesender/gcode/GcodeParserTest.java b/ugs-core/test/com/willwinder/universalgcodesender/gcode/GcodeParserTest.java index d6151c0463..4368146100 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/gcode/GcodeParserTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/gcode/GcodeParserTest.java @@ -34,6 +34,7 @@ This file is part of Universal Gcode Sender (UGS). import com.willwinder.universalgcodesender.gcode.util.Plane; import com.willwinder.universalgcodesender.i18n.Localization; import com.willwinder.universalgcodesender.model.Position; +import static com.willwinder.universalgcodesender.model.UnitUtils.Units.MM; import com.willwinder.universalgcodesender.types.GcodeCommand; import com.willwinder.universalgcodesender.types.PointSegment; import com.willwinder.universalgcodesender.utils.GcodeStreamReader; @@ -44,6 +45,8 @@ This file is part of Universal Gcode Sender (UGS). import org.apache.commons.io.IOUtils; import org.assertj.core.api.Assertions; import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import org.junit.Test; import java.io.File; @@ -55,10 +58,6 @@ This file is part of Universal Gcode Sender (UGS). import java.text.DecimalFormat; import java.util.List; -import static com.willwinder.universalgcodesender.model.UnitUtils.Units.MM; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - /** * * @author wwinder @@ -102,53 +101,56 @@ public void testAddCommand_String() throws Exception { List results; GcodeParser instance = new GcodeParser(); + results = instance.addCommand("G20"); + testCommand(results, 0, 150, Double.NaN, Double.NaN, Double.NaN, true, false, false, false, false, 0); + // X movement with speed - results = instance.addCommand("G20 G0X1F150"); - testCommand(results, 1, 150, 1., 0., 0., true, false, false, false, false, 0); + results = instance.addCommand("G0X1F150"); + testCommand(results, 1, 150, 1., Double.NaN, Double.NaN, true, false, false, false, false, 1); results = instance.addCommand("G1Y1F250"); - testCommand(results, 1, 250, 1., 1., 0., false, false, false, false, false, 1); + testCommand(results, 1, 250, 1., 1., Double.NaN, false, false, false, false, false, 2); // Use same speed from before results = instance.addCommand("G1Z1"); - testCommand(results, 1, 250, 1., 1., 1., false, true, false, false, false, 2); + testCommand(results, 1, 250, 1., 1., 1., false, true, false, false, false, 3); // Use same G command from before results = instance.addCommand("X2Y2Z2"); - testCommand(results, 1, 250, 2., 2., 2., false, false, false, false, false, 3); + testCommand(results, 1, 250, 2., 2., 2., false, false, false, false, false, 4); results = instance.addCommand("X-0.5Y0Z0"); - testCommand(results, 1, 250, -0.5, 0., 0., false, false, false, false, false, 4); + testCommand(results, 1, 250, -0.5, 0., 0., false, false, false, false, false, 5); // Clockwise arc! results = instance.addCommand("G2 X0. Y0.5 I0.5 J0. F2.5"); - testCommand(results, 1, 2.5, 0., 0.5, 0., false, false, true, true, false, 5); + testCommand(results, 1, 2.5, 0., 0.5, 0., false, false, true, true, false, 6); results = instance.addCommand("X0.5 Y0. I0. J-0.5"); - testCommand(results, 1, 2.5, 0.5, 0., 0., false, false, true, true, false, 6); + testCommand(results, 1, 2.5, 0.5, 0., 0., false, false, true, true, false, 7); results = instance.addCommand("X0. Y-0.5 I-0.5 J0."); - testCommand(results, 1, 2.5, 0., -0.5, 0., false, false, true, true, false, 7); + testCommand(results, 1, 2.5, 0., -0.5, 0., false, false, true, true, false, 8); results = instance.addCommand("X-0.5 Y0. I0. J0.5"); - testCommand(results, 1, 2.5, -0.5, 0., 0., false, false, true, true, false, 8); + testCommand(results, 1, 2.5, -0.5, 0., 0., false, false, true, true, false, 9); // Move up a bit. results = instance.addCommand("G0 Z2"); - testCommand(results, 1, 2.5, -0.5, 0., 2., true, true, false, false, false, 9); + testCommand(results, 1, 2.5, -0.5, 0., 2., true, true, false, false, false, 10); // Counter-clockwise arc! results = instance.addCommand("G3 X-0.5 Y0. I0. J0.5"); - testCommand(results, 1, 2.5, -0.5, 0., 2., false, false, true, false, false, 10); + testCommand(results, 1, 2.5, -0.5, 0., 2., false, false, true, false, false, 11); results = instance.addCommand("X0. Y-0.5 I-0.5 J0."); - testCommand(results, 1, 2.5, 0., -0.5, 2., false, false, true, false, false, 11); + testCommand(results, 1, 2.5, 0., -0.5, 2., false, false, true, false, false, 12); results = instance.addCommand("X0.5 Y0. I0. J-0.5"); - testCommand(results, 1, 2.5, 0.5, 0., 2., false, false, true, false, false, 12); + testCommand(results, 1, 2.5, 0.5, 0., 2., false, false, true, false, false, 13); results = instance.addCommand("X0. Y0.5 I0.5 J0. F2.5"); - testCommand(results, 1, 2.5, 0., 0.5, 2., false, false, true, false, false, 13); + testCommand(results, 1, 2.5, 0., 0.5, 2., false, false, true, false, false, 14); } /** @@ -161,7 +163,7 @@ public void testAddCommand_String_int() throws Exception { // More or less the same thing as the above test, so just make sure the // line number is applied. List results = instance.addCommand("G20 G0X1F150", 123); - testCommand(results, 1, 150, 1., 0., 0., true, false, false, false, false, 123); + testCommand(results, 1, 150, 1., Double.NaN, Double.NaN, true, false, false, false, false, 123); } /** @@ -178,12 +180,23 @@ public void testGetCurrentState() throws Exception { assertTrue(state.inAbsoluteMode); } + @Test + public void testGetCurrentStateWithG38_2() throws Exception { + GcodeParser instance = new GcodeParser(); + + instance.addCommand("G38.2 G54 G17 G21 G90 G94 M5 M9"); + GcodeState state = instance.getCurrentState(); + assertEquals(Plane.XY, state.plane); + assertTrue(state.isMetric); + assertTrue(state.inAbsoluteMode); + assertEquals(Code.G38_2, state.currentMotionMode); + } + /** * Test of addCommandProcessor method, of class GcodeParser. */ @Test public void testAddCommandProcessor() { - System.out.println("addCommandProcessor"); GcodeParser instance = new GcodeParser(); instance.addCommandProcessor(new CommentProcessor()); assertEquals(1, instance.numCommandProcessors()); @@ -194,7 +207,6 @@ public void testAddCommandProcessor() { */ @Test public void testResetCommandProcessors() { - System.out.println("resetCommandProcessors"); GcodeParser instance = new GcodeParser(); instance.addCommandProcessor(new CommentProcessor()); assertEquals(1, instance.numCommandProcessors()); @@ -207,7 +219,6 @@ public void testResetCommandProcessors() { */ @Test public void testPreprocessCommandGood() throws Exception { - System.out.println("preprocessCommandGood"); // Tests: // '(comment)' is removed // '; Comment!' is removed @@ -228,7 +239,6 @@ public void testPreprocessCommandGood() throws Exception { @Test public void testPreprocessCommandFeedOverride() throws Exception { - System.out.println("preprocessCommandFeedOverride"); // Tests: // '(comment)' is removed // '; Comment!' is removed @@ -261,7 +271,6 @@ public void testPreprocessCommandFeedOverride() throws Exception { @Test public void testPreprocessCommandException() throws Exception { - System.out.println("preprocessCommandException?!"); GcodeParser instance = new GcodeParser(); instance.addCommandProcessor(new CommentProcessor()); // Don't process decimals to make this test easier to create. @@ -281,7 +290,6 @@ public void testPreprocessCommandException() throws Exception { @Test public void autoLevelerProcessorSet() throws Exception { - System.out.println("autoLevelerProcessorSet"); GcodeParser gcp = new GcodeParser(); gcp.addCommandProcessor(new CommentProcessor()); gcp.addCommandProcessor(new ArcExpander(true, 0.1, new DecimalFormat("#.####", Localization.dfs))); @@ -317,7 +325,7 @@ public void autoLevelerProcessorSet() throws Exception { Assert.fail("Unexpected exception."); } }); - assertEquals(1031, reader.getNumRows()); + assertEquals(990, reader.getNumRows()); output.toFile().delete(); } diff --git a/ugs-core/test/com/willwinder/universalgcodesender/gcode/fixtures/FixturesTest.java b/ugs-core/test/com/willwinder/universalgcodesender/gcode/fixtures/FixturesTest.java index b1e4055bb7..34097cbdda 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/gcode/fixtures/FixturesTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/gcode/fixtures/FixturesTest.java @@ -3,10 +3,17 @@ import com.google.common.base.Joiner; import com.willwinder.universalgcodesender.gcode.DefaultCommandCreator; import com.willwinder.universalgcodesender.gcode.GcodeParser; -import com.willwinder.universalgcodesender.gcode.processors.*; +import com.willwinder.universalgcodesender.gcode.processors.ArcExpander; +import com.willwinder.universalgcodesender.gcode.processors.CommentProcessor; +import com.willwinder.universalgcodesender.gcode.processors.EmptyLineRemoverProcessor; +import com.willwinder.universalgcodesender.gcode.processors.LineSplitter; +import com.willwinder.universalgcodesender.gcode.processors.MeshLeveler; +import com.willwinder.universalgcodesender.gcode.processors.RunFromProcessor; +import com.willwinder.universalgcodesender.gcode.processors.WhitespaceProcessor; import com.willwinder.universalgcodesender.gcode.util.GcodeParserUtils; import com.willwinder.universalgcodesender.i18n.Localization; import com.willwinder.universalgcodesender.model.Position; +import static com.willwinder.universalgcodesender.model.UnitUtils.Units.MM; import com.willwinder.universalgcodesender.types.GcodeCommand; import com.willwinder.universalgcodesender.utils.GcodeStreamReader; import com.willwinder.universalgcodesender.utils.GcodeStreamWriter; @@ -17,10 +24,16 @@ import org.junit.Assert; import org.junit.Test; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintStream; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -30,8 +43,6 @@ import java.util.List; import java.util.concurrent.Callable; -import static com.willwinder.universalgcodesender.model.UnitUtils.Units.MM; - /** * A simple framework where you can specify one or more gcode files in the /gcode/fixtures/ test-resources folder * which gets run through various GcodeParsers and its output is recorded in a fixture and gets monitored for changes @@ -73,7 +84,7 @@ public void testArcWithMeshLevelerFixtures() throws Exception { gcp.addCommandProcessor(new WhitespaceProcessor()); gcp.addCommandProcessor(new ArcExpander(true, 0.1, new DecimalFormat("#.####", Localization.dfs))); gcp.addCommandProcessor(new LineSplitter(1)); - Position grid[][] = { + Position[][] grid = { { new Position(-5,-5,0, MM), new Position(-5,35,0, MM) }, { new Position(35,-5,0, MM), new Position(35,35,0, MM) } }; @@ -213,7 +224,7 @@ private void initializeFixture(String basePath, String fixtureResourceName, Iter System.out.println("| (if this is not correct, move it into the resource folder)"); System.out.println("-------------------------------------------------"); - PrintStream resourceFile = new PrintStream(dstFile, "UTF-8"); + PrintStream resourceFile = new PrintStream(dstFile, StandardCharsets.UTF_8); testLines.forEachRemaining(resourceFile::println); resourceFile.close(); } diff --git a/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/ArcExpanderTest.java b/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/ArcExpanderTest.java index 737c3a1709..034e440f17 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/ArcExpanderTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/ArcExpanderTest.java @@ -22,29 +22,77 @@ This file is part of Universal Gcode Sender (UGS). import com.willwinder.universalgcodesender.gcode.GcodeState; import com.willwinder.universalgcodesender.gcode.util.GcodeParserException; import com.willwinder.universalgcodesender.gcode.util.Plane; -import static com.willwinder.universalgcodesender.gcode.util.Plane.*; +import static com.willwinder.universalgcodesender.gcode.util.Plane.XY; +import static com.willwinder.universalgcodesender.gcode.util.Plane.YZ; +import static com.willwinder.universalgcodesender.gcode.util.Plane.ZX; import com.willwinder.universalgcodesender.i18n.Localization; import com.willwinder.universalgcodesender.model.Position; import static com.willwinder.universalgcodesender.model.UnitUtils.Units.MM; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import org.assertj.core.data.Offset; +import org.junit.Assert; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.util.Collection; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.junit.Test; -import static org.assertj.core.api.Assertions.*; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.assertj.core.data.Offset; -import org.junit.Assert; /** - * * @author wwinder */ public class ArcExpanderTest { - + + static Pattern LINE_COORDS = Pattern.compile("G1" + + "X([\\-+]?[0-9]+(?:\\.[0-9]+)?)" + + "Y([\\-+]?[0-9]+(?:\\.[0-9]+)?)" + + "Z([\\-+]?[0-9]+(?:\\.[0-9]+)?)"); + + /** + * Verify that the points around given center point have a known radius and + * fall within known boundaries. + */ + static void verifyLines(Position center, Collection lines, double radius, Position min, Position max, Plane p) { + for (String line : lines) { + verifyLine(center, line, radius, min, max, p); + } + } + + //+ "(F\\d+)?"); + static void verifyLine(Position center, String line, double radius, Position min, Position max, Plane p) { + Matcher m = LINE_COORDS.matcher(line); + if (m.find()) { + double x = Double.parseDouble(m.group(1)) - center.x; + double y = Double.parseDouble(m.group(2)) - center.y; + double z = Double.parseDouble(m.group(3)) - center.z; + + assertThat(x).as("X is in bounds").isBetween(min.x, max.x); + assertThat(y).as("Y is in bounds").isBetween(min.y, max.y); + assertThat(z).as("Z is in bounds").isBetween(min.z, max.z); + + double r; + switch (p) { + case XY: + r = Math.sqrt(x * x + y * y); + break; + case YZ: + r = Math.sqrt(z * z + y * y); + break; + case ZX: + r = Math.sqrt(z * z + x * x); + break; + default: + r = -1; + } + assertThat(radius).isCloseTo(r, Offset.offset(0.0001)); + } else { + Assert.fail("This should have matched."); + } + } + @Test public void arcExpandadState() throws Exception { GcodeState state = new GcodeState(); @@ -59,7 +107,7 @@ public void arcExpandadState() throws Exception { @Test public void modalsReturnedFirst() throws Exception { GcodeState state = new GcodeState(); - state.currentPoint = new Position(0,0,0,MM); + state.currentPoint = new Position(0, 0, 0, MM); state.plane = XY; ArcExpander instance = new ArcExpander(true, 1); @@ -67,11 +115,11 @@ public void modalsReturnedFirst() throws Exception { assertThat(result.get(0)).isEqualTo("G17G20S1300"); assertThat(result).size().isGreaterThan(2); } - + @Test public void arcExpandIgnoreNonArc() throws Exception { GcodeState state = new GcodeState(); - state.currentPoint = new Position(0,0,0,MM); + state.currentPoint = new Position(0, 0, 0, MM); state.plane = XY; ArcExpander instance = new ArcExpander(true, 1); String command = "G17 G0 X12"; @@ -83,84 +131,85 @@ public void arcExpandIgnoreNonArc() throws Exception { @Test public void expandArcG17() throws Exception { GcodeState state = new GcodeState(); - state.currentPoint = new Position(-1,0,0,MM); + state.currentPoint = new Position(-1, 0, 0, MM); state.plane = XY; ///////////////////////////////////////////////////////// // Using a unit circle, so I can verify a^2 + b^2 = 1. // ///////////////////////////////////////////////////////// - for (double segmentLength = 0.1; segmentLength < 1; segmentLength+=0.1) { + for (double segmentLength = 0.1; segmentLength < 1; segmentLength += 0.1) { ArcExpander instance = new ArcExpander(true, segmentLength); // Half circle clockwise, X-1 -> X1, Y0 -> Y1 -> Y0 String command = "G2 Y0 X1 R1"; List result = instance.processCommand(command, state); - assertThat(result.size()).isEqualTo((int)Math.ceil(Math.PI / segmentLength)); - verifyLines(new Position(0,0,0,MM), result, 1., new Position(-1, 0, 0,MM), new Position(1,1,0,MM), state.plane); + assertThat(result.size()).isEqualTo((int) Math.ceil(Math.PI / segmentLength)); + verifyLines(new Position(0, 0, 0, MM), result, 1., new Position(-1, 0, 0, MM), new Position(1, 1, 0, MM), state.plane); // Half circle counter-clockwise, X-1 -> X1, Y0 -> Y-1 -> Y0 command = "G3 Y0 X1 R1"; result = instance.processCommand(command, state); - assertThat(result.size()).isEqualTo((int)Math.ceil(Math.PI / segmentLength)); - verifyLines(new Position(0,0,0,MM), result, 1., new Position(-1, -1, 0,MM), new Position(1,0,0,MM), state.plane); + assertThat(result.size()).isEqualTo((int) Math.ceil(Math.PI / segmentLength)); + verifyLines(new Position(0, 0, 0, MM), result, 1., new Position(-1, -1, 0, MM), new Position(1, 0, 0, MM), state.plane); } } @Test public void expandArcG18() throws Exception { GcodeState state = new GcodeState(); - state.currentPoint = new Position(0,0,-1,MM); + state.currentPoint = new Position(0, 0, -1, MM); state.plane = ZX; ///////////////////////////////////////////////////////// // Using a unit circle, so I can verify a^2 + b^2 = 1. // ///////////////////////////////////////////////////////// - for (double segmentLength = 0.1; segmentLength < 1; segmentLength+=0.1) { + for (double segmentLength = 0.1; segmentLength < 1; segmentLength += 0.1) { ArcExpander instance = new ArcExpander(true, segmentLength); // Half circle clockwise, Z-1 -> Z1, X0 -> X1 -> X0 String command = "G2 Z1 X0 R1"; List result = instance.processCommand(command, state); - assertThat(result.size()).isEqualTo((int)Math.ceil(Math.PI / segmentLength)); - verifyLines(new Position(0,0,0,MM), result, 1., new Position(0, 0, -1,MM), new Position(1,0,1,MM), state.plane); + assertThat(result.size()).isEqualTo((int) Math.ceil(Math.PI / segmentLength)); + verifyLines(new Position(0, 0, 0, MM), result, 1., new Position(0, 0, -1, MM), new Position(1, 0, 1, MM), state.plane); // Half circle clockwise, Z-1 -> Z1, X0 -> X-1 -> X0 command = "G3 Z1 X0 R1"; result = instance.processCommand(command, state); - assertThat(result.size()).isEqualTo((int)Math.ceil(Math.PI / segmentLength)); - verifyLines(new Position(0,0,0,MM), result, 1., new Position(-1, 0, -1,MM), new Position(0,0,1,MM), state.plane); + assertThat(result.size()).isEqualTo((int) Math.ceil(Math.PI / segmentLength)); + verifyLines(new Position(0, 0, 0, MM), result, 1., new Position(-1, 0, -1, MM), new Position(0, 0, 1, MM), state.plane); } } @Test public void expandArcG19() throws Exception { GcodeState state = new GcodeState(); - state.currentPoint = new Position(0,-1,0,MM); + state.currentPoint = new Position(0, -1, 0, MM); state.plane = YZ; ///////////////////////////////////////////////////////// // Using a unit circle, so I can verify a^2 + b^2 = 1. // ///////////////////////////////////////////////////////// - for (double segmentLength = 0.1; segmentLength < 1; segmentLength+=0.1) { + for (double segmentLength = 0.1; segmentLength < 1; segmentLength += 0.1) { ArcExpander instance = new ArcExpander(true, segmentLength); // Half circle clockwise, Y-1 -> Y1, X0 -> X1 -> X0 String command = "G2 Y1 X0 R1"; List result = instance.processCommand(command, state); - assertThat(result.size()).isEqualTo((int)Math.ceil(Math.PI / segmentLength)); - verifyLines(new Position(0,0,0,MM), result, 1., new Position(0, -1., 0,MM), new Position(0,1,1,MM), state.plane); + assertThat(result.size()).isEqualTo((int) Math.ceil(Math.PI / segmentLength)); + verifyLines(new Position(0, 0, 0, MM), result, 1., new Position(0, -1., 0, MM), new Position(0, 1, 1, MM), state.plane); // Half circle clockwise, Y-1 -> Y1, X0 -> X-1 -> X0 command = "G3 Y1 X0 R1"; result = instance.processCommand(command, state); - assertThat(result.size()).isEqualTo((int)Math.ceil(Math.PI / segmentLength)); - verifyLines(new Position(0,0,0,MM), result, 1., new Position(0, -1, -1,MM), new Position(0,1,0,MM), state.plane); + assertThat(result.size()).isEqualTo((int) Math.ceil(Math.PI / segmentLength)); + verifyLines(new Position(0, 0, 0, MM), result, 1., new Position(0, -1, -1, MM), new Position(0, 1, 0, MM), state.plane); } } @Test public void verifyFeedRateNotAddedFromPreviousState() throws GcodeParserException { GcodeState gcodeState = new GcodeState(); + gcodeState.currentPoint = new Position(0, 0, 0, MM); gcodeState.feedRate = 100; ArcExpander arcExpander = new ArcExpander(true, 1); @@ -172,6 +221,7 @@ public void verifyFeedRateNotAddedFromPreviousState() throws GcodeParserExceptio @Test public void verifyFeedRateAddedFromCurrentState() throws GcodeParserException { GcodeState gcodeState = new GcodeState(); + gcodeState.currentPoint = new Position(0, 0, 0, MM); gcodeState.feedRate = 100; ArcExpander arcExpander = new ArcExpander(true, 1); @@ -179,43 +229,4 @@ public void verifyFeedRateAddedFromCurrentState() throws GcodeParserException { assertTrue("Expected the feed rate to be added to the first expanded command but was \"" + expandedGcode.get(0) + "\"", expandedGcode.get(0).endsWith("F1000")); assertTrue("Expected motion on next command but was \"" + expandedGcode.get(1) + "\"", expandedGcode.get(1).startsWith("G1")); } - - /** - * Verify that the points around given center point have a known radius and - * fall within known boundaries. - */ - static void verifyLines(Position center, Collection lines, double radius, Position min, Position max, Plane p) { - for (String line : lines) { - verifyLine(center, line, radius, min, max, p); - } - } - - static Pattern LINE_COORDS = Pattern.compile("G1" - + "X([\\-+]?[0-9]+(?:\\.[0-9]+)?)" - + "Y([\\-+]?[0-9]+(?:\\.[0-9]+)?)" - + "Z([\\-+]?[0-9]+(?:\\.[0-9]+)?)"); - //+ "(F\\d+)?"); - static void verifyLine(Position center, String line, double radius, Position min, Position max, Plane p) { - Matcher m = LINE_COORDS.matcher(line); - if (m.find()) { - double x = Double.parseDouble(m.group(1)) - center.x; - double y = Double.parseDouble(m.group(2)) - center.y; - double z = Double.parseDouble(m.group(3)) - center.z; - - assertThat(x).as("X is in bounds").isBetween(min.x, max.x); - assertThat(y).as("Y is in bounds").isBetween(min.y, max.y); - assertThat(z).as("Z is in bounds").isBetween(min.z, max.z); - - double r; - switch (p) { - case XY: r = Math.sqrt(x*x + y*y); break; - case YZ: r = Math.sqrt(z*z + y*y); break; - case ZX: r = Math.sqrt(z*z + x*x); break; - default: r = -1; - } - assertThat(radius).isCloseTo(r, Offset.offset(0.0001)); - } else { - Assert.fail("This should have matched."); - } - } } diff --git a/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RotateProcessorTest.java b/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RotateProcessorTest.java index 5dfc403dfb..5087175766 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RotateProcessorTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RotateProcessorTest.java @@ -5,18 +5,19 @@ import com.willwinder.universalgcodesender.gcode.util.GcodeParserException; import com.willwinder.universalgcodesender.model.Position; import com.willwinder.universalgcodesender.model.UnitUtils; +import static org.junit.Assert.assertEquals; import org.junit.Test; import java.util.List; -import static org.junit.Assert.*; - public class RotateProcessorTest { @Test public void rotateCommandShouldIncludeFeedRate() throws GcodeParserException { RotateProcessor rotateProcessor = new RotateProcessor(new Position(0, 0, 0, UnitUtils.Units.MM), Math.PI); + GcodeState gcodeState = new GcodeState(); + gcodeState.currentPoint = new Position(0, 0, 0, UnitUtils.Units.MM); - List commands = rotateProcessor.processCommand("G0 X1 Y0 F100", new GcodeState()); + List commands = rotateProcessor.processCommand("G0 X1 Y0 F100", gcodeState); assertEquals(1, commands.size()); assertEquals("F100.0S0.0G0X-1Y-0Z0", commands.get(0)); @@ -25,8 +26,10 @@ public void rotateCommandShouldIncludeFeedRate() throws GcodeParserException { @Test public void rotateCommandShouldIncludeSpindleSpeed() throws GcodeParserException { RotateProcessor rotateProcessor = new RotateProcessor(new Position(0, 0, 0, UnitUtils.Units.MM), Math.PI); + GcodeState gcodeState = new GcodeState(); + gcodeState.currentPoint = new Position(0, 0, 0, UnitUtils.Units.MM); - List commands = rotateProcessor.processCommand("G0 X1 Y0 S100", new GcodeState()); + List commands = rotateProcessor.processCommand("G0 X1 Y0 S100", gcodeState); assertEquals(1, commands.size()); assertEquals("F0.0S100.0G0X-1Y-0Z0", commands.get(0)); @@ -45,8 +48,10 @@ public void rotateCommandShouldIgnoreNoMotionCommands() throws GcodeParserExcept @Test public void rotateCommandShouldConvertArcs() throws GcodeParserException { RotateProcessor rotateProcessor = new RotateProcessor(new Position(0, 0, 0, UnitUtils.Units.MM), Math.PI); + GcodeState gcodeState = new GcodeState(); + gcodeState.currentPoint = new Position(0, 0, 0, UnitUtils.Units.MM); - List commands = rotateProcessor.processCommand("G2 X0. Y-0.5 I0.5 J0.0", new GcodeState()); + List commands = rotateProcessor.processCommand("G2 X0. Y-0.5 I0.5 J0.0", gcodeState); assertEquals(28, commands.size()); } @@ -57,7 +62,7 @@ public void rotateCommandShouldConvertCoordinatesInDifferentUnits() throws Gcode GcodeState gcodeState = new GcodeState(); gcodeState.units = Code.G20; // Inches gcodeState.isMetric = false; - gcodeState.currentPoint = new Position(2,0,0, UnitUtils.Units.INCH); + gcodeState.currentPoint = new Position(2, 0, 0, UnitUtils.Units.INCH); List commands = rotateProcessor.processCommand("G0 X2", gcodeState); diff --git a/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessorTest.java b/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessorTest.java index 04fce0f62d..24c4e1a52f 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessorTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/gcode/processors/RunFromProcessorTest.java @@ -2,14 +2,16 @@ import com.willwinder.universalgcodesender.gcode.GcodeState; import com.willwinder.universalgcodesender.gcode.util.GcodeParserException; +import com.willwinder.universalgcodesender.model.Position; +import com.willwinder.universalgcodesender.model.UnitUtils; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.junit.Assert.*; - public class RunFromProcessorTest { @Test @@ -33,7 +35,7 @@ public void processCommandShouldAppendStateUpToSelectedLine() throws GcodeParser RunFromProcessor processor = new RunFromProcessor(2); GcodeState gcodeState = new GcodeState(); gcodeState.commandNumber = 0; - List result = processor.processCommand("G0X10F100", gcodeState); + List result = processor.processCommand("G0X10Z0F100", gcodeState); assertEquals(0, result.size()); gcodeState.commandNumber = 1; @@ -52,6 +54,72 @@ public void processCommandShouldAppendStateUpToSelectedLine() throws GcodeParser assertEquals("F100.0S1000.0G0Y11", result.get(5)); } + @Test + public void processCommandShouldNotAddZIfNotDefined() throws GcodeParserException { + RunFromProcessor processor = new RunFromProcessor(2); + GcodeState gcodeState = new GcodeState(); + gcodeState.commandNumber = 0; + List result = processor.processCommand("G0X10F100", gcodeState); + assertEquals(0, result.size()); + + gcodeState.commandNumber = 1; + result = processor.processCommand("G0Y10S1000", gcodeState); + assertEquals(0, result.size()); + + gcodeState.commandNumber = 2; + result = processor.processCommand("G0Y11", gcodeState); + + assertEquals(4, result.size()); + assertEquals("G21G90G91.1G94G54G17", result.get(0)); + assertEquals("G0X10.0Y10.0", result.get(1)); + assertEquals("S1000.0F100.0", result.get(2)); + assertEquals("F100.0S1000.0G0Y11", result.get(3)); + } + + @Test + public void processCommandShouldNotAddYIfNotDefined() throws GcodeParserException { + RunFromProcessor processor = new RunFromProcessor(2); + GcodeState gcodeState = new GcodeState(); + gcodeState.commandNumber = 0; + List result = processor.processCommand("G0X10F100", gcodeState); + assertEquals(0, result.size()); + + gcodeState.commandNumber = 1; + result = processor.processCommand("G0S1000", gcodeState); + assertEquals(0, result.size()); + + gcodeState.commandNumber = 2; + result = processor.processCommand("G0Y11", gcodeState); + + assertEquals(4, result.size()); + assertEquals("G21G90G91.1G94G54G17", result.get(0)); + assertEquals("G0X10.0", result.get(1)); + assertEquals("S1000.0F100.0", result.get(2)); + assertEquals("F100.0S1000.0G0Y11", result.get(3)); + } + + @Test + public void processCommandShouldNotAddXIfNotDefined() throws GcodeParserException { + RunFromProcessor processor = new RunFromProcessor(2); + GcodeState gcodeState = new GcodeState(); + gcodeState.commandNumber = 0; + List result = processor.processCommand("G0F100", gcodeState); + assertEquals(0, result.size()); + + gcodeState.commandNumber = 1; + result = processor.processCommand("G0S1000", gcodeState); + assertEquals(0, result.size()); + + gcodeState.commandNumber = 2; + result = processor.processCommand("G0Y11", gcodeState); + + assertEquals(4, result.size()); + assertEquals("G21G90G91.1G94G54G17", result.get(0)); + assertEquals("G0", result.get(1)); + assertEquals("S1000.0F100.0", result.get(2)); + assertEquals("F100.0S1000.0G0Y11", result.get(3)); + } + @Test public void processArcs() throws GcodeParserException { List gcode = Arrays.asList("G17 G21 G90 G94 G54 M0 M5 M9", @@ -94,6 +162,7 @@ public void processArcsAfterExpand() throws GcodeParserException { processorList.add(new RunFromProcessor(6)); GcodeState gcodeState = new GcodeState(); + gcodeState.currentPoint = new Position(0,0,0, UnitUtils.Units.MM); List result = new ArrayList<>(); for (int i = 0; i < gcode.size(); i++) { gcodeState.commandNumber = i; diff --git a/ugs-core/test/com/willwinder/universalgcodesender/gcode/util/GcodeParserUtilsTest.java b/ugs-core/test/com/willwinder/universalgcodesender/gcode/util/GcodeParserUtilsTest.java index 9eb195a30d..1c85c8384f 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/gcode/util/GcodeParserUtilsTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/gcode/util/GcodeParserUtilsTest.java @@ -40,7 +40,7 @@ public void missingAxisWords() throws GcodeParserException { List metaList = GcodeParserUtils.processCommand("G38.2", 0, new GcodeState()); GcodeParser.GcodeMeta meta = Iterables.getOnlyElement(metaList); assertThat(meta.code).isEqualTo(G38_2); - assertThat(meta.state.currentPoint).isEqualTo(new Position(0, 0, 0, MM)); + assertThat(meta.state.currentPoint).isEqualTo(new Position(Double.NaN, Double.NaN, Double.NaN, MM)); } @Test @@ -92,7 +92,7 @@ public void motionNoAxes() throws Exception { List metaList = GcodeParserUtils.processCommand("G3", 0, new GcodeState()); GcodeParser.GcodeMeta meta = Iterables.getOnlyElement(metaList); assertThat(meta.code).isEqualTo(G3); - assertThat(meta.state.currentPoint).isEqualTo(new Position(0, 0, 0, MM)); + assertThat(meta.state.currentPoint).isEqualTo(new Position(Double.NaN, Double.NaN, Double.NaN, MM)); } @Test diff --git a/ugs-core/test/resources/gcode/circle_test.nc.processed b/ugs-core/test/resources/gcode/circle_test.nc.processed index e1ba9f2941..65c23b2a6f 100644 --- a/ugs-core/test/resources/gcode/circle_test.nc.processed +++ b/ugs-core/test/resources/gcode/circle_test.nc.processed @@ -10,51 +10,10 @@ G90 M9 T12 M6 -G0X0Y0Z1 -G0X0Y0Z2 -G0X0Y0Z3 -G0X0Y0Z4 -G0X0Y0Z5 -G0X0Y0Z6 -G0X0Y0Z7 -G0X0Y0Z8 -G0X0Y0Z9 -G0X0Y0Z10 +Z10 G54 M8 -G0X0.42Y0.8824Z10 -G0X0.84Y1.7648Z10 -G0X1.26Y2.6473Z10 -G0X1.68Y3.5297Z10 -G0X2.1Y4.4121Z10 -G0X2.52Y5.2945Z10 -G0X2.94Y6.177Z10 -G0X3.36Y7.0594Z10 -G0X3.78Y7.9418Z10 -G0X4.2Y8.8242Z10 -G0X4.62Y9.7067Z10 -G0X5.04Y10.5891Z10 -G0X5.46Y11.4715Z10 -G0X5.88Y12.3539Z10 -G0X6.3Y13.2364Z10 -G0X6.72Y14.1188Z10 -G0X7.14Y15.0012Z10 -G0X7.56Y15.8836Z10 -G0X7.98Y16.7661Z10 -G0X8.4Y17.6485Z10 -G0X8.82Y18.5309Z10 -G0X9.24Y19.4133Z10 -G0X9.66Y20.2958Z10 -G0X10.08Y21.1782Z10 -G0X10.5Y22.0606Z10 -G0X10.92Y22.943Z10 -G0X11.34Y23.8255Z10 -G0X11.76Y24.7079Z10 -G0X12.18Y25.5903Z10 -G0X12.6Y26.4727Z10 -G0X13.02Y27.3552Z10 -G0X13.44Y28.2376Z10 -G0X13.86Y29.12Z10 +G0 X13.86 Y29.12Z10 S1000 M3 G0X13.86Y29.12Z9 G0X13.86Y29.12Z8 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/G18_G2_one_arc.input.nc b/ugs-core/test/resources/gcode/fixtures/arc/G18_G2_one_arc.input.nc index cc7ecdc70b..4d887509f2 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/G18_G2_one_arc.input.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/G18_G2_one_arc.input.nc @@ -1,3 +1,3 @@ G18 -G00 X-1.5 Y0. +G00 X-1.5 Y0. Z0 G02 X1.5 Z0 I1.5 K0 F200 \ No newline at end of file diff --git a/ugs-core/test/resources/gcode/fixtures/arc/G18_G3_one_arc.input.nc b/ugs-core/test/resources/gcode/fixtures/arc/G18_G3_one_arc.input.nc index fdedabcf4d..61602ee322 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/G18_G3_one_arc.input.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/G18_G3_one_arc.input.nc @@ -1,3 +1,3 @@ G18 -G00 X-1.5 Y0. +G00 X-1.5 Y0. Z0 G03 X1.5 Z0 I1.5 K0 F200 \ No newline at end of file diff --git a/ugs-core/test/resources/gcode/fixtures/arc/Helix.input.nc b/ugs-core/test/resources/gcode/fixtures/arc/Helix.input.nc index f6110f7fb8..4466d7f57b 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/Helix.input.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/Helix.input.nc @@ -1,4 +1,4 @@ G17 -G00 X0 Y0 +G00 X0 Y0 Z0 G02 X0 Y0 Z5 I1.5 J0 G03 X0 Y0 Z10 I1.5 J0 \ No newline at end of file diff --git a/ugs-core/test/resources/gcode/fixtures/arc/arc_feed.input.nc b/ugs-core/test/resources/gcode/fixtures/arc/arc_feed.input.nc index 275adfbd8a..f97f4de9da 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/arc_feed.input.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/arc_feed.input.nc @@ -1,5 +1,5 @@ G17 -G00 X0 Y0 +G00 X0 Y0 Z0 G01 X0 Y0 F100 G02 X0 Y0 Z5 I1.5 J0 F200 G03 X0 Y0 Z10 I1.5 J0 F300 \ No newline at end of file diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.parsed_output.nc index 8e0feca9eb..f3e56399b6 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.parsed_output.nc @@ -1,52 +1,51 @@ G17 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00 X-1.5 Y0. F100 -G1X-1.496788385Y0.098104694Z0 -G1X-1.487167292Y0.195789288Z0 -G1X-1.471177921Y0.292635483Z0 -G1X-1.448888739Y0.388228568Z0 -G1X-1.420395194Y0.482159198Z0 -G1X-1.385819299Y0.574025149Z0 -G1X-1.345309112Y0.663433035Z0 -G1X-1.299038106Y0.75Z0 -G1X-1.247204418Y0.83335535Z0 -G1X-1.19003001Y0.913142144Z0 -G1X-1.127759711Y0.989018723Z0 -G1X-1.060660172Y1.060660172Z0 -G1X-0.989018723Y1.127759711Z0 -G1X-0.913142144Y1.19003001Z0 -G1X-0.83335535Y1.247204418Z0 -G1X-0.75Y1.299038106Z0 -G1X-0.663433035Y1.345309112Z0 -G1X-0.574025149Y1.385819299Z0 -G1X-0.482159198Y1.420395194Z0 -G1X-0.388228568Y1.448888739Z0 -G1X-0.292635483Y1.471177921Z0 -G1X-0.195789288Y1.487167292Z0 -G1X-0.098104694Y1.496788385Z0 -G1X0Y1.5Z0 -G1X0.098104694Y1.496788385Z0 -G1X0.195789288Y1.487167292Z0 -G1X0.292635483Y1.471177921Z0 -G1X0.388228568Y1.448888739Z0 -G1X0.482159198Y1.420395194Z0 -G1X0.574025149Y1.385819299Z0 -G1X0.663433035Y1.345309112Z0 -G1X0.75Y1.299038106Z0 -G1X0.83335535Y1.247204418Z0 -G1X0.913142144Y1.19003001Z0 -G1X0.989018723Y1.127759711Z0 -G1X1.060660172Y1.060660172Z0 -G1X1.127759711Y0.989018723Z0 -G1X1.19003001Y0.913142144Z0 -G1X1.247204418Y0.83335535Z0 -G1X1.299038106Y0.75Z0 -G1X1.345309112Y0.663433035Z0 -G1X1.385819299Y0.574025149Z0 -G1X1.420395194Y0.482159198Z0 -G1X1.448888739Y0.388228568Z0 -G1X1.471177921Y0.292635483Z0 -G1X1.487167292Y0.195789288Z0 -G1X1.496788385Y0.098104694Z0 -G1X1.5Y0Z0 +G1X-1.496788385Y0.098104694 +G1X-1.487167292Y0.195789288 +G1X-1.471177921Y0.292635483 +G1X-1.448888739Y0.388228568 +G1X-1.420395194Y0.482159198 +G1X-1.385819299Y0.574025149 +G1X-1.345309112Y0.663433035 +G1X-1.299038106Y0.75 +G1X-1.247204418Y0.83335535 +G1X-1.19003001Y0.913142144 +G1X-1.127759711Y0.989018723 +G1X-1.060660172Y1.060660172 +G1X-0.989018723Y1.127759711 +G1X-0.913142144Y1.19003001 +G1X-0.83335535Y1.247204418 +G1X-0.75Y1.299038106 +G1X-0.663433035Y1.345309112 +G1X-0.574025149Y1.385819299 +G1X-0.482159198Y1.420395194 +G1X-0.388228568Y1.448888739 +G1X-0.292635483Y1.471177921 +G1X-0.195789288Y1.487167292 +G1X-0.098104694Y1.496788385 +G1X0Y1.5 +G1X0.098104694Y1.496788385 +G1X0.195789288Y1.487167292 +G1X0.292635483Y1.471177921 +G1X0.388228568Y1.448888739 +G1X0.482159198Y1.420395194 +G1X0.574025149Y1.385819299 +G1X0.663433035Y1.345309112 +G1X0.75Y1.299038106 +G1X0.83335535Y1.247204418 +G1X0.913142144Y1.19003001 +G1X0.989018723Y1.127759711 +G1X1.060660172Y1.060660172 +G1X1.127759711Y0.989018723 +G1X1.19003001Y0.913142144 +G1X1.247204418Y0.83335535 +G1X1.299038106Y0.75 +G1X1.345309112Y0.663433035 +G1X1.385819299Y0.574025149 +G1X1.420395194Y0.482159198 +G1X1.448888739Y0.388228568 +G1X1.471177921Y0.292635483 +G1X1.487167292Y0.195789288 +G1X1.496788385Y0.098104694 +G1X1.5Y0 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.stream_output.nc index ef12589814..2abb1a578e 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G2_one_arc.stream_output.nc @@ -1,53 +1,52 @@ -gsw_meta:52 +gsw_meta:51 G17¶¶G17¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0.¶¶G00 X-1.5 Y0.¶¶2¶¶ G02 X1.5 Y0 I1.5 J0 F100¶¶F100¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.496788385Y0.098104694Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.487167292Y0.195789288Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.471177921Y0.292635483Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.448888739Y0.388228568Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.420395194Y0.482159198Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.385819299Y0.574025149Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.345309112Y0.663433035Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.299038106Y0.75Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.247204418Y0.83335535Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.19003001Y0.913142144Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.127759711Y0.989018723Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.060660172Y1.060660172Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.989018723Y1.127759711Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.913142144Y1.19003001Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.83335535Y1.247204418Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.75Y1.299038106Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.663433035Y1.345309112Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.574025149Y1.385819299Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.482159198Y1.420395194Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.388228568Y1.448888739Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.292635483Y1.471177921Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.195789288Y1.487167292Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.098104694Y1.496788385Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0Y1.5Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.098104694Y1.496788385Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.195789288Y1.487167292Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.292635483Y1.471177921Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.388228568Y1.448888739Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.482159198Y1.420395194Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.574025149Y1.385819299Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.663433035Y1.345309112Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.75Y1.299038106Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.83335535Y1.247204418Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.913142144Y1.19003001Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.989018723Y1.127759711Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.060660172Y1.060660172Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.127759711Y0.989018723Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.19003001Y0.913142144Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.247204418Y0.83335535Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.299038106Y0.75Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.345309112Y0.663433035Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.385819299Y0.574025149Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.420395194Y0.482159198Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.448888739Y0.388228568Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.471177921Y0.292635483Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.487167292Y0.195789288Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.496788385Y0.098104694Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.5Y0Z0¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.496788385Y0.098104694¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.487167292Y0.195789288¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.471177921Y0.292635483¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.448888739Y0.388228568¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.420395194Y0.482159198¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.385819299Y0.574025149¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.345309112Y0.663433035¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.299038106Y0.75¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.247204418Y0.83335535¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.19003001Y0.913142144¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.127759711Y0.989018723¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.060660172Y1.060660172¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.989018723Y1.127759711¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.913142144Y1.19003001¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.83335535Y1.247204418¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.75Y1.299038106¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.663433035Y1.345309112¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.574025149Y1.385819299¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.482159198Y1.420395194¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.388228568Y1.448888739¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.292635483Y1.471177921¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.195789288Y1.487167292¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.098104694Y1.496788385¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0Y1.5¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.098104694Y1.496788385¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.195789288Y1.487167292¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.292635483Y1.471177921¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.388228568Y1.448888739¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.482159198Y1.420395194¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.574025149Y1.385819299¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.663433035Y1.345309112¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.75Y1.299038106¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.83335535Y1.247204418¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.913142144Y1.19003001¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.989018723Y1.127759711¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.060660172Y1.060660172¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.127759711Y0.989018723¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.19003001Y0.913142144¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.247204418Y0.83335535¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.299038106Y0.75¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.345309112Y0.663433035¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.385819299Y0.574025149¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.420395194Y0.482159198¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.448888739Y0.388228568¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.471177921Y0.292635483¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.487167292Y0.195789288¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.496788385Y0.098104694¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.5Y0¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.parsed_output.nc index 651ff373b3..3794c75152 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.parsed_output.nc @@ -1,52 +1,51 @@ G17 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00 X-1.5 Y0. F200 -G1X-1.496788385Y-0.098104694Z0 -G1X-1.487167292Y-0.195789288Z0 -G1X-1.471177921Y-0.292635483Z0 -G1X-1.448888739Y-0.388228568Z0 -G1X-1.420395194Y-0.482159198Z0 -G1X-1.385819299Y-0.574025149Z0 -G1X-1.345309112Y-0.663433035Z0 -G1X-1.299038106Y-0.75Z0 -G1X-1.247204418Y-0.83335535Z0 -G1X-1.19003001Y-0.913142144Z0 -G1X-1.127759711Y-0.989018723Z0 -G1X-1.060660172Y-1.060660172Z0 -G1X-0.989018723Y-1.127759711Z0 -G1X-0.913142144Y-1.19003001Z0 -G1X-0.83335535Y-1.247204418Z0 -G1X-0.75Y-1.299038106Z0 -G1X-0.663433035Y-1.345309112Z0 -G1X-0.574025149Y-1.385819299Z0 -G1X-0.482159198Y-1.420395194Z0 -G1X-0.388228568Y-1.448888739Z0 -G1X-0.292635483Y-1.471177921Z0 -G1X-0.195789288Y-1.487167292Z0 -G1X-0.098104694Y-1.496788385Z0 -G1X-0Y-1.5Z0 -G1X0.098104694Y-1.496788385Z0 -G1X0.195789288Y-1.487167292Z0 -G1X0.292635483Y-1.471177921Z0 -G1X0.388228568Y-1.448888739Z0 -G1X0.482159198Y-1.420395194Z0 -G1X0.574025149Y-1.385819299Z0 -G1X0.663433035Y-1.345309112Z0 -G1X0.75Y-1.299038106Z0 -G1X0.83335535Y-1.247204418Z0 -G1X0.913142144Y-1.19003001Z0 -G1X0.989018723Y-1.127759711Z0 -G1X1.060660172Y-1.060660172Z0 -G1X1.127759711Y-0.989018723Z0 -G1X1.19003001Y-0.913142144Z0 -G1X1.247204418Y-0.83335535Z0 -G1X1.299038106Y-0.75Z0 -G1X1.345309112Y-0.663433035Z0 -G1X1.385819299Y-0.574025149Z0 -G1X1.420395194Y-0.482159198Z0 -G1X1.448888739Y-0.388228568Z0 -G1X1.471177921Y-0.292635483Z0 -G1X1.487167292Y-0.195789288Z0 -G1X1.496788385Y-0.098104694Z0 -G1X1.5Y0Z0 +G1X-1.496788385Y-0.098104694 +G1X-1.487167292Y-0.195789288 +G1X-1.471177921Y-0.292635483 +G1X-1.448888739Y-0.388228568 +G1X-1.420395194Y-0.482159198 +G1X-1.385819299Y-0.574025149 +G1X-1.345309112Y-0.663433035 +G1X-1.299038106Y-0.75 +G1X-1.247204418Y-0.83335535 +G1X-1.19003001Y-0.913142144 +G1X-1.127759711Y-0.989018723 +G1X-1.060660172Y-1.060660172 +G1X-0.989018723Y-1.127759711 +G1X-0.913142144Y-1.19003001 +G1X-0.83335535Y-1.247204418 +G1X-0.75Y-1.299038106 +G1X-0.663433035Y-1.345309112 +G1X-0.574025149Y-1.385819299 +G1X-0.482159198Y-1.420395194 +G1X-0.388228568Y-1.448888739 +G1X-0.292635483Y-1.471177921 +G1X-0.195789288Y-1.487167292 +G1X-0.098104694Y-1.496788385 +G1X-0Y-1.5 +G1X0.098104694Y-1.496788385 +G1X0.195789288Y-1.487167292 +G1X0.292635483Y-1.471177921 +G1X0.388228568Y-1.448888739 +G1X0.482159198Y-1.420395194 +G1X0.574025149Y-1.385819299 +G1X0.663433035Y-1.345309112 +G1X0.75Y-1.299038106 +G1X0.83335535Y-1.247204418 +G1X0.913142144Y-1.19003001 +G1X0.989018723Y-1.127759711 +G1X1.060660172Y-1.060660172 +G1X1.127759711Y-0.989018723 +G1X1.19003001Y-0.913142144 +G1X1.247204418Y-0.83335535 +G1X1.299038106Y-0.75 +G1X1.345309112Y-0.663433035 +G1X1.385819299Y-0.574025149 +G1X1.420395194Y-0.482159198 +G1X1.448888739Y-0.388228568 +G1X1.471177921Y-0.292635483 +G1X1.487167292Y-0.195789288 +G1X1.496788385Y-0.098104694 +G1X1.5Y0 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.stream_output.nc index b70ae46276..8cacdca675 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G17_G3_one_arc.stream_output.nc @@ -1,53 +1,52 @@ -gsw_meta:52 +gsw_meta:51 G17¶¶G17¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0.¶¶G00 X-1.5 Y0.¶¶2¶¶ G03 X1.5 Y0 I1.5 J0 F200¶¶F200¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.496788385Y-0.098104694Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.487167292Y-0.195789288Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.471177921Y-0.292635483Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.448888739Y-0.388228568Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.420395194Y-0.482159198Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.385819299Y-0.574025149Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.345309112Y-0.663433035Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.299038106Y-0.75Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.247204418Y-0.83335535Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.19003001Y-0.913142144Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.127759711Y-0.989018723Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.060660172Y-1.060660172Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.989018723Y-1.127759711Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.913142144Y-1.19003001Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.83335535Y-1.247204418Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.75Y-1.299038106Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.663433035Y-1.345309112Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.574025149Y-1.385819299Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.482159198Y-1.420395194Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.388228568Y-1.448888739Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.292635483Y-1.471177921Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.195789288Y-1.487167292Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.098104694Y-1.496788385Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0Y-1.5Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.098104694Y-1.496788385Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.195789288Y-1.487167292Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.292635483Y-1.471177921Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.388228568Y-1.448888739Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.482159198Y-1.420395194Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.574025149Y-1.385819299Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.663433035Y-1.345309112Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.75Y-1.299038106Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.83335535Y-1.247204418Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.913142144Y-1.19003001Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.989018723Y-1.127759711Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.060660172Y-1.060660172Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.127759711Y-0.989018723Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.19003001Y-0.913142144Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.247204418Y-0.83335535Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.299038106Y-0.75Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.345309112Y-0.663433035Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.385819299Y-0.574025149Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.420395194Y-0.482159198Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.448888739Y-0.388228568Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.471177921Y-0.292635483Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.487167292Y-0.195789288Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.496788385Y-0.098104694Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.5Y0Z0¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.496788385Y-0.098104694¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.487167292Y-0.195789288¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.471177921Y-0.292635483¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.448888739Y-0.388228568¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.420395194Y-0.482159198¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.385819299Y-0.574025149¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.345309112Y-0.663433035¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.299038106Y-0.75¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.247204418Y-0.83335535¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.19003001Y-0.913142144¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.127759711Y-0.989018723¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.060660172Y-1.060660172¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.989018723Y-1.127759711¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.913142144Y-1.19003001¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.83335535Y-1.247204418¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.75Y-1.299038106¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.663433035Y-1.345309112¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.574025149Y-1.385819299¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.482159198Y-1.420395194¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.388228568Y-1.448888739¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.292635483Y-1.471177921¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.195789288Y-1.487167292¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.098104694Y-1.496788385¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0Y-1.5¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.098104694Y-1.496788385¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.195789288Y-1.487167292¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.292635483Y-1.471177921¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.388228568Y-1.448888739¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.482159198Y-1.420395194¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.574025149Y-1.385819299¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.663433035Y-1.345309112¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.75Y-1.299038106¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.83335535Y-1.247204418¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.913142144Y-1.19003001¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.989018723Y-1.127759711¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.060660172Y-1.060660172¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.127759711Y-0.989018723¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.19003001Y-0.913142144¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.247204418Y-0.83335535¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.299038106Y-0.75¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.345309112Y-0.663433035¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.385819299Y-0.574025149¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.420395194Y-0.482159198¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.448888739Y-0.388228568¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.471177921Y-0.292635483¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.487167292Y-0.195789288¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.496788385Y-0.098104694¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.5Y0¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.parsed_output.nc index a437f26656..f0ed6e47a5 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G18 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00 X-1.5 Y0. Z0 F200 G1X-1.496788385Y0Z-0.098104694 G1X-1.487167292Y0Z-0.195789288 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.stream_output.nc index d1ade0b945..9bb7134954 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G2_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G18¶¶G18¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0. Z0¶¶G00 X-1.5 Y0. Z0¶¶2¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶F200¶¶3¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.496788385Y0Z-0.098104694¶¶3¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.487167292Y0Z-0.195789288¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.parsed_output.nc index ea4e46c617..f491863dd6 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G18 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00 X-1.5 Y0. Z0 F200 G1X-1.496788385Y0Z0.098104694 G1X-1.487167292Y0Z0.195789288 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.stream_output.nc index 591abb1700..f7322180cd 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G18_G3_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G18¶¶G18¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0. Z0¶¶G00 X-1.5 Y0. Z0¶¶2¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶F200¶¶3¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.496788385Y0Z0.098104694¶¶3¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.487167292Y0Z0.195789288¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.parsed_output.nc index 990a2c15cd..5ed5a34ec5 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G19 -G0X0Y-0.75Z0 -G0X0Y-1.5Z0 +G00 Y-1.5 Z0 X0 F200 G1X0Y-1.496788385Z0.098104694 G1X0Y-1.487167292Z0.195789288 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.stream_output.nc index e7f73ac5e1..5a20c0be73 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G2_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G19¶¶G19¶¶1¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-0.75Z0¶¶2¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-1.5Z0¶¶2¶¶ +G00 Y-1.5 Z0 X0¶¶G00 Y-1.5 Z0 X0¶¶2¶¶ G02 Y1.5 Z0 J1.5 K0 F200¶¶F200¶¶3¶¶ G02 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.496788385Z0.098104694¶¶3¶¶ G02 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.487167292Z0.195789288¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.parsed_output.nc index b1a748f800..504bd6f5fc 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G19 -G0X0Y-0.75Z0 -G0X0Y-1.5Z0 +G00 Y-1.5 Z0 X0 F200 G1X0Y-1.496788385Z-0.098104694 G1X0Y-1.487167292Z-0.195789288 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.stream_output.nc index 011a9a54c3..10015f5d15 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/G19_G3_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G19¶¶G19¶¶1¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-0.75Z0¶¶2¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-1.5Z0¶¶2¶¶ +G00 Y-1.5 Z0 X0¶¶G00 Y-1.5 Z0 X0¶¶2¶¶ G03 Y1.5 Z0 J1.5 K0 F200¶¶F200¶¶3¶¶ G03 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.496788385Z-0.098104694¶¶3¶¶ G03 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.487167292Z-0.195789288¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.parsed_output.nc index 89c765be82..efbadc1da7 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.parsed_output.nc @@ -1,5 +1,5 @@ G17 -G00 X0 Y0 +G00 X0 Y0 Z0 G1X0.003279559Y0.099135876Z0.052631579 G1X0.013103896Y0.197838257Z0.105263158 G1X0.029430051Y0.295675541Z0.157894737 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.stream_output.nc index ea064a7bf6..5a2886f344 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/Helix.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:192 G17¶¶G17¶¶1¶¶ -G00 X0 Y0¶¶G00 X0 Y0¶¶2¶¶ +G00 X0 Y0 Z0¶¶G00 X0 Y0 Z0¶¶2¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.003279559Y0.099135876Z0.052631579¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.013103896Y0.197838257Z0.105263158¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.029430051Y0.295675541Z0.157894737¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.parsed_output.nc index b2ce710d92..f7891b46fc 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.parsed_output.nc @@ -1,5 +1,5 @@ G17 -G00 X0 Y0 +G00 X0 Y0 Z0 G01 X0 Y0 F100 F200 G1X0.003279559Y0.099135876Z0.052631579 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.stream_output.nc index d9577d393e..e21a3c65ca 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/arc_feed.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:195 G17¶¶G17¶¶1¶¶ -G00 X0 Y0¶¶G00 X0 Y0¶¶2¶¶ +G00 X0 Y0 Z0¶¶G00 X0 Y0 Z0¶¶2¶¶ G01 X0 Y0 F100¶¶G01 X0 Y0 F100¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0 F200¶¶F200¶¶4¶¶ G02 X0 Y0 Z5 I1.5 J0 F200¶¶G1X0.003279559Y0.099135876Z0.052631579¶¶4¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.parsed_output.nc index 9361d7f472..646548bef7 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.parsed_output.nc @@ -10,51 +10,10 @@ G90 M9 T12 M6 -G0X0Y0Z1 -G0X0Y0Z2 -G0X0Y0Z3 -G0X0Y0Z4 -G0X0Y0Z5 -G0X0Y0Z6 -G0X0Y0Z7 -G0X0Y0Z8 -G0X0Y0Z9 -G0X0Y0Z10 +Z10 G54 M8 -G0X0.42Y0.8824Z10 -G0X0.84Y1.7648Z10 -G0X1.26Y2.6473Z10 -G0X1.68Y3.5297Z10 -G0X2.1Y4.4121Z10 -G0X2.52Y5.2945Z10 -G0X2.94Y6.177Z10 -G0X3.36Y7.0594Z10 -G0X3.78Y7.9418Z10 -G0X4.2Y8.8242Z10 -G0X4.62Y9.7067Z10 -G0X5.04Y10.5891Z10 -G0X5.46Y11.4715Z10 -G0X5.88Y12.3539Z10 -G0X6.3Y13.2364Z10 -G0X6.72Y14.1188Z10 -G0X7.14Y15.0012Z10 -G0X7.56Y15.8836Z10 -G0X7.98Y16.7661Z10 -G0X8.4Y17.6485Z10 -G0X8.82Y18.5309Z10 -G0X9.24Y19.4133Z10 -G0X9.66Y20.2958Z10 -G0X10.08Y21.1782Z10 -G0X10.5Y22.0606Z10 -G0X10.92Y22.943Z10 -G0X11.34Y23.8255Z10 -G0X11.76Y24.7079Z10 -G0X12.18Y25.5903Z10 -G0X12.6Y26.4727Z10 -G0X13.02Y27.3552Z10 -G0X13.44Y28.2376Z10 -G0X13.86Y29.12Z10 +G0 X13.86 Y29.12 S1000 M3 G0X13.86Y29.12Z9 G0X13.86Y29.12Z8 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.stream_output.nc index 5be62c581a..bf5e61229c 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArc/circle_test.stream_output.nc @@ -1,4 +1,4 @@ -gsw_meta:1030 +gsw_meta:989 %¶¶¶¶1¶¶% (1001)¶¶¶¶2¶¶1001 (T12 D=1.4 CR=0 - ZMIN=-1 - flat end mill)¶¶¶¶3¶¶T12 D=1.4 CR=0 - ZMIN=-1 - flat end mill @@ -11,51 +11,10 @@ G90¶¶G90¶¶8¶¶ (2D Contour1)¶¶¶¶10¶¶2D Contour1 M9¶¶M9¶¶11¶¶ T12 M6¶¶T12 M6¶¶12¶¶ -Z10¶¶G0X0Y0Z1¶¶13¶¶ -Z10¶¶G0X0Y0Z2¶¶13¶¶ -Z10¶¶G0X0Y0Z3¶¶13¶¶ -Z10¶¶G0X0Y0Z4¶¶13¶¶ -Z10¶¶G0X0Y0Z5¶¶13¶¶ -Z10¶¶G0X0Y0Z6¶¶13¶¶ -Z10¶¶G0X0Y0Z7¶¶13¶¶ -Z10¶¶G0X0Y0Z8¶¶13¶¶ -Z10¶¶G0X0Y0Z9¶¶13¶¶ -Z10¶¶G0X0Y0Z10¶¶13¶¶ +Z10¶¶Z10¶¶13¶¶ G54¶¶G54¶¶14¶¶ M8¶¶M8¶¶15¶¶ -G0 X13.86 Y29.12¶¶G0X0.42Y0.8824Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X0.84Y1.7648Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X1.26Y2.6473Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X1.68Y3.5297Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X2.1Y4.4121Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X2.52Y5.2945Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X2.94Y6.177Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X3.36Y7.0594Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X3.78Y7.9418Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X4.2Y8.8242Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X4.62Y9.7067Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X5.04Y10.5891Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X5.46Y11.4715Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X5.88Y12.3539Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X6.3Y13.2364Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X6.72Y14.1188Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X7.14Y15.0012Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X7.56Y15.8836Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X7.98Y16.7661Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X8.4Y17.6485Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X8.82Y18.5309Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X9.24Y19.4133Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X9.66Y20.2958Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X10.08Y21.1782Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X10.5Y22.0606Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X10.92Y22.943Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X11.34Y23.8255Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X11.76Y24.7079Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X12.18Y25.5903Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X12.6Y26.4727Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X13.02Y27.3552Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X13.44Y28.2376Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X13.86Y29.12Z10¶¶16¶¶ +G0 X13.86 Y29.12¶¶G0 X13.86 Y29.12¶¶16¶¶ S1000 M3¶¶S1000 M3¶¶17¶¶ Z5¶¶G0X13.86Y29.12Z9¶¶18¶¶ Z5¶¶G0X13.86Y29.12Z8¶¶18¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.parsed_output.nc index b5cbee04b5..db35f5290d 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.parsed_output.nc @@ -1,8 +1,8 @@ G17 G00 X-1.5 Y0. F100 -G1X-1.213525492Y0.881677878Z0 -G1X-0.463525492Y1.426584774Z0 -G1X0.463525492Y1.426584774Z0 -G1X1.213525492Y0.881677878Z0 -G1X1.5Y0Z0 +G1X-1.213525492Y0.881677878 +G1X-0.463525492Y1.426584774 +G1X0.463525492Y1.426584774 +G1X1.213525492Y0.881677878 +G1X1.5Y0 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.stream_output.nc index a12fd495fe..293586be62 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G2_one_arc.stream_output.nc @@ -2,8 +2,8 @@ gsw_meta:8 G17¶¶G17¶¶1¶¶ G00 X-1.5 Y0.¶¶G00 X-1.5 Y0.¶¶2¶¶ G02 X1.5 Y0 I1.5 J0 F100¶¶F100¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.213525492Y0.881677878Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.463525492Y1.426584774Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.463525492Y1.426584774Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.213525492Y0.881677878Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.5Y0Z0¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.213525492Y0.881677878¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-0.463525492Y1.426584774¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X0.463525492Y1.426584774¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.213525492Y0.881677878¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.5Y0¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.parsed_output.nc index d736f0c980..2daf5efab9 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.parsed_output.nc @@ -1,8 +1,8 @@ G17 G00 X-1.5 Y0. F200 -G1X-1.213525492Y-0.881677878Z0 -G1X-0.463525492Y-1.426584774Z0 -G1X0.463525492Y-1.426584774Z0 -G1X1.213525492Y-0.881677878Z0 -G1X1.5Y0Z0 +G1X-1.213525492Y-0.881677878 +G1X-0.463525492Y-1.426584774 +G1X0.463525492Y-1.426584774 +G1X1.213525492Y-0.881677878 +G1X1.5Y0 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.stream_output.nc index 69e120325b..86fa44b608 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G17_G3_one_arc.stream_output.nc @@ -2,8 +2,8 @@ gsw_meta:8 G17¶¶G17¶¶1¶¶ G00 X-1.5 Y0.¶¶G00 X-1.5 Y0.¶¶2¶¶ G03 X1.5 Y0 I1.5 J0 F200¶¶F200¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.213525492Y-0.881677878Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.463525492Y-1.426584774Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.463525492Y-1.426584774Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.213525492Y-0.881677878Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.5Y0Z0¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.213525492Y-0.881677878¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-0.463525492Y-1.426584774¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.463525492Y-1.426584774¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.213525492Y-0.881677878¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.5Y0¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.parsed_output.nc index 07afb71162..6760cd7bc0 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.parsed_output.nc @@ -1,5 +1,5 @@ G18 -G00 X-1.5 Y0. +G00 X-1.5 Y0. Z0 F200 G1X-1.213525492Y0Z-0.881677878 G1X-0.463525492Y0Z-1.426584774 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.stream_output.nc index e0bab05240..04225e0c84 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G2_one_arc.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:8 G18¶¶G18¶¶1¶¶ -G00 X-1.5 Y0.¶¶G00 X-1.5 Y0.¶¶2¶¶ +G00 X-1.5 Y0. Z0¶¶G00 X-1.5 Y0. Z0¶¶2¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶F200¶¶3¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.213525492Y0Z-0.881677878¶¶3¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶G1X-0.463525492Y0Z-1.426584774¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.parsed_output.nc index 71d9b0f122..98e2825a06 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.parsed_output.nc @@ -1,5 +1,5 @@ G18 -G00 X-1.5 Y0. +G00 X-1.5 Y0. Z0 F200 G1X-1.213525492Y0Z0.881677878 G1X-0.463525492Y0Z1.426584774 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.stream_output.nc index d6832b1e19..9a7f9bd8ea 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/G18_G3_one_arc.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:8 G18¶¶G18¶¶1¶¶ -G00 X-1.5 Y0.¶¶G00 X-1.5 Y0.¶¶2¶¶ +G00 X-1.5 Y0. Z0¶¶G00 X-1.5 Y0. Z0¶¶2¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶F200¶¶3¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.213525492Y0Z0.881677878¶¶3¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶G1X-0.463525492Y0Z1.426584774¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.parsed_output.nc index 5f940e931d..d06f4e81cd 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.parsed_output.nc @@ -1,5 +1,5 @@ G17 -G00 X0 Y0 +G00 X0 Y0 Z0 G1X0.286474508Y0.881677878Z0.5 G1X1.036474508Y1.426584774Z1 G1X1.963525492Y1.426584774Z1.5 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.stream_output.nc index 891896a0a8..8128cfc92a 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/Helix.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:22 G17¶¶G17¶¶1¶¶ -G00 X0 Y0¶¶G00 X0 Y0¶¶2¶¶ +G00 X0 Y0 Z0¶¶G00 X0 Y0 Z0¶¶2¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.286474508Y0.881677878Z0.5¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X1.036474508Y1.426584774Z1¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X1.963525492Y1.426584774Z1.5¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.parsed_output.nc index 82c99b5abf..b1182a0cf0 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.parsed_output.nc @@ -1,5 +1,5 @@ G17 -G00 X0 Y0 +G00 X0 Y0 Z0 G01 X0 Y0 F100 F200 G1X0.286474508Y0.881677878Z0.5 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.stream_output.nc index cca0aaf5c8..bd2c0255e8 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcCoarse/arc_feed.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:25 G17¶¶G17¶¶1¶¶ -G00 X0 Y0¶¶G00 X0 Y0¶¶2¶¶ +G00 X0 Y0 Z0¶¶G00 X0 Y0 Z0¶¶2¶¶ G01 X0 Y0 F100¶¶G01 X0 Y0 F100¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0 F200¶¶F200¶¶4¶¶ G02 X0 Y0 Z5 I1.5 J0 F200¶¶G1X0.286474508Y0.881677878Z0.5¶¶4¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.parsed_output.nc index efb51216c1..0243f1409e 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.parsed_output.nc @@ -1,52 +1,51 @@ G17 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00X-1.5Y0. F100 -G1X-1.4968Y0.0981Z0 -G1X-1.4872Y0.1958Z0 -G1X-1.4712Y0.2926Z0 -G1X-1.4489Y0.3882Z0 -G1X-1.4204Y0.4822Z0 -G1X-1.3858Y0.574Z0 -G1X-1.3453Y0.6634Z0 -G1X-1.299Y0.75Z0 -G1X-1.2472Y0.8334Z0 -G1X-1.19Y0.9131Z0 -G1X-1.1278Y0.989Z0 -G1X-1.0607Y1.0607Z0 -G1X-0.989Y1.1278Z0 -G1X-0.9131Y1.19Z0 -G1X-0.8334Y1.2472Z0 -G1X-0.75Y1.299Z0 -G1X-0.6634Y1.3453Z0 -G1X-0.574Y1.3858Z0 -G1X-0.4822Y1.4204Z0 -G1X-0.3882Y1.4489Z0 -G1X-0.2926Y1.4712Z0 -G1X-0.1958Y1.4872Z0 -G1X-0.0981Y1.4968Z0 -G1X0Y1.5Z0 -G1X0.0981Y1.4968Z0 -G1X0.1958Y1.4872Z0 -G1X0.2926Y1.4712Z0 -G1X0.3882Y1.4489Z0 -G1X0.4822Y1.4204Z0 -G1X0.574Y1.3858Z0 -G1X0.6634Y1.3453Z0 -G1X0.75Y1.299Z0 -G1X0.8334Y1.2472Z0 -G1X0.9131Y1.19Z0 -G1X0.989Y1.1278Z0 -G1X1.0607Y1.0607Z0 -G1X1.1278Y0.989Z0 -G1X1.19Y0.9131Z0 -G1X1.2472Y0.8334Z0 -G1X1.299Y0.75Z0 -G1X1.3453Y0.6634Z0 -G1X1.3858Y0.574Z0 -G1X1.4204Y0.4822Z0 -G1X1.4489Y0.3882Z0 -G1X1.4712Y0.2926Z0 -G1X1.4872Y0.1958Z0 -G1X1.4968Y0.0981Z0 -G1X1.5Y0Z0 +G1X-1.4968Y0.0981 +G1X-1.4872Y0.1958 +G1X-1.4712Y0.2926 +G1X-1.4489Y0.3882 +G1X-1.4204Y0.4822 +G1X-1.3858Y0.574 +G1X-1.3453Y0.6634 +G1X-1.299Y0.75 +G1X-1.2472Y0.8334 +G1X-1.19Y0.9131 +G1X-1.1278Y0.989 +G1X-1.0607Y1.0607 +G1X-0.989Y1.1278 +G1X-0.9131Y1.19 +G1X-0.8334Y1.2472 +G1X-0.75Y1.299 +G1X-0.6634Y1.3453 +G1X-0.574Y1.3858 +G1X-0.4822Y1.4204 +G1X-0.3882Y1.4489 +G1X-0.2926Y1.4712 +G1X-0.1958Y1.4872 +G1X-0.0981Y1.4968 +G1X0Y1.5 +G1X0.0981Y1.4968 +G1X0.1958Y1.4872 +G1X0.2926Y1.4712 +G1X0.3882Y1.4489 +G1X0.4822Y1.4204 +G1X0.574Y1.3858 +G1X0.6634Y1.3453 +G1X0.75Y1.299 +G1X0.8334Y1.2472 +G1X0.9131Y1.19 +G1X0.989Y1.1278 +G1X1.0607Y1.0607 +G1X1.1278Y0.989 +G1X1.19Y0.9131 +G1X1.2472Y0.8334 +G1X1.299Y0.75 +G1X1.3453Y0.6634 +G1X1.3858Y0.574 +G1X1.4204Y0.4822 +G1X1.4489Y0.3882 +G1X1.4712Y0.2926 +G1X1.4872Y0.1958 +G1X1.4968Y0.0981 +G1X1.5Y0 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.stream_output.nc index 50f4eba00f..6f93e42bd7 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G2_one_arc.stream_output.nc @@ -1,53 +1,52 @@ -gsw_meta:52 +gsw_meta:51 G17¶¶G17¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0.¶¶G00X-1.5Y0.¶¶2¶¶ G02 X1.5 Y0 I1.5 J0 F100¶¶F100¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.4968Y0.0981Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.4872Y0.1958Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.4712Y0.2926Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.4489Y0.3882Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.4204Y0.4822Z0¶¶3¶¶ -G02 X1.5 Y0 I1.5 J0 F100¶¶G1X-1.3858Y0.574Z0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 J0 F100¶¶G1X1.19Y0.9131¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.2472Y0.8334¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.299Y0.75¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.3453Y0.6634¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.3858Y0.574¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.4204Y0.4822¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.4489Y0.3882¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.4712Y0.2926¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.4872Y0.1958¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.4968Y0.0981¶¶3¶¶ +G02 X1.5 Y0 I1.5 J0 F100¶¶G1X1.5Y0¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.parsed_output.nc index 8cd7cf2753..f571a11bc5 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.parsed_output.nc @@ -1,52 +1,51 @@ G17 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00X-1.5Y0. F200 -G1X-1.4968Y-0.0981Z0 -G1X-1.4872Y-0.1958Z0 -G1X-1.4712Y-0.2926Z0 -G1X-1.4489Y-0.3882Z0 -G1X-1.4204Y-0.4822Z0 -G1X-1.3858Y-0.574Z0 -G1X-1.3453Y-0.6634Z0 -G1X-1.299Y-0.75Z0 -G1X-1.2472Y-0.8334Z0 -G1X-1.19Y-0.9131Z0 -G1X-1.1278Y-0.989Z0 -G1X-1.0607Y-1.0607Z0 -G1X-0.989Y-1.1278Z0 -G1X-0.9131Y-1.19Z0 -G1X-0.8334Y-1.2472Z0 -G1X-0.75Y-1.299Z0 -G1X-0.6634Y-1.3453Z0 -G1X-0.574Y-1.3858Z0 -G1X-0.4822Y-1.4204Z0 -G1X-0.3882Y-1.4489Z0 -G1X-0.2926Y-1.4712Z0 -G1X-0.1958Y-1.4872Z0 -G1X-0.0981Y-1.4968Z0 -G1X-0Y-1.5Z0 -G1X0.0981Y-1.4968Z0 -G1X0.1958Y-1.4872Z0 -G1X0.2926Y-1.4712Z0 -G1X0.3882Y-1.4489Z0 -G1X0.4822Y-1.4204Z0 -G1X0.574Y-1.3858Z0 -G1X0.6634Y-1.3453Z0 -G1X0.75Y-1.299Z0 -G1X0.8334Y-1.2472Z0 -G1X0.9131Y-1.19Z0 -G1X0.989Y-1.1278Z0 -G1X1.0607Y-1.0607Z0 -G1X1.1278Y-0.989Z0 -G1X1.19Y-0.9131Z0 -G1X1.2472Y-0.8334Z0 -G1X1.299Y-0.75Z0 -G1X1.3453Y-0.6634Z0 -G1X1.3858Y-0.574Z0 -G1X1.4204Y-0.4822Z0 -G1X1.4489Y-0.3882Z0 -G1X1.4712Y-0.2926Z0 -G1X1.4872Y-0.1958Z0 -G1X1.4968Y-0.0981Z0 -G1X1.5Y0Z0 +G1X-1.4968Y-0.0981 +G1X-1.4872Y-0.1958 +G1X-1.4712Y-0.2926 +G1X-1.4489Y-0.3882 +G1X-1.4204Y-0.4822 +G1X-1.3858Y-0.574 +G1X-1.3453Y-0.6634 +G1X-1.299Y-0.75 +G1X-1.2472Y-0.8334 +G1X-1.19Y-0.9131 +G1X-1.1278Y-0.989 +G1X-1.0607Y-1.0607 +G1X-0.989Y-1.1278 +G1X-0.9131Y-1.19 +G1X-0.8334Y-1.2472 +G1X-0.75Y-1.299 +G1X-0.6634Y-1.3453 +G1X-0.574Y-1.3858 +G1X-0.4822Y-1.4204 +G1X-0.3882Y-1.4489 +G1X-0.2926Y-1.4712 +G1X-0.1958Y-1.4872 +G1X-0.0981Y-1.4968 +G1X-0Y-1.5 +G1X0.0981Y-1.4968 +G1X0.1958Y-1.4872 +G1X0.2926Y-1.4712 +G1X0.3882Y-1.4489 +G1X0.4822Y-1.4204 +G1X0.574Y-1.3858 +G1X0.6634Y-1.3453 +G1X0.75Y-1.299 +G1X0.8334Y-1.2472 +G1X0.9131Y-1.19 +G1X0.989Y-1.1278 +G1X1.0607Y-1.0607 +G1X1.1278Y-0.989 +G1X1.19Y-0.9131 +G1X1.2472Y-0.8334 +G1X1.299Y-0.75 +G1X1.3453Y-0.6634 +G1X1.3858Y-0.574 +G1X1.4204Y-0.4822 +G1X1.4489Y-0.3882 +G1X1.4712Y-0.2926 +G1X1.4872Y-0.1958 +G1X1.4968Y-0.0981 +G1X1.5Y0 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.stream_output.nc index 0a10c3b927..2c4c480ac7 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G17_G3_one_arc.stream_output.nc @@ -1,53 +1,52 @@ -gsw_meta:52 +gsw_meta:51 G17¶¶G17¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0.¶¶G00X-1.5Y0.¶¶2¶¶ G03 X1.5 Y0 I1.5 J0 F200¶¶F200¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.4968Y-0.0981Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200¶¶G1X-1.4872Y-0.1958Z0¶¶3¶¶ -G03 X1.5 Y0 I1.5 J0 F200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X1.5 Y0 I1.5 J0 F200¶¶G1X0.8334Y-1.2472¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.9131Y-1.19¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X0.989Y-1.1278¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.0607Y-1.0607¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.1278Y-0.989¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.19Y-0.9131¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.2472Y-0.8334¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.299Y-0.75¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.3453Y-0.6634¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.3858Y-0.574¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.4204Y-0.4822¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.4489Y-0.3882¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.4712Y-0.2926¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.4872Y-0.1958¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.4968Y-0.0981¶¶3¶¶ +G03 X1.5 Y0 I1.5 J0 F200¶¶G1X1.5Y0¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.parsed_output.nc index e4ac2b2b38..3a3e6e88d2 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G18 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00X-1.5Y0.Z0 F200 G1X-1.4968Y0Z-0.0981 G1X-1.4872Y0Z-0.1958 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.stream_output.nc index a39cf2bd47..eb78cee788 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G2_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G18¶¶G18¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0. Z0¶¶G00X-1.5Y0.Z0¶¶2¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶F200¶¶3¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.4968Y0Z-0.0981¶¶3¶¶ G02 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.4872Y0Z-0.1958¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.parsed_output.nc index 126f787cb2..ecbbb806ca 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G18 -G0X-0.75Y0Z0 -G0X-1.5Y0Z0 +G00X-1.5Y0.Z0 F200 G1X-1.4968Y0Z0.0981 G1X-1.4872Y0Z0.1958 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.stream_output.nc index 50a069682d..36d2a388fa 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G18_G3_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G18¶¶G18¶¶1¶¶ -G00 X-1.5 Y0.¶¶G0X-0.75Y0Z0¶¶2¶¶ -G00 X-1.5 Y0.¶¶G0X-1.5Y0Z0¶¶2¶¶ +G00 X-1.5 Y0. Z0¶¶G00X-1.5Y0.Z0¶¶2¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶F200¶¶3¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.4968Y0Z0.0981¶¶3¶¶ G03 X1.5 Z0 I1.5 K0 F200¶¶G1X-1.4872Y0Z0.1958¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.parsed_output.nc index 6eacf02bd1..6aca368ccb 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G19 -G0X0Y-0.75Z0 -G0X0Y-1.5Z0 +G00Y-1.5Z0X0 F200 G1X0Y-1.4968Z0.0981 G1X0Y-1.4872Z0.1958 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.stream_output.nc index cecf7c4762..56b1e5fff9 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G2_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G19¶¶G19¶¶1¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-0.75Z0¶¶2¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-1.5Z0¶¶2¶¶ +G00 Y-1.5 Z0 X0¶¶G00Y-1.5Z0X0¶¶2¶¶ G02 Y1.5 Z0 J1.5 K0 F200¶¶F200¶¶3¶¶ G02 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.4968Z0.0981¶¶3¶¶ G02 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.4872Z0.1958¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.parsed_output.nc index e108418ac9..fece6f079e 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.parsed_output.nc @@ -1,6 +1,5 @@ G19 -G0X0Y-0.75Z0 -G0X0Y-1.5Z0 +G00Y-1.5Z0X0 F200 G1X0Y-1.4968Z-0.0981 G1X0Y-1.4872Z-0.1958 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.stream_output.nc index 905e6abbff..658b86b96b 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/G19_G3_one_arc.stream_output.nc @@ -1,7 +1,6 @@ -gsw_meta:52 +gsw_meta:51 G19¶¶G19¶¶1¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-0.75Z0¶¶2¶¶ -G00 Y-1.5 Z0 X0¶¶G0X0Y-1.5Z0¶¶2¶¶ +G00 Y-1.5 Z0 X0¶¶G00Y-1.5Z0X0¶¶2¶¶ G03 Y1.5 Z0 J1.5 K0 F200¶¶F200¶¶3¶¶ G03 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.4968Z-0.0981¶¶3¶¶ G03 Y1.5 Z0 J1.5 K0 F200¶¶G1X0Y-1.4872Z-0.1958¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/Helix.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/Helix.stream_output.nc index c79874a1ae..d991d489bd 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/Helix.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/Helix.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:192 G17¶¶G17¶¶1¶¶ -G00 X0 Y0¶¶G00X0Y0Z0¶¶2¶¶ +G00 X0 Y0 Z0¶¶G00X0Y0Z0¶¶2¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.0033Y0.0991Z0.0526¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.0131Y0.1978Z0.1053¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0¶¶G1X0.0294Y0.2957Z0.1579¶¶3¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/arc_feed.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/arc_feed.stream_output.nc index 99a35ed04c..1e39e2a218 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/arc_feed.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/arc_feed.stream_output.nc @@ -1,6 +1,6 @@ gsw_meta:195 G17¶¶G17¶¶1¶¶ -G00 X0 Y0¶¶G00X0Y0Z0¶¶2¶¶ +G00 X0 Y0 Z0¶¶G00X0Y0Z0¶¶2¶¶ G01 X0 Y0 F100¶¶G01X0Y0F100Z0¶¶3¶¶ G02 X0 Y0 Z5 I1.5 J0 F200¶¶F200¶¶4¶¶ G02 X0 Y0 Z5 I1.5 J0 F200¶¶G1X0.0033Y0.0991Z0.0526¶¶4¶¶ diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.parsed_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.parsed_output.nc index 38f7033ce6..84425d3ed1 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.parsed_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.parsed_output.nc @@ -10,50 +10,9 @@ G90 M9 T12M6 -G0X0Y0Z1 -G0X0Y0Z2 -G0X0Y0Z3 -G0X0Y0Z4 -G0X0Y0Z5 -G0X0Y0Z6 -G0X0Y0Z7 -G0X0Y0Z8 -G0X0Y0Z9 -G0X0Y0Z10 +Z10 G54 M8 -G0X0.42Y0.8824Z10 -G0X0.84Y1.7648Z10 -G0X1.26Y2.6473Z10 -G0X1.68Y3.5297Z10 -G0X2.1Y4.4121Z10 -G0X2.52Y5.2945Z10 -G0X2.94Y6.177Z10 -G0X3.36Y7.0594Z10 -G0X3.78Y7.9418Z10 -G0X4.2Y8.8242Z10 -G0X4.62Y9.7067Z10 -G0X5.04Y10.5891Z10 -G0X5.46Y11.4715Z10 -G0X5.88Y12.3539Z10 -G0X6.3Y13.2364Z10 -G0X6.72Y14.1188Z10 -G0X7.14Y15.0012Z10 -G0X7.56Y15.8836Z10 -G0X7.98Y16.7661Z10 -G0X8.4Y17.6485Z10 -G0X8.82Y18.5309Z10 -G0X9.24Y19.4133Z10 -G0X9.66Y20.2958Z10 -G0X10.08Y21.1782Z10 -G0X10.5Y22.0606Z10 -G0X10.92Y22.943Z10 -G0X11.34Y23.8255Z10 -G0X11.76Y24.7079Z10 -G0X12.18Y25.5903Z10 -G0X12.6Y26.4727Z10 -G0X13.02Y27.3552Z10 -G0X13.44Y28.2376Z10 G0X13.86Y29.12Z10 S1000M3 G0X13.86Y29.12Z9 diff --git a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.stream_output.nc b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.stream_output.nc index 3553c1c047..bb456127a0 100644 --- a/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.stream_output.nc +++ b/ugs-core/test/resources/gcode/fixtures/arc/outArcMesh/circle_test.stream_output.nc @@ -1,4 +1,4 @@ -gsw_meta:1030 +gsw_meta:989 %¶¶¶¶1¶¶% (1001)¶¶¶¶2¶¶1001 (T12 D=1.4 CR=0 - ZMIN=-1 - flat end mill)¶¶¶¶3¶¶T12 D=1.4 CR=0 - ZMIN=-1 - flat end mill @@ -11,50 +11,9 @@ G90¶¶G90¶¶8¶¶ (2D Contour1)¶¶¶¶10¶¶2D Contour1 M9¶¶M9¶¶11¶¶ T12 M6¶¶T12M6¶¶12¶¶ -Z10¶¶G0X0Y0Z1¶¶13¶¶ -Z10¶¶G0X0Y0Z2¶¶13¶¶ -Z10¶¶G0X0Y0Z3¶¶13¶¶ -Z10¶¶G0X0Y0Z4¶¶13¶¶ -Z10¶¶G0X0Y0Z5¶¶13¶¶ -Z10¶¶G0X0Y0Z6¶¶13¶¶ -Z10¶¶G0X0Y0Z7¶¶13¶¶ -Z10¶¶G0X0Y0Z8¶¶13¶¶ -Z10¶¶G0X0Y0Z9¶¶13¶¶ -Z10¶¶G0X0Y0Z10¶¶13¶¶ +Z10¶¶Z10¶¶13¶¶ G54¶¶G54¶¶14¶¶ M8¶¶M8¶¶15¶¶ -G0 X13.86 Y29.12¶¶G0X0.42Y0.8824Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X0.84Y1.7648Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X1.26Y2.6473Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X1.68Y3.5297Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X2.1Y4.4121Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X2.52Y5.2945Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X2.94Y6.177Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X3.36Y7.0594Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X3.78Y7.9418Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X4.2Y8.8242Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X4.62Y9.7067Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X5.04Y10.5891Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X5.46Y11.4715Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X5.88Y12.3539Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X6.3Y13.2364Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X6.72Y14.1188Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X7.14Y15.0012Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X7.56Y15.8836Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X7.98Y16.7661Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X8.4Y17.6485Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X8.82Y18.5309Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X9.24Y19.4133Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X9.66Y20.2958Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X10.08Y21.1782Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X10.5Y22.0606Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X10.92Y22.943Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X11.34Y23.8255Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X11.76Y24.7079Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X12.18Y25.5903Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X12.6Y26.4727Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X13.02Y27.3552Z10¶¶16¶¶ -G0 X13.86 Y29.12¶¶G0X13.44Y28.2376Z10¶¶16¶¶ G0 X13.86 Y29.12¶¶G0X13.86Y29.12Z10¶¶16¶¶ S1000 M3¶¶S1000M3¶¶17¶¶ Z5¶¶G0X13.86Y29.12Z9¶¶18¶¶ diff --git a/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/RendererInputHandler.java b/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/RendererInputHandler.java index 9a26867a74..6c893977b2 100644 --- a/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/RendererInputHandler.java +++ b/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/RendererInputHandler.java @@ -77,7 +77,7 @@ public RendererInputHandler(GcodeRenderer gr, FPSAnimator a, BackendAPI backend) animator.start(); settings = backend.getSettings(); - gcodeModel = new GcodeModel(Localization.getString("platform.visualizer.renderable.gcode-model")); + gcodeModel = new GcodeModel(Localization.getString("platform.visualizer.renderable.gcode-model"), backend); sizeDisplay = new SizeDisplay(Localization.getString("platform.visualizer.renderable.gcode-model-size")); selection = new Selection(Localization.getString("platform.visualizer.renderable.selection")); sizeDisplay.setUnits(settings.getPreferredUnits()); diff --git a/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/renderables/GcodeModel.java b/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/renderables/GcodeModel.java index a74d96276f..1f1376af68 100644 --- a/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/renderables/GcodeModel.java +++ b/ugs-platform/ugs-platform-visualizer/src/main/java/com/willwinder/ugs/nbm/visualizer/renderables/GcodeModel.java @@ -20,14 +20,23 @@ This file is part of Universal Gcode Sender (UGS). import com.jogamp.common.nio.Buffers; import com.jogamp.opengl.GL; +import static com.jogamp.opengl.GL.GL_LINES; import com.jogamp.opengl.GL2; import com.jogamp.opengl.GLAutoDrawable; +import static com.jogamp.opengl.fixedfunc.GLPointerFunc.GL_COLOR_ARRAY; +import static com.jogamp.opengl.fixedfunc.GLPointerFunc.GL_VERTEX_ARRAY; import com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions; +import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_MODEL; import com.willwinder.ugs.nbm.visualizer.shared.Renderable; import com.willwinder.universalgcodesender.gcode.DefaultCommandCreator; import com.willwinder.universalgcodesender.gcode.util.GcodeParserException; import com.willwinder.universalgcodesender.i18n.Localization; +import com.willwinder.universalgcodesender.listeners.ControllerState; +import com.willwinder.universalgcodesender.listeners.UGSEventListener; +import com.willwinder.universalgcodesender.model.BackendAPI; import com.willwinder.universalgcodesender.model.Position; +import com.willwinder.universalgcodesender.model.UGSEvent; +import com.willwinder.universalgcodesender.model.events.ControllerStateEvent; import com.willwinder.universalgcodesender.utils.GUIHelpers; import com.willwinder.universalgcodesender.utils.GcodeStreamReader; import com.willwinder.universalgcodesender.utils.IGcodeStreamReader; @@ -47,19 +56,17 @@ This file is part of Universal Gcode Sender (UGS). import java.util.logging.Level; import java.util.logging.Logger; -import static com.jogamp.opengl.GL.GL_LINES; -import static com.jogamp.opengl.fixedfunc.GLPointerFunc.GL_COLOR_ARRAY; -import static com.jogamp.opengl.fixedfunc.GLPointerFunc.GL_VERTEX_ARRAY; -import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_MODEL; - /** * @author wwinder */ -public class GcodeModel extends Renderable { +public class GcodeModel extends Renderable implements UGSEventListener { public static final double ARC_SEGMENT_LENGTH = 0.8; private static final Logger logger = Logger.getLogger(GcodeModel.class.getName()); private final GcodeLineColorizer colorizer = new GcodeLineColorizer(); - private boolean colorArrayDirty, vertexArrayDirty, vertexBufferDirty; + private final BackendAPI backend; + private boolean colorArrayDirty; + private boolean vertexArrayDirty; + private boolean vertexBufferDirty; // Gcode file data private String gcodeFile = null; private boolean isDrawable = false; //True if a file is loaded; false if not @@ -77,14 +84,16 @@ public class GcodeModel extends Renderable { private Position objectMax; private Position objectSize; - public GcodeModel(String title) { + public GcodeModel(String title, BackendAPI backend) { super(10, title); objectSize = new Position(0, 0, 0); reloadPreferences(new VisualizerOptions()); + this.backend = backend; + backend.addUGSEventListener(this); } @Override - final public void reloadPreferences(VisualizerOptions vo) { + public final void reloadPreferences(VisualizerOptions vo) { colorizer.reloadPreferences(vo); vertexBufferDirty = true; } @@ -203,15 +212,9 @@ private boolean generateObject() { } try { - GcodeViewParse gcvp = new GcodeViewParse(); logger.log(Level.INFO, "About to process {}", gcodeFile); - try (IGcodeStreamReader gsr = new GcodeStreamReader(new File(gcodeFile), new DefaultCommandCreator())) { - gcodeLineList = gcvp.toObjFromReader(gsr, ARC_SEGMENT_LENGTH); - } catch (GcodeStreamReader.NotGcodeStreamFile e) { - List linesInFile; - linesInFile = VisualizerUtils.readFiletoArrayList(this.gcodeFile); - gcodeLineList = gcvp.toObjRedux(linesInFile, ARC_SEGMENT_LENGTH); - } + GcodeViewParse gcvp = new GcodeViewParse(); + gcodeLineList = loadModel(gcvp); // Convert LineSegments to points. this.pointList = new ArrayList<>(gcodeLineList.size()); @@ -259,6 +262,16 @@ private boolean generateObject() { return true; } + private List loadModel(GcodeViewParse gcvp) throws IOException, GcodeParserException { + try (IGcodeStreamReader gsr = new GcodeStreamReader(new File(gcodeFile), new DefaultCommandCreator())) { + return gcvp.toObjFromReader(gsr, ARC_SEGMENT_LENGTH); + } catch (GcodeStreamReader.NotGcodeStreamFile e) { + List linesInFile; + linesInFile = VisualizerUtils.readFiletoArrayList(this.gcodeFile); + return gcvp.toObjRedux(linesInFile, ARC_SEGMENT_LENGTH); + } + } + /** * Convert the gcodeLineList into vertex and color arrays. */ @@ -267,11 +280,12 @@ private void updateVertexBuffers() { int vertIndex = 0; int colorIndex = 0; byte[] c = new byte[4]; + Position workPosition = backend.getWorkPosition(); for (LineSegment ls : gcodeLineList) { Color color = colorizer.getColor(ls, this.currentCommandNumber); - Position p1 = ls.getStart(); - Position p2 = ls.getEnd(); + Position p1 = addMissingCoordinateFromWorkPosition(ls.getStart(), workPosition); + Position p2 = addMissingCoordinateFromWorkPosition(ls.getEnd(), workPosition); c[0] = (byte) color.getRed(); c[1] = (byte) color.getGreen(); @@ -306,6 +320,24 @@ private void updateVertexBuffers() { } } + private Position addMissingCoordinateFromWorkPosition(Position position, Position workPosition) { + if (!Double.isNaN(position.getX()) && Double.isNaN(position.getY())&& Double.isNaN(position.getZ())) { + return position; + } + + Position result = new Position(position); + if (Double.isNaN(result.getX())) { + result.setX(workPosition.getX()); + } + if (Double.isNaN(result.getY())) { + result.setY(workPosition.getY()); + } + if (Double.isNaN(result.getZ())) { + result.setZ(workPosition.getZ()); + } + return result; + } + /** * Initialize or update open gl geometry array in native buffer objects. */ @@ -365,4 +397,17 @@ public boolean isEnabled() { public void setEnabled(boolean enabled) { VisualizerOptions.setBooleanOption(VISUALIZER_OPTION_MODEL, enabled); } + + @Override + public void UGSEvent(UGSEvent evt) { + if (evt instanceof ControllerStateEvent stateEvent) { + if (stateEvent.getPreviousState() != ControllerState.RUN && stateEvent.getPreviousState() != ControllerState.JOG) { + return; + } + if (stateEvent.getState() != ControllerState.IDLE) { + return; + } + vertexBufferDirty = true; + } + } }