ModelValidator¶
- class pyslm.geometry.ModelValidator¶
Bases:
objectModelValidator takes the data structures in pyslm.geometry such as a list of
LayerandModeland validates their input for consistency when utilised together to form a machine build file prior to exporting using libSLM. Basic consistency checks include:Validating each
BuildStyleused in eachModel, including individual laser parametersReferences to a correct
BuildStylevia its (bid) for eachLayerGeometryincludedReferences to a correct
Modelvia its (mid) for eachLayerGeometryincludedEnsure there are unique
BuildStyleentries for eachModelincluded
The key function that can be called is
validateBuild(), which is recommended 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
BuildStyleensuring that its individual parameters are not malformed.validateModel(model)Validates a single
Modelensuring that its individualBuildStyleare not malformed.Methods Documentation
- static validateBuild(models, layers)¶
Validates an AM Build which compromises of a list of models and layers
- static validateBuildStyle(bstyle)¶
Validates a single
BuildStyleensuring that its individual parameters are not malformed.- Parameters:
bstyle (
BuildStyle) – The BuildStyle to validate- Return type:
bool- Returns:
True if the structure is coherent and valid
- Raises:
Exception – When an invalid BuildStyle is provided
- static validateModel(model)¶
Validates a single
Modelensuring that its individualBuildStyleare not malformed.- Parameters:
model (
Model) – The Model to validate- Return type:
bool- Returns:
True if the structure of the Model is coherent and valid
- Raises:
Exception – When an invalid BuildStyle is provided