PySLM Python Library for Selective Laser Melting and Additive Manufacturing

Overview

PySLM Python Library for Selective Laser Melting and Additive Manufacturing

Documentation Status Chat on Gitter https://static.pepy.tech/personalized-badge/pythonslm?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads

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.

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 and 3D printing 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, but additional information such length, laser parameter information associated with each scan vector can be shown.

  • Scan vector plots (including underlying BuildStyle information and properties)
  • Exposure point visualisation
  • Exposure (effective heat) map generation
  • Overhang visualisation

Analysis: * Build time estimation tools (based on scan strategy and geometry) * Iterators (Scan Vector and Exposure Point) for Simulation

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).

For further information, see the latest release notes.

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.

conda install -c conda-forge shapely, Rtree, networkx, scikit-image, cython
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 translators available.

pip install libSLM
pip install PythonSLM

Alternatively, PySLM may be compiled directly 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
import pyslm.visualise
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 .

Comments
  • Using the pyslm.hatching.*Hatcher with shapely object as input

    Using the pyslm.hatching.*Hatcher with shapely object as input

    Hi, i'm trying to use some of the pySLM methods to do some basic hatching for robot tool path generation (there are not so many hatching implementation out there).

    The idea is to create a shapely.Polygon oder shapely.LineString from a set of arbitrary points (x,y). Then i like to feed this polygon into one of the Hatchers from pySLM.

    The examples use getVectorSlice() for generating input for the .hatch() method.

    Can i generate the input for hatching from shapely Objects? Or would it be possible to generate input directly based on some list of points that describe a polygon?

    The whole point is to generate paths for some laser cladding application, where the surface boundaries are extracted from some CAD document via FreeCAD.

    documentation question 
    opened by jkur 5
  • Facing error while running the code

    Facing error while running the code

    zsh: command not found: import zsh: command not found: import zsh: command not found: import from: can't read /var/mail/pyslm zsh: number expected zsh: number expected

    Found when I ruined example after installing PythonSLM % pip install PythonSLM Requirement already satisfied: PythonSLM in /opt/anaconda3/lib/python3.9/site-packages (0.4.2) Requirement already satisfied: triangle in /opt/anaconda3/lib/python3.9/site-packages (from PythonSLM) (20200424) Requirement already satisfied: numpy in /opt/anaconda3/lib/python3.9/site-packages (from PythonSLM) (1.20.3) Requirement already satisfied: setuptools in /opt/anaconda3/lib/python3.9/site-packages (from PythonSLM) (58.0.4) Requirement already satisfied: shapely in /opt/anaconda3/lib/python3.9/site-packages (from PythonSLM) (1.8.0) Requirement already satisfied: trimesh in /opt/anaconda3/lib/python3.9/site-packages (from PythonSLM) (3.9.35) Requirement already satisfied: cython in /opt/anaconda3/lib/python3.9/site-packages (from PythonSLM) (0.29.24)

    Please help me out

    opened by adi18997 4
  • Debug Output in Release Version

    Debug Output in Release Version

    Hello,

    While testing a fresh install of the library, there seems to be a lot of what equates to debug output (ignore the "Processing Layers"; that's just tqdm): image

    Is this intentional, or is there a good reason for this? I'd think output like this isn't useful to the end user and would be better off deleted or optionally enabled. It's messing with my tqdm progress bars and I wanted to double-check if there is a specific reason why this is still around in the library, particularly on the master branch. Note that I built from source to achieve this result; I have no idea if the PyPi version would exhibit this behavior.

    enhancement 
    opened by aacitelli 4
  • Error when try to replay the example: no module named'pyslm.visualise'

    Error when try to replay the example: no module named'pyslm.visualise'

    import pyslm import pyslm.visualise Traceback (most recent call last): File "<pyshell#5>", line 1, in import pyslm.visualise ModuleNotFoundError: No module named 'pyslm.visualise'

    Can you please help?

    bug 
    opened by TomyTiger 3
  • Hatches being output in unexpected order

    Hatches being output in unexpected order

    Here's a short video to demonstrate: Animation

    I want the vectors to be output strictly top-right to bottom-left (the direction of the hatch angle, or 90deg from it - you get the gist). However, I'm seeing that some vectors entirely below the hole are being output before some vectors to the right of the hole. I want vectors directly parallel, across from each other across the hole, to be burned one right after another, so you get a nice, linear progression down and to the left (in this example).

    Any idea what's going on here? Am I right to assume this could be remedied by LinearSort (which I've submitted a separate issue for, as I think it's flawed)?

    Thank you!

    bug 
    opened by aacitelli 3
  • Add jump vector display

    Add jump vector display

    It is often useful to be able to view jump vectors; this PR adds a keyword argument, plotJumps, to the plot() function, which causes it to plot all the jump vectors in a dark gray color (to avoid conflicts with the usual heatmap).

    Example Output: image

    If you'd like me to open a PR to a different branch or for me to change anything, let me know.

    enhancement 
    opened by aacitelli 3
  • Issues with visualize.plot()

    Issues with visualize.plot()

    I was able to successfully install pyslm and run the basic example code. However, I am not getting any output from pyslm.visualise.plot(layer, plot3D=False, plotOrderLine=True)

    Running on windows Python 3.7.9 PythonSLM 0.5.0. Any suggestions on how to address this would be appreciated.

    question 
    opened by aksvaidya 2
  • Unexpected Slicing and Hatching result

    Unexpected Slicing and Hatching result

    Hey,

    For some models i got an unexpected result after using the slicing and hatching algorithm. I used a slightly modified version of your "example_3d_multithread.py" script as a template to visualise the unexpected results for you:

    expected Result: GoodResult

    unexpected Result: BadResult

    As you can see some areas are closed incorrectly in some layers within the model. I dont know exactly how to fix this problem and if this is an issue with the model itself (model should be watertight), the slicing algorithm or the hatching algorithm. Maybe you have some ideas. You can find the used source code and the *.stl file below.

    ScriptAndModel.zip

    """
    A simple example showing how to use PySLM for generating slices across a 3D model.
    THhs example takes advantage of the multi-processing module to run across multiple threads.
    """
    import pyslm
    import pyslm.visualise
    from pyslm import hatching as hatching
    import numpy as np
    import time
    
    from multiprocessing import Manager
    from multiprocessing.pool import Pool
    from multiprocessing import set_start_method
    
    def calculateLayer(input):
        # Typically the hatch angle is globally rotated per layer by usually 66.7 degrees per layer
        d = input[0]
        zid= input[1]
    
        layerThickness = d['layerThickness']
        solidPart = d['part']
    
        # Create a StripeHatcher object for performing any hatching operations
        myHatcher = hatching.Hatcher()
    
        # Set the base hatching parameters which are generated within Hatcher
        myHatcher.hatchAngle            = 45 + zid * 66.7
        myHatcher.volumeOffsetHatch     = 0.07
        myHatcher.spotCompensation      = 0.1
        myHatcher.numInnerContours      = 0
        myHatcher.numOuterContours      = 1
        myHatcher.hatchDistance         = 0.12
        myHatcher.hatchSortMethod       = hatching.AlternateSort()
    
        # Slice the boundary
        geomSlice = solidPart.getVectorSlice(zid*layerThickness)
    
        # Hatch the boundary using myHatcher
        layer = myHatcher.hatch(geomSlice)
    
        if layer:
            # The layer height is set in integer increment of microns to ensure no rounding error during manufacturing
            layer.z = int(zid*layerThickness * 1000)
            layer.layerId = int(zid)
    
            return layer
        else:
            return None
    
    def main():
        set_start_method("spawn")
    
        # Imports the part and sets the geometry to  an STL file (frameGuide.stl)
        solidPart = pyslm.Part('bridge')
        solidPart.setGeometry('bridge_slm_cad.stl')
    
        solidPart.origin[0]     = 0.0
        solidPart.origin[1]     = 0.0
        solidPart.scaleFactor   = 1.0
        solidPart.rotation      = [0.0, 0.0, 0.0]
        solidPart.dropToPlatform()
        print(solidPart.boundingBox)
    
        # Set the layer thickness
        layerThickness = 0.03 # [mm]
    
        #Perform the hatching operations
        print('Hatching Started')
    
        layers = []
    
        p = Pool(processes=4)
    
        d = Manager().dict()
        d['part'] = solidPart
        d['layerThickness'] = layerThickness
    
        # Rather than give the z position, we give a z index to calculate the z from.
        numLayers = solidPart.boundingBox[5] / layerThickness
        z = np.arange(0, numLayers).tolist()
    
        # The layer id and manager shared dict are zipped into a list of tuple pairs
        processList = list(zip([d] * len(z), z))
    
        startTime = time.time()
    
        # uncomment to test the time processing in single process
        #for pc in processList:
        #   calculateLayer(pc)
    
        layers = p.map(calculateLayer, processList)
    
        print('Multiprocessing time {:.1f} s'.format(time.time()-startTime))
        p.close()
    
        print('Completed Hatching')
        
        return layers
    
    
    if __name__ == '__main__':
        layers = main()
        
        for k in range(164, 171, 1):
            pyslm.visualise.plotSequential(layers[k])
    

    For some other models i also have something like this for example:

    • defective small contours and a incorrectly closed area BadResult_02
    bug 
    opened by MarcelHeu 2
  • LinearSort erroring out

    LinearSort erroring out

    Hopefully this screenshot of my debugger demonstrates the error well enough: image

    The error comes from this line of sorting.py: https://github.com/drlukeparry/pyslm/blob/90a999f131eab20253f8396bc0e4250e11143832/pyslm/hatching/sorting.py#L108

    I've added a few comments in there just to try and figure stuff out, but I haven't changed any actual code from what's on the main branch.

    The error is complaining that I'm taking the dot product of a 2-long array (essentially a vector representative of the hatch angle) and a X-long array of midpoints, where X is the number of vectors. My knowledge of linear algebra and numpy is sketchy at best, but isn't this expecting two same-length arrays for the dot product? Is a dot product the proper way to handle this?

    Again, apologies for not knowing the linear algebra terminology and numpy, so I speak intuitively. I think the way to do this would be to basically extend each midpoint by the hatch angle to the x-axis, then sort the lines based on the x-value of their intersection point with the x-axis. How would you accomplish this via numpy?

    I am running this with a pretty standard setup. I don't anticipate a specific test case will help much, as I think the error is apparent. I unfortunately just don't have enough background knowledge to fix it.

    opened by aacitelli 2
  • Error Installing PythonSLM from PyPi

    Error Installing PythonSLM from PyPi

    I have a bit of an interesting environment. I am trying to bundle all the requirements for pyslm into a portable Python installation, as I'm essentially building a UI that wraps around my organization's infrastructure for interfacing with PySLM. I was able to get an embeddable version of Python working with pip by following this guide. I was then able to install 90% of the project dependencies to this embeddable version.

    However, pip is running into the following error when it gets to the triangle package:

    ERROR: Command errored out with exit status 1:
       command: 'C:\Users\Kal\Documents\cdme-scangen-ui\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Kal\\AppData\\Local\\Temp\\pip-install-4oqlhgdx\\triangle_6607d6f5e9b84b9b9d04622fc8215807\\setup.py'"'"'; __file__='"'"'C:\\Users\\Kal\\AppData\\Local\\Temp\\pip-install-4oqlhgdx\\triangle_6607d6f5e9b84b9b9d04622fc8215807\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Kal\AppData\Local\Temp\pip-wheel-020a81mv'
           cwd: C:\Users\Kal\AppData\Local\Temp\pip-install-4oqlhgdx\triangle_6607d6f5e9b84b9b9d04622fc8215807\
      Complete output (115 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.9
      creating build\lib.win-amd64-3.9\triangle
      copying triangle\core1_run.py -> build\lib.win-amd64-3.9\triangle
      copying triangle\data.py -> build\lib.win-amd64-3.9\triangle
      copying triangle\plot.py -> build\lib.win-amd64-3.9\triangle
      copying triangle\tri.py -> build\lib.win-amd64-3.9\triangle
      copying triangle\version.py -> build\lib.win-amd64-3.9\triangle
      copying triangle\__init__.py -> build\lib.win-amd64-3.9\triangle
      creating build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\A.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\bbox.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.2.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.3.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.4.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\diamond_02_00009.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\diamond_02_00009.1.v.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\diamond_02_00009.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\dots.1.v.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\dots.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.2.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.2.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex3.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex3.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\ell.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\face.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\greenland.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\la.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.q.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.r.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\square_circle_hole.1.node -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\A.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\bbox.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.2.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.3.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.4.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\diamond_02_00009.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.2.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.2.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex3.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\ell.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\face.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\greenland.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\la.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.q.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\spiral.r.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\square_circle_hole.1.ele -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\A.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\A.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.2.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.3.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.4.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\box.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.2.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.2.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex2.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex3.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\double_hex3.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\face.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\face.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\la.1.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\la.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\square_circle_hole.poly -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\bbox.1.area -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\diamond_02_00009.1.v.edge -> build\lib.win-amd64-3.9\triangle\data
      copying triangle\data\dots.1.v.edge -> build\lib.win-amd64-3.9\triangle\data
      running build_ext
      building 'triangle.core' extension
      creating build\temp.win-amd64-3.9
      creating build\temp.win-amd64-3.9\Release
      creating build\temp.win-amd64-3.9\Release\c
      creating build\temp.win-amd64-3.9\Release\triangle
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -IC:\Users\Kal\Documents\cdme-scangen-ui\python\include -IC:\Users\Kal\Documents\cdme-scangen-ui\python\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tcc/triangle.c /Fobuild\temp.win-amd64-3.9\Release\c/triangle.obj
      triangle.c
      c/triangle.c(3685): warning C4311: 'type cast': pointer truncation from 'triangle *' to 'unsigned long'
      c/triangle.c(3691): warning C4311: 'type cast': pointer truncation from 'triangle *' to 'unsigned long'
      c/triangle.c(3698): warning C4311: 'type cast': pointer truncation from 'triangle *' to 'unsigned long'
      c/triangle.c(3705): warning C4311: 'type cast': pointer truncation from 'triangle *' to 'unsigned long'
      c/triangle.c(3714): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(3721): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(3728): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(3734): warning C4311: 'type cast': pointer truncation from 'subseg *' to 'unsigned long'
      c/triangle.c(3739): warning C4311: 'type cast': pointer truncation from 'subseg *' to 'unsigned long'
      c/triangle.c(3744): warning C4311: 'type cast': pointer truncation from 'subseg *' to 'unsigned long'
      c/triangle.c(3780): warning C4311: 'type cast': pointer truncation from 'subseg *' to 'unsigned long'
      c/triangle.c(3785): warning C4311: 'type cast': pointer truncation from 'subseg *' to 'unsigned long'
      c/triangle.c(3792): warning C4311: 'type cast': pointer truncation from 'subseg *' to 'unsigned long'
      c/triangle.c(3801): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(3808): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(3815): warning C4311: 'type cast': pointer truncation from 'triangle *' to 'unsigned long'
      c/triangle.c(3822): warning C4311: 'type cast': pointer truncation from 'triangle *' to 'unsigned long'
      c/triangle.c(3831): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(3838): warning C4311: 'type cast': pointer truncation from 'vertex' to 'unsigned long'
      c/triangle.c(6966): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
      c/triangle.c(12465): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -IC:\Users\Kal\Documents\cdme-scangen-ui\python\include -IC:\Users\Kal\Documents\cdme-scangen-ui\python\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tctriangle/core.c /Fobuild\temp.win-amd64-3.9\Release\triangle/core.obj
      core.c
      triangle/core.c(4): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      ----------------------------------------
      ERROR: Failed building wheel for triangle
    

    I've looked up the fatal part of the error (cannot find Python.h) and, while I can't find anything specifically related to my circumstance (most of it is in context to actually using Visual Studio), it seems related to my installation of the Visual C++ Build Tools, which I understand are a requirement for many of the tools.

    The error appears both when I'm trying to install prerequisites for a version of pyslm built from source (our organization has a custom version with minor differences that shouldn't be relevant) and when simply trying to use the PythonSLM version from PyPi. This process works correctly when I am not using the embeddable version - that is, I've gotten the library working in general, just not when I'm trying to package it with a UI application built in Electron that essentially launches the Python script as a child process. Do you have any ideas for how I may go about fixing this?

    opened by aacitelli 2
  • Numba usage?

    Numba usage?

    I'm unsure if it's already implemented, but have you considered implementing parts of the library in Numba? It's is a library works in conjunction with Numpy that essentially implements JIT compilation in Python, speeding up loops and simple functions. The downside is that you have to write code in a style similar to C, but you can essentially selectively enable the library to only run on certain code blocks, which is done pretty simply via decorators.

    enhancement 
    opened by aacitelli 2
  • ClipperException: The path is invalid for clipping

    ClipperException: The path is invalid for clipping

    Hello,

    numpyArray.txt I am using pyslm version = '0.4.2'

    If i try to hatch a sliced contour (numpy array is attached within the *.txt file) with the following hatching settings i always got an ClipperException error:

    Traceback (most recent call last):
    
      File "C:\Users\MarcelHeuser\AppData\Local\Temp\ipykernel_6728\2481062967.py", line 18, in <cell line: 18>
        layer = myHatcher.hatch([npArray])
    
      File "C:\Developer\venvTEST\lib\site-packages\pyslm\hatching\hatching.py", line 929, in hatch
        clippedPaths = self.clipLines(paths, hatches)
    
      File "C:\Developer\venvTEST\lib\site-packages\pyslm\hatching\hatching.py", line 432, in clipLines
        pc.AddPath(BaseHatcher.scaleToClipper(boundary), pyclipper.PT_CLIP, True)
    
      File "external\pyclipper\pyclipper.pyx", line 616, in pyclipper.Pyclipper.AddPath
    
    ClipperException: The path is invalid for clipping
    

    I have extracted this contour from a sliced geometry. You can use the code below to reproduce the error.

    import numpy as np
    from pyslm import hatching as hatching
    
    # load numpy array
    npArray = np.load("numpyArray.txt")
    
    # generate Hatcher
    myHatcher = hatching.Hatcher()
    
    # Set the base hatching parameters
    myHatcher.hatchAngle        = 66.7
    myHatcher.volumeOffsetHatch = 0.08
    myHatcher.spotCompensation  = 0.025
    myHatcher.numInnerContours  = 0
    myHatcher.numOuterContours  = 1
    myHatcher.hatchDistance     = 0.12
    myHatcher.hatchingEnabled   = True
    myHatcher.hatchSortMethod   = hatching.AlternateSort()
    
    # Hatch the geomSlice
    layer = myHatcher.hatch([npArray])
    

    Do you know what could be the reason for the error?

    Best regards, Marcel

    bug 
    opened by MarcelHeu 3
Owner
Dr Luke Parry
Interest in Additive Manufacturing: Topics of interest include Simulation, Methodologies and Design Tools. Research Fellow @ University of Nottingham
Dr Luke Parry
Meta-learning for NLP

Self-Supervised Meta-Learning for Few-Shot Natural Language Classification Tasks Code for training the meta-learning models and fine-tuning on downstr

IESL 43 Nov 08, 2022
Collection of machine learning related notebooks to share.

ML_Notebooks Collection of machine learning related notebooks to share. Notebooks GAN_distributed_training.ipynb In this Notebook, TensorFlow's tutori

Sascha Kirch 14 Dec 22, 2022
Code for the published paper : Learning to recognize rare traffic sign

Improving traffic sign recognition by active search This repo contains code for the paper : "Learning to recognise rare traffic signs" How to use this

samsja 4 Jan 05, 2023
[ICLR 2021] "Neural Architecture Search on ImageNet in Four GPU Hours: A Theoretically Inspired Perspective" by Wuyang Chen, Xinyu Gong, Zhangyang Wang

Neural Architecture Search on ImageNet in Four GPU Hours: A Theoretically Inspired Perspective [PDF] Wuyang Chen, Xinyu Gong, Zhangyang Wang In ICLR 2

VITA 156 Nov 28, 2022
Age Progression/Regression by Conditional Adversarial Autoencoder

Age Progression/Regression by Conditional Adversarial Autoencoder (CAAE) TensorFlow implementation of the algorithm in the paper Age Progression/Regre

Zhifei Zhang 603 Dec 22, 2022
code for our BMVC 2021 paper "HCV: Hierarchy-Consistency Verification for Incremental Implicitly-Refined Classification"

HCV_IIRC code for our BMVC 2021 paper HCV: Hierarchy-Consistency Verification for Incremental Implicitly-Refined Classification by Kai Wang, Xialei Li

kai wang 13 Oct 03, 2022
SOLOv2 on onnx & tensorRT

SOLOv2.tensorRT: NOTE: code based on WXinlong/SOLO add support to TensorRT inference onnxruntime tensorRT full_dims and dynamic shape postprocess with

47 Nov 26, 2022
This project is for a Twitter bot that monitors a bird feeder in my backyard. Any detected birds are identified and posted to Twitter.

Backyard Birdbot Introduction This is a silly hobby project to use existing ML models to: Detect any birds sighted by a webcam Identify whic

Chi Young Moon 71 Dec 25, 2022
Patch-Diffusion Code (AAAI2022)

Patch-Diffusion This is an official PyTorch implementation of "Patch Diffusion: A General Module for Face Manipulation Detection" in AAAI2022. Require

H 7 Nov 02, 2022
How to Learn a Domain Adaptive Event Simulator? ACM MM, 2021

LETGAN How to Learn a Domain Adaptive Event Simulator? ACM MM 2021 Running Environment: pytorch=1.4, 1 NVIDIA-1080TI. More details can be found in pap

CVTEAM 4 Sep 20, 2022
[ICCV 2021 Oral] Just Ask: Learning to Answer Questions from Millions of Narrated Videos

Just Ask: Learning to Answer Questions from Millions of Narrated Videos Webpage • Demo • Paper This repository provides the code for our paper, includ

Antoine Yang 87 Jan 05, 2023
The Environment I built to study Reinforcement Learning + Pokemon Showdown

pokemon-showdown-rl-environment The Environment I built to study Reinforcement Learning + Pokemon Showdown Been a while since I ran this. Think it is

3 Jan 16, 2022
Pointer networks Tensorflow2

Pointer networks Tensorflow2 原文:https://arxiv.org/abs/1506.03134 仅供参考与学习,内含代码备注 环境 tensorflow==2.6.0 tqdm matplotlib numpy 《pointer networks》阅读笔记 应用场景

HUANG HAO 7 Oct 27, 2022
SBINN: Systems-biology informed neural network

SBINN: Systems-biology informed neural network The source code for the paper M. Daneker, Z. Zhang, G. E. Karniadakis, & L. Lu. Systems biology: Identi

Lu Group 15 Nov 19, 2022
Identify the emotion of multiple speakers in an Audio Segment

MevonAI - Speech Emotion Recognition Identify the emotion of multiple speakers in a Audio Segment Report Bug · Request Feature Try the Demo Here Table

Suyash More 110 Dec 03, 2022
PyTorch implementation of VAGAN: Visual Feature Attribution Using Wasserstein GANs

Prototypical Networks for Few shot Learning in PyTorch Simple alternative Implementation of Prototypical Networks for Few Shot Learning (paper, code)

Orobix 93 Aug 17, 2022
Captcha-tensorflow - Image Captcha Solving Using TensorFlow and CNN Model. Accuracy 90%+

Captcha Solving Using TensorFlow Introduction Solve captcha using TensorFlow. Learn CNN and TensorFlow by a practical project. Follow the steps, run t

Jackon Yang 869 Jan 06, 2023
nnFormer: Interleaved Transformer for Volumetric Segmentation Code for paper "nnFormer: Interleaved Transformer for Volumetric Segmentation "

nnFormer: Interleaved Transformer for Volumetric Segmentation Code for paper "nnFormer: Interleaved Transformer for Volumetric Segmentation ". Please

jsguo 610 Dec 28, 2022
Deep Learning with PyTorch made easy 🚀 !

Deep Learning with PyTorch made easy 🚀 ! Carefree? carefree-learn aims to provide CAREFREE usages for both users and developers. It also provides a c

381 Dec 22, 2022
以孤立语假设和宽度优先搜索为基础,构建了一种多通道堆叠注意力Transformer结构的斗地主ai

ddz-ai 介绍 斗地主是一种扑克游戏。游戏最少由3个玩家进行,用一副54张牌(连鬼牌),其中一方为地主,其余两家为另一方,双方对战,先出完牌的一方获胜。 ddz-ai以孤立语假设和宽度优先搜索为基础,构建了一种多通道堆叠注意力Transformer结构的系统,使其经过大量训练后,能在实际游戏中获

freefuiiismyname 88 May 15, 2022