OrcaSlicer latest
OrcaSlicer
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< Line > other_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 Line * closest_line
const Line * intersect_line
Polyline * intersect_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
548 :
550 {
551 // Calculate side of this intersection line of the closest line.
552 Vec2d v1((this->closest_line->b - this->closest_line->a).cast<double>());
553 Vec2d v2(this->intersect_line_dir());
554#ifndef NDEBUG
555 {
556 Vec2d v1n = v1.normalized();
557 Vec2d v2n = v2.normalized();
558 double c = cross2(v1n, v2n);
559 assert(std::abs(c) > sin(M_PI / 12.));
560 }
561#endif // NDEBUG
562 this->left = cross2(v1, v2) > 0.;
563 }
#define M_PI
Definition ExtrusionSimulator.cpp:31
int32_t cross2(const Eigen::MatrixBase< Eigen::Matrix< int32_t, 2, 1, Options > > &v1, const Eigen::MatrixBase< Eigen::Matrix< int32_t, 2, 1, Options > > &v2)=delete
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67
Point intersect_point
Definition FillAdaptive.cpp:537
const Line * closest_line
Definition FillAdaptive.cpp:530
Vec2d intersect_line_dir() const
Definition FillAdaptive.cpp:580
bool front
Definition FillAdaptive.cpp:539
const Line * intersect_line
Definition FillAdaptive.cpp:533
Polyline * intersect_pl
Definition FillAdaptive.cpp:535
bool left
Definition FillAdaptive.cpp:541

References Slic3r::Line::b, closest_line, Slic3r::cross2(), front, intersect_line, intersect_line_dir(), intersect_pl, intersect_point, and M_PI.

Here is the call graph for this function:

Member Function Documentation

◆ fresh()

bool Slic3r::FillAdaptive::Intersection::fresh ( ) const
throw ( )
inline
546{ return ! used && ! intersect_pl->empty(); }
bool used
Definition FillAdaptive.cpp:544

References intersect_pl, and used.

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

Here is the caller graph for this function:

◆ intersect_line_dir()

Vec2d Slic3r::FillAdaptive::Intersection::intersect_line_dir ( ) const
throw ( )
inline
580 {
581 return (this->intersect_point == intersect_line->a ? intersect_line->b - intersect_line->a : intersect_line->a - intersect_line->b).cast<double>();
582 }

References 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
565 {
566 std::optional<Line> out;
567 const Points &pts = intersect_pl->points;
568 if (pts.size() >= 3)
569 out = this->front ? Line(pts[1], pts[2]) : Line(pts[pts.size() - 2], pts[pts.size() - 3]);
570 return out;
571 }
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:73

References intersect_pl.

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
577{ Point pt; return this->other_hook_intersects(l, pt); }
Kernel::Point_3 Point
Definition MeshRepair.cpp:81
bool other_hook_intersects(const Line &l, Point &pt)
Definition FillAdaptive.cpp:573

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
573 {
574 std::optional<Line> h = other_hook();
575 return h && h->intersection(l, &pt);
576 }
std::optional< Line > other_hook() const
Definition FillAdaptive.cpp:565

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: