Skip to content

Commit 18bf08a

Browse files
committed
fix: retrieve adhesion_type globally (CURA-2605)
1 parent f30c309 commit 18bf08a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/FffGcodeWriter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ void FffGcodeWriter::processLayer(SliceDataStorage& storage, int layer_nr, unsig
393393
if (layer_nr < 0)
394394
{
395395
#ifdef DEBUG
396-
const ExtruderTrain& train = *storage.meshgroup->getExtruderTrain(storage.getSettingAsIndex("adhesion_extruder_nr"));
397-
assert(train.getSettingAsPlatformAdhesion("adhesion_type") == EPlatformAdhesion::RAFT && "negative layer_number means post-raft, pre-model layer!");
396+
assert(getSettingAsPlatformAdhesion("adhesion_type") == EPlatformAdhesion::RAFT && "negative layer_number means post-raft, pre-model layer!");
398397
#endif // DEBUG
399398
const int filler_layer_count = Raft::getFillerLayerCount(storage);
400399
layer_thickness = Raft::getFillerLayerHeight(storage);
@@ -410,8 +409,7 @@ void FffGcodeWriter::processLayer(SliceDataStorage& storage, int layer_nr, unsig
410409
z = storage.meshes[0].layers[layer_nr].printZ;
411410
if (layer_nr == 0)
412411
{
413-
const ExtruderTrain& train = *storage.meshgroup->getExtruderTrain(storage.getSettingAsIndex("adhesion_extruder_nr"));
414-
if (train.getSettingAsPlatformAdhesion("adhesion_type") == EPlatformAdhesion::RAFT)
412+
if (getSettingAsPlatformAdhesion("adhesion_type") == EPlatformAdhesion::RAFT)
415413
{
416414
include_helper_parts = false;
417415
}

src/raft.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int Raft::getTotalThickness(const SliceDataStorage& storage)
3939
int Raft::getZdiffBetweenRaftAndLayer1(const SliceDataStorage& storage)
4040
{
4141
const ExtruderTrain& train = *storage.meshgroup->getExtruderTrain(storage.getSettingAsIndex("adhesion_extruder_nr"));
42-
if (train.getSettingAsPlatformAdhesion("adhesion_type") != EPlatformAdhesion::RAFT)
42+
if (storage.getSettingAsPlatformAdhesion("adhesion_type") != EPlatformAdhesion::RAFT)
4343
{
4444
return 0;
4545
}
@@ -62,10 +62,9 @@ int Raft::getFillerLayerCount(const SliceDataStorage& storage)
6262

6363
int Raft::getFillerLayerHeight(const SliceDataStorage& storage)
6464
{
65-
const ExtruderTrain& train = *storage.meshgroup->getExtruderTrain(storage.getSettingAsIndex("adhesion_extruder_nr"));
66-
const int64_t normal_layer_height = storage.getSettingInMicrons("layer_height");
67-
if (train.getSettingAsPlatformAdhesion("adhesion_type") != EPlatformAdhesion::RAFT)
65+
if (storage.getSettingAsPlatformAdhesion("adhesion_type") != EPlatformAdhesion::RAFT)
6866
{
67+
const int64_t normal_layer_height = storage.getSettingInMicrons("layer_height");
6968
return normal_layer_height;
7069
}
7170
const unsigned int filler_layer_height = round_divide(getZdiffBetweenRaftAndLayer1(storage), getFillerLayerCount(storage));

0 commit comments

Comments
 (0)