Add comments

This commit is contained in:
Filip Sykala - NTB T15p 2024-08-19 16:33:54 +02:00 committed by Lukas Matena
parent 6c94f5609b
commit b39df3e6fe
2 changed files with 8 additions and 1 deletions

View File

@ -147,6 +147,8 @@ static std::vector<SupportPointGenerator::MyLayer> make_layers(
SupportPointGenerator::MyLayer &layer = layers[layer_id];
const ExPolygons & islands = slices[layer_id];
// FIXME WTF?
// It is used only for support point Z coordinate.
// Possibly some kind of big foot compensation ??
const float height = (layer_id > 2 ?
heights[layer_id - 3] :
heights[0] - (heights[1] - heights[0]));

View File

@ -55,6 +55,7 @@ public:
struct MyLayer;
// Keep data for one area(ExPlygon) on the layer
struct Structure {
Structure(MyLayer &layer, const ExPolygon& poly, const BoundingBox &bbox, const Vec2f &centroid, float area, float h) :
layer(&layer), polygon(&poly), bbox(bbox), centroid(centroid), area(area), zlevel(h)
@ -62,7 +63,9 @@ public:
, unique_id(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()))
#endif /* SLA_SUPPORTPOINTGEN_DEBUG */
{}
// Parent layer - with all ExPolygons in layer + layer_height
MyLayer *layer;
// Source ExPolygon
const ExPolygon* polygon = nullptr;
const BoundingBox bbox;
const Vec2f centroid = Vec2f::Zero();
@ -143,8 +146,10 @@ public:
struct MyLayer {
MyLayer(const size_t layer_id, coordf_t print_z) : layer_id(layer_id), print_z(print_z) {}
// index into heights + slices
size_t layer_id;
coordf_t print_z;
// Absolute distance from Zero - copy value from heights<float>
coordf_t print_z; // [in mm]
std::vector<Structure> islands;
};