ModelValidator

class pyslm.geometry.ModelValidator

Bases: object

ModelValidator takes the data structures in pyslm.geometry such as a list of Layer and Model and validates their input for consistency when utilised together to form a machine build file prior to exporting using libSLM. Basic consistency checks include:

The key function that can be called is validateBuild(), which is recommened to be called before attempting to export the layer and model information to a libSLM machine build file translator. Additional sub-functions are also available for checking specific objects used to construct the build-file.

Methods Summary

validateBuild(models, layers)

Validates an AM Build which compromises of a list of models and layers

validateBuildStyle(bstyle)

Validates a single BuildStyle ensuring that its individual parameters are not malformed.

validateModel(model)

Validates a single Model ensuring that its individual BuildStyles are not malformed.

Methods Documentation

static validateBuild(models, layers)

Validates an AM Build which compromises of a list of models and layers

Parameters:
  • models (List[Model]) – A list of Models used in the build

  • layers (List[Layer]) – A list of Layers used in the build

Raises:

Exception – When an invalid BuildStyle is provided

static validateBuildStyle(bstyle)

Validates a single BuildStyle ensuring that its individual parameters are not malformed.

Parameters:

bstyle (BuildStyle) – The BuildStyle to validate

Raises:

Exception – When an invalid BuildStyle is provided

static validateModel(model)

Validates a single Model ensuring that its individual BuildStyles are not malformed.

Parameters:

model (Model) – The Model to validate

Raises:

Exception – When an invalid BuildStyle is provided