libslic3r
Library for generating gcode from 3d models
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Slic3r::Layer Class Reference

#include <Layer.hpp>

Inheritance diagram for Slic3r::Layer:
Slic3r::SupportLayer

Public Member Functions

size_t id () const
 ID number. More...
 
void set_id (size_t id)
 Setter for this->_id. More...
 
PrintObjectobject ()
 Getter for _object. More...
 
const PrintObjectobject () const
 
size_t region_count () const
 Returns the number of regions. More...
 
LayerRegionget_region (size_t idx)
 Gets a region at a specific id. More...
 
const LayerRegionget_region (size_t idx) const
 Gets a region at a specific id as const. More...
 
LayerRegionadd_region (PrintRegion *print_region)
 Adds a PrintRegion. More...
 
void make_slices ()
 Merge all regions' slices to get islands. More...
 
void merge_slices ()
 Merges all of the LayerRegions' slices. More...
 
template<class T >
bool any_internal_region_slice_contains (const T &item) const
 Template which iterates over all of the LayerRegion for internally containing the argument. More...
 
template<class T >
bool any_bottom_region_slice_contains (const T &item) const
 Template which iterates over all of the LayerRegion for containing on the bottom the argument. More...
 
void make_perimeters ()
 Creates the perimeters cummulatively for all layer regions sharing the same parameters influencing the perimeters. More...
 
void make_fills ()
 Makes fills for all the LayerRegion. More...
 
void detect_surfaces_type ()
 Determines the type of surface (top/bottombridge/bottom/internal) each region is. More...
 
void process_external_surfaces ()
 Processes the external surfaces. More...
 
virtual bool is_support () const
 polymorphic id More...
 

Public Attributes

Layerupper_layer
 Pointer to layer above. More...
 
Layerlower_layer
 Pointer to layer below. More...
 
LayerRegionPtrs regions
 Vector of pointers to the LayerRegions of this layer. More...
 
bool slicing_errors
 Presence of slicing errors. More...
 
coordf_t slice_z
 Z used for slicing in unscaled coordinates. More...
 
coordf_t print_z
 Z used for printing in unscaled coordinates. More...
 
coordf_t height
 layer height in unscaled coordinates More...
 
ExPolygonCollection slices
 

Protected Member Functions

 Layer (size_t id, PrintObject *object, coordf_t height, coordf_t print_z, coordf_t slice_z)
 Constructor. More...
 
virtual ~Layer ()
 Destructor. More...
 
void clear_regions ()
 Deletes all regions. More...
 
void delete_region (int idx)
 Deletes a specific region. More...
 

Protected Attributes

size_t _id
 sequential number of layer, 0-based More...
 
PrintObject_object
 Associated PrintObject. More...
 

Friends

class PrintObject
 

Constructor & Destructor Documentation

◆ Layer()

Slic3r::Layer::Layer ( size_t  id,
PrintObject object,
coordf_t  height,
coordf_t  print_z,
coordf_t  slice_z 
)
protected

Constructor.

Initialises upper_layer, lower_layer to NULL Initialises slicing_errors to false

◆ ~Layer()

Slic3r::Layer::~Layer ( )
protectedvirtual

Destructor.

Removes references to self and clears regions.

Member Function Documentation

◆ add_region()

LayerRegion * Slic3r::Layer::add_region ( PrintRegion print_region)

Adds a PrintRegion.

Creates a LayerRegion from a PrintRegion and adds it to this->regions.

◆ any_bottom_region_slice_contains()

template<class T >
template bool Slic3r::Layer::any_bottom_region_slice_contains< Polyline > ( const T &  item) const

Template which iterates over all of the LayerRegion for containing on the bottom the argument.

Uses LayerRegion->slices.any_bottom_contains(item)

◆ any_internal_region_slice_contains()

template<class T >
template bool Slic3r::Layer::any_internal_region_slice_contains< Polyline > ( const T &  item) const

Template which iterates over all of the LayerRegion for internally containing the argument.

Uses LayerRegion->slices.any_internal_contains(item)

◆ clear_regions()

void Slic3r::Layer::clear_regions ( )
protected

Deletes all regions.

Deletes all regions using this->delete_region()

◆ delete_region()

void Slic3r::Layer::delete_region ( int  idx)
protected

Deletes a specific region.

Deletes an individual region.

◆ detect_surfaces_type()

void Slic3r::Layer::detect_surfaces_type ( )

Determines the type of surface (top/bottombridge/bottom/internal) each region is.

Analyzes slices of a region (SurfaceCollection slices). Each region slice (instance of Surface) is analyzed, whether it is supported or whether it is the top surface. Initially all slices are of type S_TYPE_INTERNAL. Slices are compared against the top / bottom slices and regions and classified to the following groups: S_TYPE_TOP - Part of a region, which is not covered by any upper layer. This surface will be filled with a top solid infill. S_TYPE_BOTTOMBRIDGE - Part of a region, which is not fully supported, but it hangs in the air, or it hangs losely on a support or a raft. S_TYPE_BOTTOM - Part of a region, which is not supported by the same region, but it is supported either by another region, or by a soluble interface layer. S_TYPE_INTERNAL - Part of a region, which is supported by the same region type. If a part of a region is of S_TYPE_BOTTOM and S_TYPE_TOP, the S_TYPE_BOTTOM wins.

◆ get_region() [1/2]

LayerRegion* Slic3r::Layer::get_region ( size_t  idx)
inline

Gets a region at a specific id.

◆ get_region() [2/2]

const LayerRegion* Slic3r::Layer::get_region ( size_t  idx) const
inline

Gets a region at a specific id as const.

◆ id()

size_t Slic3r::Layer::id ( ) const

ID number.

Getter for this->_id.

◆ is_support()

virtual bool Slic3r::Layer::is_support ( ) const
inlinevirtual

polymorphic id

Reimplemented in Slic3r::SupportLayer.

◆ make_fills()

void Slic3r::Layer::make_fills ( )

Makes fills for all the LayerRegion.

Iterates over all of the LayerRegion and invokes LayerRegion->make_fill() Asserts that the fills created are not NULL

◆ make_perimeters()

void Slic3r::Layer::make_perimeters ( )

Creates the perimeters cummulatively for all layer regions sharing the same parameters influencing the perimeters.

The perimeter paths and the thin fills (ExtrusionEntityCollection) are assigned to the first compatible layer region. The resulting fill surface is split back among the originating regions.

◆ make_slices()

void Slic3r::Layer::make_slices ( )

Merge all regions' slices to get islands.

◆ merge_slices()

void Slic3r::Layer::merge_slices ( )

Merges all of the LayerRegions' slices.

Iterates over all of the LayerRegion and invokes LayerRegion->merge_slices()

◆ object() [1/2]

PrintObject* Slic3r::Layer::object ( )
inline

Getter for _object.

◆ object() [2/2]

const PrintObject* Slic3r::Layer::object ( ) const
inline

◆ process_external_surfaces()

void Slic3r::Layer::process_external_surfaces ( )

Processes the external surfaces.

Iterates over all LayerRegions and invokes LayerRegion->process_external_surfaces.

◆ region_count()

size_t Slic3r::Layer::region_count ( ) const

Returns the number of regions.

Getter for this->regions.size()

◆ set_id()

void Slic3r::Layer::set_id ( size_t  id)

Setter for this->_id.

Friends And Related Function Documentation

◆ PrintObject

friend class PrintObject
friend

Member Data Documentation

◆ _id

size_t Slic3r::Layer::_id
protected

sequential number of layer, 0-based

◆ _object

PrintObject* Slic3r::Layer::_object
protected

Associated PrintObject.

◆ height

coordf_t Slic3r::Layer::height

layer height in unscaled coordinates

◆ lower_layer

Layer* Slic3r::Layer::lower_layer

Pointer to layer below.

◆ print_z

coordf_t Slic3r::Layer::print_z

Z used for printing in unscaled coordinates.

◆ regions

LayerRegionPtrs Slic3r::Layer::regions

Vector of pointers to the LayerRegions of this layer.

◆ slice_z

coordf_t Slic3r::Layer::slice_z

Z used for slicing in unscaled coordinates.

◆ slices

ExPolygonCollection Slic3r::Layer::slices

collection of expolygons generated by slicing the original geometry; also known as 'islands' (all regions and surface types are merged here)

◆ slicing_errors

bool Slic3r::Layer::slicing_errors

Presence of slicing errors.

◆ upper_layer

Layer* Slic3r::Layer::upper_layer

Pointer to layer above.


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