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

#include <src/libslic3r/Line.hpp>

+ Collaboration diagram for Slic3r::Linef3:

Public Types

using Scalar = Vec3d::Scalar
 

Public Member Functions

 Linef3 ()
 
 Linef3 (const Vec3d &_a, const Vec3d &_b)
 
Vec3d intersect_plane (double z) const
 
void scale (double factor)
 
Vec3d vector () const
 
Vec3d unit_vector () const
 
double length () const
 

Public Attributes

Vec3d a
 
Vec3d b
 

Static Public Attributes

static const constexpr int Dim = 3
 

Detailed Description

Member Typedef Documentation

◆ Scalar

Constructor & Destructor Documentation

◆ Linef3() [1/2]

Slic3r::Linef3::Linef3 ( )
inline
259: a(Vec3d::Zero()), b(Vec3d::Zero()) {}
Vec3d b
Definition Line.hpp:269
Vec3d a
Definition Line.hpp:268

◆ Linef3() [2/2]

Slic3r::Linef3::Linef3 ( const Vec3d _a,
const Vec3d _b 
)
inline
260: a(_a), b(_b) {}
Vec3d vector() const
Definition Line.hpp:264

Member Function Documentation

◆ intersect_plane()

Vec3d Slic3r::Linef3::intersect_plane ( double  z) const
116{
117 auto v = (this->b - this->a).cast<double>();
118 double t = (z - this->a(2)) / v(2);
119 return Vec3d(this->a(0) + v(0) * t, this->a(1) + v(1) * t, z);
120}
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:52

References a, b, and vector().

Referenced by Slic3r::GUI::GLCanvas3D::_mouse_to_bed_3d(), Slic3r::GUI::GLGizmoRotate::mouse_position_in_local_plane(), Slic3r::GUI::GLGizmoCut3D::mouse_position_in_local_plane(), and Slic3r::GUI::GLCanvas3D::on_mouse().

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

◆ length()

double Slic3r::Linef3::length ( ) const
inline
266{ return vector().norm(); }

References vector().

Referenced by unit_vector().

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

◆ scale()

void Slic3r::Linef3::scale ( double  factor)
inline
263{ this->a *= factor; this->b *= factor; }

References a, and b.

Referenced by Slic3r::Geometry::assemble_transform(), and Slic3r::Geometry::scale_transform().

+ Here is the caller graph for this function:

◆ unit_vector()

Vec3d Slic3r::Linef3::unit_vector ( ) const
inline
265{ return (length() == 0.0) ? Vec3d::Zero() : vector().normalized(); }
double length() const
Definition Line.hpp:266

References length(), and vector().

Referenced by Slic3r::GUI::GLCanvas3D::_mouse_to_bed_3d(), and Slic3r::GUI::GLCanvas3D::on_mouse().

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

◆ vector()

Vec3d Slic3r::Linef3::vector ( ) const
inline
264{ return this->b - this->a; }

References a, and b.

Referenced by intersect_plane(), length(), Slic3r::GUI::GLGizmoRotate::mouse_position_in_local_plane(), and unit_vector().

+ Here is the caller graph for this function:

Member Data Documentation

◆ a

◆ b

◆ Dim

const constexpr int Slic3r::Linef3::Dim = 3
staticconstexpr

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