#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Fill/Lightning/Generator.hpp>
Public Member Functions | |
| Generator (const PrintObject &print_object, const std::function< void()> &throw_on_cancel_callback) | |
| const Layer & | getTreesForLayer (const size_t &layer_id) const |
| std::vector< Polygons > & | Overhangs () |
| float | infilll_extrusion_width () const |
| 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 Member Functions | |
| void | generateInitialInternalOverhangs (const PrintObject &print_object, const std::function< void()> &throw_on_cancel_callback) |
| 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) |
Protected Attributes | |
| float | m_infill_extrusion_width |
| coord_t | m_supporting_radius |
| coord_t | m_wall_supporting_radius |
| coord_t | m_prune_length |
| coord_t | m_straightening_max_distance |
| std::vector< Polygons > | m_overhang_per_layer |
| std::vector< Layer > | m_lightning_layers |
| std::vector< BoundingBox > | bboxs |
Generates the Lightning Infill pattern.
The lightning infill pattern is designed to use a minimal amount of material to support the top skin of the print, while still printing with reasonably consistently flowing lines. It sacrifices strength completely in favour of top surface quality and reduced print time / material usage.
Lightning Infill is so named because the patterns it creates resemble a forked path with one main path and many small lines on the side. These paths grow out from the sides of the model just below where the top surface needs to be supported from the inside, so that minimal material is needed.
This pattern is based on a paper called "Ribbed Support Vaults for 3D Printing of Hollowed Objects" by Tricard, Claux and Lefebvre: https://www.researchgate.net/publication/333808588_Ribbed_Support_Vaults_for_3D_Printing_of_Hollowed_Objects
|
explicit |
Create a generator to fill a certain mesh with infill.
This generator will pre-compute things in preparation of generating Lightning Infill for the infill areas in that mesh. The infill areas must already be calculated at this point.
References Slic3r::PrintObjectRegions::all_regions, Slic3r::Flow::auto_extrusion_width(), Slic3r::Print::config(), Slic3r::PrintObject::config(), EPSILON, Slic3r::frInfill, generateInitialInternalOverhangs(), generateTrees(), m_infill_extrusion_width, M_PI, m_prune_length, m_straightening_max_distance, m_supporting_radius, m_wall_supporting_radius, Slic3r::PrintObjectBaseWithState< PrintType, PrintObjectStepEnum, COUNT >::print(), Slic3r::PrintObjectConfig, Slic3r::PrintRegionConfig, Slic3r::scaled(), and Slic3r::PrintObject::shared_regions().
| Slic3r::FillLightning::Generator::Generator | ( | PrintObject * | m_object, |
| std::vector< Polygons > & | contours, | ||
| std::vector< Polygons > & | overhangs, | ||
| const std::function< void()> & | throw_on_cancel_callback, | ||
| float | density = 0.15 ) |
References Slic3r::PrintObjectRegions::all_regions, Slic3r::Flow::auto_extrusion_width(), Slic3r::Print::config(), Slic3r::PrintObject::config(), EPSILON, Slic3r::frInfill, generateTreesforSupport(), m_infill_extrusion_width, m_overhang_per_layer, M_PI, m_prune_length, m_straightening_max_distance, m_supporting_radius, m_wall_supporting_radius, Slic3r::PrintObjectBaseWithState< PrintType, PrintObjectStepEnum, COUNT >::print(), Slic3r::PrintObjectConfig, Slic3r::PrintRegionConfig, Slic3r::scaled(), and Slic3r::PrintObject::shared_regions().
|
protected |
Calculate the overhangs above the infill areas that need to be supported by infill.
Normally, overhangs are only generated for the outside of the model and only when support is generated. For this pattern, we also need to generate overhang areas for the inside of the model.
References Slic3r::append(), Slic3r::diff(), Slic3r::Surface::expolygon, Slic3r::PrintObject::get_layer(), Slic3r::PrintObject::layers(), m_overhang_per_layer, m_wall_supporting_radius, Slic3r::offset(), Slic3r::Layer::regions(), Slic3r::ConstVectorOfPtrsAdaptor< T >::size(), Slic3r::stInternal, Slic3r::stInternalVoid, Slic3r::Surface::surface_type, and Slic3r::to_polygons().
Referenced by Generator().
|
protected |
Calculate the tree structure of all layers.
References Slic3r::append(), Slic3r::EdgeGrid::Grid::bbox(), bboxs, Slic3r::EdgeGrid::Grid::create(), Slic3r::BoundingBoxBase< PointType, APointsType >::defined, Slic3r::Surface::expolygon, Slic3r::FillLightning::Layer::generateNewTrees(), Slic3r::FillLightning::get_extents(), Slic3r::PrintObject::get_layer(), Slic3r::BoundingBox::inflated(), Slic3r::PrintObject::layers(), Slic3r::FillLightning::locator_cell_size(), m_lightning_layers, m_overhang_per_layer, m_prune_length, m_straightening_max_distance, m_supporting_radius, m_wall_supporting_radius, Slic3r::BoundingBoxBase< PointType, APointsType >::merge(), Slic3r::FillLightning::Layer::reconnectRoots(), Slic3r::Layer::regions(), SCALED_EPSILON, Slic3r::EdgeGrid::Grid::set_bbox(), Slic3r::ConstVectorOfPtrsAdaptor< T >::size(), Slic3r::stInternal, Slic3r::stInternalVoid, Slic3r::Surface::surface_type, Slic3r::to_polygons(), and Slic3r::FillLightning::Layer::tree_roots.
Referenced by Generator().
|
protected |
References Slic3r::EdgeGrid::Grid::bbox(), bboxs, Slic3r::EdgeGrid::Grid::create(), Slic3r::BoundingBoxBase< PointType, APointsType >::defined, Slic3r::FillLightning::Layer::generateNewTrees(), Slic3r::FillLightning::get_extents(), Slic3r::BoundingBox::inflated(), Slic3r::FillLightning::locator_cell_size(), m_lightning_layers, m_overhang_per_layer, m_prune_length, m_straightening_max_distance, m_supporting_radius, m_wall_supporting_radius, Slic3r::BoundingBoxBase< PointType, APointsType >::merge(), Slic3r::FillLightning::Layer::reconnectRoots(), SCALED_EPSILON, Slic3r::EdgeGrid::Grid::set_bbox(), and Slic3r::FillLightning::Layer::tree_roots.
Referenced by Generator().
| const Layer & Slic3r::FillLightning::Generator::getTreesForLayer | ( | const size_t & | layer_id | ) | const |
Get a tree of paths generated for a certain layer of the mesh.
This tree represents the paths that must be traced to print the infill.
| layer_id | The layer number to get the path tree for. This is within the range of layers of the mesh (not the global layer numbers). |
References m_lightning_layers.
|
inline |
References m_infill_extrusion_width.
|
inline |
References m_overhang_per_layer.
|
protected |
Referenced by generateTrees(), and generateTreesforSupport().
|
protected |
Referenced by Generator(), Generator(), and infilll_extrusion_width().
|
protected |
For each layer, the generated lightning paths.
This is generated by generateTrees.
Referenced by generateTrees(), generateTreesforSupport(), and getTreesForLayer().
|
protected |
For each layer, the overhang that needs to be supported by the pattern.
This is generated by generateInitialInternalOverhangs.
Referenced by Generator(), generateInitialInternalOverhangs(), generateTrees(), generateTreesforSupport(), and Overhangs().
|
protected |
How far each piece of infill can support other infill in the layer above.
This may be different than supporting_radius, because the infill is printed with one end floating in mid-air. This endpoint will sag more, so an infill line may need to be supported more than a skin line.
Referenced by Generator(), Generator(), generateTrees(), and generateTreesforSupport().
|
protected |
How far a line may be shifted in order to straighten the line out.
Straightening the line reduces material and time usage and reduces accelerations needed to print the pattern. However it makes the infill weak if lines are partially suspended next to the line on the previous layer.
Referenced by Generator(), Generator(), generateTrees(), and generateTreesforSupport().
|
protected |
How far each piece of infill can support skin in the layer above.
Referenced by Generator(), Generator(), generateTrees(), and generateTreesforSupport().
|
protected |
How far a wall can support the wall above it. If a wall completely supports the wall above it, no infill needs to support that.
This is similar to the overhang distance calculated for support. It is determined by the lightning_infill_overhang_angle setting.
Referenced by Generator(), Generator(), generateInitialInternalOverhangs(), generateTrees(), and generateTreesforSupport().