Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::Polyline3 Class Reference

#include <src/libslic3r/Polyline.hpp>

+ Inheritance diagram for Slic3r::Polyline3:
+ Collaboration diagram for Slic3r::Polyline3:

Public Member Functions

double length () const
 
Lines3 lines () const
 
void append (const Vec3crd &point)
 
void translate (double x, double y)
 
void translate (const Point &vector)
 
bool is_valid () const
 
BoundingBox3 bounding_box () const
 
bool remove_duplicate_points ()
 

Public Attributes

Points3 points
 

Detailed Description

Member Function Documentation

◆ append()

void Slic3r::MultiPoint3::append ( const Vec3crd point)
inlineinherited
100{ this->points.push_back(point); }
Points3 points
Definition MultiPoint.hpp:98

◆ bounding_box()

BoundingBox3 Slic3r::MultiPoint3::bounding_box ( ) const
inherited
334{
335 return BoundingBox3(points);
336}

References Slic3r::MultiPoint3::points.

◆ is_valid()

bool Slic3r::MultiPoint3::is_valid ( ) const
inlineinherited
104{ return this->points.size() >= 2; }

◆ length()

double Slic3r::Polyline3::length ( ) const
314{
315 double l = 0;
316 for (size_t i = 1; i < this->points.size(); ++ i)
317 l += (this->points[i] - this->points[i - 1]).cast<double>().norm();
318 return l;
319}

References Slic3r::MultiPoint3::points.

◆ lines()

Lines3 Slic3r::Polyline3::lines ( ) const
322{
324 if (points.size() >= 2)
325 {
326 lines.reserve(points.size() - 1);
327 for (Points3::const_iterator it = points.begin(); it != points.end() - 1; ++it)
328 {
329 lines.emplace_back(*it, *(it + 1));
330 }
331 }
332 return lines;
333}
Lines3 lines() const
Definition Polyline.cpp:321
std::vector< Line3 > Lines3
Definition Line.hpp:18

References lines(), and Slic3r::MultiPoint3::points.

Referenced by lines().

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

◆ remove_duplicate_points()

bool Slic3r::MultiPoint3::remove_duplicate_points ( )
inherited
339{
340 size_t j = 0;
341 for (size_t i = 1; i < points.size(); ++i) {
342 if (points[j] == points[i]) {
343 // Just increase index i.
344 } else {
345 ++ j;
346 if (j < i)
347 points[j] = points[i];
348 }
349 }
350
351 if (++j < points.size())
352 {
353 points.erase(points.begin() + j, points.end());
354 return true;
355 }
356
357 return false;
358}

References Slic3r::MultiPoint3::points.

◆ translate() [1/2]

void Slic3r::MultiPoint3::translate ( const Point vector)
inherited
329{
330 this->translate(vector(0), vector(1));
331}
void translate(double x, double y)
Definition MultiPoint.cpp:320

References Slic3r::MultiPoint3::translate().

+ Here is the call graph for this function:

◆ translate() [2/2]

void Slic3r::MultiPoint3::translate ( double  x,
double  y 
)
inherited
321{
322 for (Vec3crd &p : points) {
323 p(0) += coord_t(x);
324 p(1) += coord_t(y);
325 }
326}
int32_t coord_t
Definition libslic3r.h:39
Eigen::Matrix< coord_t, 3, 1, Eigen::DontAlign > Vec3crd
Definition Point.hpp:38

References Slic3r::MultiPoint3::points.

Referenced by Slic3r::MultiPoint3::translate().

+ Here is the caller graph for this function:

Member Data Documentation

◆ points


The documentation for this class was generated from the following files: