OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Print.cpp File Reference
#include "PrintBase.hpp"
#include <utility>
#include <string>
#include <mutex>
#include <vector>
#include "libslic3r.h"
#include "calib.hpp"
#include <cassert>
#include "CustomGCode.hpp"
#include "ObjectID.hpp"
#include <cstddef>
#include "Point.hpp"
#include "Polygon.hpp"
#include "Geometry.hpp"
#include <map>
#include <cmath>
#include <Eigen/Geometry>
#include <set>
#include "Slicing.hpp"
#include <cstdlib>
#include "TriangleSelector.hpp"
#include "GCode/AdaptivePAProcessor.hpp"
#include <exception>
#include <ostream>
#include "ExPolygon.hpp"
#include "Layer.hpp"
#include "FilamentGroup.hpp"
#include <memory>
#include "FilamentGroupUtils.hpp"
#include "MultiNozzleUtils.hpp"
#include <chrono>
#include <optional>
#include "GCode/GCodeProcessor.hpp"
#include "GCode/ThumbnailData.hpp"
#include "ExtrusionEntity.hpp"
#include <math.h>
#include "CommonDefs.hpp"
#include <ios>
#include <iomanip>
#include <tuple>
#include "Surface.hpp"
#include "Circle.hpp"
#include "Polyline.hpp"
#include "ArcFitter.hpp"
#include <cstdio>
#include <boost/filesystem/operations.hpp>
#include <boost/thread/lock_types.hpp>
#include <iterator>
#include "TriangleMesh.hpp"
#include "Config.hpp"
#include "Exception.hpp"
#include "IMEXHelpers.hpp"
#include "IMEXZones.hpp"
#include "Print.hpp"
#include "BoundingBox.hpp"
#include "Brim.hpp"
#include "ClipperUtils.hpp"
#include "ExclusionVolumeGeometry.hpp"
#include "Extruder.hpp"
#include "FilamentMixer.hpp"
#include "Flow.hpp"
#include "Geometry/ConvexHull.hpp"
#include "I18N.hpp"
#include "LifecycleEvents.hpp"
#include "ShortestPath.hpp"
#include "Thread.hpp"
#include "Time.hpp"
#include "GCode.hpp"
#include "BeltGCode.hpp"
#include "BeltTransform.hpp"
#include "GCode/WipeTower.hpp"
#include "GCode/WipeTower2.hpp"
#include "GCode/WipeTowerEstimate.hpp"
#include "Utils.hpp"
#include "PrintConfig.hpp"
#include "MaterialType.hpp"
#include "Model.hpp"
#include "format.hpp"
#include "LocalesUtils.hpp"
#include <float.h>
#include <algorithm>
#include <limits>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <sstream>
#include <boost/filesystem/path.hpp>
#include <boost/format.hpp>
#include <boost/log/trivial.hpp>
#include <boost/regex.hpp>
#include <boost/nowide/fstream.hpp>
#include <tbb/blocked_range.h>
#include <tbb/parallel_for.h>
#include "nlohmann/json.hpp"
#include "GCode/ConflictChecker.hpp"
#include <codecvt>
#include "Format/STEP.hpp"
#include "PlaceholderParser.hpp"
#include "SurfaceCollection.hpp"
#include "BeltBrim.hpp"

Go to the source code of this file.

Classes

struct  Slic3r::BedExclusionCollision
struct  Slic3r::FilamentType

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 L(s)
#define JSON_POLYGON_CONTOUR   "contour"
#define JSON_POLYGON_HOLES   "holes"
#define JSON_POINTS   "points"
#define JSON_EXPOLYGON   "expolygon"
#define JSON_ARC_FITTING   "arc_fitting"
#define JSON_OBJECT_NAME   "name"
#define JSON_IDENTIFY_ID   "identify_id"
#define JSON_LAYERS   "layers"
#define JSON_SUPPORT_LAYERS   "support_layers"
#define JSON_TREE_SUPPORT_LAYERS   "tree_support_layers"
#define JSON_LAYER_REGIONS   "layer_regions"
#define JSON_FIRSTLAYER_GROUPS   "first_layer_groups"
#define JSON_FIRSTLAYER_GROUP_ID   "group_id"
#define JSON_FIRSTLAYER_GROUP_VOLUME_IDS   "volume_ids"
#define JSON_FIRSTLAYER_GROUP_SLICES   "slices"
#define JSON_LAYER_PRINT_Z   "print_z"
#define JSON_LAYER_SLICE_Z   "slice_z"
#define JSON_LAYER_HEIGHT   "height"
#define JSON_LAYER_ID   "layer_id"
#define JSON_LAYER_SLICED_POLYGONS   "sliced_polygons"
#define JSON_LAYER_SLLICED_BBOXES   "sliced_bboxes"
#define JSON_LAYER_OVERHANG_POLYGONS   "overhang_polygons"
#define JSON_LAYER_OVERHANG_BBOX   "overhang_bbox"
#define JSON_SUPPORT_LAYER_ISLANDS   "support_islands"
#define JSON_SUPPORT_LAYER_FILLS   "support_fills"
#define JSON_SUPPORT_LAYER_INTERFACE_ID   "interface_id"
#define JSON_SUPPORT_LAYER_TYPE   "support_type"
#define JSON_LAYER_REGION_CONFIG_HASH   "config_hash"
#define JSON_LAYER_REGION_SLICES   "slices"
#define JSON_LAYER_REGION_RAW_SLICES   "raw_slices"
#define JSON_LAYER_REGION_THIN_FILLS   "thin_fills"
#define JSON_LAYER_REGION_FILL_EXPOLYGONS   "fill_expolygons"
#define JSON_LAYER_REGION_FILL_SURFACES   "fill_surfaces"
#define JSON_LAYER_REGION_FILL_NO_OVERLAP   "fill_no_overlap_expolygons"
#define JSON_LAYER_REGION_UNSUPPORTED_BRIDGE_EDGES   "unsupported_bridge_edges"
#define JSON_LAYER_REGION_PERIMETERS   "perimeters"
#define JSON_LAYER_REGION_FILLS   "fills"
#define JSON_SURF_TYPE   "surface_type"
#define JSON_SURF_THICKNESS   "thickness"
#define JSON_SURF_THICKNESS_LAYER   "thickness_layers"
#define JSON_SURF_BRIDGE_ANGLE   "bridge_angle"
#define JSON_SURF_EXTRA_PERIMETERS   "extra_perimeters"
#define JSON_ARC_DATA   "arc_data"
#define JSON_ARC_START_INDEX   "start_index"
#define JSON_ARC_END_INDEX   "end_index"
#define JSON_ARC_PATH_TYPE   "path_type"
#define JSON_IS_ARC   "is_arc"
#define JSON_ARC_LENGTH   "length"
#define JSON_ARC_ANGLE_RADIUS   "angle_radians"
#define JSON_ARC_POLAY_START_THETA   "polar_start_theta"
#define JSON_ARC_POLAY_END_THETA   "polar_end_theta"
#define JSON_ARC_START_POINT   "start_point"
#define JSON_ARC_END_POINT   "end_point"
#define JSON_ARC_DIRECTION   "direction"
#define JSON_ARC_RADIUS   "radius"
#define JSON_ARC_CENTER   "center"
#define JSON_EXTRUSION_ENTITY_TYPE   "entity_type"
#define JSON_EXTRUSION_NO_SORT   "no_sort"
#define JSON_EXTRUSION_PATHS   "paths"
#define JSON_EXTRUSION_ENTITIES   "entities"
#define JSON_EXTRUSION_TYPE_PATH   "path"
#define JSON_EXTRUSION_TYPE_MULTIPATH   "multipath"
#define JSON_EXTRUSION_TYPE_LOOP   "loop"
#define JSON_EXTRUSION_TYPE_COLLECTION   "collection"
#define JSON_EXTRUSION_POLYLINE   "polyline"
#define JSON_EXTRUSION_MM3_PER_MM   "mm3_per_mm"
#define JSON_EXTRUSION_WIDTH   "width"
#define JSON_EXTRUSION_HEIGHT   "height"
#define JSON_EXTRUSION_ROLE   "role"
#define JSON_EXTRUSION_NO_EXTRUSION   "no_extrusion"
#define JSON_EXTRUSION_LOOP_ROLE   "loop_role"

Functions

static std::vector< BedExcludeRegion > Slic3r::translated_bed_exclusion_volumes (const Print &print)
static std::vector< std::vector< BedExcludeRegion > > Slic3r::translated_bed_exclusion_volumes_by_extruder (const Print &print)
static bool Slic3r::intersects_bed_exclusion_purpose (const ModelInstance &instance, const std::vector< BedExcludeRegion > &regions, const bool collision_volume)
static std::optional< BedExclusionCollision > Slic3r::colliding_bed_exclusion (const Print &print, const PrintObject &print_object, const ModelInstance &instance, const std::vector< std::vector< BedExcludeRegion > > &regions_by_extruder)
static Polygons Slic3r::full_height_bed_exclusion_polygons (const std::vector< BedExcludeRegion > &regions)
double Slic3r::compacted_tower_footprint_padding (const PrintConfig &config, double brim_width)
Polygons Slic3r::compacted_wipe_tower_rings (const CompactedTowerZone &zone, bool any_body_tier)
CompactedTowerZone Slic3r::compacted_wipe_tower_zone (const PrintConfig &config, const Polygon &tower_footprint)
CompactedTowerClearance Slic3r::compacted_wipe_tower_clearance (const PrintConfig &config, const CompactedTowerZone &zone, const Polygon &inst_hull, double object_rise)
Polygon Slic3r::compacted_wipe_tower_offender_outline (const Polygon &inst_hull, double body_clearance)
static std::string Slic3r::compacted_wipe_tower_clearance_error ()
static Polygon Slic3r::compacted_tower_print_instance_hull (const PrintObject &object, const PrintInstance &instance)
static Polygon Slic3r::estimated_wipe_tower_footprint (const Print &print)
static StringObjectException Slic3r::layered_print_cleareance_valid (const Print &print, StringObjectException *warning)
std::map< ObjectID, unsigned int > Slic3r::getObjectExtruderMap (const Print &print)
static void Slic3r::to_json (json &j, const Points &p_s)
static void Slic3r::to_json (json &j, const BoundingBox &bb)
static void Slic3r::to_json (json &j, const ExPolygon &polygon)
static void Slic3r::to_json (json &j, const Surface &surf)
static void Slic3r::to_json (json &j, const ArcSegment &arc_seg)
static void Slic3r::to_json (json &j, const Polyline &poly_line)
static void Slic3r::to_json (json &j, const ExtrusionPath &extrusion_path)
static bool Slic3r::convert_extrusion_to_json (json &entity_json, json &entity_paths_json, const ExtrusionEntity *extrusion_entity)
static void Slic3r::to_json (json &j, const LayerRegion &layer_region)
static void Slic3r::to_json (json &j, const groupedVolumeSlices &first_layer_group)
static void Slic3r::from_json (const json &j, Points &p_s)
static void Slic3r::from_json (const json &j, BoundingBox &bbox)
static void Slic3r::from_json (const json &j, ExPolygon &polygon)
static void Slic3r::from_json (const json &j, Surface &surf)
static void Slic3r::from_json (const json &j, ArcSegment &arc_seg)
static void Slic3r::from_json (const json &j, Polyline &poly_line)
static void Slic3r::from_json (const json &j, ExtrusionPath &extrusion_path)
static bool Slic3r::convert_extrusion_from_json (const json &entity_json, ExtrusionEntityCollection &entity_collection)
static void Slic3r::convert_layer_region_from_json (const json &j, LayerRegion &layer_region)
void Slic3r::extract_layer (const json &layer_json, Layer &layer)
void Slic3r::extract_support_layer (const json &support_layer_json, SupportLayer &support_layer)
static void Slic3r::from_json (const json &j, groupedVolumeSlices &firstlayer_group)

Class Documentation

◆ Slic3r::BedExclusionCollision

struct Slic3r::BedExclusionCollision
Class Members
bool collision_volume
size_t extruder_id

◆ Slic3r::FilamentType

struct Slic3r::FilamentType
Collaboration diagram for Slic3r::FilamentType:
Class Members
int max_temp
int min_temp
string name
string temp_type

Macro Definition Documentation

◆ JSON_ARC_ANGLE_RADIUS

#define JSON_ARC_ANGLE_RADIUS   "angle_radians"

◆ JSON_ARC_CENTER

#define JSON_ARC_CENTER   "center"

◆ JSON_ARC_DATA

#define JSON_ARC_DATA   "arc_data"

◆ JSON_ARC_DIRECTION

#define JSON_ARC_DIRECTION   "direction"

◆ JSON_ARC_END_INDEX

#define JSON_ARC_END_INDEX   "end_index"

◆ JSON_ARC_END_POINT

#define JSON_ARC_END_POINT   "end_point"

◆ JSON_ARC_FITTING

#define JSON_ARC_FITTING   "arc_fitting"

◆ JSON_ARC_LENGTH

#define JSON_ARC_LENGTH   "length"

◆ JSON_ARC_PATH_TYPE

#define JSON_ARC_PATH_TYPE   "path_type"

◆ JSON_ARC_POLAY_END_THETA

#define JSON_ARC_POLAY_END_THETA   "polar_end_theta"

◆ JSON_ARC_POLAY_START_THETA

#define JSON_ARC_POLAY_START_THETA   "polar_start_theta"

◆ JSON_ARC_RADIUS

#define JSON_ARC_RADIUS   "radius"

◆ JSON_ARC_START_INDEX

#define JSON_ARC_START_INDEX   "start_index"

◆ JSON_ARC_START_POINT

#define JSON_ARC_START_POINT   "start_point"

◆ JSON_EXPOLYGON

#define JSON_EXPOLYGON   "expolygon"

◆ JSON_EXTRUSION_ENTITIES

◆ JSON_EXTRUSION_ENTITY_TYPE

#define JSON_EXTRUSION_ENTITY_TYPE   "entity_type"

◆ JSON_EXTRUSION_HEIGHT

#define JSON_EXTRUSION_HEIGHT   "height"

◆ JSON_EXTRUSION_LOOP_ROLE

#define JSON_EXTRUSION_LOOP_ROLE   "loop_role"

◆ JSON_EXTRUSION_MM3_PER_MM

#define JSON_EXTRUSION_MM3_PER_MM   "mm3_per_mm"

◆ JSON_EXTRUSION_NO_EXTRUSION

#define JSON_EXTRUSION_NO_EXTRUSION   "no_extrusion"

◆ JSON_EXTRUSION_NO_SORT

◆ JSON_EXTRUSION_PATHS

#define JSON_EXTRUSION_PATHS   "paths"

◆ JSON_EXTRUSION_POLYLINE

#define JSON_EXTRUSION_POLYLINE   "polyline"

◆ JSON_EXTRUSION_ROLE

#define JSON_EXTRUSION_ROLE   "role"

◆ JSON_EXTRUSION_TYPE_COLLECTION

#define JSON_EXTRUSION_TYPE_COLLECTION   "collection"

◆ JSON_EXTRUSION_TYPE_LOOP

#define JSON_EXTRUSION_TYPE_LOOP   "loop"

◆ JSON_EXTRUSION_TYPE_MULTIPATH

#define JSON_EXTRUSION_TYPE_MULTIPATH   "multipath"

◆ JSON_EXTRUSION_TYPE_PATH

#define JSON_EXTRUSION_TYPE_PATH   "path"

◆ JSON_EXTRUSION_WIDTH

#define JSON_EXTRUSION_WIDTH   "width"

◆ JSON_FIRSTLAYER_GROUP_ID

#define JSON_FIRSTLAYER_GROUP_ID   "group_id"

◆ JSON_FIRSTLAYER_GROUP_SLICES

#define JSON_FIRSTLAYER_GROUP_SLICES   "slices"

◆ JSON_FIRSTLAYER_GROUP_VOLUME_IDS

#define JSON_FIRSTLAYER_GROUP_VOLUME_IDS   "volume_ids"

◆ JSON_FIRSTLAYER_GROUPS

#define JSON_FIRSTLAYER_GROUPS   "first_layer_groups"

◆ JSON_IDENTIFY_ID

#define JSON_IDENTIFY_ID   "identify_id"

◆ JSON_IS_ARC

#define JSON_IS_ARC   "is_arc"

◆ JSON_LAYER_HEIGHT

#define JSON_LAYER_HEIGHT   "height"

◆ JSON_LAYER_ID

#define JSON_LAYER_ID   "layer_id"

◆ JSON_LAYER_OVERHANG_BBOX

#define JSON_LAYER_OVERHANG_BBOX   "overhang_bbox"

◆ JSON_LAYER_OVERHANG_POLYGONS

#define JSON_LAYER_OVERHANG_POLYGONS   "overhang_polygons"

◆ JSON_LAYER_PRINT_Z

#define JSON_LAYER_PRINT_Z   "print_z"

◆ JSON_LAYER_REGION_CONFIG_HASH

#define JSON_LAYER_REGION_CONFIG_HASH   "config_hash"

Referenced by Slic3r::to_json().

◆ JSON_LAYER_REGION_FILL_EXPOLYGONS

#define JSON_LAYER_REGION_FILL_EXPOLYGONS   "fill_expolygons"

◆ JSON_LAYER_REGION_FILL_NO_OVERLAP

#define JSON_LAYER_REGION_FILL_NO_OVERLAP   "fill_no_overlap_expolygons"

◆ JSON_LAYER_REGION_FILL_SURFACES

#define JSON_LAYER_REGION_FILL_SURFACES   "fill_surfaces"

◆ JSON_LAYER_REGION_FILLS

#define JSON_LAYER_REGION_FILLS   "fills"

◆ JSON_LAYER_REGION_PERIMETERS

#define JSON_LAYER_REGION_PERIMETERS   "perimeters"

◆ JSON_LAYER_REGION_RAW_SLICES

#define JSON_LAYER_REGION_RAW_SLICES   "raw_slices"

◆ JSON_LAYER_REGION_SLICES

#define JSON_LAYER_REGION_SLICES   "slices"

◆ JSON_LAYER_REGION_THIN_FILLS

#define JSON_LAYER_REGION_THIN_FILLS   "thin_fills"

◆ JSON_LAYER_REGION_UNSUPPORTED_BRIDGE_EDGES

#define JSON_LAYER_REGION_UNSUPPORTED_BRIDGE_EDGES   "unsupported_bridge_edges"

◆ JSON_LAYER_REGIONS

#define JSON_LAYER_REGIONS   "layer_regions"

◆ JSON_LAYER_SLICE_Z

#define JSON_LAYER_SLICE_Z   "slice_z"

◆ JSON_LAYER_SLICED_POLYGONS

#define JSON_LAYER_SLICED_POLYGONS   "sliced_polygons"

◆ JSON_LAYER_SLLICED_BBOXES

#define JSON_LAYER_SLLICED_BBOXES   "sliced_bboxes"

◆ JSON_LAYERS

#define JSON_LAYERS   "layers"

◆ JSON_OBJECT_NAME

#define JSON_OBJECT_NAME   "name"

◆ JSON_POINTS

#define JSON_POINTS   "points"

◆ JSON_POLYGON_CONTOUR

#define JSON_POLYGON_CONTOUR   "contour"

◆ JSON_POLYGON_HOLES

#define JSON_POLYGON_HOLES   "holes"

◆ JSON_SUPPORT_LAYER_FILLS

#define JSON_SUPPORT_LAYER_FILLS   "support_fills"

◆ JSON_SUPPORT_LAYER_INTERFACE_ID

#define JSON_SUPPORT_LAYER_INTERFACE_ID   "interface_id"

◆ JSON_SUPPORT_LAYER_ISLANDS

#define JSON_SUPPORT_LAYER_ISLANDS   "support_islands"

◆ JSON_SUPPORT_LAYER_TYPE

#define JSON_SUPPORT_LAYER_TYPE   "support_type"

◆ JSON_SUPPORT_LAYERS

#define JSON_SUPPORT_LAYERS   "support_layers"

◆ JSON_SURF_BRIDGE_ANGLE

#define JSON_SURF_BRIDGE_ANGLE   "bridge_angle"

◆ JSON_SURF_EXTRA_PERIMETERS

#define JSON_SURF_EXTRA_PERIMETERS   "extra_perimeters"

◆ JSON_SURF_THICKNESS

#define JSON_SURF_THICKNESS   "thickness"

◆ JSON_SURF_THICKNESS_LAYER

#define JSON_SURF_THICKNESS_LAYER   "thickness_layers"

◆ JSON_SURF_TYPE

#define JSON_SURF_TYPE   "surface_type"

◆ JSON_TREE_SUPPORT_LAYERS

#define JSON_TREE_SUPPORT_LAYERS   "tree_support_layers"

◆ L

#define L ( s)