OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::SupportGridPattern Class Reference
Collaboration diagram for Slic3r::SupportGridPattern:

Public Member Functions

 SupportGridPattern (const Polygons *support_polygons, const Polygons *trimming_polygons, const SupportGridParams &params)
Polygons extract_support (const coord_t offset_in_grid, bool fill_holes)

Private Member Functions

 SupportGridPattern ()
SupportGridPattern & operator= (const SupportGridPattern &rhs)

Static Private Member Functions

static std::vector< unsigned char > dilate_trimming_region (const std::vector< unsigned char > &trimming, const Vec2i32 &grid_size)
static void seed_fill_block (std::vector< unsigned char > &grid, Vec2i32 grid_size, const std::vector< unsigned char > &trimming, const Vec2i32 &grid_blocks, int oversampling)
static Points island_samples (const ExPolygons &expolygons)

Private Attributes

SupportMaterialStyle m_style
const Polygons * m_support_polygons
const Polygons * m_trimming_polygons
Polygons m_support_polygons_rotated
Polygons m_trimming_polygons_rotated
coordf_t m_support_angle
coordf_t m_support_spacing
coordf_t m_extrusion_width
coordf_t m_support_material_closing_radius
Vec2i32 m_grid_size
double m_pixel_size
BoundingBox m_bbox
std::vector< unsigned char > m_grid2

Detailed Description

Constructor & Destructor Documentation

◆ SupportGridPattern() [1/2]

Slic3r::SupportGridPattern::SupportGridPattern ( const Polygons * support_polygons,
const Polygons * trimming_polygons,
const SupportGridParams & params )
inline
723 :
724 m_style(params.style),
725 m_support_polygons(support_polygons), m_trimming_polygons(trimming_polygons),
726 m_support_spacing(params.grid_resolution), m_support_angle(params.support_angle),
727 m_extrusion_width(params.extrusion_width),
728 m_support_material_closing_radius(params.support_closing_radius)
729 {
731 if (std::set<SupportMaterialStyle>{smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic}.count(m_style))
733 switch (m_style) {
734 case smsGrid:
735 {
736 // Prepare the grid data, it will be reused when extracting support structures.
737 if (m_support_angle != 0.) {
738 // Create a copy of the rotated contours.
739 m_support_polygons_rotated = *support_polygons;
740 m_trimming_polygons_rotated = *trimming_polygons;
743 polygons_rotate(m_support_polygons_rotated, - params.support_angle);
744 polygons_rotate(m_trimming_polygons_rotated, - params.support_angle);
745 }
746
747 // Resolution of the sparse support grid.
748 coord_t grid_resolution = coord_t(scale_(m_support_spacing));
749 BoundingBox bbox = get_extents(*m_support_polygons);
750 bbox.offset(20);
751 // Align the bounding box with the sparse support grid.
752 bbox.align_to_grid(grid_resolution);
753
754 #ifdef SUPPORT_USE_AGG_RASTERIZER
755 m_bbox = bbox;
756 // Oversample the grid to avoid leaking of supports through or around the object walls.
757 int extrusion_width_scaled = scale_(params.extrusion_width);
758 int oversampling = std::clamp(int(scale_(m_support_spacing) / (extrusion_width_scaled + 100)), 1, 8);
759 m_pixel_size = std::max<double>(extrusion_width_scaled + 21, scale_(m_support_spacing / oversampling));
760 // Add one empty column / row boundaries.
761 m_bbox.offset(m_pixel_size);
762 // Grid size fitting the support polygons plus one pixel boundary around the polygons.
763 Vec2i32 grid_size_raw(int(ceil((m_bbox.max.x() - m_bbox.min.x()) / m_pixel_size)),
764 int(ceil((m_bbox.max.y() - m_bbox.min.y()) / m_pixel_size)));
765 // Overlay macro blocks of (oversampling x oversampling) over the grid.
766 Vec2i32 grid_blocks((grid_size_raw.x() + oversampling - 1 - 2) / oversampling,
767 (grid_size_raw.y() + oversampling - 1 - 2) / oversampling);
768 // and resize the grid to fit the macro blocks + one pixel boundary.
769 m_grid_size = grid_blocks * oversampling + Vec2i32(2, 2);
770 assert(m_grid_size.x() >= grid_size_raw.x());
771 assert(m_grid_size.y() >= grid_size_raw.y());
773
776 grid_blocks, oversampling);
777
778 #ifdef SLIC3R_DEBUG
779 {
780 static int irun;
781 Slic3r::png::write_gray_to_file_scaled(debug_out_path("support-rasterizer-%d.png", irun++), m_grid_size.x(), m_grid_size.y(), m_grid2.data(), 4);
782 }
783 #endif // SLIC3R_DEBUG
784
785 #else // SUPPORT_USE_AGG_RASTERIZER
786 // Create an EdgeGrid, initialize it with projection, initialize signed distance field.
787 m_grid.set_bbox(bbox);
788 m_grid.create(*m_support_polygons, grid_resolution);
789 #if 0
790 if (m_grid.has_intersecting_edges()) {
791 // EdgeGrid fails to produce valid signed distance function for self-intersecting polygons.
794 m_grid.set_bbox(bbox);
795 m_grid.create(*m_support_polygons, grid_resolution);
796 // assert(! m_grid.has_intersecting_edges());
797 printf("SupportGridPattern: fixing polygons with intersection %s\n",
798 m_grid.has_intersecting_edges() ? "FAILED" : "SUCCEEDED");
799 }
800 #endif
801 m_grid.calculate_sdf();
802 #endif // SUPPORT_USE_AGG_RASTERIZER
803 break;
804 }
805
806 case smsSnug:
807 default:
808 // nothing to prepare
809 break;
810 }
811 }
Polygons m_trimming_polygons_rotated
Definition SupportMaterial.cpp:1179
BoundingBox m_bbox
Definition SupportMaterial.cpp:1191
const Polygons * m_trimming_polygons
Definition SupportMaterial.cpp:1177
coordf_t m_support_spacing
Definition SupportMaterial.cpp:1183
const Polygons * m_support_polygons
Definition SupportMaterial.cpp:1176
std::vector< unsigned char > m_grid2
Definition SupportMaterial.cpp:1192
static std::vector< unsigned char > dilate_trimming_region(const std::vector< unsigned char > &trimming, const Vec2i32 &grid_size)
Definition SupportMaterial.cpp:1058
coordf_t m_support_angle
Definition SupportMaterial.cpp:1181
coordf_t m_extrusion_width
Definition SupportMaterial.cpp:1184
double m_pixel_size
Definition SupportMaterial.cpp:1190
SupportMaterialStyle m_style
Definition SupportMaterial.cpp:1175
coordf_t m_support_material_closing_radius
Definition SupportMaterial.cpp:1186
Vec2i32 m_grid_size
Definition SupportMaterial.cpp:1189
static void seed_fill_block(std::vector< unsigned char > &grid, Vec2i32 grid_size, const std::vector< unsigned char > &trimming, const Vec2i32 &grid_blocks, int oversampling)
Definition SupportMaterial.cpp:1079
Polygons m_support_polygons_rotated
Definition SupportMaterial.cpp:1178
#define scale_(val)
Definition libslic3r.h:106
int64_t coord_t
Definition libslic3r.h:48
bool write_gray_to_file_scaled(const char *file_name_utf8, size_t width, size_t height, const uint8_t *data_gray, size_t scale)
Definition PNGReadWrite.cpp:400
std::string debug_out_path(const char *name,...)
Definition utils.cpp:382
static std::vector< unsigned char > rasterize_polygons(const Vec2i32 &grid_size, const double pixel_size, const Point &left_bottom, const Polygons &polygons)
Definition SupportMaterial.cpp:202
Polygons simplify_polygons(const Polygons &subject)
Definition ClipperUtils.cpp:1303
Eigen::Matrix< int32_t, 2, 1, Eigen::DontAlign > Vec2i32
Definition Point.hpp:57
BoundingBox get_extents(const ExPolygonsWithIds &e)
Definition Emboss.cpp:1374
@ smsTreeHybrid
Definition PrintConfig.hpp:363
@ smsTreeStrong
Definition PrintConfig.hpp:363
@ smsGrid
Definition PrintConfig.hpp:363
@ smsSnug
Definition PrintConfig.hpp:363
@ smsDefault
Definition PrintConfig.hpp:363
@ smsTreeOrganic
Definition PrintConfig.hpp:363
@ smsTreeSlim
Definition PrintConfig.hpp:363
void polygons_rotate(Polygons &polys, double angle)
Definition Polygon.hpp:169

References Slic3r::BoundingBox::align_to_grid(), Slic3r::debug_out_path(), dilate_trimming_region(), Slic3r::SupportGridParams::extrusion_width, Slic3r::get_extents(), m_bbox, m_extrusion_width, m_grid2, m_grid_size, m_pixel_size, m_style, m_support_angle, m_support_material_closing_radius, m_support_polygons, m_support_polygons_rotated, m_support_spacing, m_trimming_polygons, m_trimming_polygons_rotated, Slic3r::BoundingBoxBase< PointType, APointsType >::offset(), Slic3r::polygons_rotate(), Slic3r::rasterize_polygons(), scale_, seed_fill_block(), Slic3r::simplify_polygons(), Slic3r::smsDefault, Slic3r::smsGrid, Slic3r::smsSnug, Slic3r::smsTreeHybrid, Slic3r::smsTreeOrganic, Slic3r::smsTreeSlim, Slic3r::smsTreeStrong, style, Slic3r::SupportGridParams::support_angle, and Slic3r::png::write_gray_to_file_scaled().

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SupportGridPattern() [2/2]

Slic3r::SupportGridPattern::SupportGridPattern ( )
inlineprivate
1053{}

Member Function Documentation

◆ dilate_trimming_region()

std::vector< unsigned char > Slic3r::SupportGridPattern::dilate_trimming_region ( const std::vector< unsigned char > & trimming,
const Vec2i32 & grid_size )
inlinestaticprivate
1059 {
1060 std::vector<unsigned char> dilated(trimming.size(), 0);
1061 for (int r = 1; r + 1 < grid_size.y(); ++ r)
1062 for (int c = 1; c + 1 < grid_size.x(); ++ c) {
1063 //int addr = c + r * m_grid_size.x();
1064 // 4-neighborhood is not sufficient.
1065 // dilated[addr] = trimming[addr] != 0 && trimming[addr - 1] != 0 && trimming[addr + 1] != 0 && trimming[addr - m_grid_size.x()] != 0 && trimming[addr + m_grid_size.x()] != 0;
1066 // 8-neighborhood
1067 int addr = c + (r - 1) * grid_size.x();
1068 bool b = trimming[addr - 1] != 0 && trimming[addr] != 0 && trimming[addr + 1] != 0;
1069 addr += grid_size.x();
1070 b = b && trimming[addr - 1] != 0 && trimming[addr] != 0 && trimming[addr + 1] != 0;
1071 addr += grid_size.x();
1072 b = b && trimming[addr - 1] != 0 && trimming[addr] != 0 && trimming[addr + 1] != 0;
1073 dilated[addr - grid_size.x()] = b;
1074 }
1075 return dilated;
1076 }

Referenced by SupportGridPattern().

Here is the caller graph for this function:

◆ extract_support()

Polygons Slic3r::SupportGridPattern::extract_support ( const coord_t offset_in_grid,
bool fill_holes )
inline
822 {
823 switch (m_style) {
824 case smsTreeSlim:
825 case smsTreeStrong:
826 case smsTreeHybrid:
827 case smsTreeOrganic:
828 assert(false);
829 //[[fallthrough]];
830 return Polygons();
831 case smsGrid:
832 {
833 #ifdef SUPPORT_USE_AGG_RASTERIZER
834 Polygons support_polygons_simplified = contours_simplified(m_grid_size, m_pixel_size, m_bbox.min, m_grid2, offset_in_grid, fill_holes);
835 #else // SUPPORT_USE_AGG_RASTERIZER
836 // Generate islands, so each island may be tested for overlap with island_samples.
837 assert(std::abs(2 * offset_in_grid) < m_grid.resolution());
838 Polygons support_polygons_simplified = m_grid.contours_simplified(offset_in_grid, fill_holes);
839 #endif // SUPPORT_USE_AGG_RASTERIZER
840
841 ExPolygons islands = diff_ex(support_polygons_simplified, *m_trimming_polygons);
842
843 // Extract polygons, which contain some of the island_samples.
844 Polygons out;
845
846 // Sample a single point per input support polygon, keep it as a reference to maintain corresponding
847 // polygons if ever these polygons get split into parts by the trimming polygons.
848 // As offset_in_grid may be negative, m_support_polygons may stick slightly outside of islands.
849 // Trim ti with islands.
850 Points samples = island_samples(
851 offset_in_grid > 0 ?
852 // Expanding, thus m_support_polygons are all inside islands.
854 // Shrinking, thus m_support_polygons may be trimmed a tiny bit by islands.
856
857 std::vector<std::pair<Point,bool>> samples_inside;
858 for (ExPolygon &island : islands) {
859 BoundingBox bbox = get_extents(island.contour);
860 // Samples are sorted lexicographically.
861 auto it_lower = std::lower_bound(samples.begin(), samples.end(), Point(bbox.min - Point(1, 1)));
862 auto it_upper = std::upper_bound(samples.begin(), samples.end(), Point(bbox.max + Point(1, 1)));
863 samples_inside.clear();
864 for (auto it = it_lower; it != it_upper; ++ it)
865 if (bbox.contains(*it))
866 samples_inside.push_back(std::make_pair(*it, false));
867 if (! samples_inside.empty()) {
868 // For all samples_inside count the boundary crossing.
869 for (size_t i_contour = 0; i_contour <= island.holes.size(); ++ i_contour) {
870 Polygon &contour = (i_contour == 0) ? island.contour : island.holes[i_contour - 1];
871 Points::const_iterator i = contour.points.begin();
872 Points::const_iterator j = contour.points.end() - 1;
873 for (; i != contour.points.end(); j = i ++) {
874 //FIXME this test is not numerically robust. Particularly, it does not handle horizontal segments at y == point(1) well.
875 // Does the ray with y == point(1) intersect this line segment?
876 for (auto &sample_inside : samples_inside) {
877 if (((*i)(1) > sample_inside.first(1)) != ((*j)(1) > sample_inside.first(1))) {
878 double x1 = (double)sample_inside.first(0);
879 double x2 = (double)(*i)(0) + (double)((*j)(0) - (*i)(0)) * (double)(sample_inside.first(1) - (*i)(1)) / (double)((*j)(1) - (*i)(1));
880 if (x1 < x2)
881 sample_inside.second = !sample_inside.second;
882 }
883 }
884 }
885 }
886 // If any of the sample is inside this island, add this island to the output.
887 for (auto &sample_inside : samples_inside)
888 if (sample_inside.second) {
889 polygons_append(out, std::move(island));
890 island.clear();
891 break;
892 }
893 }
894 }
895
896 #ifdef SLIC3R_DEBUG
897 BoundingBox bbox = get_extents(*m_trimming_polygons);
898 if (! islands.empty())
899 bbox.merge(get_extents(islands));
900 if (!out.empty())
901 bbox.merge(get_extents(out));
902 if (!support_polygons_simplified.empty())
903 bbox.merge(get_extents(support_polygons_simplified));
904 SVG svg(debug_out_path("extract_support_from_grid_trimmed-%s-%d-%d-%lf.svg", step_name, iRun, layer_id, print_z).c_str(), bbox);
905 if (svg.is_opened()) {
906 svg.draw(union_ex(support_polygons_simplified), "gray", 0.25f);
907 svg.draw(islands, "red", 0.5f);
908 svg.draw(union_ex(out), "green", 0.5f);
909 svg.draw(union_ex(*m_support_polygons), "blue", 0.5f);
910 svg.draw_outline(islands, "red", "red", scale_(0.05));
911 svg.draw_outline(union_ex(out), "green", "green", scale_(0.05));
912 svg.draw_outline(union_ex(*m_support_polygons), "blue", "blue", scale_(0.05));
913 for (const Point& pt : samples)
914 svg.draw(pt, "black", coord_t(scale_(0.15)));
915 svg.Close();
916 }
917 #endif /* SLIC3R_DEBUG */
918
919 if (m_support_angle != 0.)
921 return out;
922 }
923 case smsSnug:
924 // Merge the support polygons by applying morphological closing and inwards smoothing.
925 auto closing_distance = scaled<float>(m_support_material_closing_radius);
926 auto smoothing_distance = scaled<float>(m_extrusion_width);
927#ifdef SLIC3R_DEBUG
928 SVG::export_expolygons(debug_out_path("extract_support_from_grid_trimmed-%s-%d-%d-%lf.svg", step_name, iRun, layer_id, print_z),
929 { { { diff_ex(expand(*m_support_polygons, closing_distance), closing(*m_support_polygons, closing_distance, SUPPORT_SURFACES_OFFSET_PARAMETERS)) }, { "closed", "blue", 0.5f } },
930 { { union_ex(smooth_outward(closing(*m_support_polygons, closing_distance, SUPPORT_SURFACES_OFFSET_PARAMETERS), smoothing_distance)) }, { "regularized", "red", "black", "", scaled<coord_t>(0.1f), 0.5f } },
931 { { union_ex(*m_support_polygons) }, { "src", "green", 0.5f } },
932 });
933#endif /* SLIC3R_DEBUG */
934 //FIXME do we want to trim with the object here? On one side the columns will be thinner, on the other side support interfaces may disappear for snug supports.
935 // return diff(smooth_outward(closing(*m_support_polygons, closing_distance, SUPPORT_SURFACES_OFFSET_PARAMETERS), smoothing_distance), *m_trimming_polygons);
936 return smooth_outward(closing(*m_support_polygons, closing_distance, SUPPORT_SURFACES_OFFSET_PARAMETERS), smoothing_distance);
937 }
938 assert(false);
939 return Polygons();
940 }
#define SUPPORT_SURFACES_OFFSET_PARAMETERS
Definition PrintObject.cpp:5148
Points points
Definition MultiPoint.hpp:22
static void export_expolygons(const char *path, const BoundingBox &bbox, const Slic3r::ExPolygons &expolygons, std::string stroke_outer="black", std::string stroke_holes="blue", coordf_t stroke_width=0)
Definition SVG.cpp:381
static Points island_samples(const ExPolygons &expolygons)
Definition SupportMaterial.cpp:1148
Kernel::Point_3 Point
Definition MeshRepair.cpp:81
void smooth_outward(MutablePolygon &polygon, coord_t clip_dist_scaled)
Definition MutablePolygon.cpp:262
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:284
Slic3r::ExPolygons diff_ex(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:831
std::vector< ExPolygon > ExPolygons
Definition ExPolygon.hpp:20
Slic3r::Polygons expand(const Slic3r::Polygon &polygon, const float delta, JoinType joinType=DefaultJoinType, double miterLimit=DefaultMiterLimit)
Definition ClipperUtils.hpp:397
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:22
static Polygons 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)
Definition SupportMaterial.cpp:236
Slic3r::Polygons closing(const Slic3r::Polygons &polygons, const float delta1, const float delta2, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:670
Slic3r::ExPolygons intersection_ex(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:878
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:73
void polygons_append(Polygons &dst, const ExPolygon &src)
Definition ExPolygon.hpp:411
Slic3r::ExPolygons union_ex(const Slic3r::Polygons &subject, PolyFillType fill_type)
Definition ClipperUtils.cpp:1011
const Polygon & contour(const ExPolygon &p)
Definition AGGRaster.hpp:30
const Polygons & holes(const ExPolygon &p)
Definition AGGRaster.hpp:31
Slic3r::Polygon Polygon
Definition Emboss.cpp:101

References Slic3r::SVG::Close(), Slic3r::closing(), Slic3r::BoundingBoxBase< PointType, APointsType >::contains(), Slic3r::contour(), Slic3r::contours_simplified(), Slic3r::debug_out_path(), Slic3r::diff_ex(), Slic3r::SVG::draw(), Slic3r::SVG::draw_outline(), Slic3r::expand(), Slic3r::SVG::export_expolygons(), Slic3r::get_extents(), Slic3r::intersection_ex(), Slic3r::SVG::is_opened(), island_samples(), m_bbox, m_extrusion_width, m_grid2, m_grid_size, m_pixel_size, m_style, m_support_angle, m_support_material_closing_radius, m_support_polygons, m_trimming_polygons, Slic3r::BoundingBoxBase< PointType, APointsType >::max, Slic3r::BoundingBoxBase< PointType, APointsType >::merge(), Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::polygons_append(), Slic3r::polygons_rotate(), scale_, Slic3r::scaled(), Slic3r::smooth_outward(), Slic3r::smsGrid, Slic3r::smsSnug, Slic3r::smsTreeHybrid, Slic3r::smsTreeOrganic, Slic3r::smsTreeSlim, Slic3r::smsTreeStrong, SUPPORT_SURFACES_OFFSET_PARAMETERS, and Slic3r::union_ex().

Referenced by Slic3r::fill_contact_layer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ island_samples()

Points Slic3r::SupportGridPattern::island_samples ( const ExPolygons & expolygons)
inlinestaticprivate
1149 {
1150 Points pts;
1151 pts.reserve(expolygons.size());
1152 for (const ExPolygon &expoly : expolygons)
1153 if (expoly.contour.points.size() > 2) {
1154 #if 0
1155 pts.push_back(island_sample(expoly));
1156 #else
1157 Polygons polygons = offset(expoly, - 20.f);
1158 for (const Polygon &poly : polygons)
1159 if (! poly.points.empty()) {
1160 // Take a small fixed number of samples of this polygon for robustness.
1161 int num_points = int(poly.points.size());
1162 int num_samples = std::min(num_points, 4);
1163 int stride = num_points / num_samples;
1164 for (int i = 0; i < num_points; i += stride)
1165 pts.push_back(poly.points[i]);
1166 break;
1167 }
1168 #endif
1169 }
1170 // Sort the points lexicographically, so a binary search could be used to locate points inside a bounding box.
1171 std::sort(pts.begin(), pts.end());
1172 return pts;
1173 }
void poly(std::vector< std::pair< Vec2d, Vec2d > > &out, std::initializer_list< Vec2d > p)
Definition DesignSketchTool.cpp:7751
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582

References Slic3r::ExPolygon::contour, Slic3r::offset(), and Slic3r::MultiPoint::points.

Referenced by extract_support().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

SupportGridPattern & Slic3r::SupportGridPattern::operator= ( const SupportGridPattern & rhs)
private

References SupportGridPattern().

Here is the call graph for this function:

◆ seed_fill_block()

void Slic3r::SupportGridPattern::seed_fill_block ( std::vector< unsigned char > & grid,
Vec2i32 grid_size,
const std::vector< unsigned char > & trimming,
const Vec2i32 & grid_blocks,
int oversampling )
inlinestaticprivate
1080 {
1081 int size = oversampling;
1082 int stride = grid_size.x();
1083 for (int block_r = 0; block_r < grid_blocks.y(); ++ block_r)
1084 for (int block_c = 0; block_c < grid_blocks.x(); ++ block_c) {
1085 // Propagate the support pixels over the macro cell up to the trimming mask.
1086 int addr = block_c * size + 1 + (block_r * size + 1) * stride;
1087 unsigned char *grid_data = grid.data() + addr;
1088 const unsigned char *mask_data = trimming.data() + addr;
1089 // Top to bottom propagation.
1090 #define PROPAGATION_STEP(offset) \
1091 do { \
1092 int addr = r * stride + c; \
1093 int addr2 = addr + offset; \
1094 if (grid_data[addr2] && ! mask_data[addr] && ! mask_data[addr2]) \
1095 grid_data[addr] = 1; \
1096 } while (0);
1097 for (int r = 0; r < size; ++ r) {
1098 if (r > 0)
1099 for (int c = 0; c < size; ++ c)
1100 PROPAGATION_STEP(- stride);
1101 for (int c = 1; c < size; ++ c)
1102 PROPAGATION_STEP(- 1);
1103 for (int c = size - 2; c >= 0; -- c)
1104 PROPAGATION_STEP(+ 1);
1105 }
1106 // Bottom to top propagation.
1107 for (int r = size - 2; r >= 0; -- r) {
1108 for (int c = 0; c < size; ++ c)
1109 PROPAGATION_STEP(+ stride);
1110 for (int c = 1; c < size; ++ c)
1111 PROPAGATION_STEP(- 1);
1112 for (int c = size - 2; c >= 0; -- c)
1113 PROPAGATION_STEP(+ 1);
1114 }
1115 #undef PROPAGATION_STEP
1116 }
1117 }
#define PROPAGATION_STEP(offset)
std::vector< ArithmeticOnly< T > > grid(const T &start, const T &stop, const T &stride)
A set of equidistant values starting from 'start' (inclusive), ending in the closest multiple of 'str...
Definition MTUtils.hpp:127

References Slic3r::grid(), and PROPAGATION_STEP.

Referenced by SupportGridPattern().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_bbox

BoundingBox Slic3r::SupportGridPattern::m_bbox
private

◆ m_extrusion_width

coordf_t Slic3r::SupportGridPattern::m_extrusion_width
private

◆ m_grid2

std::vector<unsigned char> Slic3r::SupportGridPattern::m_grid2
private

◆ m_grid_size

Vec2i32 Slic3r::SupportGridPattern::m_grid_size
private

◆ m_pixel_size

double Slic3r::SupportGridPattern::m_pixel_size
private

◆ m_style

SupportMaterialStyle Slic3r::SupportGridPattern::m_style
private

◆ m_support_angle

coordf_t Slic3r::SupportGridPattern::m_support_angle
private

◆ m_support_material_closing_radius

coordf_t Slic3r::SupportGridPattern::m_support_material_closing_radius
private

◆ m_support_polygons

const Polygons* Slic3r::SupportGridPattern::m_support_polygons
private

◆ m_support_polygons_rotated

Polygons Slic3r::SupportGridPattern::m_support_polygons_rotated
private

Referenced by SupportGridPattern().

◆ m_support_spacing

coordf_t Slic3r::SupportGridPattern::m_support_spacing
private

Referenced by SupportGridPattern().

◆ m_trimming_polygons

const Polygons* Slic3r::SupportGridPattern::m_trimming_polygons
private

◆ m_trimming_polygons_rotated

Polygons Slic3r::SupportGridPattern::m_trimming_polygons_rotated
private

Referenced by SupportGridPattern().


The documentation for this class was generated from the following file: