Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
luktug-ltd committed Jul 24, 2024
2 parents 2046afe + d983ee2 commit 33c95d3
Show file tree
Hide file tree
Showing 61 changed files with 4,478 additions and 8,092 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
name: Upload Python Package

on:
push:
branches: [ master ]
release:
types: [published]

jobs:
deploy:

runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]

python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
exclude:
- os: ubuntu-latest
python-version: '3.12'
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.11"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand Down
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,56 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

### Fixed

### Changed

## [0.6.0] - 2024-07-07

### Added
- Added documentation covering basic example usage for the operation of PySLM [8eee1f96f13b4b7915ea862ee643984f8e1e2f41](https://github.com/drlukeparry/pyslm/commit/8eee1f96f13b4b7915ea862ee643984f8e1e2f41)
- In `pyslm.support` added a method for sweeping polygons along a path `sweepPolygon` based on Trimesh [7ac9e4fd771fa6abc65753c21735c1592dbc9aa1](https://github.com/drlukeparry/pyslm/commit/7ac9e4fd771fa6abc65753c21735c1592dbc9aa1)
- In `pyslm.support` for `BlockSupportBase` that are connected directly to the baseplate are now smoothly created [df2dd41e0b04160a7ed4c96f8f7c0aed71003430](https://github.com/drlukeparry/pyslm/commit/df2dd41e0b04160a7ed4c96f8f7c0aed71003430)
- In `pyslm.support` added perforated teeth to the upper and lower surfaces of `GridBlockSupport` [70c510cce31b0cb297873252fa72c2f67b386423](https://github.com/drlukeparry/pyslm/commit/70c510cce31b0cb297873252fa72c2f67b386423)
- In `pyslm.support` added a method for checking the approximate intersection of a cylindrical strut `checkStrutCylinderIntersection` [f2baa3383b1c01512d3a74d74af65931b14f7986](https://github.com/drlukeparry/pyslm/commit/f2baa3383b1c01512d3a74d74af65931b14f7986)
- In `pyslm.support` added regions for strengthening the support on upper and lower regions of both the skin and slices in
`GridBlockSupport` [0121971813e50296e3f6d9bab0beb431067443d2](https://github.com/drlukeparry/pyslm/commit/0121971813e50296e3f6d9bab0beb431067443d2)
- In `pyslm.support.GridBlockSupport` added methods for labelling generated geometry based on the interior X,Y grid and across the skin [71fb3efd1a8376809850f83760639fa331181436](https://github.com/drlukeparry/pyslm/commit/71fb3efd1a8376809850f83760639fa331181436)
- In `pyslm.support.GridBlockSupport` added methods for slicing the geometry into layers and performing sorting to provide correct orientation [4c7000b604b3f231d0160312aa2cd5a170de69f1](https://github.com/drlukeparry/pyslm/commit/4c7000b604b3f231d0160312aa2cd5a170de69f1)
- Added methods `pyslm.hatching.poly2paths` , `pyslm.hatching.paths2clipper` and `pyslm.hatching.clipper2paths` for conversion
between shapely polygons and pyclipr paths [adcb371e62e45a5dbadfa46e4e5589a0f5cb28ae](https://github.com/drlukeparry/pyslm/commit/adcb371e62e45a5dbadfa46e4e5589a0f5cb28ae)
- In `pyslm.support.GridBlockSupport` the grid truss slices include additional face-attributes `order` and `type` describing
their order of generation across X,Y planes. This is used for the scan order when slicing and hatching these regions

### Fixed
- Fixed a bug in 'pyslm.hatching.BaseHatcher.hatch' - internal contour is offset when needed [344941fdd951152b69d81e97a957fd2709251151](https://github.com/drlukeparry/pyslm/commit/344941fdd951152b69d81e97a957fd2709251151)
- Fixed a bug in `pyslm.support.GridBlockSupport` - fixes for identifying top and bottom paths of the skin and fixed ordering during slicing - [7d4c9e1294f17334f97016c22062eccd3111b2a6](https://github.com/drlukeparry/pyslm/commit/7d4c9e1294f17334f97016c22062eccd3111b2a6)
- Fixed a bug in `BlockSupportGenerator.identifySupportRegions` where supports connected to the build-plate were not self-intersected with the original mesh - [f1d9c95a5921bf6070799f05fd940cc056d852b1](https://github.com/drlukeparry/pyslm/commit/f1d9c95a5921bf6070799f05fd940cc056d852b1)
- Fixed a bug in `pyslm.analysis.getLayerGeometryTime` where the jump distance was not correctly calculated resulting
in an `NaN` by dividing by zero by checking the build-style jump speed is greater than zero [d169b30302e79c73ea37f9759feff72784dda4e6](https://github.com/drlukeparry/pyslm/commit/d169b30302e79c73ea37f9759feff72784dda4e6)
- Fixed a bug in `pyslm.analysis.getLayerGeometryTime` where the jump delay was not added and default argument is used
alternatively in the calculation [3d996ef44284959d40b81918ecfbfba4ef240d0c](https://github.com/drlukeparry/pyslm/commit/3d996ef44284959d40b81918ecfbfba4ef240d0c)
- Fixed bug in `pyslm.support.render.Canvas` not capturing the depth correctly - [114ffa9259f844549c4aa509c5e3d4b2db4ab081](https://github.com/drlukeparry/pyslm/commit/114ffa9259f844549c4aa509c5e3d4b2db4ab081)
- Invalid projection of extruded prismatic mesh in `support.GridBlockSupportGenerator.identifySupportMethods`. Generated mesh
is not automatically processed by Trimesh prior to extrusion to prevent mismatch between vertices. [df2dd41e0b04160a7ed4c96f8f7c0aed71003430](https://github.com/drlukeparry/pyslm/commit/df2dd41e0b04160a7ed4c96f8f7c0aed71003430)
- Fixed the `pyslm.support` module to use manifold3D library instead of pycork [df2dd41e0b04160a7ed4c96f8f7c0aed71003430](https://github.com/drlukeparry/pyslm/commit/df2dd41e0b04160a7ed4c96f8f7c0aed71003430)
- Updated to Trimesh version 4.0 [081dede9a14357fe9fb706470a5d42e698b763a6](https://github.com/drlukeparry/pyslm/commit/081dede9a14357fe9fb706470a5d42e698b763a6)
- Update to Shapely Library version 2.0 [081dede9a14357fe9fb706470a5d42e698b763a6](https://github.com/drlukeparry/pyslm/commit/081dede9a14357fe9fb706470a5d42e698b763a6)
- Fixes for IslandHatcher when processing empty regions [f9ff55ecc2709c3514b1d14f815cb2620856be97](https://github.com/drlukeparry/pyslm/commit/f9ff55ecc2709c3514b1d14f815cb2620856be97)
- `pyslm.visualise.plot` will now plot point geometries when included [ddb7f27f6c18b6d494870e5823dbede7987e2e12](https://github.com/drlukeparry/pyslm/commit/ddb7f27f6c18b6d494870e5823dbede7987e2e12)
- In `pyslm.visaulise.plot`, the method will correctly plot `shapely.geometry.MultiPolygon` after the update to Shapely 2.0 [99c7a475e10b9c138e061f56aa28f7780f2a5eac](https://github.com/drlukeparry/pyslm/commit/99c7a475e10b9c138e061f56aa28f7780f2a5eac)
- Update imports to prevent namespace polluting
- In `pyslm.analysis` fixed bug for build-time calculation using `pyslm.geometry.PointsGeometry` [7f1e42ae6b30ee157a96303fa6e0b6e5632eabfd](https://github.com/drlukeparry/pyslm/commit/7f1e42ae6b30ee157a96303fa6e0b6e5632eabfd)

### Changed
- Change PySLM to use manifold library instead of pycork [bad0fc0285835e998a3acdb02afa7e0ed02619ee](https://github.com/drlukeparry/pyslm/commit/bad0fc0285835e998a3acdb02afa7e0ed02619ee)
- Change PySLM to use pyclipr library [081dede9a14357fe9fb706470a5d42e698b763a6](https://github.com/drlukeparry/pyslm/commit/dda04c15b66ace3c487bc5e20acd806dda1ba89a)
- `pyslm.visualise.plot` by default only plots for a single layer [02ccc1d503580cea802d996f6d6532c2f7526c8f](https://github.com/drlukeparry/pyslm/commit/02ccc1d503580cea802d996f6d6532c2f7526c8f)
- Removal of custom pyclipper bindings and removing the requirement for compiling via cython [f434d77c8670bbb0bf5e289d9b7d2c011a9dcc92](https://github.com/drlukeparry/pyslm/commit/f434d77c8670bbb0bf5e289d9b7d2c011a9dcc92)
- Cannot currently use` `mergeMesh` in `pyslm.support.GridBlockSupport` due to change to the manifold boolean CSG library

## [0.5.0] - 2022-04-26

### Added
Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ include README.rst
include CHANGELOG.md

include examples/*.py
include models/*
include external/pyclipper/*
include models/*
88 changes: 49 additions & 39 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,39 @@ PySLM Python Library for Selective Laser Melting and Additive Manufacturing
.. https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslm.png
.. image:: https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslm.png
:alt: PySLM - Library for Additive Manufacturing and 3D Printing including Selective Laser Melting

:alt: PySLM - Library for Additive Manufacturing and 3D Printing including Selective Laser Melting
.. image:: https://github.com/drlukeparry/pyslm/actions/workflows/pythonpublish.yml/badge.svg
:target: https://github.com/drlukeparry/pyslm/actions
.. image:: https://readthedocs.org/projects/pyslm/badge/?version=latest
:target: https://pyslm.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://badge.fury.io/py/PythonSLM.svg
:target: https://badge.fury.io/py/PythonSLM
.. image:: https://badges.gitter.im/pyslm/community.svg
:target: https://gitter.im/pyslm/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
:alt: Chat on Gitter
.. image:: https://static.pepy.tech/personalized-badge/pythonslm?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads
:target: https://pepy.tech/project/pythonslm


PySLM is a Python library for supporting development of input files used in Additive Manufacturing or 3D Printing,
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.
PySLM is a Python library for supporting development and generation of build files in Additive Manufacturing or 3D
Printing, 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 <https://github.com/mikedh/trimesh>`_ and based on some custom modifications
to the `PyClipper <https://pypi.org/project/pyclipper/>`_ libraries, which are leveraged to provide the slicing and
manipulation of polygons, such as offsetting and clipping of lines.
PySLM is built-upon `Trimesh <https://github.com/mikedh/trimesh>`_ v4.0 for mesh handling and manipulation
and the polygon clipping and offsetting provided by `Clipper 2 <https://github.com/AngusJohnson/Clipper2>`_ library
via `Pyclipr <https://github.com/drlukeparry/pyclipr>`_, which together leveraged to provide the slicing and
manipulation of polygons, such as offsetting and clipping of scan vectors used.

The aims of this library is to provide a useful set of tools for prototyping novel pre-processing approaches to aid
research and development of Additive Manufacturing processes, amongst an academic environment. The tools aim to compliment
experimental and analytical studies that can enrich scientific understanding of the process. This includes data-fusion
from expeirments and sensors within the process but also enahcning the capability of the process by providing greater control
over the process. Furthermore, the open nature of the library intends to inform and educate those interested in the
underlying algorithms of preparing toolpaths in Additive Manufacturing.
research and development of Additive Manufacturing processes, amongst an academic environment. The tools aim to
compliment experimental and analytical studies that can enrich scientific understanding of the process. This includes
data-fusion from experiments and sensors within the process but also enhancing the capability of the process by
providing greater control over the process. Furthermore, the open nature of the library intends to inform and educate
those interested in the underlying algorithms of preparing toolpaths in Additive Manufacturing.

Current Features
******************
Expand Down Expand Up @@ -69,12 +66,13 @@ The following scan strategies have been implemented as reference for AM platform

**Support Structure Generation**

PySLM provides underlying tools and a framework for identifying and generating support structures suitable for SLM.
Tools are provided identifying overhang areas based on their mesh and connectivity information, but also
usingprojection based method. The projection method takes advantage of GPU GLSL shaders for providing an efficient
raytracing approach. Using the `PyCork <https://github.com/drlukeparry/pycork>`_ boolean CSG library, an algorithm for
extracting precise defintion of volumetric support regions. These regions are segmented based on self-intersections with
the mesh. From these volumes, porous grid-truss structure suitable for SLM based process can be generated.
PySLM provides underlying tools and a framework for identifying and generating support structures suitable for SLM
and other AM processes. Tools are provided identifying overhang areas based on their mesh and connectivity
information, but also using a projection based method. The projection method takes advantage of GPU GLSL shaders for
providing an efficient raytracing approach. Using the `Manifold <https://github.com/elalish/manifold>`_ boolean CSG
library, an algorithm for extracting precise definition of volumetric support regions. These regions are segmented
based on self-intersections with the mesh. From these volumes, porous grid-truss structure suitable for SLM based
process can be generated.

.. image:: https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslmSupportStructures.png
:alt: The tools available in PySLM for locating overhang regions and support regions for 3D Printing and
Expand All @@ -86,7 +84,8 @@ the mesh. From these volumes, porous grid-truss structure suitable for SLM based
* Projection based block and truss support structure generation
* 3D intersected support volumes are generated from overhang regions using OpenGL ray-tracing approach
* Generate a truss grid using support volumes suitable for Metal AM processes
* Exact support volume generation using the `pycork <https://github.com/drlukeparry/pycork>`_ library
* Perforated teeth for support connection
* Exact support volume generation using `Manifold <https://github.com/elalish/manifold>`_ CSG library

**Visualisation:**

Expand Down Expand Up @@ -120,6 +119,7 @@ build file formats have been developed.

* Renishaw MTT (**.mtt**),
* DMG Mori Realizer (**.rea**),
* CLI/CLI+ & .ilt (**.cli**/**.ilt**),
* EOS SLI formats (**.sli**)
* SLM Solutions (**.slm**).

Expand All @@ -128,25 +128,34 @@ For further information, see the latest `release notes <https://github.com/drluk

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

.. code:: bash
conda install -c conda-forge shapely, Rtree, networkx, scikit-image, cython
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, as this cannot be installed currently without having the machine build file
If you are interested using the support generation module, there are additional dependencies that
are required to be installed. These are not required for the core functionality of PySLM such as slicing and hatching.
These require a working OpenGL environment to work via `vispy <https://vispy.org>`_ - the PyQt5 module provides the
OpenGL backend for this currently, which is currently supported across all major platforms.

.. code:: bash
pip install vispy pyqt5 triangle pyclipr manifold3d mapbox-earcut
Installation of PySLM can be performed using pre-built python packages using the PyPi repository. Additionally to
interface with commercial L-PBF systems, the user can choose to install libSLM. Note, the user should contact the author
to request machine build file translators, as this cannot be installed currently without having the machine build file
translators available.

.. code:: bash
pip install PythonSLM
Alternatively, PySLM may be compiled directly from source. Currently the prerequisites are the cython package and a compliant c++
build environment.
Alternatively, PySLM may be compiled directly from source. For PySLM version (>v0.6) the entire library are now written
exclusively in Python, therefore a seperate compiler infrastructure (cython) is not required.

.. code:: bash
Expand All @@ -155,9 +164,9 @@ build environment.
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.
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.

.. code:: python
Expand All @@ -174,7 +183,7 @@ length generated in a region.
# Create a StripeHatcher object for performing any hatching operations
myHatcher = hatching.StripeHatcher()
myHatcher.stripeWidth = 5.0
myHatcher.stripeWidth = 5.0 # [mm]
# Set the base hatching parameters which are generated within Hatcher
myHatcher.hatchAngle = 10 # [°]
Expand All @@ -199,4 +208,5 @@ The result of the script output is shown here
:align: center
:alt: PySLM - Illustration of a Stripe Scan Strategy employed in 3D printing

For further guidance please look at documented examples are provided in `examples <https://github.com/drlukeparry/pyslm/tree/master/examples>`_ .
For further guidance please look at documented examples are provided in
`examples <https://github.com/drlukeparry/pyslm/tree/master/examples>`_ .
Loading

0 comments on commit 33c95d3

Please sign in to comment.