BaseSlicer
- class compas_slicer.slicers.BaseSlicer(mesh)[source]
Bases:
object
This is an organizational class that holds all the information for the slice process. Do not use this class directly in your python code. Instead use PlanarSlicer or InterpolationSlicer. This class is meant to be extended for the implementation of the various slicers. See
compas.slicer.slicers.PlanarSlicer
andcompas.slicer.slicers.InterpolationSlicer
as examples.- Attributes:
mesh (
compas.datastructures.Mesh
) – Input mesh, has to be a triangular mesh (i.e. no quads or n-gons allowed)
Attributes
horizontal_layers
Returns a list of all the layers stored in the slicer that are NOT vertical.
number_of_layers
Total number of layers.
number_of_paths
Total number of paths, number of open paths, number of closed paths.
number_of_points
Total number of points in the slicer.
vertical_layers
Returns a list of all the vertical layers stored in the slicer.
Inherited Attributes
Methods
__init__
(mesh)For paths that are labeled as closed, it makes sure that the first and the last point are identical.
from_data
(data)Construct a slicer from its data representation.
To be implemented by the inheriting classes.
Returns a dictionary consisting of the layers.
Applies standard post-processing operations: seams_align and unify_paths.
Prints out information from the slicing process.
Removes invalid layers and paths from the slicer.
slice_model
(*args, **kwargs)Slices the model and applies standard post-processing and removing of invalid paths.
to_data
()Returns a dictionary of structured data representing the data structure.
to_json
(filepath, name)Writes the slicer to a JSON file.
Inherited Methods