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

Public Member Functions

bool fresh () const throw ()
 
 Intersection (const Line &closest_line, const Line &intersect_line, Polyline *intersect_pl, const Point &intersect_point, bool front)
 
std::optional< Lineother_hook () const
 
bool other_hook_intersects (const Line &l, Point &pt)
 
bool other_hook_intersects (const Line &l)
 
Vec2d intersect_line_dir () const throw ()
 

Public Attributes

const Lineclosest_line
 
const Lineintersect_line
 
Polylineintersect_pl
 
Point intersect_point
 
bool front
 
bool left
 
bool used = false
 

Detailed Description

Constructor & Destructor Documentation

◆ Intersection()

Slic3r::FillAdaptive::Intersection::Intersection ( const Line closest_line,
const Line intersect_line,
Polyline intersect_pl,
const Point intersect_point,
bool  front 
)
inline
582 :
584 {
585 // Calculate side of this intersection line of the closest line.
586 Vec2d v1((this->closest_line->b - this->closest_line->a).cast<double>());
587 Vec2d v2(this->intersect_line_dir());
588#ifndef NDEBUG
589 {
590 Vec2d v1n = v1.normalized();
591 Vec2d v2n = v2.normalized();
592 double c = cross2(v1n, v2n);
593 assert(std::abs(c) > sin(M_PI / 12.));
594 }
595#endif // NDEBUG
596 this->left = cross2(v1, v2) > 0.;
597 }
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220
#define M_PI
Definition ExtrusionSimulator.cpp:20
Point b
Definition Line.hpp:198
Derived::Scalar cross2(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:93
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:51
Point intersect_point
Definition FillAdaptive.cpp:571
const Line * closest_line
Definition FillAdaptive.cpp:564
Vec2d intersect_line_dir() const
Definition FillAdaptive.cpp:614
bool front
Definition FillAdaptive.cpp:573
const Line * intersect_line
Definition FillAdaptive.cpp:567
Polyline * intersect_pl
Definition FillAdaptive.cpp:569
bool left
Definition FillAdaptive.cpp:575

References Slic3r::Line::b, Slic3r::cross2(), intersect_line_dir(), M_PI, and sin().

+ Here is the call graph for this function:

Member Function Documentation

◆ fresh()

bool Slic3r::FillAdaptive::Intersection::fresh ( ) const
throw (
)
inline
580{ return ! used && ! intersect_pl->empty(); }
bool empty() const
Definition MultiPoint.hpp:40
bool used
Definition FillAdaptive.cpp:578

References Slic3r::MultiPoint::empty(), intersect_pl, and used.

Referenced by Slic3r::FillAdaptive::connect_lines_using_hooks().

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

◆ intersect_line_dir()

Vec2d Slic3r::FillAdaptive::Intersection::intersect_line_dir ( ) const
throw (
)
inline
614 {
616 }
EIGEN_DEVICE_FUNC CastXpr< NewType >::Type cast() const
Definition CommonCwiseUnaryOps.h:62
Point a
Definition Line.hpp:197

References Slic3r::Line::a, Slic3r::Line::b, and intersect_line.

Referenced by Intersection().

+ Here is the caller graph for this function:

◆ other_hook()

std::optional< Line > Slic3r::FillAdaptive::Intersection::other_hook ( ) const
inline
599 {
600 std::optional<Line> out;
601 const Points &pts = intersect_pl->points;
602 if (pts.size() >= 3)
603 out = this->front ? Line(pts[1], pts[2]) : Line(pts[pts.size() - 2], pts[pts.size() - 3]);
604 return out;
605 }
Points points
Definition MultiPoint.hpp:18
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:58
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183

References intersect_pl, and Slic3r::MultiPoint::points.

Referenced by other_hook_intersects().

+ Here is the caller graph for this function:

◆ other_hook_intersects() [1/2]

bool Slic3r::FillAdaptive::Intersection::other_hook_intersects ( const Line l)
inline
611{ Point pt; return this->other_hook_intersects(l, pt); }
Kernel::Point_2 Point
Definition point_areas.cpp:20
bool other_hook_intersects(const Line &l, Point &pt)
Definition FillAdaptive.cpp:607

References other_hook_intersects().

Referenced by other_hook_intersects().

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

◆ other_hook_intersects() [2/2]

bool Slic3r::FillAdaptive::Intersection::other_hook_intersects ( const Line l,
Point pt 
)
inline
607 {
608 std::optional<Line> h = other_hook();
609 return h && h->intersection(l, &pt);
610 }
std::optional< Line > other_hook() const
Definition FillAdaptive.cpp:599

References other_hook().

Referenced by Slic3r::FillAdaptive::connect_lines_using_hooks().

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

Member Data Documentation

◆ closest_line

const Line* Slic3r::FillAdaptive::Intersection::closest_line

◆ front

bool Slic3r::FillAdaptive::Intersection::front

◆ intersect_line

const Line* Slic3r::FillAdaptive::Intersection::intersect_line

◆ intersect_pl

Polyline* Slic3r::FillAdaptive::Intersection::intersect_pl

◆ intersect_point

Point Slic3r::FillAdaptive::Intersection::intersect_point

◆ left

bool Slic3r::FillAdaptive::Intersection::left

◆ used

bool Slic3r::FillAdaptive::Intersection::used = false

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