mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 22:31:02 +00:00
Every libslic3r source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, with libslic3r headers spelled libslic3r/... so they resolve outside the library's private include paths. MultiMaterialSegmentation.hpp, Support/SupportParameters.hpp and Format/STEP.hpp are made self-contained by hand.
70 lines
1.9 KiB
C++
70 lines
1.9 KiB
C++
//Copyright (c) 2020 Ultimaker B.V.
|
|
//CuraEngine is released under the terms of the AGPLv3 or higher.
|
|
|
|
|
|
#ifndef UTILS_EXTRUSION_JUNCTION_H
|
|
#define UTILS_EXTRUSION_JUNCTION_H
|
|
|
|
#include "../../Point.hpp"
|
|
#include "libslic3r/libslic3r.h"
|
|
#include <cstddef>
|
|
#include <vector>
|
|
|
|
namespace Slic3r::Arachne
|
|
{
|
|
|
|
/*!
|
|
* This struct represents one vertex in an extruded path.
|
|
*
|
|
* It contains information on how wide the extruded path must be at this point,
|
|
* and which perimeter it represents.
|
|
*/
|
|
struct ExtrusionJunction
|
|
{
|
|
/*!
|
|
* The position of the centreline of the path when it reaches this junction.
|
|
* This is the position that should end up in the g-code eventually.
|
|
*/
|
|
Point p;
|
|
|
|
/*!
|
|
* The width of the extruded path at this junction.
|
|
*/
|
|
coord_t w;
|
|
|
|
/*!
|
|
* Which perimeter this junction is part of.
|
|
*
|
|
* Perimeters are counted from the outside inwards. The outer wall has index
|
|
* 0.
|
|
*/
|
|
size_t perimeter_index;
|
|
|
|
ExtrusionJunction(const Point p, const coord_t w, const coord_t perimeter_index) : p(p), w(w), perimeter_index(perimeter_index) {}
|
|
|
|
bool operator==(const ExtrusionJunction &other) const {
|
|
return p == other.p && w == other.w && perimeter_index == other.perimeter_index;
|
|
}
|
|
|
|
coord_t x() const { return p.x(); }
|
|
coord_t y() const { return p.y(); }
|
|
coord_t z() const { return w; }
|
|
};
|
|
|
|
inline Point operator-(const ExtrusionJunction& a, const ExtrusionJunction& b)
|
|
{
|
|
return a.p - b.p;
|
|
}
|
|
|
|
// Identity function, used to be able to make templated algorithms that do their operations on 'point-like' input.
|
|
inline const Point& make_point(const ExtrusionJunction& ej)
|
|
{
|
|
return ej.p;
|
|
}
|
|
|
|
using LineJunctions = std::vector<ExtrusionJunction>; //<! The junctions along a line without further information. See \ref ExtrusionLine for a more extensive class.
|
|
using ExtrusionJunctions = std::vector<ExtrusionJunction>;
|
|
|
|
}
|
|
#endif // UTILS_EXTRUSION_JUNCTION_H
|