... | ... | @@ -320,8 +320,8 @@ public: |
|
|
virtual void setNumSlices(int num) = 0;
|
|
|
|
|
|
// Sets the world space position and dimension, before any infill is generated.
|
|
|
// This allows to go from build space to world space, for instance to query
|
|
|
// per-layer or field parameters.
|
|
|
// This allows to convert 3D coordinates from build space to world space, for
|
|
|
// instance to query per-layer or field parameters.
|
|
|
virtual void setWorldSpace(v3f world_corner_mm, v3f extent_mm) = 0;
|
|
|
|
|
|
// Called when the infill plugin is about to be used for a brush, prior to infill generation.
|
... | ... | @@ -332,7 +332,7 @@ public: |
|
|
|
|
|
// Called just before the path generation for a given layer
|
|
|
virtual void prepareInfillForSlice(
|
|
|
int id, // Layer number (0 means lowest layer)
|
|
|
int id, // Layer number (0 means bottom layer)
|
|
|
const AAB<2, int> &xy_slice_box, // Layer position and dimension in world space
|
|
|
float layer_height_mm, // Layer height in millimeters w.r.t. bed level
|
|
|
double layer_thickness_mm, // Layer thickness in millimeters
|
... | ... | @@ -342,13 +342,13 @@ public: |
|
|
// Called on each surface within a layer. Returns 'true' if an infill was produced, 'false' to
|
|
|
// default to IceSL's built-in infiller.
|
|
|
virtual bool generateInfill(
|
|
|
int id, // Layer number (0 means lowest layer)
|
|
|
int id, // Layer number (0 means bottom layer)
|
|
|
float layer_height_mm, // Layer height in millimeters w.r.t. bed level
|
|
|
double layer_thickness_mm, // Layer thickness in millimeters
|
|
|
int brush, // Brush of geometry to be infilled
|
|
|
const ClipperLib::Paths &surface, // Surface to infill
|
|
|
std::vector<std::unique_ptr<IPath> > &fills, // Set this to the generated infill
|
|
|
bool &preserve_order, // Set to 'true' to preserve order of generated paths (defaults to false)
|
|
|
bool& preserve_order, // Set to 'true' to preserve order of generated paths (defaults to false)
|
|
|
ClipperLib::Paths &_fallback_surface // Unfilled surfaces to be handled by IceSL (can be empty)
|
|
|
) = 0;
|
|
|
|
... | ... | @@ -964,7 +964,7 @@ The function `postProcessLayer` goes through the whole layer specifically discer |
|
|
|
|
|
#### `SampleMachineCodePlugin`
|
|
|
|
|
|
Finally, in the sample machine code plugin, we want to export a preview of each layer into an SVG file where each color stands for a specific type of trajectory. This is useful for debugging purposes when IceSL's path previewer isn't available or hard to discern. The sample plugin also shows these previews as UI elements, thus also exemplifying how to use the GUI functionalty of plugins.
|
|
|
Finally, in the sample machine code plugin, we want to export a preview of each layer into an SVG file where each color stands for a specific type of trajectory. This is useful for debugging purposes when IceSL's path previewer isn't available or hard to discern. The sample plugin also shows these previews as UI elements, thus also exemplifying how to use the GUI functionality of plugins.
|
|
|
|
|
|
```c++
|
|
|
// Each layer gets an SVG file. Output to a directory
|
... | ... | @@ -1022,7 +1022,7 @@ bool SampleMachineCode::startWriting(const std::string& filename) |
|
|
nozzleDiameter = std::max(nozzle, nozzleDiameter);
|
|
|
for (int v = 0; v < path.getNumVertices(); v++) {
|
|
|
v2f point = m_LayerSet->xyBuildSpace(path.getVertexPos(v)); // build position
|
|
|
point = v2f(LibSL::Math::quatf(v3f(1, 0, 0), (float)M_PI).toMatrix() * v4f(point[0], point[1], 0, 1)); // Rotate 180 in X to accomodate for SVG coordinate system (Y is flipped)
|
|
|
point = v2f(LibSL::Math::quatf(v3f(1, 0, 0), (float)M_PI).toMatrix() * v4f(point[0], point[1], 0, 1)); // Rotate 180 in X to accommmodate for SVG coordinate system (Y is flipped)
|
|
|
m_TightSquare.addPoint(point);
|
|
|
}
|
|
|
}
|
... | ... | @@ -1081,7 +1081,7 @@ bool SampleMachineCode::stepWriting() |
|
|
}
|
|
|
svg.endPath(true);
|
|
|
}
|
|
|
// Travel paths drawn later so they are always visible
|
|
|
// Travel paths drawn afterwards to make them visible
|
|
|
for (const IceSLInterface::IPath* path : travelPaths) {
|
|
|
sl_assert(path != nullptr);
|
|
|
v3f strokeColor = m_StrokeColors.at(pathTypetoStr(path->getPathType()));
|
... | ... | |