{"id":18356575,"url":"https://github.com/drlukeparry/pyslm","last_synced_at":"2025-04-04T07:07:33.919Z","repository":{"id":51222753,"uuid":"330024503","full_name":"drlukeparry/pyslm","owner":"drlukeparry","description":"PySLM: A Python Library for 3D Printing and Additive Manufacturing","archived":false,"fork":false,"pushed_at":"2025-01-12T23:34:10.000Z","size":4932,"stargazers_count":113,"open_issues_count":11,"forks_count":19,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-07T09:13:40.517Z","etag":null,"topics":["3d-printing","additive-manufacturing","dmls","hatching","python","slicer","slm","trimesh"],"latest_commit_sha":null,"homepage":"http://lukeparry.uk/projects/pyslm","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drlukeparry.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-15T21:18:01.000Z","updated_at":"2025-02-03T09:14:01.000Z","dependencies_parsed_at":"2025-02-23T21:09:43.367Z","dependency_job_id":"bb613d7f-38c7-498b-9331-8ce60d4c5804","html_url":"https://github.com/drlukeparry/pyslm","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyslm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyslm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyslm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyslm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drlukeparry","download_url":"https://codeload.github.com/drlukeparry/pyslm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135143,"owners_count":20889421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-printing","additive-manufacturing","dmls","hatching","python","slicer","slm","trimesh"],"created_at":"2024-11-05T22:10:48.224Z","updated_at":"2025-04-04T07:07:33.898Z","avatar_url":"https://github.com/drlukeparry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PySLM Python Library for Selective Laser Melting and Additive Manufacturing\n=============================================================================\n\n.. https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslm.png\n\n.. image:: https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslm.png\n    :alt:  PySLM - Library for Additive Manufacturing and 3D Printing including Selective Laser Melting\n.. image:: https://github.com/drlukeparry/pyslm/actions/workflows/pythonpublish.yml/badge.svg\n    :target: https://github.com/drlukeparry/pyslm/actions\n.. image:: https://readthedocs.org/projects/pyslm/badge/?version=latest\n    :target: https://pyslm.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n.. image:: https://badge.fury.io/py/PythonSLM.svg\n    :target: https://badge.fury.io/py/PythonSLM\n.. image:: https://static.pepy.tech/personalized-badge/pythonslm?period=total\u0026units=international_system\u0026left_color=black\u0026right_color=orange\u0026left_text=Downloads\n :target: https://pepy.tech/project/pythonslm\n\n\nPySLM is a Python library for supporting development and generation of build files in Additive Manufacturing or 3D\nPrinting, in particular Selective Laser Melting (SLM), Direct Metal Laser Sintering (DMLS) platforms typically used\nin both academia and industry. The core capabilities aim to include slicing, hatching and support generation and\nproviding an interface to the binary build file formats available for platforms. The library is built of core classes\nwhich may provide the basic functionality to generate the scan vectors used on systems and also be used as building\nblocks to prototype and develop new algorithms.\n\nThis library provides design tools for use in Additive Manufacturing including the slicing, hatching, support generation\nand related analysis tools (e.g. overhang analysis, build-time estimation).\n\nPySLM is built-upon `Trimesh \u003chttps://github.com/mikedh/trimesh\u003e`_ v4.0 for mesh handling and manipulation\nand the polygon clipping and offsetting provided by `Clipper 2 \u003chttps://github.com/AngusJohnson/Clipper2\u003e`_ library\nvia `Pyclipr \u003chttps://github.com/drlukeparry/pyclipr\u003e`_, which together leveraged to provide the slicing and\nmanipulation of polygons, such as offsetting and clipping of scan vectors used.\n\nThe aims of this library is to provide a useful set of tools for prototyping novel pre-processing approaches to aid\nresearch and development of Additive Manufacturing processes, amongst an academic environment. The tools aim to\ncompliment experimental and analytical studies that can enrich scientific understanding of the process. This includes\ndata-fusion from experiments and sensors within the process but also enhancing the capability of the process by\nproviding greater control over the process. Furthermore, the open nature of the library intends to inform and educate\nthose interested in the underlying algorithms of preparing toolpaths in Additive Manufacturing.\n\nCurrent Features\n******************\n\nPySLM is building up a core feature set aiming to provide the basic blocks for primarily generating the scan paths and\nadditional design features used for AM and 3D printing systems typically (SLM/SLS/SLA) systems which consolidate material\nusing a single/multi point exposure by generating a series of scan vectors in a region.\n\n**Slicing:**\n\n* Slicing of triangular meshes supported via the `Trimesh \u003chttps://github.com/mikedh/trimesh\u003e`_ library.\n* Simplification of 2D layer boundaries\n* Bitmap slicing for SLA, DLP, Inkjet Systems\n\n**Hatching:**\nThe following operations are provided as a convenience to aid the development of novel scan strategies in Selective\nLaser Melting:\n\n* Offsetting of contours and boundaries\n* Trimming of lines and hatch vectors (sequentially ordered and sorted)\n\nThe following scan strategies have been implemented as reference for AM platforms:\n\n* Standard 'alternating' hatching\n* Stripe scan strategy\n* Island or checkerboard scan strategy\n\n**Support Structure Generation**\n\nPySLM provides underlying tools and a framework for identifying and generating support structures suitable for SLM\nand other AM processes. Tools are provided identifying overhang areas based on their mesh and connectivity\ninformation, but also using a projection based method. The projection method takes advantage of GPU GLSL shaders for\nproviding an efficient raytracing approach. Using the `Manifold \u003chttps://github.com/elalish/manifold\u003e`_ boolean CSG\nlibrary, an algorithm for extracting precise definition of volumetric support regions. These regions are segmented\nbased on self-intersections with the mesh. From these volumes, porous grid-truss structure suitable for SLM based\nprocess can be generated.\n\n.. image:: https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslmSupportStructures.png\n    :alt: The tools available in PySLM for locating overhang regions and support regions for 3D Printing and\n          generating volumetric block supports alongside grid-truss based support structures suitable for SLM.\n    :width: 80%\n    :align: center\n\n* Extracting overhang surfaces from meshes with optional connectivity information\n* Projection based block and truss support structure generation\n    * 3D intersected support volumes are generated from overhang regions using OpenGL ray-tracing approach\n    * Generate a truss grid using support volumes suitable for Metal AM processes\n    * Perforated teeth for support connection\n    * Exact support volume generation using `Manifold \u003chttps://github.com/elalish/manifold\u003e`_ CSG library\n\n**Visualisation:**\n\nThe laser scan vectors can be visualised using ``Matplotlib``. The order of the scan vectors can be shown to aid\ndevelopment of the scan strategies, but additional information such length, laser parameter information associated\nwith each scan vector can be shown.\n\n.. image:: https://github.com/drlukeparry/pyslm/raw/dev/docs/images/pyslmVisualisationTools.png\n    :alt: The tools available in PySLM for visualising analyisng collections of scan vectors used in SLM.\n    :width: 80%\n    :align: center\n\n* Scan vector plots (including underlying BuildStyle information and properties)\n* Exposure point visualisation\n* Exposure (effective heat) map generation\n* Overhang visualisation\n\n**Analysis:**\n\n* Build time estimation tools\n    * Based on scan strategy and geometry\n    * Time estimation based on LayerGeometry\n* Iterators (Scan Vector and Exposure Points) useful for simulation studies\n\n**Export to Machine Files:**\n\nCurrently the capability to enable translation to commercial machine build platforms is being providing through a\nsupporting library called `libSLM \u003chttps://github.com/drlukeparry/libSLM\u003e`_ . This is a c++ library to enable efficient\nimport and export across various commercial machine build files. With support from individuals the following machine\nbuild file formats have been developed.\n\n* Renishaw MTT (**.mtt**),\n* DMG Mori Realizer (**.rea**),\n* CLI/CLI+ \u0026 .ilt (**.cli**/**.ilt**),\n* EOS SLI formats (**.sli**)\n* SLM Solutions (**.slm**).\n\nIf you would like to support implementing a custom format, please raise a `request \u003chttps://github.com/drlukeparry/pyslm/issues\u003e`_.\nFor further information, see the latest `release notes \u003chttps://github.com/drlukeparry/pyslm/blob/dev/CHANGELOG.md\u003e`_.\n\nInstallation\n*************\nInstallation is currently supported on Windows, Mac OS X and Linux environments. The pre-requisites for using PySLM\ncan be installed via PyPi and/or Anaconda distribution.\n\n.. code:: bash\n\n    conda install -c conda-forge shapely, Rtree, networkx, scikit-image\n    conda install trimesh\n\nIf you are interested using the support generation module, there are additional dependencies that\nare required to be installed. These are not required for the core functionality of PySLM such as slicing and hatching.\nThese require a working OpenGL environment to work via `vispy \u003chttps://vispy.org\u003e`_ - the PyQt5 module provides the\nOpenGL backend for this currently, which is currently supported across all major platforms.\n\n.. code:: bash\n\n    pip install vispy pyqt5 triangle pyclipr manifold3d mapbox-earcut\n\nInstallation of PySLM can be performed using pre-built python packages using the PyPi repository. Additionally to\ninterface with commercial L-PBF systems, the user can choose to install libSLM. Note, the user should contact the author\nto request machine build file translators, as this cannot be installed currently without having the machine build file\ntranslators available.\n\n.. code:: bash\n\n    pip install PythonSLM\n\nAlternatively, PySLM may be compiled directly from source. For PySLM version (\u003ev0.6) the entire library are now written\nexclusively in Python, therefore a seperate compiler infrastructure (cython) is not required.\n\n.. code:: bash\n\n    git clone https://github.com/drlukeparry/pyslm.git \u0026\u0026 cd ./pyslm\n    python setup.py install\n\nUsage\n******\nA basic example below, shows how relatively straightforward it is to generate a single layer from a STL mesh which\ngenerates a the hatch infill using a Stripe Scan Strategy typically employed on some commercial systems to limit the\nmaximum scan vector length generated in a region.\n\n.. code:: python\n\n    import pyslm\n    import pyslm.visualise\n    from pyslm import hatching as hatching\n\n    # Imports the part and sets the geometry to an STL file (frameGuide.stl)\n    solidPart = pyslm.Part('myFrameGuide')\n    solidPart.setGeometry('../models/frameGuide.stl')\n\n    # Set te slice layer position\n    z = 23.\n\n    # Create a StripeHatcher object for performing any hatching operations\n    myHatcher = hatching.StripeHatcher()\n    myHatcher.stripeWidth = 5.0 # [mm]\n\n    # Set the base hatching parameters which are generated within Hatcher\n    myHatcher.hatchAngle = 10 # [°]\n    myHatcher.volumeOffsetHatch = 0.08 # [mm]\n    myHatcher.spotCompensation = 0.06 # [mm]\n    myHatcher.numInnerContours = 2\n    myHatcher.numOuterContours = 1\n\n    # Slice the object at Z and get the boundaries\n    geomSlice = solidPart.getVectorSlice(z)\n\n    # Perform the hatching operations\n    layer = myHatcher.hatch(geomSlice)\n\n    # Plot the layer geometries generated\n    pyslm.visualise.plot(layer, plot3D=False, plotOrderLine=True) # plotArrows=True)\n\nThe result of the script output is shown here\n\n.. image:: https://github.com/drlukeparry/pyslm/raw/dev/docs/images/stripe_scan_strategy_example.png\n   :width: 50%\n   :align: center\n   :alt:  PySLM - Illustration of a Stripe Scan Strategy employed in 3D printing\n\nFor further guidance please look at documented examples are provided in\n`examples \u003chttps://github.com/drlukeparry/pyslm/tree/master/examples\u003e`_ .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrlukeparry%2Fpyslm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrlukeparry%2Fpyslm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrlukeparry%2Fpyslm/lists"}