Model

class pyslm.geometry.Model(mid=0)

Bases: object

A Model represents a parametric group or in practice a part which contains a set unique and assignable BuildStyle used a specific LayerGeometry. The buildstyles are stored in buildStyles.

Each Model must have a unique model-id (mid). Additionally, for some build formats, the top layer id (topLayerId) should correspond Layer.id value of the last layer’s LayerGeometry that uses this Model. It is recommended that ModelValidator should be used to verify that all Models have a unique model-id and that the correct topLayerId is set, using the following methods

pyslm.geometry.ModelValidator.validateModel(model)

or

models = [modelA, modelB]
pyslm.geometry.ModelValidator.validateBuild(models, layer_list)

Additional generic metadata can be stored for reference and describing the Model that are not necessarily used when exporting to build file including

Attributes Summary

buildStyleDescription

The description of the BuildStyles applied to the Model

buildStyleName

The BuildStyle name applied to the Model

buildStyles

The BuildStyles associated with this model

mid

The unique id for this Model

name

The name described by the model

topLayerId

The Top Layer of all Layer Geometries using this model

Attributes Documentation

buildStyleDescription

The description of the BuildStyles applied to the Model

buildStyleName

The BuildStyle name applied to the Model

Return type:

str

buildStyles

The BuildStyles associated with this model

Return type:

List[BuildStyle]

mid

The unique id for this Model

Return type:

int

name

The name described by the model

Return type:

str

topLayerId

The Top Layer of all Layer Geometries using this model

Return type:

int