Skip to main content

Python Package for Additive Manufacturing Development

Project description

https://github.com/drlukeparry/pyslm/workflows/Python%20application/badge.svg Documentation Status https://badge.fury.io/py/PythonSLM.svg Chat on Gitter

PySLM is a python library for supporting development of input files used in Additive Manufacturing, in particular Selective Laser Melting (SLM), Direct Metal Laser Sintering (DMLS) platforms typically used in both academia and industry. The core capabilities aim to include slicing, hatching and support generation and providing an interface to the binary build file formats available for platforms. The library is built of core classes which may provide the basic functionality to generate the scan vectors used on systems and also be used as building blocks to prototype and develop new algorithms.

This library provides design tools for use in Additive Manufacturing including the slicing, hatching, support generation and related analysis tools (e.g. overhang analysis, build-time estimation).

PySLM is built-upon python libraries Trimesh and based on some custom modifications to the PyClipper libraries which are leveraged to provide the slicing and manipulation of polygons, such as offsetting and clipping of lines. Additional functionality will be added to provide basic capabilities.

The aims is this library provides especially for an academic environment, a useful set of tools for prototyping and used in-conjunction with simulation and analytic studies.

Current Features

PySLM is building up a core feature set aiming to provide the basic blocks for primarily generating the scan paths and additional design features used for AM systems typically (SLM/SLS/SLA) systems which consolidate material using a single/multi point exposure by generating a series of scan vectors in a region.

Support Structure Generation

  • [TODO] A prototype for support structure generation

Slicing:

  • Slicing of triangular meshes supported via the Trimesh library.

  • Simplification of 2D layer boundaries

  • Bitmap slicing for SLA, DLP, Inkjet Systems

Hatching: The following operations are provided as a convenience to aid developing the scan strategies:

  • Offsetting of contours and boundaries

  • Trimming of lines and hatch vectors (sequentially ordered)

The following scan strategies have been implemented as reference on platforms:

  • Standard ‘Alternating’ hatching

  • Stripe Scan Strategy

  • Island or Checkerboard Scan Strategy

Visualisation:

The laser scan vectors can be visualised using Matplotlib. The order of the scan vectors can be shown to aid development of the scan strategies.

  • Scan vector plots

  • Exposure point visualisation

  • Exposure map generation

  • Overhang visualisation

Analysis: * Build time estimation tools (based on scan strategy)

Export to Machine Files:

Currently the capability to enable translation to commercial machine build platforms is being providing through a supporting library called libSLM . This is a c++ library to enable efficient import and export across various commercial machine build files. Work is underway to support the following file formats. If you would like to support implementing a custom format, please raise a request.

  • Renishaw MTT (.mtt),

  • DMG Mori Realizer (.rea),

  • EOS SLI formats (.sli) - WIP,

  • SLM Solutions (.slm) - WIP .

For further information, see the latest release notes.

Installation

Installation is currently supported on Windows and Linux environments. The pre-requisites for using PySLM can be installed via PyPi and/or Anaconda distribution.

conda install -c conda-forge shapely, Rtree, networkx, scikit-image
conda install trimesh

Installation of pySLM can then be performed using pre-built python packages using the PyPi repository. Additionally to interface with commercial systems, the user can choose to install libSLM. Note, the user should contact the author to request machine build file translators.

pip install libSLM
pip install PythonSLM

Alternatively, PySLM may be compiled from source. Currently the prerequisites are the cython package and a compliant c++ build environment.

git clone https://github.com/drlukeparry/pyslm.git && cd ./pyslm
python setup.py install

Usage

A basic example below, shows how relatively straightforward it is to generate a single layer from a STL mesh which generates a the hatch infill using a Stripe Scan Strategy typically employed on some commercial systems to limit the maximum scan vector length generated in a region.

import pyslm
from pyslm import hatching as hatching

# Imports the part and sets the geometry to  an STL file (frameGuide.stl)
solidPart = pyslm.Part('myFrameGuide')
solidPart.setGeometry('../models/frameGuide.stl')

# Set te slice layer position
z = 23.

# Create a StripeHatcher object for performing any hatching operations
myHatcher = hatching.StripeHatcher()
myHatcher.stripeWidth = 5.0

# Set the base hatching parameters which are generated within Hatcher
myHatcher.hatchAngle = 10 # [°]
myHatcher.volumeOffsetHatch = 0.08 # [mm]
myHatcher.spotCompensation = 0.06 # [mm]
myHatcher.numInnerContours = 2
myHatcher.numOuterContours = 1

# Slice the object
geomSlice = solidPart.getVectorSlice(z)

#Perform the hatching operations
layer = myHatcher.hatch(geomSlice)

# Plot the layer geometries
pyslm.visualise.plot(layer, plot3D=False, plotOrderLine=True) # plotArrows=True)

For further guidance please look at documented examples are provided in examples .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PythonSLM-0.3.0.tar.gz (206.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

PythonSLM-0.3.0-cp38-cp38-win_amd64.whl (249.0 kB view details)

Uploaded CPython 3.8Windows x86-64

PythonSLM-0.3.0-cp37-cp37m-win_amd64.whl (246.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

File details

Details for the file PythonSLM-0.3.0.tar.gz.

File metadata

  • Download URL: PythonSLM-0.3.0.tar.gz
  • Upload date:
  • Size: 206.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.6

File hashes

Hashes for PythonSLM-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fd00b560134a85a173d27bb31dfe7643860d2ee645f1b3dc4784ec867c35dee0
MD5 038e7363990ad94177524ba71cd0ea38
BLAKE2b-256 c2015b77810825d7398fe20180c82c0ed3289a482e7293b0d3e5710a8baa76c8

See more details on using hashes here.

File details

Details for the file PythonSLM-0.3.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: PythonSLM-0.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 249.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.6

File hashes

Hashes for PythonSLM-0.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9e45fa4317cb25a870857fc840a473d7a56b9aab5824291e9a6953a6113a6151
MD5 1d5298fb8d48c51c2397024c9636a69f
BLAKE2b-256 bc6f6a0ecf74c74d5d1372e33caa0ca466023cd7a55693d03c66028f6dfeed46

See more details on using hashes here.

File details

Details for the file PythonSLM-0.3.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: PythonSLM-0.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 246.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.6

File hashes

Hashes for PythonSLM-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 761997faf4fc45dbad6592edb82b5b8d777ac5b963e9dc78cd47d20393fa5df3
MD5 5528a4159f6c4c2c03d65882bd2acbf7
BLAKE2b-256 69d5dc2ed767a2f58ed8917e3ffb94bd56360f69c31eafc9ad48e54b1df7c26d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page