OrcaSlicer latest
OrcaSlicer
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 Point & point (const ContourIntersectionPoint &cp) const
const Point & infill_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 ContourIntersectionPoint & other (const ContourIntersectionPoint &cp) const
ContourIntersectionPoint & other (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< Points > boundary
std::vector< std::vector< double > > boundary_params
std::vector< ContourIntersectionPoint > map_infill_end_point_to_boundary

Detailed Description

Member Enumeration Documentation

◆ Direction

Enumerator
Left 
Right 
Up 
Down 
Taken 
1409 {
1410 Left,
1411 Right,
1412 Up,
1413 Down,
1414 Taken,
1415 };
@ Taken
Definition FillBase.cpp:1414
@ Down
Definition FillBase.cpp:1413
@ Up
Definition FillBase.cpp:1412
@ Left
Definition FillBase.cpp:1410
@ Right
Definition FillBase.cpp:1411

Member Function Documentation

◆ dir()

Direction Slic3r::BoundaryInfillGraph::dir ( const Point & p1,
const Point & p2 )
inlinestatic
1417 {
1418 return p1.x() == p2.x() ?
1419 (p1.y() < p2.y() ? Up : Down) :
1420 (p1.x() < p2.x() ? Right : Left);
1421 }

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
1430 {
1431 assert(cp.next_on_contour);
1432 return cp.could_take_next() ?
1433 dir(this->point(cp), this->point(*cp.next_on_contour)) :
1434 Taken;
1435 }
const Point & point(const ContourIntersectionPoint &cp) const
Definition FillBase.cpp:1382
static Direction dir(const Point &p1, const Point &p2)
Definition FillBase.cpp:1417

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
1423 {
1424 assert(cp.prev_on_contour);
1425 return cp.could_take_prev() ?
1426 dir(this->point(cp), this->point(*cp.prev_on_contour)) :
1427 Taken;
1428 }

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
1437 {
1438 return ((&cp - this->map_infill_end_point_to_boundary.data()) & 1) == 0;
1439 }
std::vector< ContourIntersectionPoint > map_infill_end_point_to_boundary
Definition FillBase.cpp:1380

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
1388 {
1389 return this->point(this->map_infill_end_point_to_boundary[infill_end_point_idx]);
1390 }

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
1392 {
1393 const Points &contour = this->boundary[cp.contour_idx];
1394 const std::vector<double> &contour_params = this->boundary_params[cp.contour_idx];
1395 // Find the start of a contour segment with param.
1396 auto it = std::lower_bound(contour_params.begin(), contour_params.end(), param);
1397 if (*it != param) {
1398 assert(it != contour_params.begin());
1399 -- it;
1400 }
1401 size_t i = it - contour_params.begin();
1402 if (i == contour.size())
1403 i = 0;
1404 double t1 = contour_params[i];
1405 double t2 = next_value_modulo(i, contour_params);
1406 return lerp(contour[i], next_value_modulo(i, contour), (param - t1) / (t2 - t1));
1407 }
size_t size() const
Definition MultiPoint.hpp:50
ColorRGB lerp(const ColorRGB &a, const ColorRGB &b, float t)
Definition Color.cpp:244
const CONTAINER_TYPE::value_type & next_value_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
Definition Utils.hpp:493
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:73
const Polygon & contour(const ExPolygon &p)
Definition AGGRaster.hpp:30
std::vector< Points > boundary
Definition FillBase.cpp:1378
std::vector< std::vector< double > > boundary_params
Definition FillBase.cpp:1379

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

Here is the call graph for this function:

◆ next_vertical()

bool Slic3r::BoundaryInfillGraph::next_vertical ( const ContourIntersectionPoint & cp) const
inline
1453 {
1454 return this->point(cp).x() == this->point(*cp.next_on_contour).x();
1455 }

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
1445 {
1446 return this->map_infill_end_point_to_boundary[((&cp - this->map_infill_end_point_to_boundary.data()) ^ 1)];
1447 }

◆ other() [2/2]

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

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
1382 {
1383 assert(cp.contour_idx != size_t(-1));
1384 assert(cp.point_idx != size_t(-1));
1385 return this->boundary[cp.contour_idx][cp.point_idx];
1386 }

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
1449 {
1450 return this->point(cp).x() == this->point(*cp.prev_on_contour).x();
1451 }

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:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Fill/FillBase.cpp