ModelValidator¶
-
class
pyslm.geometry.
ModelValidator
¶ Bases:
object
ModelValidator takes the pyslm.geometry data structures such as a list of
Layer
andModel
and validates their input for consistency when utilised together to form a build file prior to exporting using libSLM. Basic checks include:Validating each
BuildStyle
used in eachModel
, including individual laser parametersReferences to a correct
BuildStyle
via its id (bid) for eachLayerGeometry
sectionReferences to a correct
Model
via its id (mid) for eachLayerGeometry
sectionEnsure there are unique
BuildStyle
entries for eachModel
The key function that can be called is
validateBuild()
which ideally should 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:
- 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
) – TheBuildStyle
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
) – TheModel
to validate- Raises:
Exception – When an invalid
BuildStyle
is provided