OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
SupportMaterial.cpp File Reference
#include "ClipperUtils.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "ExtrusionEntity.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "libslic3r/Flow.hpp"
#include "Layer.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
#include "Print.hpp"
#include "SupportMaterial.hpp"
#include "libslic3r/Slicing.hpp"
#include "libslic3r/Support/SupportLayer.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "SupportCommon.hpp"
#include "BeltFloorContext.hpp"
#include "Geometry.hpp"
#include "Point.hpp"
#include "MutablePolygon.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Surface.hpp"
#include "libslic3r/TriangleSelector.hpp"
#include <agg/agg_rendering_buffer.h>
#include <agg/agg_renderer_base.h>
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <iterator>
#include <cstdint>
#include <cstddef>
#include <deque>
#include <initializer_list>
#include <limits>
#include <map>
#include <memory>
#include <boost/log/trivial.hpp>
#include <boost/container/static_vector.hpp>
#include <set>
#include <numeric>
#include <tbb/parallel_for.h>
#include <tbb/spin_mutex.h>
#include <tbb/task_group.h>
#include <vector>
#include <utility>
#include <tuple>
#include <agg/agg_pixfmt_gray.h>
#include <agg/agg_renderer_scanline.h>
#include <agg/agg_scanline_p.h>
#include <agg/agg_rasterizer_scanline_aa.h>
#include <agg/agg_path_storage.h>
#include "PNGReadWrite.hpp"
#include <cassert>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/MultiMaterialSegmentation.hpp"
#include "libslic3r/Support/SupportParameters.hpp"
#include "libslic3r/SurfaceCollection.hpp"

Go to the source code of this file.

Classes

struct  Slic3r::SupportGridParams
class  Slic3r::SupportGridPattern
struct  Slic3r::SupportAnnotations
struct  Slic3r::SlicesMarginCache
struct  Slic3r::OverhangCluster

Namespaces

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

Macros

#define SUPPORT_USE_AGG_RASTERIZER
#define SQ(x)
#define SUPPORT_MATERIAL_MARGIN   1.2
#define NUM_MARGIN_STEPS   3
#define PILLAR_SIZE   (2.5)
#define PILLAR_SPACING   10
#define SUPPORT_SURFACES_OFFSET_PARAMETERS   jtSquare, 0.
#define PROPAGATION_STEP(offset)

Functions

static std::vector< unsigned char > Slic3r::rasterize_polygons (const Vec2i32 &grid_size, const double pixel_size, const Point &left_bottom, const Polygons &polygons)
static Polygons Slic3r::contours_simplified (const Vec2i32 &grid_size, const double pixel_size, Point left_bottom, const std::vector< unsigned char > &grid, coord_t offset, bool fill_holes)
SupportGeneratorLayer & Slic3r::layer_allocate (std::deque< SupportGeneratorLayer > &layer_storage, SupporLayerType layer_type)
SupportGeneratorLayer & Slic3r::layer_allocate (std::deque< SupportGeneratorLayer > &layer_storage, tbb::spin_mutex &layer_storage_mutex, SupporLayerType layer_type)
void Slic3r::layers_append (SupportGeneratorLayersPtr &dst, const SupportGeneratorLayersPtr &src)
static Polygons Slic3r::belt_floor_valid_region_polygon (const SlicingParameters &slicing_params, const PrintConfig &print_config, const PrintObject &object, coordf_t print_z)
static void Slic3r::trim_support_layers_by_belt_floor (const SlicingParameters &slicing_params, const PrintConfig &print_config, const PrintObject &object, SupportGeneratorLayersPtr &support_layers)
Polygons Slic3r::collect_region_slices_by_type (const Layer &layer, SurfaceType surface_type)
Polygons Slic3r::belt_floor_surface_polygon (const SlicingParameters &slicing_params, const PrintConfig &print_config, const PrintObject &object, coordf_t print_z)
Polygons Slic3r::collect_slices_outer (const Layer &layer)
static bool Slic3r::SupportMaterialInternal::has_bridging_perimeters (const ExtrusionLoop &loop)
static bool Slic3r::SupportMaterialInternal::has_bridging_perimeters (const ExtrusionEntityCollection &perimeters)
static bool Slic3r::SupportMaterialInternal::has_bridging_fills (const ExtrusionEntityCollection &fills)
static bool Slic3r::SupportMaterialInternal::has_bridging_extrusions (const Layer &layer)
static void Slic3r::SupportMaterialInternal::collect_bridging_perimeter_areas (const ExtrusionLoop &loop, const float expansion_scaled, Polygons &out)
static void Slic3r::SupportMaterialInternal::collect_bridging_perimeter_areas (const ExtrusionEntityCollection &perimeters, const float expansion_scaled, Polygons &out)
static void Slic3r::SupportMaterialInternal::remove_bridges_from_contacts (const PrintConfig &print_config, const Layer &lower_layer, const Polygons &lower_layer_polygons, const LayerRegion &layerm, float fw, Polygons &contact_polygons)
static ExPolygons Slic3r::detect_overhangs (const Layer &layer, const size_t layer_id, Polygons &lower_layer_polygons, const PrintConfig &print_config, const PrintObjectConfig &object_config, SupportAnnotations &annotations, const double gap_xy)
static std::tuple< Polygons, Polygons, double > Slic3r::detect_contacts (const Layer &layer, const size_t layer_id, Polygons &overhang_polygons, Polygons &lower_layer_polygons, const PrintConfig &print_config, const PrintObjectConfig &object_config, SupportAnnotations &annotations, SlicesMarginCache &slices_margin, const double gap_xy)
Layer * Slic3r::sync_gap_with_object_layer (const Layer &layer, const coordf_t gap_support_object, bool is_top_contact)
static std::pair< SupportGeneratorLayer *, SupportGeneratorLayer * > Slic3r::new_contact_layer (const PrintConfig &print_config, const PrintObjectConfig &object_config, const SlicingParameters &slicing_params, const coordf_t support_layer_height_min, const Layer &layer, SupportGeneratorLayerStorage &layer_storage)
static void Slic3r::fill_contact_layer (SupportGeneratorLayer &new_layer, size_t layer_id, const SlicingParameters &slicing_params, const PrintObjectConfig &object_config, const SlicesMarginCache &slices_margin, const Polygons &overhang_polygons, const Polygons &contact_polygons, const Polygons &enforcer_polygons, const Polygons &lower_layer_polygons, const Flow &support_material_flow, float no_interface_offset)
static void Slic3r::merge_contact_layers (const SlicingParameters &slicing_params, double support_layer_height_min, SupportGeneratorLayersPtr &layers)
static OverhangCluster * Slic3r::add_overhang (std::vector< OverhangCluster > &clusters, ExPolygon *overhang, int layer_nr, coordf_t offset_scaled)
static SupportGeneratorLayer * Slic3r::detect_bottom_contacts (const SlicingParameters &slicing_params, const SupportParameters &support_params, const PrintObject &object, const Layer &layer, const SupportGeneratorLayersPtr &top_contacts, size_t contact_idx, SupportGeneratorLayerStorage &layer_storage, std::vector< Polygons > &layer_support_areas, const Polygons &supports_projected)
static SupportGeneratorLayer * Slic3r::detect_belt_floor_bottom_contacts (const SlicingParameters &slicing_params, const SupportParameters &support_params, const PrintConfig &print_config, const PrintObject &object, const Layer &layer, const SupportGeneratorLayersPtr &top_contacts, size_t contact_idx, SupportGeneratorLayerStorage &layer_storage, std::vector< Polygons > &layer_support_areas, const Polygons &supports_projected)
static std::pair< Polygons, Polygons > Slic3r::project_support_to_grid (const Layer &layer, const SupportGridParams &grid_params, const Polygons &overhangs, Polygons *layer_buildplate_covered)

Variables

static constexpr bool Slic3r::support_with_sheath = false
static constexpr const std::initializer_list< SupporLayerType > Slic3r::support_types_interface
static const double Slic3r::length_thresh_well_supported = scale_(6)
static const double Slic3r::area_thresh_well_supported = SQ(length_thresh_well_supported)
static const double Slic3r::sharp_tail_xy_gap = 0.2f
static const double Slic3r::no_overlap_xy_gap = 0.2f
static const double Slic3r::sharp_tail_max_support_height = 16.f

Class Documentation

◆ Slic3r::SlicesMarginCache

struct Slic3r::SlicesMarginCache
Collaboration diagram for Slic3r::SlicesMarginCache:
Class Members
Polygons all_polygons
float offset { -1 }
Polygons polygons

Macro Definition Documentation

◆ NUM_MARGIN_STEPS

#define NUM_MARGIN_STEPS   3

Referenced by Slic3r::detect_contacts().

◆ PILLAR_SIZE

#define PILLAR_SIZE   (2.5)

◆ PILLAR_SPACING

#define PILLAR_SPACING   10

◆ PROPAGATION_STEP

#define PROPAGATION_STEP ( offset)
Value:
do { \
int addr = r * stride + c; \
int addr2 = addr + offset; \
if (grid_data[addr2] && ! mask_data[addr] && ! mask_data[addr2]) \
grid_data[addr] = 1; \
} while (0);

Referenced by Slic3r::SupportGridPattern::seed_fill_block().

◆ SQ

#define SQ ( x)
Value:
((x)*(x))

◆ SUPPORT_MATERIAL_MARGIN

#define SUPPORT_MATERIAL_MARGIN   1.2

◆ SUPPORT_SURFACES_OFFSET_PARAMETERS

#define SUPPORT_SURFACES_OFFSET_PARAMETERS   jtSquare, 0.

◆ SUPPORT_USE_AGG_RASTERIZER

#define SUPPORT_USE_AGG_RASTERIZER