mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 14:51:11 -06:00
Merge branch 'master' into SoftFever
# Conflicts: # bbl/i18n/zh_cn/BambuStudio_zh_CN.po # resources/i18n/de/BambuStudio.mo # resources/i18n/en/BambuStudio.mo # resources/i18n/es/BambuStudio.mo # resources/i18n/fr/BambuStudio.mo # resources/i18n/hu/BambuStudio.mo # resources/i18n/nl/BambuStudio.mo # resources/i18n/sv/BambuStudio.mo # resources/i18n/zh_cn/BambuStudio.mo # resources/profiles/Creality.json # resources/profiles/Voron.json # resources/web/guide/3/index.html # src/libslic3r/AppConfig.cpp # src/libslic3r/GCode.cpp # src/libslic3r/GCode/GCodeProcessor.cpp # src/libslic3r/LayerRegion.cpp # src/libslic3r/Preset.cpp # src/libslic3r/Print.cpp # src/libslic3r/PrintConfig.cpp # src/libslic3r/PrintConfig.hpp # src/libslic3r/PrintObject.cpp # src/slic3r/GUI/AboutDialog.cpp # src/slic3r/GUI/BBLTopbar.cpp # src/slic3r/GUI/ConfigManipulation.cpp # src/slic3r/GUI/ConfigWizard.cpp # src/slic3r/GUI/GCodeViewer.cpp # src/slic3r/GUI/GUI_App.cpp # src/slic3r/GUI/GUI_Factories.cpp # src/slic3r/GUI/MainFrame.cpp # src/slic3r/GUI/Plater.cpp # src/slic3r/GUI/Tab.cpp # version.inc
This commit is contained in:
commit
bf8a9fee1f
689 changed files with 46784 additions and 10006 deletions
|
@ -46,6 +46,8 @@ struct SurfaceFillParams
|
|||
// 1000mm is roughly the maximum length line that fits into a 32bit coord_t.
|
||||
float anchor_length = 1000.f;
|
||||
float anchor_length_max = 1000.f;
|
||||
//BBS
|
||||
bool with_loop = false;
|
||||
|
||||
// width, height of extrusion, nozzle diameter, is bridge
|
||||
// For the output, for fill generator.
|
||||
|
@ -77,6 +79,7 @@ struct SurfaceFillParams
|
|||
// RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, dont_adjust);
|
||||
RETURN_COMPARE_NON_EQUAL(anchor_length);
|
||||
RETURN_COMPARE_NON_EQUAL(anchor_length_max);
|
||||
RETURN_COMPARE_NON_EQUAL(with_loop);
|
||||
RETURN_COMPARE_NON_EQUAL(flow.width());
|
||||
RETURN_COMPARE_NON_EQUAL(flow.height());
|
||||
RETURN_COMPARE_NON_EQUAL(flow.nozzle_diameter());
|
||||
|
@ -97,6 +100,7 @@ struct SurfaceFillParams
|
|||
// this->dont_adjust == rhs.dont_adjust &&
|
||||
this->anchor_length == rhs.anchor_length &&
|
||||
this->anchor_length_max == rhs.anchor_length_max &&
|
||||
this->with_loop == rhs.with_loop &&
|
||||
this->flow == rhs.flow &&
|
||||
this->extrusion_role == rhs.extrusion_role;
|
||||
}
|
||||
|
@ -147,6 +151,8 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
|
|||
params.extruder = layerm.region().extruder(extrusion_role);
|
||||
params.pattern = region_config.sparse_infill_pattern.value;
|
||||
params.density = float(region_config.sparse_infill_density);
|
||||
//BBS
|
||||
params.with_loop = surface.surface_type == stInternalWithLoop;
|
||||
|
||||
if (surface.is_solid()) {
|
||||
params.density = 100.f;
|
||||
|
@ -363,8 +369,8 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
|
|||
surface_fills.back().region_id = surface_fills[i].region_id;
|
||||
surface_fills.back().surface.surface_type = stInternalSolid;
|
||||
surface_fills.back().surface.thickness = surface_fills[i].surface.thickness;
|
||||
surface_fills.back().region_id_group = surface_fills[i].region_id_group;
|
||||
surface_fills.back().no_overlap_expolygons = surface_fills[i].no_overlap_expolygons;
|
||||
surface_fills.back().region_id_group = surface_fills[i].region_id_group;
|
||||
surface_fills.back().no_overlap_expolygons = surface_fills[i].no_overlap_expolygons;
|
||||
for (size_t j = 0; j < narrow_expolygons_index.size(); j++) {
|
||||
// BBS: move the narrow expolygons to new surface_fills.back();
|
||||
surface_fills.back().expolygons.emplace_back(std::move(surface_fills[i].expolygons[narrow_expolygons_index[j]]));
|
||||
|
@ -478,11 +484,12 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
|
|||
params.extrusion_role = surface_fill.params.extrusion_role;
|
||||
params.using_internal_flow = using_internal_flow;
|
||||
params.no_extrusion_overlap = surface_fill.params.overlap;
|
||||
params.with_loop = surface_fill.params.with_loop;
|
||||
|
||||
LayerRegion* layerm = this->m_regions[surface_fill.region_id];
|
||||
params.config = &layerm->region().config();
|
||||
for (ExPolygon& expoly : surface_fill.expolygons) {
|
||||
f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly});
|
||||
f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly});
|
||||
// Spacing is modified by the filler to indicate adjustments. Reset it for each expolygon.
|
||||
f->spacing = surface_fill.params.spacing;
|
||||
surface_fill.surface.expolygon = std::move(expoly);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
namespace Slic3r {
|
||||
|
||||
//BBS: 0% of sparse_infill_line_width, no anchor at the start of sparse infill
|
||||
float Fill::infill_anchor = 0;
|
||||
float Fill::infill_anchor = 400;
|
||||
//BBS: 20mm
|
||||
float Fill::infill_anchor_max = 20;
|
||||
|
||||
|
@ -54,9 +54,7 @@ Fill* Fill::new_from_type(const InfillPattern type)
|
|||
case ipAdaptiveCubic: return new FillAdaptive::Filler();
|
||||
case ipSupportCubic: return new FillAdaptive::Filler();
|
||||
case ipSupportBase: return new FillSupportBase();
|
||||
#if HAS_LIGHTNING_INFILL
|
||||
case ipLightning: return new FillLightning::Filler();
|
||||
#endif // HAS_LIGHTNING_INFILL
|
||||
// BBS: for internal solid infill only
|
||||
case ipConcentricInternal: return new FillConcentricInternal();
|
||||
// BBS: for bottom and top surface only
|
||||
|
@ -122,13 +120,57 @@ void Fill::fill_surface_extrusion(const Surface* surface, const FillParams& para
|
|||
{
|
||||
Polylines polylines;
|
||||
ThickPolylines thick_polylines;
|
||||
try {
|
||||
if (params.use_arachne)
|
||||
thick_polylines = this->fill_surface_arachne(surface, params);
|
||||
else
|
||||
polylines = this->fill_surface(surface, params);
|
||||
if (!params.with_loop) {
|
||||
try {
|
||||
if (params.use_arachne)
|
||||
thick_polylines = this->fill_surface_arachne(surface, params);
|
||||
else
|
||||
polylines = this->fill_surface(surface, params);
|
||||
}
|
||||
catch (InfillFailedException&) {}
|
||||
}
|
||||
//BBS: add handling for infill pattern with loop
|
||||
else {
|
||||
Slic3r::ExPolygons expp = offset_ex(surface->expolygon, float(scale_(this->overlap - 0.5 * this->spacing)));
|
||||
Polylines loop_polylines = to_polylines(expp);
|
||||
{
|
||||
//BBS: clip the loop
|
||||
size_t j = 0;
|
||||
for (size_t i = 0; i < loop_polylines.size(); ++i) {
|
||||
loop_polylines[i].clip_end(this->loop_clipping);
|
||||
if (loop_polylines[i].is_valid()) {
|
||||
if (j < i)
|
||||
loop_polylines[j] = std::move(loop_polylines[i]);
|
||||
++j;
|
||||
}
|
||||
}
|
||||
if (j < loop_polylines.size())
|
||||
loop_polylines.erase(loop_polylines.begin() + int(j), loop_polylines.end());
|
||||
}
|
||||
|
||||
if (!loop_polylines.empty()) {
|
||||
if (params.use_arachne)
|
||||
append(thick_polylines, to_thick_polylines(std::move(loop_polylines), scaled<coord_t>(this->spacing)));
|
||||
else
|
||||
append(polylines, std::move(loop_polylines));
|
||||
expp = offset_ex(expp, float(scale_(0 - 0.5 * this->spacing)));
|
||||
} else {
|
||||
//BBS: the area is too narrow to place a loop, return to original expolygon
|
||||
expp = { surface->expolygon };
|
||||
}
|
||||
|
||||
Surface temp_surface = *surface;
|
||||
for (ExPolygon& ex : expp) {
|
||||
temp_surface.expolygon = ex;
|
||||
try {
|
||||
if (params.use_arachne)
|
||||
append(thick_polylines, std::move(this->fill_surface_arachne(&temp_surface, params)));
|
||||
else
|
||||
append(polylines, std::move(this->fill_surface(&temp_surface, params)));
|
||||
}
|
||||
catch (InfillFailedException&) {}
|
||||
}
|
||||
}
|
||||
catch (InfillFailedException&) {}
|
||||
|
||||
if (!polylines.empty() || !thick_polylines.empty()) {
|
||||
// calculate actual flow from spacing (which might have been adjusted by the infill
|
||||
|
|
|
@ -67,6 +67,8 @@ struct FillParams
|
|||
bool use_arachne{ false };
|
||||
// Layer height for Concentric infill with Arachne.
|
||||
coordf_t layer_height { 0.f };
|
||||
//BBS
|
||||
bool with_loop { false };
|
||||
|
||||
// BBS
|
||||
Flow flow;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "Arachne/WallToolPaths.hpp"
|
||||
|
||||
#include "FillConcentric.hpp"
|
||||
#include <libslic3r/ShortestPath.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -133,6 +134,8 @@ void FillConcentric::_fill_surface_single(const FillParams& params,
|
|||
}
|
||||
if (j < thick_polylines_out.size())
|
||||
thick_polylines_out.erase(thick_polylines_out.begin() + int(j), thick_polylines_out.end());
|
||||
|
||||
reorder_by_shortest_traverse(thick_polylines_out);
|
||||
}
|
||||
else {
|
||||
Polylines polylines;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "Arachne/WallToolPaths.hpp"
|
||||
|
||||
#include "FillConcentricInternal.hpp"
|
||||
#include <libslic3r/ShortestPath.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -22,7 +23,7 @@ void FillConcentricInternal::fill_surface_extrusion(const Surface* surface, cons
|
|||
coord_t min_spacing = params.flow.scaled_spacing();
|
||||
|
||||
coord_t loops_count = std::max(bbox_size.x(), bbox_size.y()) / min_spacing + 1;
|
||||
Polygons polygons = offset(expolygon, 0);
|
||||
Polygons polygons = to_polygons(expolygon);
|
||||
|
||||
double min_nozzle_diameter = *std::min_element(print_config->nozzle_diameter.values.begin(), print_config->nozzle_diameter.values.end());
|
||||
Arachne::WallToolPathsParams input_params;
|
||||
|
@ -76,6 +77,8 @@ void FillConcentricInternal::fill_surface_extrusion(const Surface* surface, cons
|
|||
}
|
||||
if (j < thick_polylines_out.size())
|
||||
thick_polylines_out.erase(thick_polylines_out.begin() + int(j), thick_polylines_out.end());
|
||||
|
||||
reorder_by_shortest_traverse(thick_polylines_out);
|
||||
}
|
||||
|
||||
ExtrusionEntityCollection *coll_nosort = new ExtrusionEntityCollection();
|
||||
|
|
|
@ -26,9 +26,9 @@ void GeneratorDeleter::operator()(Generator *p) {
|
|||
delete p;
|
||||
}
|
||||
|
||||
GeneratorPtr build_generator(const PrintObject &print_object)
|
||||
GeneratorPtr build_generator(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback)
|
||||
{
|
||||
return GeneratorPtr(new Generator(print_object));
|
||||
return GeneratorPtr(new Generator(print_object, throw_on_cancel_callback));
|
||||
}
|
||||
|
||||
} // namespace Slic3r::FillAdaptive
|
||||
|
|
|
@ -3,13 +3,6 @@
|
|||
|
||||
#include "FillBase.hpp"
|
||||
|
||||
/*
|
||||
* A few modifications based on dba1179(2022.06.10) from Prusa, mainly in Generator.hpp and .cpp:
|
||||
* 1. delete the second parameter(a throw back function) of Generator(), since I didnt find corresponding throw back function in BBS code
|
||||
* 2. those codes that call the functions above
|
||||
* 3. add codes of generating lightning in TreeSupport.cpp
|
||||
*/
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class PrintObject;
|
||||
|
@ -21,7 +14,7 @@ class Generator;
|
|||
struct GeneratorDeleter { void operator()(Generator *p); };
|
||||
using GeneratorPtr = std::unique_ptr<Generator, GeneratorDeleter>;
|
||||
|
||||
GeneratorPtr build_generator(const PrintObject &print_object);
|
||||
GeneratorPtr build_generator(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback);
|
||||
|
||||
class Filler : public Slic3r::Fill
|
||||
{
|
||||
|
|
|
@ -43,7 +43,8 @@ DistanceField::DistanceField(const coord_t& radius, const Polygons& current_outl
|
|||
m_supporting_radius2 = Slic3r::sqr(int64_t(radius));
|
||||
// Sample source polygons with a regular grid sampling pattern.
|
||||
const BoundingBox overhang_bbox = get_extents(current_overhang);
|
||||
for (const ExPolygon &expoly : union_ex(current_overhang)) {
|
||||
ExPolygons expolys = offset2_ex(union_ex(current_overhang), -m_cell_size / 2, m_cell_size / 2); // remove dangling lines which causes sample_grid_pattern crash (fails the OUTER_LOW assertions)
|
||||
for (const ExPolygon &expoly : expolys) {
|
||||
const Points sampled_points = sample_grid_pattern(expoly, m_cell_size, overhang_bbox);
|
||||
const size_t unsupported_points_prev_size = m_unsupported_points.size();
|
||||
m_unsupported_points.resize(unsupported_points_prev_size + sampled_points.size());
|
||||
|
@ -94,10 +95,6 @@ DistanceField::DistanceField(const coord_t& radius, const Polygons& current_outl
|
|||
|
||||
void DistanceField::update(const Point& to_node, const Point& added_leaf)
|
||||
{
|
||||
std::ofstream out1("z:/misc/lightning.txt", std::ios::app);
|
||||
out1 << m_unsupported_points.size() << std::endl;
|
||||
out1.close();
|
||||
|
||||
Vec2d v = (added_leaf - to_node).cast<double>();
|
||||
auto l2 = v.squaredNorm();
|
||||
Vec2d extent = Vec2d(-v.y(), v.x()) * m_supporting_radius / sqrt(l2);
|
||||
|
|
|
@ -63,7 +63,7 @@ Slic3r::SVG draw_two_overhangs_to_svg(size_t ts_layer, const ExPolygons& overhan
|
|||
|
||||
namespace Slic3r::FillLightning {
|
||||
|
||||
Generator::Generator(const PrintObject &print_object)
|
||||
Generator::Generator(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback)
|
||||
{
|
||||
const PrintConfig &print_config = print_object.print()->config();
|
||||
const PrintObjectConfig &object_config = print_object.config();
|
||||
|
@ -87,11 +87,11 @@ Generator::Generator(const PrintObject &print_object)
|
|||
m_prune_length = coord_t(layer_thickness * std::tan(lightning_infill_prune_angle));
|
||||
m_straightening_max_distance = coord_t(layer_thickness * std::tan(lightning_infill_straightening_angle));
|
||||
|
||||
generateInitialInternalOverhangs(print_object);
|
||||
generateTrees(print_object);
|
||||
generateInitialInternalOverhangs(print_object, throw_on_cancel_callback);
|
||||
generateTrees(print_object, throw_on_cancel_callback);
|
||||
}
|
||||
|
||||
Generator::Generator(PrintObject* m_object, std::vector<Polygons>& contours, std::vector<Polygons>& overhangs, float density)
|
||||
Generator::Generator(PrintObject* m_object, std::vector<Polygons>& contours, std::vector<Polygons>& overhangs, const std::function<void()> &throw_on_cancel_callback, float density)
|
||||
{
|
||||
const PrintConfig &print_config = m_object->print()->config();
|
||||
const PrintObjectConfig &object_config = m_object->config();
|
||||
|
@ -120,7 +120,7 @@ Generator::Generator(PrintObject* m_object, std::vector<Polygons>& contours, std
|
|||
|
||||
m_overhang_per_layer = overhangs;
|
||||
|
||||
generateTreesforSupport(contours);
|
||||
generateTreesforSupport(contours, throw_on_cancel_callback);
|
||||
|
||||
//for (size_t i = 0; i < overhangs.size(); i++)
|
||||
//{
|
||||
|
@ -130,13 +130,14 @@ Generator::Generator(PrintObject* m_object, std::vector<Polygons>& contours, std
|
|||
//}
|
||||
}
|
||||
|
||||
void Generator::generateInitialInternalOverhangs(const PrintObject &print_object)
|
||||
void Generator::generateInitialInternalOverhangs(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback)
|
||||
{
|
||||
m_overhang_per_layer.resize(print_object.layers().size());
|
||||
|
||||
Polygons infill_area_above;
|
||||
//Iterate from top to bottom, to subtract the overhang areas above from the overhang areas on the layer below, to get only overhang in the top layer where it is overhanging.
|
||||
for (int layer_nr = int(print_object.layers().size()) - 1; layer_nr >= 0; --layer_nr) {
|
||||
throw_on_cancel_callback();
|
||||
Polygons infill_area_here;
|
||||
for (const LayerRegion* layerm : print_object.get_layer(layer_nr)->regions())
|
||||
for (const Surface& surface : layerm->fill_surfaces.surfaces)
|
||||
|
@ -157,7 +158,7 @@ const Layer& Generator::getTreesForLayer(const size_t& layer_id) const
|
|||
return m_lightning_layers[layer_id];
|
||||
}
|
||||
|
||||
void Generator::generateTrees(const PrintObject &print_object)
|
||||
void Generator::generateTrees(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback)
|
||||
{
|
||||
m_lightning_layers.resize(print_object.layers().size());
|
||||
bboxs.resize(print_object.layers().size());
|
||||
|
@ -165,6 +166,7 @@ void Generator::generateTrees(const PrintObject &print_object)
|
|||
|
||||
// For-each layer from top to bottom:
|
||||
for (int layer_id = int(print_object.layers().size()) - 1; layer_id >= 0; layer_id--) {
|
||||
throw_on_cancel_callback();
|
||||
for (const LayerRegion *layerm : print_object.get_layer(layer_id)->regions())
|
||||
for (const Surface &surface : layerm->fill_surfaces.surfaces)
|
||||
if (surface.surface_type == stInternal || surface.surface_type == stInternalVoid)
|
||||
|
@ -178,6 +180,7 @@ void Generator::generateTrees(const PrintObject &print_object)
|
|||
|
||||
// For-each layer from top to bottom:
|
||||
for (int layer_id = int(top_layer_id); layer_id >= 0; layer_id--) {
|
||||
throw_on_cancel_callback();
|
||||
Layer ¤t_lightning_layer = m_lightning_layers[layer_id];
|
||||
const Polygons ¤t_outlines = infill_outlines[layer_id];
|
||||
const BoundingBox ¤t_outlines_bbox = get_extents(current_outlines);
|
||||
|
@ -187,7 +190,7 @@ void Generator::generateTrees(const PrintObject &print_object)
|
|||
// register all trees propagated from the previous layer as to-be-reconnected
|
||||
std::vector<NodeSPtr> to_be_reconnected_tree_roots = current_lightning_layer.tree_roots;
|
||||
|
||||
current_lightning_layer.generateNewTrees(m_overhang_per_layer[layer_id], current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
current_lightning_layer.generateNewTrees(m_overhang_per_layer[layer_id], current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius, throw_on_cancel_callback);
|
||||
current_lightning_layer.reconnectRoots(to_be_reconnected_tree_roots, current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
|
||||
// Initialize trees for next lower layer from the current one.
|
||||
|
@ -211,8 +214,10 @@ void Generator::generateTrees(const PrintObject &print_object)
|
|||
}
|
||||
}
|
||||
|
||||
void Generator::generateTreesforSupport(std::vector<Polygons>& contours)
|
||||
void Generator::generateTreesforSupport(std::vector<Polygons>& contours, const std::function<void()> &throw_on_cancel_callback)
|
||||
{
|
||||
if (contours.empty()) return;
|
||||
|
||||
m_lightning_layers.resize(contours.size());
|
||||
bboxs.resize(contours.size());
|
||||
|
||||
|
@ -223,6 +228,7 @@ void Generator::generateTreesforSupport(std::vector<Polygons>& contours)
|
|||
|
||||
// For-each layer from top to bottom:
|
||||
for (int layer_id = int(top_layer_id); layer_id >= 0; layer_id--) {
|
||||
throw_on_cancel_callback();
|
||||
Layer& current_lightning_layer = m_lightning_layers[layer_id];
|
||||
const Polygons& current_outlines = contours[layer_id];
|
||||
const BoundingBox& current_outlines_bbox = get_extents(current_outlines);
|
||||
|
@ -232,7 +238,7 @@ void Generator::generateTreesforSupport(std::vector<Polygons>& contours)
|
|||
// register all trees propagated from the previous layer as to-be-reconnected
|
||||
std::vector<NodeSPtr> to_be_reconnected_tree_roots = current_lightning_layer.tree_roots;
|
||||
|
||||
current_lightning_layer.generateNewTrees(m_overhang_per_layer[layer_id], current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
current_lightning_layer.generateNewTrees(m_overhang_per_layer[layer_id], current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius, throw_on_cancel_callback);
|
||||
current_lightning_layer.reconnectRoots(to_be_reconnected_tree_roots, current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
|
||||
// Initialize trees for next lower layer from the current one.
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
* Lightning Infill for the infill areas in that mesh. The infill areas must
|
||||
* already be calculated at this point.
|
||||
*/
|
||||
explicit Generator(const PrintObject &print_object);
|
||||
explicit Generator(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback);
|
||||
|
||||
/*!
|
||||
* Get a tree of paths generated for a certain layer of the mesh.
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
float infilll_extrusion_width() const { return m_infill_extrusion_width; }
|
||||
|
||||
Generator(PrintObject* m_object, std::vector<Polygons>& contours, std::vector<Polygons>& overhangs, float density = 0.15);
|
||||
Generator(PrintObject* m_object, std::vector<Polygons>& contours, std::vector<Polygons>& overhangs, const std::function<void()> &throw_on_cancel_callback, float density = 0.15);
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
@ -72,13 +72,13 @@ protected:
|
|||
* only when support is generated. For this pattern, we also need to
|
||||
* generate overhang areas for the inside of the model.
|
||||
*/
|
||||
void generateInitialInternalOverhangs(const PrintObject &print_object);
|
||||
void generateInitialInternalOverhangs(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback);
|
||||
|
||||
/*!
|
||||
* Calculate the tree structure of all layers.
|
||||
*/
|
||||
void generateTrees(const PrintObject &print_object);
|
||||
void generateTreesforSupport(std::vector<Polygons>& contours);
|
||||
void generateTrees(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback);
|
||||
void generateTreesforSupport(std::vector<Polygons>& contours, const std::function<void()> &throw_on_cancel_callback);
|
||||
|
||||
float m_infill_extrusion_width;
|
||||
|
||||
|
|
|
@ -48,10 +48,12 @@ void Layer::generateNewTrees
|
|||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outlines_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius
|
||||
const coord_t wall_supporting_radius,
|
||||
const std::function<void()> &throw_on_cancel_callback
|
||||
)
|
||||
{
|
||||
DistanceField distance_field(supporting_radius, current_outlines, current_outlines_bbox, current_overhang);
|
||||
throw_on_cancel_callback();
|
||||
|
||||
SparseNodeGrid tree_node_locator;
|
||||
fillLocator(tree_node_locator, current_outlines_bbox);
|
||||
|
@ -61,6 +63,7 @@ void Layer::generateNewTrees
|
|||
size_t unsupported_cell_idx = 0;
|
||||
Point unsupported_location;
|
||||
while (distance_field.tryGetNextPoint(&unsupported_location, &unsupported_cell_idx, unsupported_cell_idx)) {
|
||||
throw_on_cancel_callback();
|
||||
GroundingLocation grounding_loc = getBestGroundingLocation(
|
||||
unsupported_location, current_outlines, current_outlines_bbox, outlines_locator, supporting_radius, wall_supporting_radius, tree_node_locator);
|
||||
|
||||
|
|
|
@ -44,7 +44,8 @@ public:
|
|||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
coord_t supporting_radius,
|
||||
coord_t wall_supporting_radius
|
||||
coord_t wall_supporting_radius,
|
||||
const std::function<void()> &throw_on_cancel_callback
|
||||
);
|
||||
|
||||
/*! Determine & connect to connection point in tree/outline.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue