OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
FillRectilinear.cpp File Reference
#include <numeric>
#include <math.h>
#include <initializer_list>
#include <array>
#include <map>
#include <stdlib.h>
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <random>
#include <boost/container/small_vector.hpp>
#include <boost/log/trivial.hpp>
#include <boost/static_assert.hpp>
#include <boost/math/constants/constants.hpp>
#include <vector>
#include <utility>
#include <string>
#include "../ClipperUtils.hpp"
#include "../ExPolygon.hpp"
#include "../Geometry.hpp"
#include "../Surface.hpp"
#include "../ShortestPath.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Fill/FillBase.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/ExtrusionEntityCollection.hpp"
#include "FillCornerSmoothing.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Flow.hpp"
#include "FillRectilinear.hpp"
#include <cassert>
#include "../libslic3r.h"
Include dependency graph for FillRectilinear.cpp:

Go to the source code of this file.

Classes

struct  Slic3r::SegmentIntersection
struct  Slic3r::SegmentedIntersectionLine
struct  Slic3r::ExPolygonWithOffset
struct  Slic3r::MonotonicRegion
struct  Slic3r::MonotonicRegion::Boundary
struct  Slic3r::AntPath
class  Slic3r::AntPathMatrix

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 INFILL_DEBUG_ASSERT(CONDITION)
#define ASSERT_THROW(CONDITION)
#define SLIC3R_DEBUG_MONOTONOUS_REGIONS

Enumerations

enum  Slic3r::DirectionMask { Slic3r::DIR_FORWARD = 1 , Slic3r::DIR_BACKWARD = 2 }

Functions

static coordf_t Slic3r::segment_length (const Polygon &poly, size_t seg1, const Point &p1, size_t seg2, const Point &p2)
static void Slic3r::polygon_segment_append (Points &out, const Polygon &polygon, size_t seg1, size_t seg2)
static void Slic3r::polygon_segment_append_reversed (Points &out, const Polygon &polygon, size_t seg1, size_t seg2)
static SegmentIntersection Slic3r::phony_outer_intersection (SegmentIntersection::SegmentIntersectionType type, coord_t pos)
static int Slic3r::distance_of_segmens (const Polygon &poly, size_t seg1, size_t seg2, bool forward)
static bool Slic3r::intersection_on_prev_next_vertical_line_valid (const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iIntersection, SegmentIntersection::Side side)
static bool Slic3r::intersection_on_prev_vertical_line_valid (const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iIntersection)
static bool Slic3r::intersection_on_next_vertical_line_valid (const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iIntersection)
static coordf_t Slic3r::measure_perimeter_horizontal_segment_length (const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iIntersection, size_t iIntersection2)
static void Slic3r::emit_perimeter_prev_next_segment (const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iInnerContour, size_t iIntersection, size_t iIntersection2, Polyline &out, bool dir_is_next)
static coordf_t Slic3r::measure_perimeter_segment_on_vertical_line_length (const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iIntersection, size_t iIntersection2, bool forward)
static void Slic3r::emit_perimeter_segment_on_vertical_line (const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs, size_t iVerticalLine, size_t iInnerContour, size_t iIntersection, size_t iIntersection2, Polyline &out, bool forward)
static std::vector< SegmentedIntersectionLine > Slic3r::slice_region_by_vertical_lines (const ExPolygonWithOffset &poly_with_offset, size_t n_vlines, coord_t x0, coord_t line_spacing)
bool Slic3r::validate_segment_intersection_connectivity (const std::vector< SegmentedIntersectionLine > &segs)
static void Slic3r::connect_segment_intersections_by_contours (const ExPolygonWithOffset &poly_with_offset, std::vector< SegmentedIntersectionLine > &segs, const FillParams &params, const coord_t link_max_length)
static void Slic3r::pinch_contours_insert_phony_outer_intersections (std::vector< SegmentedIntersectionLine > &segs)
static const SegmentIntersection & Slic3r::end_of_vertical_run_raw (const SegmentIntersection &start)
static const SegmentIntersection & Slic3r::end_of_vertical_run (const SegmentedIntersectionLine &il, const SegmentIntersection &start)
static SegmentIntersection & Slic3r::end_of_vertical_run (SegmentedIntersectionLine &il, SegmentIntersection &start)
static void Slic3r::traverse_graph_generate_polylines (const ExPolygonWithOffset &poly_with_offset, const FillParams &params, std::vector< SegmentedIntersectionLine > &segs, const bool consistent_pattern, Polylines &polylines_out)
static const SegmentIntersection & Slic3r::vertical_run_bottom (const SegmentedIntersectionLine &vline, const SegmentIntersection &start)
static SegmentIntersection & Slic3r::vertical_run_bottom (SegmentedIntersectionLine &vline, SegmentIntersection &start)
static const SegmentIntersection & Slic3r::vertical_run_top (const SegmentedIntersectionLine &vline, const SegmentIntersection &start)
static SegmentIntersection & Slic3r::vertical_run_top (SegmentedIntersectionLine &vline, SegmentIntersection &start)
static SegmentIntersection * Slic3r::overlap_bottom (SegmentIntersection &start, SegmentIntersection &end, SegmentedIntersectionLine &vline_this, SegmentedIntersectionLine &vline_other, SegmentIntersection::Side side)
static SegmentIntersection * Slic3r::overlap_top (SegmentIntersection &start, SegmentIntersection &end, SegmentedIntersectionLine &vline_this, SegmentedIntersectionLine &vline_other, SegmentIntersection::Side side)
static std::pair< SegmentIntersection *, SegmentIntersection * > Slic3r::left_overlap (SegmentIntersection &start, SegmentIntersection &end, SegmentedIntersectionLine &vline_this, SegmentedIntersectionLine &vline_left)
static std::pair< SegmentIntersection *, SegmentIntersection * > Slic3r::left_overlap (std::pair< SegmentIntersection *, SegmentIntersection * > &start_end, SegmentedIntersectionLine &vline_this, SegmentedIntersectionLine &vline_left)
static std::pair< SegmentIntersection *, SegmentIntersection * > Slic3r::right_overlap (SegmentIntersection &start, SegmentIntersection &end, SegmentedIntersectionLine &vline_this, SegmentedIntersectionLine &vline_right)
static std::pair< SegmentIntersection *, SegmentIntersection * > Slic3r::right_overlap (std::pair< SegmentIntersection *, SegmentIntersection * > &start_end, SegmentedIntersectionLine &vline_this, SegmentedIntersectionLine &vline_right)
static std::vector< MonotonicRegion > Slic3r::generate_montonous_regions (std::vector< SegmentedIntersectionLine > &segs)
static float Slic3r::montonous_region_path_length (const MonotonicRegion &region, bool dir, const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs)
static void Slic3r::connect_monotonic_regions (std::vector< MonotonicRegion > &regions, const ExPolygonWithOffset &poly_with_offset, std::vector< SegmentedIntersectionLine > &segs)
void Slic3r::monotonic_3_opt (std::vector< MonotonicRegionLink > &path, const std::vector< SegmentedIntersectionLine > &segs)
template<typename... TArgs>
void Slic3r::print_ant (const std::string &fmt, TArgs &&... args)
static std::vector< MonotonicRegionLink > Slic3r::chain_monotonic_regions (std::vector< MonotonicRegion > &regions, const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs, std::mt19937_64 &rng)
static void Slic3r::polylines_from_paths (const std::vector< MonotonicRegionLink > &path, const ExPolygonWithOffset &poly_with_offset, const std::vector< SegmentedIntersectionLine > &segs, Polylines &polylines_out)
void Slic3r::make_fill_lines (const ExPolygonWithOffset &poly_with_offset, Point refpt, double angle, coord_t x_margin, coord_t line_spacing, coord_t pattern_shift, Polylines &fill_lines)
static void Slic3r::remove_overlapped (Polylines &polylines, coord_t line_width)
static std::vector< Vec2d > Slic3r::cubic_upper_level (double tau, double h, double period, double d1)
Points Slic3r::sample_grid_pattern (const ExPolygon &expolygon, coord_t spacing, const BoundingBox &global_bounding_box)
Points Slic3r::sample_grid_pattern (const ExPolygons &expolygons, coord_t spacing, const BoundingBox &global_bounding_box)
Points Slic3r::sample_grid_pattern (const Polygons &polygons, coord_t spacing, const BoundingBox &global_bounding_box)

Class Documentation

◆ Slic3r::SegmentedIntersectionLine

struct Slic3r::SegmentedIntersectionLine
Collaboration diagram for Slic3r::SegmentedIntersectionLine:
Class Members
size_t idx
vector< SegmentIntersection > intersections
coord_t pos

◆ Slic3r::MonotonicRegion::Boundary

struct Slic3r::MonotonicRegion::Boundary
Class Members
int high
int low
int vline

◆ Slic3r::AntPath

struct Slic3r::AntPath
Class Members
float length { -1. }
float pheromone { 0 }
float visibility { -1. }

◆ Slic3r::MonotonicRegionLink

struct Slic3r::MonotonicRegionLink
Collaboration diagram for Slic3r::MonotonicRegionLink:
Class Members
bool flipped
AntPath * next
AntPath * next_flipped
MonotonicRegion * region

Macro Definition Documentation

◆ ASSERT_THROW

#define ASSERT_THROW ( CONDITION)
Value:
do { INFILL_DEBUG_ASSERT(CONDITION); if (! (CONDITION)) throw InfillFailedException(); } while (0)
#define INFILL_DEBUG_ASSERT(CONDITION)

Referenced by Slic3r::slice_region_by_vertical_lines().

◆ INFILL_DEBUG_ASSERT

#define INFILL_DEBUG_ASSERT ( CONDITION)
Value:
assert(CONDITION)

◆ SLIC3R_DEBUG_MONOTONOUS_REGIONS

#define SLIC3R_DEBUG_MONOTONOUS_REGIONS