OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
ExtrusionSimulator.cpp File Reference
#include <boost/geometry/core/cs.hpp>
#include <algorithm>
#include <boost/multi_array/base.hpp>
#include <cmath>
#include <cassert>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/multi_array.hpp>
#include <cstring>
#include <vector>
#include <cstddef>
#include <utility>
#include "Point.hpp"
#include "BoundingBox.hpp"
#include "ExtrusionEntity.hpp"
#include "libslic3r.h"
#include "ExtrusionSimulator.hpp"
#include "Polyline.hpp"
Include dependency graph for ExtrusionSimulator.cpp:

Go to the source code of this file.

Classes

struct  Slic3r::V2< T >
struct  Slic3r::V3< T >
struct  Slic3r::V4< T >
struct  Slic3r::Cell
struct  Slic3r::ExtrusionPoint
class  Slic3r::ExtrusionSimulatorImpl

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/

Macros

#define M_PI   3.1415926535897932384626433832795

Typedefs

typedef V2< int >::Type Slic3r::V2i
typedef V2< float >::Type Slic3r::V2f
typedef V2< double >::Type Slic3r::V2d
typedef V3< unsignedchar >::Type Slic3r::V3uc
typedef V4< unsignedchar >::Type Slic3r::V4uc
typedef boost::geometry::model::box< V2i > Slic3r::B2i
typedef boost::geometry::model::box< V2f > Slic3r::B2f
typedef boost::geometry::model::box< V2d > Slic3r::B2d
typedef boost::multi_array< unsigned char, 2 > Slic3r::A2uc
typedef boost::multi_array< int, 2 > Slic3r::A2i
typedef boost::multi_array< float, 2 > Slic3r::A2f
typedef boost::multi_array< double, 2 > Slic3r::A2d
typedef std::vector< ExtrusionPoint > Slic3r::ExtrusionPoints

Functions

template<typename T>
void Slic3r::operator+= (boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
template<typename T>
void Slic3r::operator-= (boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
template<typename T>
void Slic3r::operator*= (boost::geometry::model::d2::point_xy< T > &v, const T c)
template<typename T>
void Slic3r::operator/= (boost::geometry::model::d2::point_xy< T > &v, const T c)
template<typename T>
boost::geometry::model::d2::point_xy< T > Slic3r::operator+ (const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
template<typename T>
boost::geometry::model::d2::point_xy< T > Slic3r::operator- (const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
template<typename T>
boost::geometry::model::d2::point_xy< T > Slic3r::operator* (const boost::geometry::model::d2::point_xy< T > &v, const T c)
template<typename T>
boost::geometry::model::d2::point_xy< T > Slic3r::operator* (const T c, const boost::geometry::model::d2::point_xy< T > &v)
template<typename T>
boost::geometry::model::d2::point_xy< T > Slic3r::operator/ (const boost::geometry::model::d2::point_xy< T > &v, const T c)
template<typename T>
T Slic3r::dot (const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
template<typename T>
T Slic3r::dot (const boost::geometry::model::d2::point_xy< T > &v)
template<typename T>
T Slic3r::cross (const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
template<typename T>
T Slic3r::l2 (const boost::geometry::model::d2::point_xy< T > &v)
template<typename T>
T Slic3r::mag (const boost::geometry::model::d2::point_xy< T > &v)
template<typename T>
T Slic3r::dist2_to_line (const boost::geometry::model::d2::point_xy< T > &p0, const boost::geometry::model::d2::point_xy< T > &p1, const boost::geometry::model::d2::point_xy< T > &px)
template<typename T>
int Slic3r::line_circle_intersection (const boost::geometry::model::d2::point_xy< T > &p0, const boost::geometry::model::d2::point_xy< T > &p1, const boost::geometry::model::d2::point_xy< T > &center, const T radius, boost::geometry::model::d2::point_xy< T > intersection[2])
template<typename T>
int Slic3r::clip_rect_by_AABB (boost::geometry::model::d2::point_xy< T > rect[8], const boost::geometry::model::box< boost::geometry::model::d2::point_xy< T > > &aabb)
template<typename T>
int Slic3r::clip_circle_by_AABB (const boost::geometry::model::d2::point_xy< T > &center, const T radius, const boost::geometry::model::box< boost::geometry::model::d2::point_xy< T > > &aabb, boost::geometry::model::d2::point_xy< T > result[8], bool result_arc[8])
template<typename T>
T Slic3r::polyArea (const boost::geometry::model::d2::point_xy< T > *poly, int n)
template<typename T>
boost::geometry::model::d2::point_xy< T > Slic3r::polyCentroid (const boost::geometry::model::d2::point_xy< T > *poly, int n)
void Slic3r::gcode_paint_layer (const std::vector< V2f > &polyline, float width, float thickness, A2f &acc)
void Slic3r::gcode_paint_bitmap (const std::vector< V2f > &polyline, float width, A2uc &bitmap, float scale)
void Slic3r::gcode_spread_points (A2f &acc, const A2f &mask, const ExtrusionPoints &points, ExtrusionSimulationType simulationType)
std::vector< V3uc > Slic3r::CreatePowerColorGradient24bit ()

Class Documentation

◆ Slic3r::V2

struct Slic3r::V2
template<typename T>
struct Slic3r::V2< T >
Inheritance diagram for Slic3r::V2< T >:
Class Members
typedef point_xy< T > Type

◆ Slic3r::V3

struct Slic3r::V3
template<typename T>
struct Slic3r::V3< T >
Inheritance diagram for Slic3r::V3< T >:
Class Members
typedef point< T, 3, cartesian > Type

◆ Slic3r::V4

struct Slic3r::V4
template<typename T>
struct Slic3r::V4< T >
Inheritance diagram for Slic3r::V4< T >:
Class Members
typedef point< T, 4, cartesian > Type

◆ Slic3r::ExtrusionPoint

struct Slic3r::ExtrusionPoint
Collaboration diagram for Slic3r::ExtrusionPoint:
Class Members
V2f center
float height
float radius

◆ Slic3r::ExtrusionSimulatorImpl

class Slic3r::ExtrusionSimulatorImpl
Collaboration diagram for Slic3r::ExtrusionSimulatorImpl:
Class Members
A2f accumulator
A2uc bitmap
unsigned int bitmap_oversampled
vector< point< unsigned char, 3, cartesian > > color_gradient
ExtrusionPoints extrusion_points
vector< unsigned char > image_data

Macro Definition Documentation

◆ M_PI

#define M_PI   3.1415926535897932384626433832795

Referenced by Slic3r::GUI::DesignPanel::DesignPanel(), Slic3r::FillLightning::Generator::Generator(), Slic3r::FillLightning::Generator::Generator(), Slic3r::FillAdaptive::Intersection::Intersection(), Slic3r::LoopInterfaceProcessor::LoopInterfaceProcessor(), Slic3r::PressureEqualizer::PressureEqualizer(), Slic3r::SupportParameters::SupportParameters(), Slic3r::TreeSupport::TreeSupport(), Slic3r::TreeSupportData::TreeSupportData(), Slic3r::TreeSupport3D::TreeSupportMeshGroupSettings::TreeSupportMeshGroupSettings(), Slic3r::TreeSupport3D::TreeSupportSettings::TreeSupportSettings(), Slic3r::anonymous_namespace{TextureDisplacement.cpp}::UVTransform::UVTransform(), Slic3r::FillGyroid::_fill_surface_single(), Slic3r::FillTpmsD::_fill_surface_single(), Slic3r::FillTpmsFK::_fill_surface_single(), Slic3r::Fill::_infill_direction(), Slic3r::Fill::_layer_angle(), Slic3r::FillHoneycomb::_layer_angle(), Slic3r::GCodeWriter::_spiral_travel_to_z(), Slic3r::GUI::GLGizmoTextureDisplacement::adjust_handle_center(), Slic3r::adjust_layer_height_profile(), Slic3r::GUI::anonymous_namespace{UVEditorCanvas.cpp}::angle_delta(), Slic3r::anonymous_namespace{SketchEngine.cpp}::angle_on_arc(), Slic3r::WipeTowerIntegration::append_tcr(), Slic3r::WipeTowerIntegration::append_tcr2(), Slic3r::GUI::DesignSketchTool::apply_angle_between(), Slic3r::PrintObject::apply_conical_overhang(), Slic3r::TextureBake::apply_displacement(), Slic3r::GUI::DesignPanel::apply_edit_op(), Slic3r::CadDocument::apply_feature(), Slic3r::CadDocument::apply_mate(), Slic3r::GUI::DesignPanel::apply_move_card(), Slic3r::apply_texture_adjustments(), Slic3r::CadDocument::apply_transform(), Slic3r::apply_uv_transform(), Slic3r::Geometry::ArcWelder::arc_discretization_steps(), Slic3r::GUI::DesignSketchTool::arm_polyline_segment_edit(), Slic3r::GUI::belt_calib_flip_ringing_tower(), Slic3r::GUI::DesignSketchTool::build_readout(), Slic3r::ArcSegment::calc_arc_radian(), FlushPredict::calc_color_distance(), Slic3r::GCodeProcessor::calc_vmax_junction_deviation(), Slic3r::GUI::AmsRMGroup::CalculateEndpoint(), Slic3r::GUI::Plater::calib_temp(), Slic3r::GUI::GizmoObjectManipulation::change_absolute_rotation_value(), Slic3r::GUI::GizmoObjectManipulation::change_rotation_value(), Slic3r::tex2color::color_utils::ciede2000(), Slic3r::circle_cross_angles(), Slic3r::GUI::circle_polygon(), Slic3r::Algorithm::clipper_round_offset_error(), Slic3r::GUI::DesignSketchTool::compute_trim_preview(), Slic3r::WipeTower2::cone_base_polygon(), Slic3r::GUI::DesignPanel::constraint_label(), Slic3r::contour_distance(), Slic3r::contour_distance(), Slic3r::contour_distance2(), Slic3r::contour_extrusion_path(), Slic3r::NormalUtils::create_normals_angle_weighted(), Slic3r::Emboss::create_transformation_onto_surface(), Slic3r::GUI::GLGizmoRotate3D::data_changed(), FlushPredict::deg_to_rad(), DeltaE00(), Slic3r::detect_bridge_directions(), Slic3r::GUI::DesignSketchTool::dimension_current(), Slic3r::Arachne::SkeletalTrapezoidation::discretize(), Slic3r::TreeSupport3D::discretize_circle(), Slic3r::GUI::AmsRMGroup::doRender(), Slic3r::GUI::MaterialItem::doRender(), Slic3r::GUI::DesignSketchTool::drag_arc_handle(), Slic3r::GUI::DesignSketchTool::drag_draft_arc(), Slic3r::GUI::DesignSketchTool::drag_ellipsearc_handle(), Slic3r::GUI::DesignSketchTool::drag_pattern_handle(), Slic3r::GUI::DesignSketchTool::drag_revolve_arc(), Slic3r::GUI::GLGizmoEmboss::draw_advanced(), Slic3r::CalibPressureAdvance::draw_box(), Slic3r::GUI::GLGizmoSVG::draw_rotation(), Slic3r::GUI::DrawRoundedRect(), Slic3r::TreeSupport::drop_nodes(), Slic3r::CalibPressureAdvance::e_per_mm(), Slic3r::GUI::ensure_belt_purge_tower(), Slic3r::GUI::entity_pick_dist(), Slic3r::GUI::DesignSketchTool::entity_polyline(), Slic3r::WipeTower::estimate_tower_blocks_depth(), Slic3r::eval_expr(), Slic3r::SketchEngine::extend_entity(), Slic3r::Measure::MeasuringImpl::extract_features(), Slic3r::WipeTowerWriter2::extrude_arc_explicit(), Slic3r::WipeTowerWriter::extrude_arc_explicit(), Slic3r::TreeSupport3D::extrude_branch(), Slic3r::WipeTowerWriter2::extrude_explicit(), Slic3r::WipeTowerWriter::extrude_explicit(), Slic3r::GCode::extrude_loop(), Slic3r::WipeTower2::extrusion_flow(), Slic3r::WipeTower::extrusion_flow(), Slic3r::f(), Slic3r::FillCubic::fill_surface(), Slic3r::FillGrid::fill_surface(), Slic3r::FillLateralLattice::fill_surface(), Slic3r::FillQuarterCubic::fill_surface(), Slic3r::FillStars::fill_surface(), Slic3r::FillTriangles::fill_surface(), Slic3r::FillRectilinear::fill_surface_by_lines(), Slic3r::FillRectilinear::fill_surface_trapezoidal(), Slic3r::SketchEngine::fillet_lines(), Slic3r::filter_convex_concave_points_by_angle_threshold(), Slic3r::Print::first_layer_wipe_tower_corners(), Slic3r::Feature::FuzzySkin::fuzzy_extrusion_line(), Slic3r::Feature::FuzzySkin::fuzzy_extrusion_line_ripple(), Slic3r::Feature::FuzzySkin::fuzzy_polyline_ripple(), Slic3r::gcode_spread_points(), Slic3r::gcode_statistics_json(), Slic3r::generate_archimedean_chords(), Slic3r::TreeSupport::generate_contact_points(), Slic3r::TreeSupport3D::generate_initial_areas(), Slic3r::generate_layer_height_texture(), Slic3r::WipeTower2::generate_support_cone_wall(), Slic3r::Arachne::SkeletalTrapezoidation::generateLocalMaximaSingleBeads(), Slic3r::tex2color::color_utils::get_angle_between_vectors(), Slic3r::GUI::AmsRMGroup::GetAngle(), Slic3r::Arachne::LinearAlg2D::getAngleLeft(), Slic3r::FakeWipeTower::getFakeExtrusionPathsFromWipeTower2(), Slic3r::GUI::GLCanvas3D::handle_shortcut(), Slic3r::FillAdaptive::has_no_collinear_lines(), Slic3r::GUI::DesignSketchTool::helix_point(), Slic3r::GUI::DesignSketchTool::hit_test_draft_handle(), Slic3r::GUI::DesignSketchTool::hit_test_move_arc(), Slic3r::GUI::DesignSketchTool::hit_test_pattern_handle(), Slic3r::GUI::DesignSketchTool::hit_test_revolve_handle(), Slic3r::infer_axis_constraint(), Slic3r::infer_point_snap(), Slic3r::infer_relations(), Slic3r::GUI::init_torus_data(), Slic3r::ArcSegment::is_point_inside(), Slic3r::GUI::UVEditorCanvas::island_rotation_deg(), Slic3r::island_transform_matrix(), anonymous_namespace{TextLines.cpp}::its_create_torus(), Slic3r::its_make_frustum_dowel(), Slic3r::its_make_sphere(), Slic3r::length_to_volume(), Slic3r::WipeTower::length_to_volume(), Slic3r::line_entity_hits(), Slic3r::CalibPressureAdvancePattern::line_spacing(), Slic3r::CalibPressureAdvancePattern::line_spacing_first_layer(), Slic3r::GLVolumeCollection::load_real_wipe_tower_preview(), Slic3r::GLVolumeCollection::load_wipe_tower_preview(), Slic3r::loop_clip_length(), Slic3r::GUI::DesignSketchTool::loop_report(), Slic3r::GUI::make_arc_through(), Slic3r::make_circle(), Slic3r::make_circle_num_segments(), Slic3r::GUI::DesignSketchTool::make_ellipse(), Slic3r::GUI::DesignSketchTool::make_ellipse_arc(), Slic3r::SketchEngine::make_extrude_taper(), Slic3r::make_gyroid_waves(), Slic3r::make_helix_spine(), Slic3r::make_helix_wire(), Slic3r::Layer::make_ironing(), Slic3r::make_one_period(), Slic3r::GUI::DesignSketchTool::make_polygon(), Slic3r::SketchEngine::make_revolve(), Slic3r::make_waves(), Slic3r::GUI::anonymous_namespace{McpControl.cpp}::measure(), Slic3r::GUI::DesignSketchTool::measure_dim(), Slic3r::GeometryEngine::mesh_to_brep(), Slic3r::SketchEngine::mirror_entities(), Slic3r::FillAdaptive::multiline_paths(), Slic3r::WipeTower::nozzle_change_extrusion_flow(), Slic3r::anonymous_namespace{SketchEngine.cpp}::off_set_end(), Slic3r::offset_angle_plane(), Slic3r::GUI::UVEditorCanvas::on_mouse(), Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_adjust_texture(), Slic3r::GUI::DesignSketchTool::on_mouse_impl(), Slic3r::GUI::GLGizmoMeasure::on_render(), Slic3r::GUI::DesignSketchTool::open_arc_angle_editor(), Slic3r::GUI::DesignSketchTool::open_polygon_angle_editor(), Slic3r::GUI::DesignSketchTool::open_primary_autoedit(), Slic3r::GUI::DesignSketchTool::open_slot_editor(), Slic3r::GUI::DesignSketchTool::open_tf_editor_a(), Slic3r::Cut::perform_with_groove(), Slic3r::Arachne::pi_div(), Slic3r::plan_entity_constraint(), Slic3r::GCodeProcessor::process_elegoo_M6211(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G2_G3(), Slic3r::GCodeProcessor::process_tags(), Slic3r::GCodeProcessor::process_VG1(), Slic3r::project_edges_to_entities(), FlushPredict::rad_to_deg(), Slic3r::GUI::UVEditorCanvas::rebuild_rotation_dial(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::Arachne::removeColinearEdges(), Slic3r::GUI::Bed3D::Axes::render(), Slic3r::GUI::GCodeViewer::SequentialView::Marker::render(), Slic3r::GUI::TexturePreviewCanvas::render(), Slic3r::GUI::DesignSketchTool::render_draft_gizmo(), Slic3r::GUI::Bed3D::render_gravity_arrow(), Slic3r::GUI::DesignSketchTool::render_hole_gizmo(), Slic3r::GUI::DesignSketchTool::render_live_quotes(), Slic3r::GUI::DesignSketchTool::render_mate_connectors(), Slic3r::GUI::DesignSketchTool::render_mate_face(), Slic3r::GUI::DesignSketchTool::render_move_gizmo(), Slic3r::GUI::DesignSketchTool::render_pattern_gizmo(), Slic3r::GUI::DesignSketchTool::render_reference_axes(), Slic3r::GUI::DesignSketchTool::render_revolve_gizmo(), Slic3r::GUI::GLGizmoTextureDisplacement::render_shaded_preview_mesh(), Slic3r::GUI::DesignSketchTool::render_tf_gizmo(), Slic3r::GUI::DesignSketchTool::render_thread_gizmo(), Slic3r::GUI::GLGizmoTextureDisplacement::render_uvcheck_mesh(), Slic3r::CadDocument::resolve_datum_planes(), Slic3r::Feature::FuzzySkin::ripple_phase_shift_rad(), Slic3r::WipeTowerWriter2::rotate(), Slic3r::WipeTowerWriter::rotate(), Slic3r::GCodeProcessor::run_post_process(), Slic3r::anonymous_namespace{TextureDisplacement.cpp}::segment_into_charts(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::GUI::DesignSketchTool::set_arc_sweep(), Slic3r::GUI::DesignSketchTool::set_ellipsearc_sweep(), Slic3r::GCode::set_extruder(), Slic3r::WipeTower2::set_extruder(), Slic3r::WipeTower::set_extruder(), Slic3r::GUI::DesignSketchTool::set_line_angle(), Slic3r::GUI::DesignSketchTool::set_polygon_angle(), Slic3r::GUI::DesignSketchTool::set_polygon_side(), Slic3r::GUI::DesignSketchTool::set_rect_angle(), priv::set_skip_by_angle(), Slic3r::GUI::DesignSketchTool::set_slot_angle(), Slic3r::GUI::smooth_cylinder(), Slic3r::smooth_height_profile(), Slic3r::GUI::smooth_sphere(), Slic3r::GUI::smooth_torus(), Slic3r::TextureBake::snap_bottom_to_flat(), Slic3r::GUI::DesignSketchTool::snap_dir(), Slic3r::anonymous_namespace{TextureDisplacement.cpp}::solve_edge_alignment(), Slic3r::solve_system(), Slic3r::GUI::DesignSketchTool::tf_pick(), Slic3r::TextureBake::to_indexed(), Slic3r::CalibPressureAdvance::to_radians(), Slic3r::to_radians(), Slic3r::SketchEngine::transform_entities(), Slic3r::WipeTowerIntegration::transform_wt2_pt(), Slic3r::SketchEngine::trim_entity(), Slic3r::sla::SupportPointGenerator::uniformly_cover(), Slic3r::ArcSegment::update_angle_and_length(), Slic3r::GUI::GizmoObjectManipulation::update_settings_value(), Slic3r::GUI::Camera::update_zenit(), Slic3r::GUI::UVEditorCanvas::uv_delta_to_unwrap(), Slic3r::GUI::GLGizmoTextureDisplacement::uv_editor_island_transforms(), Slic3r::volume_to_length(), Slic3r::WipeTower::volume_to_length(), Slic3r::Flow::with_cross_section(), Slic3r::GUI::wrap_2pi(), Slic3r::wrap_2pi(), Slic3r::GUI::write_plan_value(), and Slic3r::GUI::xf_compose().