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

#include <src/libslic3r/Emboss.hpp>

+ Inheritance diagram for Slic3r::Emboss::ProjectZ:
+ Collaboration diagram for Slic3r::Emboss::ProjectZ:

Public Member Functions

 ProjectZ (double depth)
 
std::pair< Vec3d, Vec3dcreate_front_back (const Point &p) const override
 convert 2d point to 3d points
 
Vec3d project (const Vec3d &point) const override
 Move point with respect to projection direction e.g. Orthogonal projection will move with point by direction e.g. Spherical projection need to use center of projection.
 
std::optional< Vec2dunproject (const Vec3d &p, double *depth=nullptr) const override
 Back projection.
 

Public Attributes

double m_depth
 

Detailed Description

Constructor & Destructor Documentation

◆ ProjectZ()

Slic3r::Emboss::ProjectZ::ProjectZ ( double  depth)
inline
307: m_depth(depth) {}
double m_depth
Definition Emboss.hpp:312

Member Function Documentation

◆ create_front_back()

std::pair< Vec3d, Vec3d > Emboss::ProjectZ::create_front_back ( const Point p) const
overridevirtual

convert 2d point to 3d points

Parameters
p2d coordinate
Returns
first - front spatial point second - back spatial point

Implements Slic3r::Emboss::IProjection.

1525{
1526 Vec3d front(
1527 p.x() * SHAPE_SCALE,
1528 p.y() * SHAPE_SCALE,
1529 0.);
1530 return std::make_pair(front, project(front));
1531}
Vec3d project(const Vec3d &point) const override
Move point with respect to projection direction e.g. Orthogonal projection will move with point by di...
Definition Emboss.cpp:1533
static constexpr double SHAPE_SCALE
Definition Emboss.hpp:23
TPoint< P > front(const P &p)
Definition geometry_traits.hpp:872

References project(), and Slic3r::Emboss::SHAPE_SCALE.

+ Here is the call graph for this function:

◆ project()

Vec3d Emboss::ProjectZ::project ( const Vec3d point) const
overridevirtual

Move point with respect to projection direction e.g. Orthogonal projection will move with point by direction e.g. Spherical projection need to use center of projection.

Parameters
pointSpatial point coordinate
Returns
Projected spatial point

Implements Slic3r::Emboss::IProject3d.

1534{
1535 Vec3d res = point; // copy
1536 res.z() = m_depth;
1537 return res;
1538}

Referenced by create_front_back().

+ Here is the caller graph for this function:

◆ unproject()

std::optional< Vec2d > Emboss::ProjectZ::unproject ( const Vec3d p,
double *  depth = nullptr 
) const
overridevirtual

Back projection.

Parameters
pPoint to project
depth[optional] Depth of 2d projected point. Be careful number is in 2d scale
Returns
Uprojected point when it is possible

Implements Slic3r::Emboss::IProjection.

1540 {
1541 if (depth != nullptr) *depth /= SHAPE_SCALE;
1542 return Vec2d(p.x() / SHAPE_SCALE, p.y() / SHAPE_SCALE);
1543}
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:51

References Slic3r::Emboss::SHAPE_SCALE.

Member Data Documentation

◆ m_depth

double Slic3r::Emboss::ProjectZ::m_depth

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