Skip to content

Commit

Permalink
Merge pull request #2 from drlukeparry/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
drlukeparry committed Feb 20, 2021
2 parents c2d9853 + 21094d0 commit 9a25e86
Show file tree
Hide file tree
Showing 36 changed files with 2,462 additions and 332 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install APT On Linux
run: |
sudo apt-get update -qq -y
sudo apt-get install -qq -y libglu1-mesa libspatialindex-c4v5 build-essential
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest
pytest
39 changes: 39 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install APT On Linux
run: |
sudo apt-get update -qq -y
sudo apt-get install -qq -y libglu1-mesa libspatialindex-c4v5 build-essential
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.pyc
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
.egg-info
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
87 changes: 59 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,49 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added
### Changed

### Fixed

## [0.3.0] - 2021-02-20

### Added
- Added BaseHatcher.boundaryBoundingBox() to obtain the bounding box of a collection of polygons - returned internally from PyClipper
- Added a simplifyBoundaries() in hatching/utils.py to simplify polygons (shapely and raw coordinate boundaries using scikit image)
- hatching.generateExposurePoints() now generates for ContourGeometry
- Added a `simplifyBoundaries()` in [hatching/utils.py](pyslm/hatching/utils.py) to simplify polygons (shapely and raw coordinate boundaries using scikit image)
-` hatching.generateExposurePoints()` now generates for `ContourGeometry`
- Added [example_exporting_multilayer.py](examples/example_exporting_multilayer.py) showing how to export a multi-layer build using libSLM - 52090085fd52336e2cc2181ff886a8aebbdca1ef
- Added [example_custom_island_hatcher.py](examples/example_custom_island_hatcher.py) showing a method to create customised island scan
- Added [example_custom_island_hatcher.py](examples/example_custom_island_hatcher.py) showing a method to create customised island scan
- Added a `HexagonIsland` Class to demonstrate custom implementation of island regions
- Added [example_build_time_analysis.py](examples/example_build_time_analysis.py) to show the processes of estimating build-time
- Added [example_custom_sinusoidal_hatching.py](examples/example_custom_sinusoidal_hatching.py) for showing custom hatch-infills - c7c1a4304dd4f2a4cdf0286385ccb68d3968ba5e
- Added a method `BaseHatcher.clipContourLines` for clipping open scan paths to fill a region
- Added an analysis method utility `getBuildStyleById` to find the `BuildStyle` given a model id and build style id
- Added a method in plotLayer to visualise the scan vector properties (e.g. length)
- Added properties for geometry class to be compatible with [libSLM](https://github.com/drlukeparry/libSLM) 0.2.2 - providing multi-laser compatibility
- Added the method `Part.getTrimeshSlice` to get a `trimesh.Path2D` slice from the geometry - bb2ebb9c4514a05cc1728c810deef7fc6c3239e4
- Added a method to find the 'inverse' projection of support faces
- Added `visualise.visualiseOverhang` for showing overhang regions
- Added `geometry.utils.ModelValidator` for validting the build inputs (layers, models) when exporting to a machine build file
- Added a `.gitignore` file - 498d9116dd9d91698695669d5d1309a7941e0dd9

### Changed
- Internally generateHatching() and hatch() in subclasses of BaseHatcher to generate the internal hatch geometry to use multiple boundaries
- Internally generateHatching() and hatch() in subclasses of `BaseHatcher` to generate the internal hatch geometry to use multiple boundaries
to ensure that the subregion generation sorting covers the global region.
- Internally BaseHatcher.boundaryBoundingBox() is called instead of BaseHatcher.polygonBoundingBox()
- Removed the for loop which previously iterate across boundaries.
- Updated IslandHatcher to use this behaviour
- Internally `BaseHatcher.boundaryBoundingBox()` is called instead of `BaseHatcher.polygonBoundingBox()`
- Removed the for loop which previously iterate across boundaries.
- Updated IslandHatcher to use this behaviour
- Updated BaseHatcher to use static members where possible
- Analysis method `analysis.getLayerTime` requires a `Model` list
- Analysis methods use point exposure time and distance using `analysis.getLayerTime`
- Removed debug messages when visualising layers
- Fixed import of submodules in PySLM - 66f48fd9929d244b836583f24c087602cdc31a96

### Fixed
- Jump distance between LayerGeometry is accounted for in analysis submodule
- Fixed `LaserMode`, `LaserType` Enums to be compatible with libSLM - 52090085fd52336e2cc2181ff886a8aebbdca1ef
- Jump distance between `LayerGeometry` is accounted for in the [Analysis Submodule](pyslm/analysis)
- Updated Documentation across the project

## [0.2.1] - 2020-06-19

Expand All @@ -33,49 +62,51 @@ Development branch of PySLM with new features.
- Updates on the geometry are cached when geometry method is called.
- Method included to drop the part to the platform
- Added an enhanced version and higher performance of generated clippable island regions.
- Introduced InnerHatchRegion in the hatching submodule
- Introduce IslandHatcher which re-implements the Island/Checkerboard Scan Strategy
- Introduced `InnerHatchRegion` in the hatching submodule
- Introduce `IslandHatcher` which re-implements the Island/Checkerboard Scan Strategy
- Added a method to alternate adjacent scan vectors in the hatching module
- Added a method to generateExposurePoint method in the hatching submodule to create exposure points from scan vectors
- Added a geometry submodule
- Added a method to `generateExposurePoint` method in the hatching submodule to create exposure points from scan vectors
- Added a Geometry Submodule in [pyslm.geometry](pyslm/geometry)
- libSLM Python Extension Library is used if available
- A set of native compatible Python classes are available if libSLM is not available
- Classes include:
- Layer
- LayerGeometry
- Model
- BuildStyle
- Header
- HatchGeometry, ContourGeometry, PointsGeometry
- Added an analysis module:
- `Layer`
- `LayerGeometry`
- `Model`
- `BuildStyle`
- `Header`
- `HatchGeometry`, `ContourGeometry`, `PointsGeometry`
- Added an Analysis Module in [pyslm.analysis](pyslm/analysis):
- Total length of all the scan vectors across a layer
- Total jump length between scan vectors across all vectors
- Total scan time across a layer
- Added a method to generate bitmap slices from a single image is included in Part
- Added a visualise submodule
- Added a Visualise Submodule in [pyslm.visualise](pyslm/visualise.py)
- Introduced a method to visualise a collection of shapely polygons
- Introduced a method to generate a heatmap based on a set of exposure points in a layer
- Introduced an updated method to plot layerGeometry
- Plot scan order
- Plot arrow direction
- Plot the layers correctly in 3D
- Introduced several new examples:
- 3D slicing example - example_3d.py
- Multi-threading example - example_3d_multithread.py
- Island hatching example using new implementation - example_island_hatcher.py
- Bitmap slicing of parts - example_bitmap_slice.py
- A heat-map/exposure map visualisation - example_island_hatcher.py
- 3D slicing example - [example_3d.py](examples/example_3d.py)
- Multi-threading example - [example_3d_multithread.py](examples/example_3d_multithread.py)
- Island hatching example using new implementation - [example_island_hatcher.py](examples/example_island_hatcher.py)
- Bitmap slicing of parts - [example_bitmap_slice.py](examples/example_bitmap_slice.py)
- A heat-map/exposure map visualisation - [example_heatmap.py](examples/example_heatmap.py)


### Changed
- getVectorSlice method by default returns a list of coord paths
- getVectorSlice now returns a list of Shapely.geometry.Polygon if optional argument is passed
- IslandHatcher in the previous release is changed to BasicIslandHatcher
- `Part.getVectorSlice` method by default returns a list of coord paths
- `Part.getVectorSlice` now returns a list of `Shapely.geometry.Polygon` if optional argument is passed
- `hatching.IslandHatcher` in the previous release is changed to `BasicIslandHatcher`

### Fixed
- Further changes and improvements to the overall documentation.
- Updated requirements.txt to ensure documentation can correctly build on readthedocs

## [0.1.0] - 2020-05-08

The first release of PySLM in its distributed packaged form via PyPi. This release includes basic slicing and
hatching using a custom version of PyClipper built internally using setuptools.


Loading

0 comments on commit 9a25e86

Please sign in to comment.