Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::BoundaryInfillGraph Struct Reference
+ Collaboration diagram for Slic3r::BoundaryInfillGraph:

Public Types

enum  Direction {
  Left , Right , Up , Down ,
  Taken
}
 

Public Member Functions

const Pointpoint (const ContourIntersectionPoint &cp) const
 
const Pointinfill_end_point (size_t infill_end_point_idx) const
 
const Point interpolate_contour_point (const ContourIntersectionPoint &cp, double param)
 
const Direction dir_prev (const ContourIntersectionPoint &cp) const
 
const Direction dir_next (const ContourIntersectionPoint &cp) const
 
bool first (const ContourIntersectionPoint &cp) const
 
const ContourIntersectionPointother (const ContourIntersectionPoint &cp) const
 
ContourIntersectionPointother (const ContourIntersectionPoint &cp)
 
bool prev_vertical (const ContourIntersectionPoint &cp) const
 
bool next_vertical (const ContourIntersectionPoint &cp) const
 

Static Public Member Functions

static Direction dir (const Point &p1, const Point &p2)
 

Public Attributes

std::vector< Pointsboundary
 
std::vector< std::vector< double > > boundary_params
 
std::vector< ContourIntersectionPointmap_infill_end_point_to_boundary
 

Detailed Description

Member Enumeration Documentation

◆ Direction

Enumerator
Left 
Right 
Up 
Down 
Taken 
1151 {
1152 Left,
1153 Right,
1154 Up,
1155 Down,
1156 Taken,
1157 };
@ Taken
Definition FillBase.cpp:1156
@ Down
Definition FillBase.cpp:1155
@ Up
Definition FillBase.cpp:1154
@ Left
Definition FillBase.cpp:1152
@ Right
Definition FillBase.cpp:1153

Member Function Documentation

◆ dir()

static Direction Slic3r::BoundaryInfillGraph::dir ( const Point p1,
const Point p2 
)
inlinestatic
1159 {
1160 return p1.x() == p2.x() ?
1161 (p1.y() < p2.y() ? Up : Down) :
1162 (p1.x() < p2.x() ? Right : Left);
1163 }
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References Down, Left, Right, and Up.

Referenced by dir_next(), and dir_prev().

+ Here is the caller graph for this function:

◆ dir_next()

const Direction Slic3r::BoundaryInfillGraph::dir_next ( const ContourIntersectionPoint cp) const
inline
1172 {
1173 assert(cp.next_on_contour);
1174 return cp.could_take_next() ?
1175 dir(this->point(cp), this->point(*cp.next_on_contour)) :
1176 Taken;
1177 }
const Point & point(const ContourIntersectionPoint &cp) const
Definition FillBase.cpp:1124
static Direction dir(const Point &p1, const Point &p2)
Definition FillBase.cpp:1159

References Slic3r::ContourIntersectionPoint::could_take_next(), dir(), Slic3r::ContourIntersectionPoint::next_on_contour, point(), and Taken.

Referenced by Slic3r::Fill::connect_base_support().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dir_prev()

const Direction Slic3r::BoundaryInfillGraph::dir_prev ( const ContourIntersectionPoint cp) const
inline
1165 {
1166 assert(cp.prev_on_contour);
1167 return cp.could_take_prev() ?
1168 dir(this->point(cp), this->point(*cp.prev_on_contour)) :
1169 Taken;
1170 }

References Slic3r::ContourIntersectionPoint::could_take_prev(), dir(), point(), Slic3r::ContourIntersectionPoint::prev_on_contour, and Taken.

Referenced by Slic3r::Fill::connect_base_support().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ first()

bool Slic3r::BoundaryInfillGraph::first ( const ContourIntersectionPoint cp) const
inline
1179 {
1180 return ((&cp - this->map_infill_end_point_to_boundary.data()) & 1) == 0;
1181 }
std::vector< ContourIntersectionPoint > map_infill_end_point_to_boundary
Definition FillBase.cpp:1122

Referenced by Slic3r::base_support_extend_infill_lines(), and Slic3r::Fill::connect_base_support().

+ Here is the caller graph for this function:

◆ infill_end_point()

const Point & Slic3r::BoundaryInfillGraph::infill_end_point ( size_t  infill_end_point_idx) const
inline
1130 {
1131 return this->point(this->map_infill_end_point_to_boundary[infill_end_point_idx]);
1132 }

References point().

+ Here is the call graph for this function:

◆ interpolate_contour_point()

const Point Slic3r::BoundaryInfillGraph::interpolate_contour_point ( const ContourIntersectionPoint cp,
double  param 
)
inline
1134 {
1135 const Points &contour = this->boundary[cp.contour_idx];
1136 const std::vector<double> &contour_params = this->boundary_params[cp.contour_idx];
1137 // Find the start of a contour segment with param.
1138 auto it = std::lower_bound(contour_params.begin(), contour_params.end(), param);
1139 if (*it != param) {
1140 assert(it != contour_params.begin());
1141 -- it;
1142 }
1143 size_t i = it - contour_params.begin();
1144 if (i == contour.size())
1145 i = 0;
1146 double t1 = contour_params[i];
1147 double t2 = next_value_modulo(i, contour_params);
1148 return lerp(contour[i], next_value_modulo(i, contour), (param - t1) / (t2 - t1));
1149 }
size_t size() const
Definition MultiPoint.hpp:39
ColorRGB lerp(const ColorRGB &a, const ColorRGB &b, float t)
Definition Color.cpp:228
const CONTAINER_TYPE::value_type & next_value_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
Definition Utils.hpp:243
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:58
const Polygon & contour(const ExPolygon &p)
Definition AGGRaster.hpp:21
std::vector< Points > boundary
Definition FillBase.cpp:1120
std::vector< std::vector< double > > boundary_params
Definition FillBase.cpp:1121

References Slic3r::contour(), Slic3r::ContourIntersectionPoint::contour_idx, Slic3r::lerp(), Slic3r::next_value_modulo(), and Slic3r::MultiPoint::size().

+ Here is the call graph for this function:

◆ next_vertical()

bool Slic3r::BoundaryInfillGraph::next_vertical ( const ContourIntersectionPoint cp) const
inline
1195 {
1196 return this->point(cp).x() == this->point(*cp.next_on_contour).x();
1197 }

References Slic3r::ContourIntersectionPoint::next_on_contour, and point().

Referenced by Slic3r::base_support_extend_infill_lines().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ other() [1/2]

ContourIntersectionPoint & Slic3r::BoundaryInfillGraph::other ( const ContourIntersectionPoint cp)
inline
1187 {
1188 return this->map_infill_end_point_to_boundary[((&cp - this->map_infill_end_point_to_boundary.data()) ^ 1)];
1189 }

◆ other() [2/2]

const ContourIntersectionPoint & Slic3r::BoundaryInfillGraph::other ( const ContourIntersectionPoint cp) const
inline
1183 {
1184 return this->map_infill_end_point_to_boundary[((&cp - this->map_infill_end_point_to_boundary.data()) ^ 1)];
1185 }

Referenced by Slic3r::Fill::connect_base_support().

+ Here is the caller graph for this function:

◆ point()

const Point & Slic3r::BoundaryInfillGraph::point ( const ContourIntersectionPoint cp) const
inline
1124 {
1125 assert(cp.contour_idx != size_t(-1));
1126 assert(cp.point_idx != size_t(-1));
1127 return this->boundary[cp.contour_idx][cp.point_idx];
1128 }

References Slic3r::ContourIntersectionPoint::contour_idx, and Slic3r::ContourIntersectionPoint::point_idx.

Referenced by Slic3r::Fill::connect_base_support(), dir_next(), dir_prev(), Slic3r::evaluate_support_arches(), infill_end_point(), next_vertical(), and prev_vertical().

+ Here is the caller graph for this function:

◆ prev_vertical()

bool Slic3r::BoundaryInfillGraph::prev_vertical ( const ContourIntersectionPoint cp) const
inline
1191 {
1192 return this->point(cp).x() == this->point(*cp.prev_on_contour).x();
1193 }

References point(), and Slic3r::ContourIntersectionPoint::prev_on_contour.

Referenced by Slic3r::base_support_extend_infill_lines().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ boundary

◆ boundary_params

◆ map_infill_end_point_to_boundary


The documentation for this struct was generated from the following file: