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

Public Member Functions

 PointMatrix ()
 
 PointMatrix (double rotation)
 
 PointMatrix (const Point p)
 
Point apply (const Point p) const
 
Point unapply (const Point p) const
 

Static Public Member Functions

static PointMatrix scale (double s)
 

Public Attributes

double matrix [4]
 

Detailed Description

Constructor & Destructor Documentation

◆ PointMatrix() [1/3]

Slic3r::Arachne::PointMatrix::PointMatrix ( )
inline
96 {
97 matrix[0] = 1;
98 matrix[1] = 0;
99 matrix[2] = 0;
100 matrix[3] = 1;
101 }
double matrix[4]
Definition VoronoiUtils.cpp:93

References matrix.

◆ PointMatrix() [2/3]

Slic3r::Arachne::PointMatrix::PointMatrix ( double  rotation)
inline
104 {
105 rotation = rotation / 180 * M_PI;
106 matrix[0] = cos(rotation);
107 matrix[1] = -sin(rotation);
108 matrix[2] = -matrix[1];
109 matrix[3] = matrix[0];
110 }
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition ArrayCwiseUnaryOps.h:202
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220
#define M_PI
Definition ExtrusionSimulator.cpp:20

References cos(), M_PI, matrix, and sin().

+ Here is the call graph for this function:

◆ PointMatrix() [3/3]

Slic3r::Arachne::PointMatrix::PointMatrix ( const Point  p)
inline
113 {
114 matrix[0] = p.x();
115 matrix[1] = p.y();
116 double f = sqrt((matrix[0] * matrix[0]) + (matrix[1] * matrix[1]));
117 matrix[0] /= f;
118 matrix[1] /= f;
119 matrix[2] = -matrix[1];
120 matrix[3] = matrix[0];
121 }
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition ArrayCwiseUnaryOps.h:152
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:12

References Slic3r::f(), matrix, and sqrt().

+ Here is the call graph for this function:

Member Function Documentation

◆ apply()

Point Slic3r::Arachne::PointMatrix::apply ( const Point  p) const
inline
132 {
133 return Point(coord_t(p.x() * matrix[0] + p.y() * matrix[1]), coord_t(p.x() * matrix[2] + p.y() * matrix[3]));
134 }
int32_t coord_t
Definition libslic3r.h:39
Kernel::Point_2 Point
Definition point_areas.cpp:20

References matrix.

◆ scale()

static PointMatrix Slic3r::Arachne::PointMatrix::scale ( double  s)
inlinestatic
124 {
125 PointMatrix ret;
126 ret.matrix[0] = s;
127 ret.matrix[3] = s;
128 return ret;
129 }
PointMatrix()
Definition VoronoiUtils.cpp:95

References matrix.

◆ unapply()

Point Slic3r::Arachne::PointMatrix::unapply ( const Point  p) const
inline
137 {
138 return Point(coord_t(p.x() * matrix[0] + p.y() * matrix[2]), coord_t(p.x() * matrix[1] + p.y() * matrix[3]));
139 }

References matrix.

Referenced by Slic3r::Arachne::VoronoiUtils::discretizeParabola().

+ Here is the caller graph for this function:

Member Data Documentation

◆ matrix

double Slic3r::Arachne::PointMatrix::matrix[4]

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