OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Emboss::OrthoProject Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Emboss.hpp>

Inheritance diagram for Slic3r::Emboss::OrthoProject:
Collaboration diagram for Slic3r::Emboss::OrthoProject:

Public Member Functions

 OrthoProject (Transform3d matrix, Vec3d direction)
std::pair< Vec3d, Vec3d > create_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< Vec2d > unproject (const Vec3d &p, double *depth=nullptr) const override
 Back projection.

Private Attributes

Transform3d m_matrix
Vec3d m_direction
Transform3d m_matrix_inv

Detailed Description

Constructor & Destructor Documentation

◆ OrthoProject()

Slic3r::Emboss::OrthoProject::OrthoProject ( Transform3d matrix,
Vec3d direction )
inline
426 : m_matrix(matrix), m_direction(direction), m_matrix_inv(matrix.inverse())
427 {}
Vec3d m_direction
Definition Emboss.hpp:422
Transform3d m_matrix_inv
Definition Emboss.hpp:423
Transform3d m_matrix
Definition Emboss.hpp:420

References m_direction, m_matrix, and m_matrix_inv.

Member Function Documentation

◆ create_front_back()

std::pair< Vec3d, Vec3d > Emboss::OrthoProject::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.

1843 {
1844 Vec3d front(p.x(), p.y(), 0.);
1845 Vec3d front_tr = m_matrix * front;
1846 return std::make_pair(front_tr, project(front_tr));
1847}
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:1849
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68

References m_matrix, and project().

Here is the call graph for this function:

◆ project()

Vec3d Emboss::OrthoProject::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.

1850{
1851 return point + m_direction;
1852}

References m_direction.

Referenced by create_front_back().

Here is the caller graph for this function:

◆ unproject()

std::optional< Vec2d > Emboss::OrthoProject::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.

1855{
1856 Vec3d pp = m_matrix_inv * p;
1857 if (depth != nullptr) *depth = pp.z();
1858 return Vec2d(pp.x(), pp.y());
1859}
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67

References m_matrix_inv.

Member Data Documentation

◆ m_direction

Vec3d Slic3r::Emboss::OrthoProject::m_direction
private

Referenced by OrthoProject(), and project().

◆ m_matrix

Transform3d Slic3r::Emboss::OrthoProject::m_matrix
private

Referenced by OrthoProject(), and create_front_back().

◆ m_matrix_inv

Transform3d Slic3r::Emboss::OrthoProject::m_matrix_inv
private

Referenced by OrthoProject(), and unproject().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Emboss.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Emboss.cpp