Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURA-10823_bridging_when_infill_0 #1945

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions include/skin.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//Copyright (c) 2021 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
// Copyright (c) 2021 Ultimaker B.V.
// CuraEngine is released under the terms of the AGPLv3 or higher.

#ifndef SKIN_H
#define SKIN_H

#include "settings/types/LayerIndex.h"
#include "utils/Coord_t.h"

namespace cura
namespace cura
{

class Polygons;
Expand All @@ -21,10 +21,9 @@ class SliceMeshStorage;
class SkinInfillAreaComputation
{
public:

/*!
* \brief Initialize the parameters for skin and infill area computation.
*
*
* \param layer_nr The index of the layer for which to generate the skins
* and infill.
* \param mesh The storage where the layer outline information (input) is
Expand All @@ -41,11 +40,11 @@ class SkinInfillAreaComputation

/*!
* \brief Combines the infill of multiple layers for a specified mesh.
*
*
* The infill layers are combined while the thickness of each layer is
* multiplied such that the infill should fill up again to the full height of
* all combined layers.
*
*
* \param mesh The mesh to combine the infill layers of.
*/
static void combineInfillLayers(SliceMeshStorage& mesh);
Expand All @@ -69,10 +68,10 @@ class SkinInfillAreaComputation

/*!
* Limit the infill areas to places where they support internal overhangs.
*
*
* This function uses the part.infill_area and part.infill_area_own
* and computes a new part.infill_area_own
*
*
* \param mesh The mesh for which to recalculate the infill areas
*/
static void generateInfillSupport(SliceMeshStorage& mesh);
Expand All @@ -85,7 +84,7 @@ class SkinInfillAreaComputation

/*!
* Generate the skin areas (outlines) of one part in a layer
*
*
* \param part The part for which to generate skins.
*/
void generateSkinAndInfillAreas(SliceLayerPart& part);
Expand All @@ -112,7 +111,7 @@ class SkinInfillAreaComputation
* Apply skin expansion:
* expand skins into infill area
* where the skin is broad enough
*
*
* \param original_outline The outline within which skin and infill lie (inner bounds of innermost walls)
* \param[in,out] upskin The top skin areas to grow
* \param[in,out] downskin The bottom skin areas to grow
Expand All @@ -125,12 +124,12 @@ class SkinInfillAreaComputation
* where the infill areas (output) are stored.
* \param skin The skin areas on the layer of the \p part
*/
void generateInfill(SliceLayerPart& part, const Polygons& skin);
void generateInfill(SliceLayerPart& part);

/*!
* Remove the areas which are 'directly' under air from the \ref SkinPart::inner_infill and
* Remove the areas which are 'directly' under air from the \ref SkinPart::inner_infill and
* save them in the \ref SkinPart::roofing_fill of the \p part.
*
*
* \param[in,out] part Where to get the SkinParts to get the outline info from and to store the roofing areas
*/
void generateRoofingFillAndSkinFill(SliceLayerPart& part);
Expand Down Expand Up @@ -194,6 +193,6 @@ class SkinInfillAreaComputation
Polygons getOutlineOnLayer(const SliceLayerPart& part_here, const LayerIndex layer2_nr);
};

}//namespace cura
} // namespace cura

#endif//SKIN_H
#endif // SKIN_H
9 changes: 5 additions & 4 deletions src/skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ void SkinInfillAreaComputation::generateSkinAndInfillAreas(SliceLayerPart& part)
Polygons skin = top_skin.unionPolygons(bottom_skin);

skin.removeSmallAreas(MIN_AREA_SIZE);

// Create infill area irrespective if the infill is to be generated or not(would be used for bridging).
part.infill_area = part.inner_area.difference(skin);
if (process_infill)
{ // process infill when infill density > 0
// or when other infill meshes want to modify this infill
generateInfill(part, skin);
generateInfill(part);
}

for (PolygonsPart& skin_area_part : skin.splitIntoParts())
Expand Down Expand Up @@ -306,9 +307,9 @@ void SkinInfillAreaComputation::applySkinExpansion(const Polygons& original_outl
*
* generateInfill read mesh.layers[n].parts[*].{insets,skin_parts,boundingBox} and write mesh.layers[n].parts[*].infill_area
*/
void SkinInfillAreaComputation::generateInfill(SliceLayerPart& part, const Polygons& skin)
void SkinInfillAreaComputation::generateInfill(SliceLayerPart& part)
{
part.infill_area = part.inner_area.difference(skin); // Generate infill everywhere where there wasn't any skin.
// Generate infill everywhere where there wasn't any skin.
part.infill_area.removeSmallAreas(MIN_AREA_SIZE);
}

Expand Down
Loading