nicolai-wachenschwan / arc-overhang-prusaslicer-integration

A 3D printer slicing algorithm that lets you print 90° overhangs without support material.
GNU General Public License v3.0
328 stars 26 forks source link

The code doesn't work with orca produced gcode #74

Open vgdh opened 5 months ago

vgdh commented 5 months ago

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?

jperry004 commented 5 months ago

Upload the gcode file and I'll look at it.

vgdh commented 5 months ago

@Rickthebig is the author of the issue and he append the project below to the original issue. https://github.com/SoftFever/OrcaSlicer/files/14665397/Carl_the_Cubeish_Test_Joint.zip

vgdh commented 5 months ago

@Rickthebig please add the gcode if the problem is still there.

Rickthebig commented 5 months ago

@Rickthebig please add the gcode if the problem is still there.

What do you mean? Should I retry the postprocessor script? Where is the improved version? I postponed printing this particular model until a viable solution is available. So the problem is still there, so to say.

jperry004 commented 5 months ago

@Rickthebig please add the gcode if the problem is still there.

What do you mean? Should I retry the postprocessor script? Where is the improved version? I postponed printing this particular model until a viable solution is available. So the problem is still there, so to say.

Upload a gcode file and we'll see if it's possible/easy to add support for Orca. You have to change the filetype to .txt first.

Rickthebig commented 5 months ago

@jperry004 OK, I am uploading the corresponding gcode file (renamed). Carl_the_Cubeish_Test_Joint__PLA.txt I will stay tuned since I am very interested to get this arc overhang working, even if it is not a general option to be used blindly.

jperry004 commented 5 months ago

@jperry004 OK, I am uploading the corresponding gcode file (renamed). Carl_the_Cubeish_Test_Joint__PLA.txt I will stay tuned since I am very interested to get this arc overhang working, even if it is not a general option to be used blindly.

Nice, thanks for uploading. I did get it to run, and it's fairly easy - there's just a few things that are named differently in Orca. However no arcs were generated. It looks like most of the overhangs in this model are very small, too small for arcs. The default minimum is 50mm^2. However I found 1 overhang, at around line 120120, which is large enough but still was not generated. I'm not sure why that is, and more advanced knowledge than mine is needed from there. If you want to continue it would be best to start with some simple geometry object. I tried to open the STL in Prusa, but it wouldn't open for me. Perhaps the easiest things for now is to use Prusa slicer.

image

image

Rickthebig commented 5 months ago

@jperry004 OK, I am uploading the corresponding gcode file (renamed). Carl_the_Cubeish_Test_Joint__PLA.txt I will stay tuned since I am very interested to get this arc overhang working, even if it is not a general option to be used blindly.

Nice, thanks for uploading. I did get it to run, and it's fairly easy - there's just a few things that are named differently in Orca. However no arcs were generated. It looks like most of the overhangs in this model are very small, too small for arcs. The default minimum is 50mm^2. However I found 1 overhang, at around line 120120, which is large enough but still was not generated. I'm not sure why that is, and more advanced knowledge than mine is needed from there. If you want to continue it would be best to start with some simple geometry object. I tried to open the STL in Prusa, but it wouldn't open for me. Perhaps the easiest things for now is to use Prusa slicer.

image

image

Yes, the overhang you detected at 120120 is the one I am coping with. But in fact, it begins at 120156 (a bit later). The overhang mark seems to be a bit displaced.

Here is the crucial layer where overhang comes to play and showing a pronounced overhang:

image

Trying to build this layer in midair with conventional overhang technique will definitely fail.

Prior to building this layer, you can find the overhang mark at line 120125:

image

which is a bit too early in my understanding. The actual overhang begins a couple of moves later.

See also the mark "120791;TYPE:Overhang wall".

image

Actually one could manually edit the gcode and move this mark upwards..., if that is the pattern that the script uses to identify overhangs.

Besides, it could be indeed that the overhang area is slightly smaller than the minimal setting. To overcome that, I am providing a model which is scaled up a bit (in this enlarged model, the overhang mark appears at line 332447). Alternatively, one could decrease the minimal overhang area in the script to allow processing regardless.

Would you be so kind to provide the script adapted to Orca? Then I would also try myself, assuming I get phyton to run under Windows (but it should run). I will let you know the outcome of my trials. By the way, I am also uploading the model (STL), it should be loadable in Prusa Slicer. The model itself has nothing specific to Orca.

Thanks a lot for your efforts, I wish I would "pay back" contributing to the improvement of the script.

Carl_the_Cubeish_Test_Joint__PLA-enlarged.txt Carl_the_Cubeish_Cat-model.zip

jperry004 commented 5 months ago

@jperry004 OK, I am uploading the corresponding gcode file (renamed). Carl_the_Cubeish_Test_Joint__PLA.txt I will stay tuned since I am very interested to get this arc overhang working, even if it is not a general option to be used blindly.

Nice, thanks for uploading. I did get it to run, and it's fairly easy - there's just a few things that are named differently in Orca. However no arcs were generated. It looks like most of the overhangs in this model are very small, too small for arcs. The default minimum is 50mm^2. However I found 1 overhang, at around line 120120, which is large enough but still was not generated. I'm not sure why that is, and more advanced knowledge than mine is needed from there. If you want to continue it would be best to start with some simple geometry object. I tried to open the STL in Prusa, but it wouldn't open for me. Perhaps the easiest things for now is to use Prusa slicer. image image

Yes, the overhang you detected at 120120 is the one I am coping with. But in fact, it begins at 120156 (a bit later). The overhang mark seems to be a bit displaced.

Here is the crucial layer where overhang comes to play and showing a pronounced overhang:

image

Trying to build this layer in midair with conventional overhang technique will definitely fail.

Prior to building this layer, you can find the overhang mark at line 120125:

image

which is a bit too early in my understanding. The actual overhang begins a couple of moves later.

See also the mark "120791;TYPE:Overhang wall".

image

Actually one could manually edit the gcode and move this mark upwards..., if that is the pattern that the script uses to identify overhangs.

Besides, it could be indeed that the overhang area is slightly smaller than the minimal setting. To overcome that, I am providing a model which is scaled up a bit (in this enlarged model, the overhang mark appears at line 332447). Alternatively, one could decrease the minimal overhang area in the script to allow processing regardless.

Would you be so kind to provide the script adapted to Orca? Then I would also try myself, assuming I get phyton to run under Windows (but it should run). I will let you know the outcome of my trials. By the way, I am also uploading the model (STL), it should be loadable in Prusa Slicer. The model itself has nothing specific to Orca.

Thanks a lot for your efforts, I wish I would "pay back" contributing to the improvement of the script.

Carl_the_Cubeish_Test_Joint__PLA-enlarged.txt Carl_the_Cubeish_Cat-model.zip

Thanks for the screenshots, really helpful! That is one overhang definitely large enough and should be generated. I tried the englarged gcode, but same problem. I suspect the issue is a bit deeper in how polygons are being detected. As if the lines are being drawn differently in Orca.

I created a script that will modify Orca gcode files to work with the arc overhang script. I thought this would be easiest, as it doesn't require modifying the actual arc overhang script. It's located here:

https://github.com/jperry004/arc-overhang-prusaslicer-integration/tree/orca-tests-issue-78

that should be public I believe. To use it:

image

The layers and polys printouts are debug only, you won't see those.

Rickthebig commented 5 months ago

The layers and polys printouts are debug only

"Layer 96: 14 overhangs found"

That is the point where the script should kick in. I downloaded the conversion script and will give it a try today later. I think the problem could be that the original overhang has a very particular form and is filled with arcs due to the round perimeter - substituting arcs with arcs...

So to begin I will try more normal cases and see if it works at all.

I will report back - thanks sofar.

jperry004 commented 5 months ago

One cool thing I noticed is after using the converter script you can then look at the gcode with Prusa gcode visualizer. So I made a new STL with the same rough shape and it's able to generate the arcs no problem, first try. Behold, fake Carl:

image

I still can't quite figure out what is stopping the Orca file from working though.

caxtell commented 4 months ago

I have experienced this as well when using orca slicer and have tried using the convert_orca_prusa-script with little success. I was able to capture from the terminal a clue. Type Error: unsupported operand type(s) for *: 'float' and 'Nonetype' [process exited with code 1 (0x00000001)]

jperry004 commented 4 months ago

I have experienced this as well when using orca slicer and have tried using the convert_orca_prusa-script with little success. I was able to capture from the terminal a clue. Type Error: unsupported operand type(s) for *: 'float' and 'Nonetype' [process exited with code 1 (0x00000001)]

Could you upload the gcode file that you're trying to convert?

caxtell commented 4 months ago

Thanks in advance for the advise.

I tried also setting up the script in Prusa Slicer and configured the printer settings to work with my bambu P1S, just for clarification, and I got the exact same error when trying to Export to G-code. I believe it maybe something inherent to the printer custom g-code settings.

(Note: Had to split the file in two to upload it du 7684-conti.gcode.txt.txt e to size) [Uploading 7684.gcode.txt…]()

jperry004 commented 4 months ago

Thanks in advance for the advise.

I tried also setting up the script in Prusa Slicer and configured the printer settings to work with my bambu P1S, just for clarification, and I got the exact same error when trying to Export to G-code. I believe it maybe something inherent to the printer custom g-code settings.

(Note: Had to split the file in two to upload it du 7684-conti.gcode.txt.txt e to size) Uploading 7684.gcode.txt…

The first part file isn't downloading for me.

boromyr commented 3 weeks ago

Has anyone managed to get it to work in orcaslicer? I am getting this error.

Traceback (most recent call last):
  File "C:\Users\PC\AppData\Roaming\OrcaSlicer\arc.py", line 1197, in <module>
    main(gCodeFileStream,path2GCode, skipInput)
  File "C:\Users\PC\AppData\Roaming\OrcaSlicer\arc.py", line 106, in main
    parameters=makeFullSettingDict(gCodeSettingDict)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\OrcaSlicer\arc.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'