diff --git a/src/exporter/renderer/renderer.h b/src/exporter/renderer/renderer.h index 4a40b04..8948354 100644 --- a/src/exporter/renderer/renderer.h +++ b/src/exporter/renderer/renderer.h @@ -12,6 +12,7 @@ class Renderer private: const config::Tools::Tool &m_tool; const config::Profiles::Profile &m_profile; + const bool m_laser; const float m_depthPerCut; const float m_maximumStartDepth; const float m_depthToRetract; @@ -50,7 +51,6 @@ class Renderer void render(const geometry::Polyline &polyline, const model::PathSettings &settings, geometry::CuttingDirection cuttingDirection) const { - const float maxDepth = settings.depth(); const float intensity = settings.intensity(); const float planeFeedRate = settings.planeFeedRate(); const float depthFeedRate = settings.depthFeedRate(); @@ -59,11 +59,17 @@ class Renderer m_visitor.startOperation((*iterator).start(), intensity); - const float startDepth = std::min(m_maximumStartDepth, maxDepth); - for (float depth = startDepth; depth < maxDepth + m_depthPerCut; depth += m_depthPerCut, ++iterator) { - const float boundDepth = std::fminf(depth, maxDepth); + if (m_laser) { + m_visitor.processPathAtDepth(*iterator, 0.0f, planeFeedRate, depthFeedRate); + } + else { + const float maxDepth = settings.depth(); + const float startDepth = std::min(m_maximumStartDepth, maxDepth); + for (float depth = startDepth; depth < maxDepth + m_depthPerCut; depth += m_depthPerCut, ++iterator) { + const float boundDepth = std::fminf(depth, maxDepth); - m_visitor.processPathAtDepth(*iterator, -boundDepth, planeFeedRate, depthFeedRate); + m_visitor.processPathAtDepth(*iterator, -boundDepth, planeFeedRate, depthFeedRate); + } } m_visitor.endOperation(m_depthToRetract); @@ -73,9 +79,10 @@ class Renderer explicit Renderer(const config::Tools::Tool& tool, const config::Profiles::Profile& profile, Visitor& visitor) :m_tool(tool), m_profile(profile), + m_laser(m_tool.general().laser()), m_depthPerCut(m_tool.general().depthPerCut()), m_maximumStartDepth(m_profile.cut().passAtZeroDepth() ? 0.0f : m_depthPerCut), - m_depthToRetract(m_tool.general().retractDepth()), + m_depthToRetract(m_laser ? 0.0f : m_tool.general().retractDepth()), m_visitor(visitor) { } diff --git a/template/config.xml b/template/config.xml index 4abd942..3c2e68c 100644 --- a/template/config.xml +++ b/template/config.xml @@ -41,6 +41,7 @@ +