mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Ported Slic3r::GCode::AvoidCrossingPerimeters to XS
This commit is contained in:
parent
580d28d071
commit
bf9cd1b8e6
10 changed files with 148 additions and 79 deletions
|
@ -2,32 +2,37 @@
|
|||
#define slic3r_GCode_hpp_
|
||||
|
||||
#include <myinit.h>
|
||||
#include "ExPolygon.hpp"
|
||||
#include "MotionPlanner.hpp"
|
||||
#include <string>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
// draft for a binary representation of a G-code line
|
||||
|
||||
enum GCodeCmdType {
|
||||
gcctSyncMotion,
|
||||
gcctExtrude,
|
||||
gcctResetE,
|
||||
gcctSetTemp,
|
||||
gcctSetTempWait,
|
||||
gcctToolchange,
|
||||
gcctCustom
|
||||
};
|
||||
|
||||
class GCodeCmd {
|
||||
class AvoidCrossingPerimeters {
|
||||
public:
|
||||
GCodeCmdType type;
|
||||
float X, Y, Z, E, F;
|
||||
unsigned short T, S;
|
||||
std::string custom, comment;
|
||||
float xy_dist; // cache
|
||||
|
||||
GCodeCmd(GCodeCmdType type)
|
||||
: type(type), X(0), Y(0), Z(0), E(0), F(0), T(-1), S(0), xy_dist(-1) {};
|
||||
// this flag triggers the use of the external configuration space
|
||||
bool use_external_mp;
|
||||
bool use_external_mp_once; // just for the next travel move
|
||||
|
||||
// this flag disables avoid_crossing_perimeters just for the next travel move
|
||||
// we enable it by default for the first travel move in print
|
||||
bool disable_once;
|
||||
|
||||
AvoidCrossingPerimeters();
|
||||
~AvoidCrossingPerimeters();
|
||||
void init_external_mp(const ExPolygons &islands);
|
||||
void init_layer_mp(const ExPolygons &islands);
|
||||
|
||||
//Polyline travel_to(GCode &gcodegen, const Point &point);
|
||||
Polyline travel_to(Point point, const Pointf &gcodegen_origin,
|
||||
const Point &gcodegen_last_pos);
|
||||
|
||||
private:
|
||||
MotionPlanner* _external_mp;
|
||||
MotionPlanner* _layer_mp;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue