Path: make 3Dview G99 aware

This commit is contained in:
J-Dunn
2023-04-06 12:02:48 +02:00
committed by GitHub
parent 874f4cdd15
commit 2960e0e934
2 changed files with 12 additions and 2 deletions

View File

@@ -327,7 +327,12 @@ void PathSegmentWalker::walk(PathSegmentVisitor &cb, const Base::Vector3d &start
}
Base::Vector3d p3(next);
p3.*pz = last.*pz;
if (retract_mode == 99) // G81,G83 need to account for G99 and retract to R only
p3.*pz = p2.*pz;
else
p3.*pz = last.*pz;
Base::Vector3d p3r = compensateRotation(p3, nrot, rotCenter);
plist.push_back(p1r);
@@ -353,6 +358,10 @@ void PathSegmentWalker::walk(PathSegmentVisitor &cb, const Base::Vector3d &start
pz = &Base::Vector3d::y;
} else if(name=="G19") {
pz = &Base::Vector3d::x;
} else if(name=="G98") {
retract_mode = 98;
} else if(name=="G99") {
retract_mode = 99;
}
}
}

View File

@@ -52,7 +52,7 @@ class PathExport PathSegmentVisitor
};
/**
* PathSegmentWalker processes a path a splits all movement commands into straight segments and calls the
* PathSegmentWalker processes a path and splits all movement commands into straight segments and calls the
* appropriate member of the provided PathSegmentVisitor.
* All non-movement commands are processed accordingly if they affect the movement commands.
*/
@@ -66,6 +66,7 @@ public:
private:
const Toolpath &tp;
int retract_mode;
};