OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Arachne::OuterWallInsetBeadingStrategy Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Arachne/BeadingStrategy/OuterWallInsetBeadingStrategy.hpp>

Inheritance diagram for Slic3r::Arachne::OuterWallInsetBeadingStrategy:
Collaboration diagram for Slic3r::Arachne::OuterWallInsetBeadingStrategy:

Public Member Functions

 OuterWallInsetBeadingStrategy (coord_t outer_wall_offset, BeadingStrategyPtr parent)
 ~OuterWallInsetBeadingStrategy () override=default
Beading compute (coord_t thickness, coord_t bead_count) const override
coord_t getOptimalThickness (coord_t bead_count) const override
coord_t getTransitionThickness (coord_t lower_bead_count) const override
coord_t getOptimalBeadCount (coord_t thickness) const override
coord_t getTransitioningLength (coord_t lower_bead_count) const override
std::string toString () const override
virtual float getTransitionAnchorPos (coord_t lower_bead_count) const
virtual std::vector< coord_t > getNonlinearThicknesses (coord_t lower_bead_count) const
double getSplitMiddleThreshold () const
double getTransitioningAngle () const

Protected Attributes

std::string name
coord_t optimal_width
double wall_split_middle_threshold
 Optimal bead width, nominal width off the walls in 'ideal' circumstances.
double wall_add_middle_threshold
 Threshold when a middle wall should be split into two, as a ratio of the optimal wall width.
coord_t default_transition_length
 Threshold when a new middle wall should be added between an even number of walls, as a ratio of the optimal wall width.
double transitioning_angle
 The length of the region to smoothly transfer between bead counts.

Private Attributes

BeadingStrategyPtr parent
coord_t outer_wall_offset

Detailed Description

Constructor & Destructor Documentation

◆ OuterWallInsetBeadingStrategy()

Slic3r::Arachne::OuterWallInsetBeadingStrategy::OuterWallInsetBeadingStrategy ( coord_t outer_wall_offset,
BeadingStrategyPtr parent )
16{
17 name = "OuterWallOfsetBeadingStrategy";
18}
std::string name
Definition BeadingStrategy.hpp:101
BeadingStrategy(coord_t optimal_width, double wall_split_middle_threshold, double wall_add_middle_threshold, coord_t default_transition_length, float transitioning_angle=pi_div(3))
Definition BeadingStrategy.cpp:12
coord_t outer_wall_offset
Definition OuterWallInsetBeadingStrategy.hpp:35
BeadingStrategyPtr parent
Definition OuterWallInsetBeadingStrategy.hpp:34

References Slic3r::Arachne::BeadingStrategy::BeadingStrategy(), Slic3r::Arachne::BeadingStrategy::name, outer_wall_offset, and parent.

Here is the call graph for this function:

◆ ~OuterWallInsetBeadingStrategy()

Slic3r::Arachne::OuterWallInsetBeadingStrategy::~OuterWallInsetBeadingStrategy ( )
overridedefault

Member Function Documentation

◆ compute()

BeadingStrategy::Beading Slic3r::Arachne::OuterWallInsetBeadingStrategy::compute ( coord_t thickness,
coord_t bead_count ) const
overridevirtual

Retrieve the bead widths with which to cover a given thickness.

Requirement: Given a constant bead_count the output of each bead width must change gradually along with the thickness.

Note
The bead_count might be different from the BeadingStrategy::optimal_bead_count

Implements Slic3r::Arachne::BeadingStrategy.

46{
47 Beading ret = parent->compute(thickness, bead_count);
48
49 // Actual count and thickness as represented by extant walls. Don't count any potential zero-width 'signaling' walls.
50 bead_count = std::count_if(ret.bead_widths.begin(), ret.bead_widths.end(), [](const coord_t width) { return width > 0; });
51
52 // No need to apply any inset if there is just a single wall.
53 if (bead_count < 2)
54 {
55 return ret;
56 }
57
58 // Actually move the outer wall inside. Ensure that the outer wall never goes beyond the middle line.
59 ret.toolpath_locations[0] = std::min(ret.toolpath_locations[0] + outer_wall_offset, thickness / 2);
60 return ret;
61}
Definition BeadingStrategy.hpp:36
int64_t coord_t
Definition libslic3r.h:48

References Slic3r::Arachne::BeadingStrategy::Beading::bead_widths, outer_wall_offset, parent, and Slic3r::Arachne::BeadingStrategy::Beading::toolpath_locations.

◆ getNonlinearThicknesses()

std::vector< coord_t > Slic3r::Arachne::BeadingStrategy::getNonlinearThicknesses ( coord_t lower_bead_count) const
virtualinherited

Get the locations in a bead count region where BeadingStrategy::compute exhibits a bend in the widths. Ordered from lower thickness to higher.

This is used to insert extra support bones into the skeleton, so that the resulting beads in long trapezoids don't linearly change between the two ends.

Reimplemented in Slic3r::Arachne::WideningBeadingStrategy.

47{
48 return {};
49}

◆ getOptimalBeadCount()

coord_t Slic3r::Arachne::OuterWallInsetBeadingStrategy::getOptimalBeadCount ( coord_t thickness) const
overridevirtual

The number of beads should we ideally usefor a given model thickness

Implements Slic3r::Arachne::BeadingStrategy.

31{
32 return parent->getOptimalBeadCount(thickness);
33}

References parent.

◆ getOptimalThickness()

coord_t Slic3r::Arachne::OuterWallInsetBeadingStrategy::getOptimalThickness ( coord_t bead_count) const
overridevirtual

The ideal thickness for a given

Parameters
bead_count

Reimplemented from Slic3r::Arachne::BeadingStrategy.

21{
22 return parent->getOptimalThickness(bead_count);
23}

References parent.

◆ getSplitMiddleThreshold()

double Slic3r::Arachne::BeadingStrategy::getSplitMiddleThreshold ( ) const
inherited
57{
59}
double wall_split_middle_threshold
Optimal bead width, nominal width off the walls in 'ideal' circumstances.
Definition BeadingStrategy.hpp:105

References wall_split_middle_threshold.

◆ getTransitionAnchorPos()

float Slic3r::Arachne::BeadingStrategy::getTransitionAnchorPos ( coord_t lower_bead_count) const
virtualinherited

The fraction of the transition length to put between the lower end of the transition and the point where the unsmoothed bead count jumps.

Transitions are used to smooth out the jumps in integer bead count; the jumps turn into ramps which could be positioned relative to the jump location.

Reimplemented in Slic3r::Arachne::LimitedBeadingStrategy, Slic3r::Arachne::RedistributeBeadingStrategy, and Slic3r::Arachne::WideningBeadingStrategy.

39{
40 coord_t lower_optimum = getOptimalThickness(lower_bead_count);
41 coord_t transition_point = getTransitionThickness(lower_bead_count);
42 coord_t upper_optimum = getOptimalThickness(lower_bead_count + 1);
43 return 1.0 - float(transition_point - lower_optimum) / float(upper_optimum - lower_optimum);
44}
virtual coord_t getOptimalThickness(coord_t bead_count) const
Definition BeadingStrategy.cpp:66
virtual coord_t getTransitionThickness(coord_t lower_bead_count) const
Definition BeadingStrategy.cpp:71

References getOptimalThickness(), and getTransitionThickness().

Here is the call graph for this function:

◆ getTransitioningAngle()

double Slic3r::Arachne::BeadingStrategy::getTransitioningAngle ( ) const
inherited
62{
64}
double transitioning_angle
The length of the region to smoothly transfer between bead counts.
Definition BeadingStrategy.hpp:115

References transitioning_angle.

◆ getTransitioningLength()

coord_t Slic3r::Arachne::OuterWallInsetBeadingStrategy::getTransitioningLength ( coord_t lower_bead_count) const
overridevirtual

The length of the transitioning region along the marked / significant regions of the skeleton.

Transitions are used to smooth out the jumps in integer bead count; the jumps turn into ramps with some incline defined by their length.

Reimplemented from Slic3r::Arachne::BeadingStrategy.

36{
37 return parent->getTransitioningLength(lower_bead_count);
38}

References parent.

◆ getTransitionThickness()

coord_t Slic3r::Arachne::OuterWallInsetBeadingStrategy::getTransitionThickness ( coord_t lower_bead_count) const
overridevirtual

The model thickness at which BeadingStrategy::optimal_bead_count transitions from lower_bead_count to lower_bead_count + 1

Reimplemented from Slic3r::Arachne::BeadingStrategy.

26{
27 return parent->getTransitionThickness(lower_bead_count);
28}

References parent.

◆ toString()

std::string Slic3r::Arachne::OuterWallInsetBeadingStrategy::toString ( ) const
overridevirtual

Reimplemented from Slic3r::Arachne::BeadingStrategy.

41{
42 return std::string("OuterWallOfsetBeadingStrategy+") + parent->toString();
43}

References parent.

Member Data Documentation

◆ default_transition_length

coord_t Slic3r::Arachne::BeadingStrategy::default_transition_length
protectedinherited

Threshold when a new middle wall should be added between an even number of walls, as a ratio of the optimal wall width.

Referenced by BeadingStrategy(), BeadingStrategy(), Slic3r::Arachne::DistributedBeadingStrategy::DistributedBeadingStrategy(), and getTransitioningLength().

◆ name

◆ optimal_width

◆ outer_wall_offset

coord_t Slic3r::Arachne::OuterWallInsetBeadingStrategy::outer_wall_offset
private

◆ parent

◆ transitioning_angle

double Slic3r::Arachne::BeadingStrategy::transitioning_angle
protectedinherited

The length of the region to smoothly transfer between bead counts.

The maximum angle between outline segments smaller than which we are going to add transitions Equals 180 - the "limit bisector angle" from the paper

Referenced by BeadingStrategy(), BeadingStrategy(), Slic3r::Arachne::DistributedBeadingStrategy::DistributedBeadingStrategy(), and getTransitioningAngle().

◆ wall_add_middle_threshold

double Slic3r::Arachne::BeadingStrategy::wall_add_middle_threshold
protectedinherited

◆ wall_split_middle_threshold

double Slic3r::Arachne::BeadingStrategy::wall_split_middle_threshold
protectedinherited

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