OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::BeltTransformPipeline Class Reference

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

Classes

struct  PhysicalTilt
struct  BeltFloorParams
struct  BeltHeightResult

Static Public Member Functions

static bool axis_remap_enabled (const PrintConfig &config)
static bool has_rotation (const PrintConfig &config)
static PhysicalTilt physical_tilt (BeltRotationAxis axis, double angle_deg)
static Matrix3d build_rotation_matrix (const PrintConfig &config, bool *has_rot_out=nullptr)
static Transform3d build_forward_transform (const PrintConfig &config)
static bool floor_shear (const PrintConfig &config, BeltFloorParams &out)
static double frame_margin (const BeltFloorParams &fp)
static BeltHeightResult compute_belt_height_and_floor (const PrintConfig &config, const BoundingBoxf3 &bbox, double original_height)

Detailed Description


Class Documentation

◆ Slic3r::BeltTransformPipeline::PhysicalTilt

struct Slic3r::BeltTransformPipeline::PhysicalTilt
Class Members
double tilt_x_deg = 0.
double tilt_y_deg = 0.

◆ Slic3r::BeltTransformPipeline::BeltFloorParams

struct Slic3r::BeltTransformPipeline::BeltFloorParams
Class Members
int from_axis = 1
double shear_factor = 0.0
double z_shift = 0.0

◆ Slic3r::BeltTransformPipeline::BeltHeightResult

struct Slic3r::BeltTransformPipeline::BeltHeightResult
Collaboration diagram for Slic3r::BeltTransformPipeline::BeltHeightResult:
Class Members
BeltFloorParams floor_params
double object_height

Member Function Documentation

◆ axis_remap_enabled()

bool Slic3r::BeltTransformPipeline::axis_remap_enabled ( const PrintConfig & config)
inlinestatic
54{ return config.belt_printer.value; }

Referenced by Slic3r::GCode::_do_export().

Here is the caller graph for this function:

◆ build_forward_transform()

Transform3d Slic3r::BeltTransformPipeline::build_forward_transform ( const PrintConfig & config)
static
39{
40 // Mesh-side belt transform: the rotation. (Shear & scale are a g-code-side
41 // stage, not part of the mesh transform.)
42 Transform3d combined = Transform3d::Identity();
43 combined.linear() = build_rotation_matrix(config);
44 return combined;
45}
static Matrix3d build_rotation_matrix(const PrintConfig &config, bool *has_rot_out=nullptr)
Definition BeltTransform.cpp:19
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Transform3d
Definition Point.hpp:96

References build_rotation_matrix().

Referenced by Slic3r::BeltBackTransform::init_from_config(), and Slic3r::BeltGCode::on_set_origin().

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

◆ build_rotation_matrix()

Matrix3d Slic3r::BeltTransformPipeline::build_rotation_matrix ( const PrintConfig & config,
bool * has_rot_out = nullptr )
static
20{
21 BeltRotationAxis axis = config.belt_slice_rotation.value;
22 double angle_deg = config.belt_slice_rotation_angle.value;
23 bool active = axis != BeltRotationAxis::None && std::abs(angle_deg) > EPSILON;
24 if (has_rot_out) *has_rot_out = active;
25 if (!active)
26 return Matrix3d::Identity();
27 double angle_rad = Geometry::deg2rad(angle_deg);
28 Vec3d unit_axis;
29 switch (axis) {
30 case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break;
31 case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break;
32 case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break;
33 default: return Matrix3d::Identity();
34 }
35 return Eigen::AngleAxisd(angle_rad, unit_axis).toRotationMatrix();
36}
#define EPSILON
Definition ColorUtils.cpp:64
constexpr T deg2rad(const T angle)
Definition Geometry.hpp:312
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
BeltRotationAxis
Definition PrintConfig.hpp:341
@ X
Definition PrintConfig.hpp:343
@ Z
Definition PrintConfig.hpp:345
@ Y
Definition PrintConfig.hpp:344
@ None
Definition PrintConfig.hpp:342

References Slic3r::Geometry::deg2rad(), EPSILON, Slic3r::None, Slic3r::X, Slic3r::Y, and Slic3r::Z.

Referenced by Slic3r::BeltSliceStrategy::apply_preslice_transforms(), and build_forward_transform().

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

◆ compute_belt_height_and_floor()

BeltTransformPipeline::BeltHeightResult Slic3r::BeltTransformPipeline::compute_belt_height_and_floor ( const PrintConfig & config,
const BoundingBoxf3 & bbox,
double original_height )
static
138{
139 return compute_belt_height_and_floor_impl(config, bbox, original_height);
140}
BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl(const PrintConfig &config, const BoundingBoxf3 &bb, double original_height)
Definition BeltTransform.cpp:82

Referenced by Slic3r::PrintObject::slicing_parameters(), and Slic3r::PrintObject::update_slicing_parameters().

Here is the caller graph for this function:

◆ floor_shear()

bool Slic3r::BeltTransformPipeline::floor_shear ( const PrintConfig & config,
BeltFloorParams & out )
static
143{
144 out = BeltFloorParams{};
145 const BeltRotationAxis rot_axis = config.belt_slice_rotation.value;
146 const double rot_angle = config.belt_slice_rotation_angle.value;
147 if (rot_axis == BeltRotationAxis::None || std::abs(rot_angle) <= EPSILON)
148 return false;
149 belt_floor_shear(rot_axis, Geometry::deg2rad(rot_angle), out);
150 return std::abs(out.shear_factor) > EPSILON;
151}
Definition BeltTransform.hpp:99
void belt_floor_shear(BeltRotationAxis rot_axis, double angle_rad, BeltTransformPipeline::BeltFloorParams &out)
Definition BeltTransform.cpp:55

References Slic3r::Geometry::deg2rad(), EPSILON, Slic3r::None, and Slic3r::BeltTransformPipeline::BeltFloorParams::shear_factor.

Referenced by Slic3r::BeltSliceStrategy::apply_preslice_transforms().

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

◆ frame_margin()

double Slic3r::BeltTransformPipeline::frame_margin ( const BeltFloorParams & fp)
inlinestatic
116{ return 10. * std::abs(fp.shear_factor); }

References Slic3r::BeltTransformPipeline::BeltFloorParams::shear_factor.

Referenced by Slic3r::BeltSliceStrategy::apply_preslice_transforms(), and Slic3r::anonymous_namespace{BeltTransform.cpp}::compute_belt_height_and_floor_impl().

Here is the caller graph for this function:

◆ has_rotation()

bool Slic3r::BeltTransformPipeline::has_rotation ( const PrintConfig & config)
inlinestatic
57 {
58 return config.belt_slice_rotation.value != BeltRotationAxis::None &&
59 std::abs(config.belt_slice_rotation_angle.value) > EPSILON;
60 }

References EPSILON, and Slic3r::None.

Referenced by Slic3r::slices_to_regions().

Here is the caller graph for this function:

◆ physical_tilt()

PhysicalTilt Slic3r::BeltTransformPipeline::physical_tilt ( BeltRotationAxis axis,
double angle_deg )
inlinestatic
74 {
76 double mag = std::abs(angle_deg);
77 switch (axis) {
78 case BeltRotationAxis::X: t.tilt_x_deg = mag; break;
79 case BeltRotationAxis::Y: t.tilt_y_deg = mag; break;
80 default: break; // Z / None: no physical tilt
81 }
82 return t;
83 }
Definition BeltTransform.hpp:71
T mag(const boost::geometry::model::d2::point_xy< T > &v)
Definition ExtrusionSimulator.cpp:184

References Slic3r::mag(), Slic3r::BeltTransformPipeline::PhysicalTilt::tilt_x_deg, Slic3r::BeltTransformPipeline::PhysicalTilt::tilt_y_deg, Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::Print::apply(), Slic3r::anonymous_namespace{PrintConfig.cpp}::project_bed_material_keepouts(), and Slic3r::GUI::TabPrinter::update_fff().

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

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