OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
PerimeterGenerator.cpp File Reference
#include "PerimeterGenerator.hpp"
#include "Arachne/utils/ExtrusionLine.hpp"
#include "Arachne/utils/ExtrusionJunction.hpp"
#include "BridgeDetector.hpp"
#include "ClipperUtils.hpp"
#include "ClipperZUtils.hpp"
#include "ExPolygon.hpp"
#include "ExtrusionEntity.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "Feature/FuzzySkin/FuzzySkin.hpp"
#include "Polygon.hpp"
#include "Polyline.hpp"
#include "Point.hpp"
#include "Flow.hpp"
#include "PrintConfig.hpp"
#include "ShortestPath.hpp"
#include "Surface.hpp"
#include "VariableWidth.hpp"
#include "Arachne/WallToolPaths.hpp"
#include "Geometry/ConvexHull.hpp"
#include "ExPolygonCollection.hpp"
#include "Geometry.hpp"
#include "Line.hpp"
#include <algorithm>
#include <cmath>
#include <cassert>
#include <cstddef>
#include <limits>
#include <iterator>
#include <map>
#include <unordered_map>
#include <tuple>
#include <unordered_set>
#include <thread>
#include <tbb/blocked_range.h>
#include <tbb/parallel_for.h>
#include <vector>
#include "libslic3r.h"
#include <utility>
#include "libslic3r/AABBTreeLines.hpp"
#include "BoundingBox.hpp"
#include "MultiMaterialSegmentation.hpp"
#include "SurfaceCollection.hpp"
Include dependency graph for PerimeterGenerator.cpp:

Go to the source code of this file.

Classes

class  Slic3r::PerimeterGeneratorLoop
struct  Slic3r::PerimeterGeneratorArachneExtrusion

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 EXTRA_PERIMETER_OFFSET_PARAMETERS   jtSquare, 0.

Typedefs

using Slic3r::PerimeterGeneratorLoops = std::vector<PerimeterGeneratorLoop>

Enumerations

enum class  Slic3r::TopOverlap { Slic3r::None , Slic3r::Partial , Slic3r::Full }

Functions

template<class _T>
static bool Slic3r::detect_steep_overhang (const PrintRegionConfig *config, bool is_contour, const BoundingBox &extrusion_bboxs, double extrusion_width, const _T extrusion, const ExPolygons *lower_slices, bool &steep_overhang_contour, bool &steep_overhang_hole)
static ExtrusionEntityCollection Slic3r::traverse_loops (const PerimeterGenerator &perimeter_generator, const PerimeterGeneratorLoops &loops, ThickPolylines &thin_walls, bool &steep_overhang_contour, bool &steep_overhang_hole)
static ClipperZUtils::ZPaths Slic3r::clip_extrusion (const ClipperZUtils::ZPath &subject, const ClipperZUtils::ZPaths &clip, ClipType clipType)
static double Slic3r::clipper_z_path_length (const ClipperZUtils::ZPath &path)
static ExtrusionEntityCollection Slic3r::traverse_extrusions (const PerimeterGenerator &perimeter_generator, std::vector< PerimeterGeneratorArachneExtrusion > &pg_extrusions, bool &steep_overhang_contour, bool &steep_overhang_hole)
static bool Slic3r::has_top_shell_layers (const PrintRegionConfig &config)
static bool Slic3r::has_bottom_shell_layers (const PrintRegionConfig &config)
static bool Slic3r::top_fill_replaces_inner_walls (const PrintRegionConfig &config)
static bool Slic3r::point_over_top (const Point &p, const ExPolygons &top_region, const BoundingBox &top_region_bbox)
static TopOverlap Slic3r::classify_over_top (const Points &pts, const ExPolygons &top_region, const BoundingBox &top_region_bbox)
static TopOverlap Slic3r::classify_over_top (const Arachne::ExtrusionLine &el, const ExPolygons &top_region, const BoundingBox &top_region_bbox)
static void Slic3r::clip_inner_walls_over_top (std::vector< Arachne::VariableWidthLines > &inner_perimeters, const ExPolygons &top_region, coord_t perimeter_width, Polygons &kept_over_top)
static coord_t Slic3r::widest_bead (const std::vector< Arachne::VariableWidthLines > &walls)
static double Slic3r::length_off_reference (const std::vector< Arachne::VariableWidthLines > &walls, const Arachne::VariableWidthLines &reference, const ExPolygons &excluded, coord_t tolerance)
static Polygons Slic3r::walls_footprint (const Arachne::VariableWidthLines &walls)
bool Slic3r::paths_touch (const ExtrusionPath &path_one, const ExtrusionPath &path_two, double limit_distance)
Polylines Slic3r::reconnect_polylines (const Polylines &polylines, double limit_distance)
ExtrusionPaths Slic3r::sort_extra_perimeters (const ExtrusionPaths &extra_perims, int index_of_first_unanchored, double extrusion_spacing)
std::tuple< std::vector< ExtrusionPaths >, Polygons > Slic3r::generate_extra_perimeters_over_overhangs (ExPolygons infill_area, const Polygons &lower_slices_polygons, int perimeter_count, const Flow &overhang_flow, double scaled_resolution, const PrintObjectConfig &object_config, const PrintConfig &print_config)
static void Slic3r::reorient_perimeters (ExtrusionEntityCollection &entities, bool steep_overhang_contour, bool steep_overhang_hole, bool reverse_internal_only)
static bool Slic3r::is_unsupported_loop (const ExtrusionEntity *entity)
static void Slic3r::defer_unsupported_loops (const PerimeterGenerator &perimeter_generator, ExtrusionEntityCollection &entities)
static bool Slic3r::arachne_lines_touch (const Arachne::ExtrusionLine &a, const Arachne::ExtrusionLine &b, double min_threshold)
std::vector< int > Slic3r::findAllTouchingPerimeters (const std::vector< PerimeterGeneratorArachneExtrusion > &entities, const std::unordered_set< int > &referenceIndices, size_t threshold_external, size_t threshold_internal, size_t considered_inset_idx)
 Finds all perimeters touching a given set of reference lines, given as indexes.
std::vector< PerimeterGeneratorArachneExtrusion > Slic3r::reorderPerimetersByProximity (std::vector< PerimeterGeneratorArachneExtrusion > entities, size_t threshold_external, size_t threshold_internal)
 Reorders perimeters based on proximity to the reference perimeter.
void Slic3r::bringContoursToFront (std::vector< PerimeterGeneratorArachneExtrusion > &ordered_extrusions)
 Reorders the vector to bring external perimeter (i.e. paths with inset index 0) that are also contours (i.e. external facing lines) to the front.
bool Slic3r::brim_puts_outer_walls_first (BrimType brim_type, double brim_width)

Variables

static const int overhang_sampling_number = 6
static const double narrow_loop_length_threshold = 10
static constexpr double SMALLER_EXT_INSET_OVERLAP_TOLERANCE = 0.22

Class Documentation

◆ Slic3r::PerimeterGeneratorArachneExtrusion

struct Slic3r::PerimeterGeneratorArachneExtrusion
Collaboration diagram for Slic3r::PerimeterGeneratorArachneExtrusion:
Class Members
ExtrusionLine * extrusion = nullptr
bool is_contour = false

Macro Definition Documentation

◆ EXTRA_PERIMETER_OFFSET_PARAMETERS

#define EXTRA_PERIMETER_OFFSET_PARAMETERS   jtSquare, 0.

Variable Documentation

◆ narrow_loop_length_threshold

const double narrow_loop_length_threshold = 10
static

◆ overhang_sampling_number

const int overhang_sampling_number = 6
static

◆ SMALLER_EXT_INSET_OVERLAP_TOLERANCE

double SMALLER_EXT_INSET_OVERLAP_TOLERANCE = 0.22
staticconstexpr