Code Monkey home page Code Monkey logo

arc-overhang-prusaslicer-integration's Introduction

Arc Overhang

A 3D printer toolpath generation algorithm that lets you print up to 90° overhangs without support material, original Idea by Steven McCulloch: https://github.com/stmcculloch/arc-overhang

Now it is easy and convinient to use by integrating the functionality into PrusaSlicer as a post-processing script.

Steven and I hope that some day this feature gets integrated into slicing software. But until then you can use this script to get the added functionalitiy today!

possible usecases

0. Videos

This is a basic visualisation how the algorithm works:

arc-overhang visualization

(this visualisation uses depth first generation, the current version uses breadth first search algorithm to fill the remaining space in the overhang.

1. Brief Explanation (from Steven McCulloch):

  1. You can print 90° overhangs by wrapping filament around itself in concentric arcs. You may have seen the fullcontrol.xyz overhang challenge. This uses the exact same principle. Here's what this effect looks like while printing:

printing demo

  1. You can start an arc on an arc to get ridiculously large overhangs. To get perfect results you need to tune the process to fit your machine. Also it is painfully slow, but still faster than support + removal :P

For more details visit: https://github.com/stmcculloch/arc-overhang

3. Setup-Process

  1. download and install Python 3, at least Version 3.5, check the "add to PATH" box during the installation.
  2. install the librarys shapely, numpy and matplotlib and new numpy-hilbert-curve via "python -m pip install "+library-name in your console (type cmd in windows start-menu search) python -m pip install shapely numpy matplotlib numpy-hilbert-curve.
  3. Ready to go! Tested only with PrusaSlicer 2.5 & Python 3.10 :)

4. How to use it:

Option A) via Console

Simply open your system console and type 'python ' followed by the path to this script and the path of the gcode file. Will overwrite the file.

Option B) use it as a automatic post-processing script in PrusaSlicer

  1. open PrusaSlicer, go to print-settings-tab->output-options. Locate the window for post-processing-script.
  2. In that window enter: C:\full\path\to\your\python.exe C:\full\path\to\this\script\including\prusa_slicer_post_processing_script.py (with blank space between the two paths!). For unix like systems (linux, macOS, ecc.) use the / instead of \, obtaining something like this: full/path/to/your/python full/path/to/this/script/including/prusa_slicer_post_processing_script.py
  3. PrusaSlicer will execute the script after the export of the Gcode, therefore the view in PrusaSlicer wont change.
  4. Open the finished gcode file to see the results.

Notes to nail it first try: If any path contains empty spaces, mask them as described here (using "\ " on unix like sistems and "! " on windows): https://manual.slic3r.org/advanced/post-processing https://help.prusa3d.com/article/post-processing-scripts_283913

currently only using quotation marks " at the beginning and end of the path with empty spaces seem to work.

If you want to change generation settings: Open the Script in an editor, scroll to 'Parameter' section. Settings from PrusaSlicer will be extracted automaticly from the gcode.

5. Current Limitations

  1. Some settings need to be taylored to your specific geometry, just like you adapt the settings in your slicer. Details below.
  2. Code is slow on more complicated models.
  3. The Arcs are extruded very thick, so the layer will be 0.1-0.5mm thicker (dependend on nozzle dia) than expected =>if precision needed make test prints to counter this effect.
  4. Some warping, when printing the follow up layers. Print the followup layers as slow as possible with the least ammount of cooling possible. You dont need to change any PrusaSlicer Settings, as this is handled automaticly by the script via the special cooling parameters. When you print to low cooling it will result in sagging/heat softening. Balance the cooling of these layers with gravity/heat softening: More Cooling=>More Warping. There is no generalized solution for all printers, but the default values should be a good start.
  5. no wiping or z-hop during travel moves
  6. remaining print time shown during printing is wrong. The real printtime can be seen when opening the finished file in GcodeViewer.
  7. will take the first island of the prev. perimeter as a startpoint. If you dont like that point, turn the models along z-axis.
  8. delets solid infill incl the last travel move if multiple islands present. Causes small defect. Fixing in progress.
  9. settings testet for PLA only. You can of cause try other materials and share your knowlege here!
  10. Physics: The arcs need to be able to support their own weight without much deformation. Therefore narrow and long bridges will be generated, but not print successfull. Use some supports to stabilize critical areas.

5.1 Updates:

Reduced warping significantly! The warping is caused by the follow-up layers that contract during the cooldown. The Script now automaticly applies warping-reducing print settings within a certain z-distance over the arcs. There are parameters defined in the script to adapt the settings to your printer. The following settings are applied: Lower speed, lower fan speed. Conversion from solid infill to hilbert curve.

A hilbert curve pattern is associatet with the smallest residual thermal stresses Reasearch on SLS-3d-printing. This shows great success, but some more time is needed to find the limits (e.g printing speed) and effects of this printing strategy. Additionally the script splits up the hilbert-curve to avoid heat accumulation and therefore softening of the material below.

Unfortunately we can't convert the perimeters, so print them as slow as possible and with the least cooling possible to reduce the warping. On the other hand: printing without cooling causes the overhang to bend downwards. Possibly caused by the added weight + heat softening, so a balance of the thermal contraction forces and gravity might be a solution. For me cooling at 10% worked quite nice. Research is in Progress, Steven and I would be happy if you share your knowlege and experiences from you prints!

Example images of minimized warping, tested on extreme overhang with 100mm diameter:

The bulging downwards happens due to the geometry of the object: The long arcs contract when cooled down, causing some stress in the printed part. The next one adds more contraction stress, that release in the bulging. This happens due to physics and geometry. The bulging issue can be solved by a)set rMax to 40mm, b) change the geometry so the arclines are splited into multiple parts and extreme long arcs are avoided.

The warping of <2mm is in my opinion acceptable, as we talk about a very large surface and it is only occuring at the very edge.

6. Suggested Print Settings

Some PrusaSlicer PrintSettings will be checked and warned if "wrong".

Important Settings in the Script are:

a) "ArcCenterOffset": The surfacequality is imporved by Offsetting the arc center, because the smallest r is larger->more time to cool. Set to 0 to get into delicate areas.

b) "ExtendIntoPerimeter": Enlargen the Area, where Arcs are Generated. Increase to thicken small/delicate passages. minValue for the algorithm to work is 0.5extrusionwidth!

c) "MaxDistanceFromPerimeter": Controls how bumpy you tolerate your edge. big: less tiny arcs, better surface. small:follow the curvature more exact.

d) Thresholds for area and bridging length, adjust as needed, but Arc shine at large surfaces :)

e) "UseLeastAmountOfCenterPoints": experimental: use only one arc-center until rMax is reached (then iterate as usual), improves surface finish but can lead to failed prints on complex geometrys.

f) Adjust the special cooling settings to your printer. This affects the follow-up layers to reduce warping.(More cooling->more warping)

General Print Settings for the arcs:

The overhang print quality is greatly improved when the material solidifies as quickly as possible. Therefore:

  1. Print as cold as possible. I used 190 degrees for PLA. You can probably go even lower. If you require higher temp for the rest of the print, you could insert could insert some temp-change gcode before and after the arcs are printed. Might waste a lot of time though.

  2. Maximize cooling. Set your fans to full blast. I don't think this technique will work too well with ABS and materials that can't use cooling fans, but I haven't tested it.

  3. Print slowly. I use around 2 mm/s. Even that is too fast sometimes for the really tiny arcs, since they have almost no time to cool before the next layer begins.

6.1 Examples:

7. Room for Improvement

We would be happy if you contribute! The surface-finish seems to be better with using as little as possible start points for the arcs. but where are the Limits? Finding an algorithm deciding when to start a new arc, working reliable an a wide set of geometrys is the next ongoing developement. I you have any questions/ideas I would be happy if you share them!

Printing long overhangs is tricky due to gravity. a meet in the middle concept could help, but how do we teach that to the computer? Feel free to encorporate any Ideas in the post-processing script and try them!

Further optimize the settings or add features like z-hop and quality of life features like correct displaying of remaining print time.

8. Printer Compatibility

By default, the output gcode should print fine on most standard desktop FDM printers you can use with PrusaSlicer. PrusaSlicer is mandatory as the script listens to sepcific keywords....

9. Easy Way to try Out

If you want to try the prints without installing, Steven and I added some test print gcode files in the root directory that you can directly download. They should print fine on most printers although you may need to manually adjust the gcode so that it works with your printer.

10. Print it!

If you get a successful print using this algorithm, I'd (and I am sure Steven to) love to hear about it.

11. How the Post-Procssing-Script works

The script analyses the given gcode-file and splits it into layers. For every layer the informations are saved as an object (Class:Layer). Than it searches for "Bridge Infill" tag in the gcode, kindly provided by PrusaSlicer.

The process will be shown with this simple example geometry(left). It has Bridge Infill at 2 areas in one layer, the right one is the overhang we want to replace.(right) Explain Geometry

The real work is done by the shapely-Library. The Algorithm extracts the gcode and converts it into a shapely line (plot:green). By thickening the line we get one continous Polygon(plot black): infill to poly

The Polygon is verified by several steps, including touching some overhang perimeter. To find a start point the external perimeter of the previous layer is extracted and the intersection area with our Polygon calculated. The commom boundary of the intersection area and the Polygon will be the startline (magenta) for the arc generation. Start Geometry

For each step concentric arcs are generated, until they hit a boundary or rMax. The Farthest Point on the pervious arc will be the next startpoint. Algorithm Animation

The process is repeated until all points on the arcs are close enough to the boundary or overprinted by other arcs. Finally the gcode file will be rewritten. All infos are copied and the Arcs are injected at the beginning of the layer. the replaced bridge infill will be excluded: Result

arc-overhang-prusaslicer-integration's People

Contributors

deckar01 avatar erjanmx avatar jxgreer1 avatar nicolai-wachenschwan avatar rox97 avatar sthompson-celerity avatar stmcculloch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arc-overhang-prusaslicer-integration's Issues

Extrusion generated between disconnected bodies

I tried running the script on a file containing two disconnected bodies, and it generated a number of extrusions between the two. They generated only on layers that were modified by the script.

image

The layers that feature it are the arc overhangs, then the Hilbert curve infill, none appear on the layers with gyroid infill as selected in PrusaSlicer, then it appears again on the layers of Hilbert before the top layer.

I haven't attempted printing it, but in PrusaSlicer G-code Viewer, it shows them listed perimeters, except one that is listed as internal infill. I am somewhat curious if these may just be travel moves that are improperly listed by the viewer.

My files (gcode, and 3mf with the printer/profiles

I'm seeing now that there's some similar issues mentioned in Thomas Sandlander's video, as well as the 8th limitation listed on the main project page, so if this is the same thing, please go ahead and close it! I figured I should mention it anyway since I haven't seen anything about multi body files

Computer Info:
OS: Windows 11 (build 22621), 64-bit edition
Version: PrusaSlicer-2.6.0-alpha5+win64-202303061442
Python: Python-3.11.2-amd64

Solid infill above overhang is not rectilinear

When looking at the printer during the printing of the layers above the overhang (only solid infill), it looks like a labyrinth and is not rectilinear as it usually is. I cannot find a way to correct this.

Do you have any suggestions on how to fix this?

Kind regards,
Lars

Cura and arc-overhang script

I just tried your script and I'm getting an error using Cura. I don't know if I'm doing something wrong or not. I'm using Python 3.9.2

root@Debian:/mnt/usb# python3 ./arc-overhang.py ./test1.gcode
Traceback (most recent call last):
File "/mnt/usb/./arc-overhang.py", line 1156, in
main(gCodeFileStream,path2GCode)
File "/mnt/usb/./arc-overhang.py", line 114, in main
parameters=makeFullSettingDict(gCodeSettingDict)
File "/mnt/usb/./arc-overhang.py", line 64, in makeFullSettingDict
"ExtendIntoPerimeter":1.0*gCodeSettingDict.get("perimeter_extrusion_width"), #min=0.5extrusionwidth!, extends the Area for arc generation, put higher to go through small passages. Unit:mm
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

TypeError encountered in script

I get the following error when attempting to run the script on the attached gcode.

Traceback (most recent call last):
  File "c:\standalone\prusa_slicer_post_processing_script.py", line 1182, in <module>
    main(gCodeFileStream,path2GCode, skipInput)
  File "c:\standalone\prusa_slicer_post_processing_script.py", line 109, in main
    parameters=makeFullSettingDict(gCodeSettingDict)
  File "c:\standalone\prusa_slicer_post_processing_script.py", line 76, in makeFullSettingDict
    "ArcWidth":gCodeSettingDict.get("nozzle_diameter")*0.95, #change the spacing between the arcs,should be nozzle_diameter`
TypeError: can't multiply sequence by non-int of type 'float'

I am using the latest stable release of PrusaSlicer, 2.5.2. My Python is 3.10 and I have installed the necessary libraries.

Rolodex_frame_0.2mm_PLA_MK3SMMU2S_29m.zip

Little issues

HI
image
Filament in the air

image
Random Hibertcurve in the air.

image
No arc at the middle overhang

image
Printspeed is 1mm/s

image

Error when exporting the g-code after slicing.

Just went through the install process and sliced a model. Prusa Slicers seems to run the slice process... but gives me an error when I go to Export the G-code: "Post-processing script C:\Users\billf\AppData\Local\Programs\Python\Python311\python.exe C:\TEMParc\prusa_slicer_post_processing_script.py on file C:\Users\Public\Documents\Wondershare\CreatorTemp.28732.gcode.pp failed.
Error code: 1"

What is Wondershare? and how did it get included in the script?
I haven't been able to get any g-code out to confirm the script is actually doing anything; the slice from prusa slicer still looks like a normal slice.

thank you.

Error code: 2

Post-processing script C:\Users\jobem\AppData\Local\Programs\Python\Python310\python.exe PS C:\for arc overhangs in prusa> on file C:\Users\jobem\AppData\Local\Temp.PrusaSlicer.upload.0817-3f43-751f-d6c0 failed.
Error code: 2

using script with non std printer profiles

Hey, I'm new here and don't know the etiquette so I hope this is the right place to ask.
Trying to have a go at this and trying to use it through the console, I've gotten past numerous hurdles but I'm stuck here
arc
I shortened the script filename just to make life simpler.

In PrusaSlicer under Printer Settings the "After layer change G-code" box is empty, should I have something in there?
Thanks.

Two errors when trying to run on Vase mode PrusaSlicer 2.6.0-alpha5

Setup was easy:

pip3 install shapely numpy matplotlib numpy-hilbert-curve

But when trying to modify a vase-mode print, I got:

$ python3 prusa_slicer_post_processing_script.py egg3_arc.gcode 
unmatching setting: [' end_gcode ', '{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+1, max_print_height)} F720 ; Move print head up{endif}\\nG1 X0 Y200 F3600 ; park\\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+49, max_print_height)} F720 ; Move print head further up{endif}\\nG4 ; wait\\nM221 S100 ; reset flow\\nM900 K0 ; reset LA\\n{if print_settings_id=~/.*(DETAIL @MK3|QUALITY @MK3|@0.25 nozzle MK3).*/}M907 E538 ; reset extruder motor current{endif}\\nM104 S0 ; turn off temperature\\nM140 S0 ; turn off heatbed\\nM107 ; turn off fan\\nM84 ; disable motors\\n; max_layer_z ', '[max_layer_z]']

prusa_slicer_post_processing_script.py:1074: Overhang detection disabled. Activate for script success!
prusa_slicer_post_processing_script.py:111: Incompatible Settings used!

Can not run script, gcode unmodified. Press enter to close.

So two quick questions:

  1. How do I enable overhang detection? (PrusaSlicer, I assume the Alpha does it the same as the released version)
  2. That unmatching setting part, not sure what the cause is.

hilbert surface gets printed again on top surface

attached the models I created to test ArcOverhangs

may it's because the thickness of the overhang is quite low
I reduced BottomLayers to 3 and after ArcOverhangs and hilbert surface the infill starts (even printing slow)
but after the infill it starts again with hilbert surface printing super slow and this destried the prints (I think because the hot nozzle was nearby / touching the overhang-area for long time

I'm printing ABS and the ArcOverhangs work great!
just the following layers need to get printed faster
is there an option to limit the number of hilbert layers and the number of slow layers?

arc.zip

while testing I also saw some moves in the infill above the hilbert that have been ultra slow and creating little blobs on the outer surface
I didn't found that part in the gcode but it felt like a G1 command without feedrate using an old slow feedrate

Python 3.5 compatibility issue by type hints

Hello. I now tried both methods and both doesn't work for me. I have a Windows 11 x64 system. I didn't change the code, maybe there is something that I'm missing. I would be really happy to find a solution. Likewise, I want to try to integrate the arc-support in my workflow. I'm working in a makerspace and the arc overhangs could be a way to drastically reduce the waste material.

Methode A:
Screenshot 2023-03-03 161107
Methode B:
Screenshot 2023-03-03 160850
My PrusaSlicer integration
grafik

Enhancement: Allow External perimeter only for enclosed objects. Working Code sample and screenshots included.

The checks for the arc are pretty decent, and seem to handle External perimeters without the need for an Overhang perimeter.

It is important to note that I had my crummy workaround for #59 implemented, so no special cooling layers/hilbert curve layers were applied. I'd suggest this not be implemented until #59 gets resolved. This is because I don't have a check for internal infill on the layer below and all bridge infill gets replaced, making #59 a much larger issue.

layer below arc
openblock

arc layer
closedblock

This is the modification that allowed this to work (my experience with Python is relatively basic, so it may be sub-optimal):

    def getOverhangPerimeterLineStrings(self):
        parts=self.spotFeaturePoints("Overhang perimeter",includeRealStartPt=True)
        if parts:
            return [LineString(pts) for pts in parts]
        parts=self.spotFeaturePoints("External perimeter",includeRealStartPt=True) #added start
        if parts:
            return [LineString(pts) for pts in parts] #added end
        return []

Post-Processing error and Standalone error (Unicode Error)

Hello,

I've been testing the script with PrusaSlicer 2.7.1 (Python 3.12.1) (numpy 1.26.3, matplotlib 3.8.2, shapely 2.0.2, numpy-hilbert-curve 1.0.1) and I've noticed an issue.

When trying to use it with Geetech printers [A10M (2 extruders) and A10Pro (1 extruder)], it seems to throw a "UnicodeDecodeError" both if used manually (via command prompt) on a gcode generated by PrusaSlide or as code on the Post-Processing options. This leads to a failure to edit or output any gcode, respectively. Oddly enough, when performed with Ultimaker printers (Ultimaker2) it doesn't fail.

I've been checking for similar error situations and all seem to point to an encoding issue and utf-8 but I've not been able to implement the fix. Furthermore, there seems to be no similar issue (closed or open) on the matter.

All default configuration parameters for that printer have not been modified (Print, Filament, Printer) except for those significant to the script (Relative E distances and Bridging speeds). See the attached image for more information on the CMD error log (blurred fields are sensitive information).

Update 1: Tested again with the following parameters changed to that which better fits the script's needs: External perimeters first, Avoid crossing perimeters, Infill before perimeters, Bridge speed, Extrusion widths, and Relative E distances. The error persists.

Capture

"can not run script, gcode unmodified" error

trying to run the script on ender 3 v2 profile but im getting this error - "can not run script, gcode unmodified". i have noticed that when i change my profile to one of prusa printers the scripts run just fine. how can i fix this issue with my profile? or an update on the script will make creality compatible too? im so excited with this project and cant wait to try it!

unable to install using python 3.11.3

I realize this is not a issue with your library but I found it trying to install the pre-reqs as instructed. Can you publish a set of specific-version modules that will still work with this?

ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
ERROR: Could not find a version that satisfies the requirement numpy-hilbert-curv (from versions: none)
ERROR: No matching distribution found for numpy-hilbert-curv

no matching overhangs found->no arcs generated.

I'm sorry if I've missed a clear instruction, but I can't find it, and I just get the error:
"no matching overhangs found->no arcs generated."
It goes on to say " If unexpected: look if restricting settings like 'minArea' or 'MinBridgeLength' are correct".
I can find these terms in the script, but nowhere in Prusa, so what would be correct settings for these?

MacOS: Cant use script as post-processing script but console works

Hi. I tried to use the script, both in prusaslicer and via console.
In prusaslicer I got this error:
Post-processing script /usr/local/Cellar/[email protected]/3.10.10_1/bin/python3.10 /Users/andrearossetti/Library/Application) Support/PrusaSlicer-alpha/prusa_slicer_post_processing_script.py on file /var/folders/7q/qzjmm0d121_gtxOycd6vryr0000gn/T/.40741.gcode.pp failed. Error code: 1 Output: Traceback (most recent call last): File "/Users/andrearossetti/Library/Application Support/PrusaSlicer-alpha/prusa_slicer_post_processing_script.py", line 1158, in <module> main(gCodeFileStream,path2GCode) File "/Users/andrearossetti/Library/Application Support/PrusaSlicer-alpha/prusa_slicer_post_processing _script.py", line 374, in main input("Push enter to close this window") EOFError: EOF when reading a line

And via console I can finish the script but it doesn't change anything. This is what I got from console:
/usr/local/Cellar/[email protected]/3.10.10_1/bin/python3.10 /Users/andrearossetti/Library/Application\ Support/PrusaSlicer-alpha/prusa_slicer_post_processing_script.py /Users/andrearossetti/Downloads/Unito_0.2mm_PETG_MK3S_1h15m.gcode /Users/andrearossetti/Library/Application Support/PrusaSlicer-alpha/prusa_slicer_post_processing_script.py:1070: Travel Moves may cross the outline and therefore cause artefacts in arc generation. last read linenumber: 93755 layers: 247 /Users/andrearossetti/Library/Application Support/PrusaSlicer-alpha/prusa_slicer_post_processing_script.py:492: Layer 0: no height found, using layerheight default! write to file Code executed successful Push enter to close this window

Got it to run, but may not be handing it the "right" gcode to show off the capabilities.

This isn't a bug, more of a question of "am I feeding this script the right starting point?"

I openSCAD rendered a complex organic dragon-egg looking thing with lots of small scale overhang areas. Cool. Then I

  1. plop it into PrusaSlicer,
  2. turn on the necessary bridge detection settings,
  3. Set the infill to 0% because I'd like this to be as close to vase-mode as possible
  4. Set the layer height down from the suggested 0.3 (I'm using a 0.6 nozzle) down to 0.1 because it helps draw more layers on the steeply slanting areas
  5. Hope it can handle the steeply-sloping but not-quite-horizontal planes
  6. run it through this script. Script runs without complaints
  7. But I don't see the scallop-like patterns

Step num 3, 4, 5 all could be me doing it wrong.
I... don't think I did it right. The overhangish areas are still back-and-forth squiggles not growing-arc shell-like patterns.

Script won't run in prusaslicer postprocessing

Thanks for the quick response time. I updated to 2.5.0 (hadn't realized this computer was lagging) and that previous gcode issue is sorted, but a new one arose which required the activation of "Detect Bridging Perimeters" before the code would run. I don't see this anywhere in the readme so I'm not sure if it's papering over another error or was just always required and not made explicit.

Upshot of it is, the script now works when run in terminal, and I confirmed the printing path is correct in gcode viewer. However, it won't run when called by prusaslicer, and the error message is

Failed starting the script
C:\Users\iterhating\Documents\Octolab\FDM\arc-overhang-prusaslicer-integration\prusa_slicer_post_processing_script.py C:\Users\iterhating\AppData\Local\Temp.17896.gcode.pp, Win32 error: 193

Any suggestions?

Printer nocks print off buildplate

I've ran the script and it works fine. In the print when it generates the first few arcs it always goes back to starting pos of the next arc at the same pos. At the start of every arc a small blob appears and at that move it crashed into the print.

You can see the blobs I was talking about
20230501_195944

20230501_195950

Double deretraction at start of arc

I noticed that at the start of an arc infill section I was getting a large blog of filament being extruded. I investigated the gcode and found that deretraction from the layer change was being done twice (I believe). I have 0.3 mm extra deretraction, so I believe the first line is from Prusa slicer, and the second line is being added by the arc overhang script.

image

image

PrusaSlicer Arc Overhang Issues

I know this is the wrong hub, sorry. I can't find the issues page for the prusaslicer-integrated arc generator https://github.com/nicolai-wachenschwan/arc-overhang-prusaslicer-integration and barely know how to use github (if at all).
The code fails for me. I did a little digging and looking at the code line 841
if "; prusaslicer_config = begin" in line:

It never enters this block, as demonstrated in my debugging and verified with a search through a virgin .gcode output of prusaslicer 2.3.0, which reveals this string never appears.

What prusaslicer version does this require/what gcode block is it looking for so the syntax searched for can be updated?

Error Code 1 ?

Hi,
What is meant by "Error Code 1" ?
I get this when trying to export the g-code.

error-code-1 - Copy

Error on some conversions

I apologize if this isn't the correct forum. I'm having an issue running the script, either automatically with prusa slicer or from the command line. I have had 1 successful use, but all others have thrown errors with the message below, I do not know how to fix this, or what causes it and would appreciate assistance either with changing my settings/model or the script to get it to work.

/home/mstanich/Programming/3dModels/3dPrinter/prusa_slicer_post_processing_script.py:504: Layer 0: no height found, using layerheight default!
overhang found layer 71: 2 Z: 11.40
/home/mstanich/Programming/3dModels/3dPrinter/prusa_slicer_post_processing_script.py:529: Layer 70: Could not fetch real StartPoint.
Traceback (most recent call last):
File "/home/mstanich/Programming/3dModels/3dPrinter/prusa_slicer_post_processing_script.py", line 1197, in
main(gCodeFileStream,path2GCode, skipInput)
File "/home/mstanich/Programming/3dModels/3dPrinter/prusa_slicer_post_processing_script.py", line 170, in main
startpt=getStartPtOnLS(startLineString,parameters)
File "/home/mstanich/Programming/3dModels/3dPrinter/prusa_slicer_post_processing_script.py", line 862, in getStartPtOnLS
if not lsidx.is_integer():
AttributeError: 'numpy.int64' object has no attribute 'is_integer'

The code doesn't work with orca produced gcode

It throw an error about can't find a nozzle diameter settings.
Orca generate gcode different somehow from prusa slicer.

May it possible to make the code to accept parameters or make some default values for the settings in order to prevent exceptions if settings is not defined in the gcode file?

2 problems

I found 2 problems when testing this out.

  1. while I do not see the circle in this version of the print it filled the hole(right one) while I have printed this model before and it did not fill the hole.
    image
  2. After the part where it does the circles it goes back to normal but the speed is super slow.

Did I miss something in the documentation or are these real bugs?

Post-processing script Error

Good afternoon, I am not able to understand the reason for this error,
I use another script accelerations.py, this one works fine, but when I try to use prusa_slicer_post_processing_script.py, I always get the error below.
I already tested with pyton 3.10 and 3.11
all libraries are installed

thanks

Post-processing script
C:\python-3.10.0\scripts\prusa_slicer_post_processing_script.py
on file C:\Users\Eduardo\AppData\Local\Temp.4904.gcode.pp failed.
Error code: 1

file fails when using prusa slicer and python 3.11 on kali linux

i get the error

Post-processing script python3 /home/owner/.arc-overhang-prusaslicer-integration/prusa_slicer_post_processing_script.py on file /tmp/.153477.gcode.pp failed.
Error code: 1
Output:
Traceback (most recent call last):
File "/home/owner/.arc-overhang-prusaslicer-integration/prusa_slicer_post_processing_script.py", line 34, in <module>
from shapely import Point, Polygon, LineString, GeometryCollection, MultiLineString, MultiPolygon
ImportError: cannot import name 'Point' from 'shapely' (/home/owner/.local/lib/python3.11/site-packages/shapely/__init__.py)

TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

Running Prusa2.3.0
Error I get is

Error code: 1
Output:
Traceback (most recent call last):
File "/home/pi/Documents/3Dprinting/postprocessing/NoOverhang.py", line 1179, in <module>
main(gCodeFileStream,path2GCode, skipInput)
File "/home/pi/Documents/3Dprinting/postprocessing/NoOverhang.py", line 109, in main
parameters=makeFullSettingDict(gCodeSettingDict)
File "/home/pi/Documents/3Dprinting/postprocessing/NoOverhang.py", line 58, in makeFullSettingDict
"ExtendIntoPerimeter":1.5*gCodeSettingDict.get("perimeter_extrusion_width"), #min=0.5extrusionwidth!, extends the Area for arc generation, put higher to go through small passages. Unit:mm
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

Header of print file (gcode file) is:

; generated by PrusaSlicer 2.3.0 on 2023-03-20 at 19:39:36 UTC

; 

; external perimeters extrusion width = 0.45mm
; perimeters extrusion width = 0.45mm
; infill extrusion width = 0.45mm
; solid infill extrusion width = 0.45mm
; top infill extrusion width = 0.40mm
; first layer extrusion width = 0.42mm

M107
M190 S50 ; set bed temperature and wait for it to be reached
M104 S220 ; set temperature
;TYPE:Custom
START_PRINT
M109 S220 ; set temperature and wait for it to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for ...
etc etc

What is the problem? Is it a bug? Or do I have to correct a Prusa setting?

predicates.py:540: invalid value encountered in contains

I think I always got this message when a overhang was found

overhang found layer 280: Z28.1: 1
←[F←[Kwhile executed: 0 1
...\Python\Python311\Lib\site-packages\shapely\predicates.py:540: invalid value encountered in contains
modifying GCode
oldpolys found in layer: 281

script continues fine as far I can see, anyway results are great

Arcs not generated after removing bridge infill

The post-processing script outputs this:

Layer 201: No ExternalPerimeterPolys found in prev Layer
Skipping Polygon because no StartLine Found

and changed this bridging:
image
into a hole like this:
image
This is happening because the external perimeter is a line and doesn't contain enough points to make a polygon. The makePolygonFromGCode function returns None, due to this. Following this, the makeExternalPerimeter2Polys function does not update the self.extPerimeterPolys list, causing the makeStartLineString function to return None, None. When this occurs, arc generation skips the current polygon, leaving a hole. I haven't looked into a fix yet.

TypeError using MMU

OK, I am going to try this again, and address the closing comment in issue #42.

Trying to run the script on the attached gcode file (somewhat different than in #42) produces the following message:

INFO:PrusaSlicer Setting not in the expected format, but added into script dictionary: [' end_gcode ', '{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+1, max_print_height)} F720 ; Move print head up{endif}\\nG1 X0 Y210 F7200 ; park\\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+49, max_print_height)} F720 ; Move print head further up{endif}\\n{if has_wipe_tower}\\nG1 E-15 F3000\\n{else}\\nG1 E2 F5000\\nG1 E2 F5500\\nG1 E2 F6000\\nG1 E-15 F5800\\nG1 E-20 F5500\\nG1 E10 F3000\\nG1 E-10 F3100\\nG1 E10 F3150\\nG1 E-10 F3250\\nG1 E10 F3300\\n{endif}\\n\\nM140 S0 ; turn off heatbed\\nM107 ; turn off fan\\n\\n; Unload filament\\nM702 C\\n\\nG4 ; wait\\nM221 S100 ; reset flow\\nM900 K0 ; reset LA\\n{if print_settings_id=~/.*(DETAIL @MK3|QUALITY @MK3|SOLUBLE|@0.25 nozzle MK3).*/}M907 E538 ; reset extruder motor current{endif}\\nM104 S0 ; turn off temperature\\nM84 ; disable motors\\n; max_layer_z ', '[max_layer_z]']
Traceback (most recent call last):
  File "c:\standalone\prusa_slicer_post_processing_script.py", line 1189, in <module>
    main(gCodeFileStream,path2GCode,path2Output,skipInput)
  File "c:\standalone\prusa_slicer_post_processing_script.py", line 109, in main
    parameters=makeFullSettingDict(gCodeSettingDict)
  File "c:\standalone\prusa_slicer_post_processing_script.py", line 76, in makeFullSettingDict
    "ArcWidth":gCodeSettingDict.get("nozzle_diameter")*0.95, #change the spacing between the arcs,should be nozzle_diameter
TypeError: can't multiply sequence by non-int of type 'float'

The "INFO" message above appears to be from the "End G-code" setting, which is the stock setting for a Prusa MK3S+MMU2S.

The closing comment in #42 said that the extrusion width is not a number.

That is not the case here. I am using stock PrusaSlicer 2.5.2 settings for a Prusa MK3S with MMU. I'm using the "0.20mm QUALITY @mk3" preset. No changes to any parameters. The extrusion widths are all set to a number, 0.45 for all except top solid infill at 0.4 and support material at 0.35. These are all default values.

If PrusaSlicer is emitting incorrect g-code, then please identify what that is so you or I can report a bug on the PrusaSlicer github repository.

gcode file: rolodex_frame_0.2mm_PLA_MK3SMMU2S_26m.zip

Default PrusaSlicer settings for extrusion widths:
Screenshot 2023-04-12 210820

Layer 0: no height found

Getting this warning when executing the script

Tried to debug it but it's confusing,
I don't know where the script is trying to read the layer height from.

Strings added between edges

I tried the script on a small holder with overhangs. It appears to works as expected but adds a few strings between edges. PrusaSlicer 2.6. Model: https://cults3d.com/en/3d-model/tool/aqara-temperature-and-humidity-sensor-wsdcgq11lm-holder

arc_script_artifacts

I was able to remove most warnings, in particular enabling Avoid Crossing Perimeters, which I thought could be the cause of this, but it did not help. The remaining warnings are as below.

prusa_slicer_post_processing_script.py:1072: PrusaSlicer Setting end_gcode not in the expected key/value format, but added into the settings-dictionarry
prusa_slicer_post_processing_script.py:1086: machine_max_acceleration_e was specified as tuple/list, this is normal for using multiple extruders. For all list values First values will be used. If unhappy: Add manual fallback value by searching for ADD FALLBACK in the code. And add 'Fallback_:' into the dictionary.
last read linenumber: 38609
layers: 69
prusa_slicer_post_processing_script.py:504: Layer 0: no height found, using layerheight default!
overhang found layer 61: 2 Z: 12.40
prusa_slicer_post_processing_script.py:529: Layer 60: Could not fetch real StartPoint.
←[F←[Kwhile executed: 0 1
predicates.py:540: invalid value encountered in contains
←[F←[Kwhile executed: 0 1
modifying GCode

Unmodified gcode
c.zip

Finished part (pretty horrible, need to tune a lot of settings for this to look good. Will put it with a different face down to avoid overhangs)

IMG_1586

getting error unsupported operand type(s)

File "...overhang.py", line 1197, in
main(gCodeFileStream,path2GCode, skipInput)
File "...overhang.py", line 106, in main
parameters=makeFullSettingDict(gCodeSettingDict)
File "...overhang.py", line 53, in makeFullSettingDict
"ExtendIntoPerimeter":1.5*gCodeSettingDict.get("perimeter_extrusion_width"), #min=0.5extrusionwidth!, extends the Area for arc generation, put higher to go through small passages. Unit:mm
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

i didnt change the script at all

EOFError: EOF when reading a line -- > line 1197 and line 109

I am receiving this error when exporting out of PrusaSlicer as a post processing script or when running standalone.

Post-processing script /usr/bin/python3 /Users/cm/scripts/prusa_slicer_post_processing_script.py on file /var/folders/mb/6fmyt45x6fd0ntcxhh9yg7880000gp/T/.94609.gcode.pp failed.
Error code: 1
Output:
Traceback (most recent call last):
File "/Users/cm/scripts/prusa_slicer_post_processing_script.py", line 1197, in
main(gCodeFileStream,path2GCode, skipInput)
File "/Users/cm/scripts/prusa_slicer_post_processing_script.py", line 109, in main
input("Can not run script, gcode unmodified. Press enter to close.")
EOFError: EOF when reading a line

// system info
macOS 14.2.1
-rwxrwxrwx@ 1 cm staff 64019 Jan 27 10:33 prusa_slicer_post_processing_script.py

Python 3.11.7 (main, Jan 1 2024, 01:39:59) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin

pip list
Package Version


altgraph 0.17.2
contourpy 1.2.0
cycler 0.12.1
fonttools 4.47.2
future 0.18.2
importlib-resources 6.1.1
kiwisolver 1.4.5
macholib 1.15.2
matplotlib 3.8.2
numpy 1.26.3
numpy-hilbert-curve 1.0.1
packaging 23.2
pillow 10.2.0
pip 23.3.2
pyparsing 3.1.1
python-dateutil 2.8.2
setuptools 58.0.4
shapely 2.0.2
six 1.15.0
wheel 0.37.0
zipp 3.17.0

Script does not read parameters from gcode

When running the script on a gcode file I'm getting the following error:

python prusa* 16x* Traceback (most recent call last): File "/home/username/Documents/arc-overhang-prusaslicer-integration/prusa_slicer_post_processing_script.py", line 1173, in <module> main(gCodeFileStream,path2GCode, skipInput) File "/home/username/Documents/arc-overhang-prusaslicer-integration/prusa_slicer_post_processing_script.py", line 109, in main parameters=makeFullSettingDict(gCodeSettingDict) File "/home/username/Documents/arc-overhang-prusaslicer-integration/prusa_slicer_post_processing_script.py", line 58, in makeFullSettingDict "ExtendIntoPerimeter":1.5*gCodeSettingDict.get("perimeter_extrusion_width"), #min=0.5extrusionwidth!, extends the Area for arc generation, put higher to go through small passages. Unit:mm TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

Any help in solving this would be very much appreciated. I'm excited to give arc overhangs a try!

Turning off the Hilbert Curve infill and random lines of filament.

Hello, I want to ask if there is any way to turn off the Hilbert curve infill because my overhangs isn't that big for this infill and it is also very time consuming. I just want to try arc overhangs. 😄
PrusaSlicer version is 2.7.1 and I use MK4.

obrazek

And I also want to ask if there is any change how to remove this "red" random infill:

obrazek

Whole rewrited model:

obrazek

No supports made

This is the layer with bridging on it:
before modification:
image
after modification:
image
and you can see the next layer here:
image

here is my output:

E:\Tools\Prusa3D\Utilities\arcs.py:1087: PrusaSlicer-Setting: Travel Moves may cross the outline and therefore cause artefacts in arc generation.
last read linenumber: 5239
layers: 18
E:\Tools\Prusa3D\Utilities\arcs.py:492: Layer 0: no height found, using layerheight default!
overhang found layer 11: 1
E:\Tools\Prusa3D\Utilities\arcs.py:529: Layer 10: No ExternalPerimeterPolys found in prev Layer
E:\Tools\Prusa3D\Utilities\arcs.py:166: Skipping Polygon because to StartLine Found
modifying GCode
oldpolys found in layer: 12
making hilbert surface

There is clearly something I am missing, but I dont know what it is...

Overhang detection disabled in PrusaSlicer.

Hi, when i try to export get error that i dont htve Overhang detection in PrusaSlicer. i cant find any settings for that neither online or in the app itself.
here is the full error message:
C:\temp\prusa_slicer_post_processing_script.py:1080: Overhang detection disabled in PrusaSlicer. Activate in PrusaSlicer for script success!
C:\temp\prusa_slicer_post_processing_script.py:111: Incompatible PursaSlicer-Settings used!
Can not run script, gcode unmodified. Press enter to close.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.