Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect arcs and generate G2/G3 #23

Open
alranel opened this issue Oct 19, 2011 · 120 comments
Open

Detect arcs and generate G2/G3 #23

alranel opened this issue Oct 19, 2011 · 120 comments

Comments

@alranel
Copy link
Member

alranel commented Oct 19, 2011

No description provided.

@alranel
Copy link
Member Author

alranel commented Nov 7, 2011

There are still some glitches in detection or arc center.

@alranel
Copy link
Member Author

alranel commented Nov 8, 2011

@alranel
Copy link
Member Author

alranel commented Dec 20, 2011

Also, it appears that radius is not always correct.

@sparr
Copy link
Contributor

sparr commented Dec 22, 2011

http://www.thingiverse.com/thing:13976

Slicing this model with --gcode-arcs results in this error around 70% of the way up the model:

Can't call method "distance_to" on an undefined value at /home/sparr/src/slic3r/git/Slic3r/lib/Slic3r/ExtrusionPath.pm line 168.

I suspect this is because ray_intersection is failing to return a point.

@jgeerds-zz
Copy link

Please add a checkbox under the advanced tab to enable/disable arc-slicing support.

@thiagopeixoto16
Copy link

I like @jgeerds suggestion.
I'd love to see Arcs working on Slic3r.

@furynick
Copy link

I'll be very glad too if arc support could be useable resulting in better accuracy of printed objects and avoiding some extrusion problem with very short segments of small arcs.

@alranel
Copy link
Member Author

alranel commented Jul 24, 2014

@furynick, can you provide more details about extrusion problems with very short segments of small arcs? Even with G2 and G3 firmware will subdivide the curve in many small segments.

@furynick
Copy link

it's not a Slic3r problem but a physical problem, I bought a all in one extruder where stepper is directly "plugged" on filament so the minimum extrusion length for 1 step (RAMPS driver configured with 1/16 microsteps) is about 0.02mm (49 steps per mm).
The gcode of the raft for example contains after each infill line a very small extrusion of 0.0031mm for ex (I use a 0.2mm nozzle). Arcs contains also small segments needing less than 0.02mm of filament and I believe they should be correctly extruded with G2/G3 commands (I need to make some tests to verify this hypothesis).
In all cases I plan to print precision mechanical parts and almost all parts may have rounded faces which will be better printed with G2/G3 commands.
I'm planning to add a Worm as a reductor to multiply needed amount of steps to forward 1mm of filament and avoid this problem as the minimum steps/mm value should not be less than 1000 in my mind.

@bethebeer
Copy link

Are arc commands supported in the GUI? I would like to output gcode with arc commands so that there is less code when I am printing cylindrical objects.

@qharley
Copy link

qharley commented Jan 25, 2015

I have a machine running smoothieware and I would love to test this feature to have it possibly included in a future release.
It seems to be disabled - How do I go about enabling it again?

@alranel
Copy link
Member Author

alranel commented Jan 25, 2015

@qharley, that code is not maintained and probably doesn't even work unless some work is done on it

@qharley
Copy link

qharley commented Jan 25, 2015

I see. I could do some work on it. It seems to be one of those features that everyone gets excited about, and then give up on...

Perhaps make it gcode flavor dependent, and only support the firmware that actually support it properly.

@thiagopeixoto16
Copy link

+1 on this

@manticorp
Copy link

Hi

I've been working on a gcode curve detector for implementing G2 and G3 code arcs for a while, and it seems to be coming along nicely and completely stops stuttering over USB.

An example of the change it can make:

G1 X115.938 Y62.818 E5.73464 F1200.000
G1 X116.919 Y62.911 E5.84105
G1 X117.874 Y63.038 E5.94500
G1 X118.846 Y63.205 E6.05141
G1 X119.789 Y63.405 E6.15536
G1 X120.745 Y63.645 E6.26177
G1 X121.670 Y63.915 E6.36572
G1 X122.606 Y64.226 E6.47213
G1 X123.508 Y64.565 E6.57608
G1 X124.417 Y64.947 E6.68248
G1 X125.290 Y65.353 E6.78644
G1 X126.168 Y65.803 E6.89284
G1 X127.009 Y66.274 E6.99679
G1 X127.850 Y66.788 E7.10320
G1 X128.652 Y67.322 E7.20716
G1 X129.452 Y67.898 E7.31356
G1 X130.212 Y68.491 E7.41751
G1 X130.966 Y69.126 E7.52392
G1 X131.679 Y69.775 E7.62787
G1 X132.383 Y70.465 E7.73428
G1 X133.044 Y71.166 E7.83823
G1 X133.507 Y71.694 E7.91402
G1 X134.301 Y72.656 E8.04857
G1 X134.892 Y73.445 E8.15498
G1 X135.441 Y74.237 E8.25893
G1 X135.971 Y75.068 E8.36534
G1 X136.458 Y75.900 E8.46929
G1 X136.924 Y76.769 E8.57570
G1 X137.347 Y77.635 E8.67964
G1 X137.746 Y78.537 E8.78605
G1 X138.102 Y79.432 E8.89001
G1 X138.431 Y80.361 E8.99641
G1 X138.718 Y81.281 E9.10036
G1 X138.977 Y82.233 E9.20677
G1 X139.194 Y83.171 E9.31072
G1 X139.379 Y84.140 E9.41713
G1 X139.524 Y85.092 E9.52108
G1 X139.636 Y86.072 E9.62749
G1 X139.709 Y87.033 E9.73144
G1 X139.746 Y88.018 E9.83784
G1 X139.746 Y88.982 E9.94180
G1 X139.709 Y89.967 E10.04821
G1 X139.636 Y90.928 E10.15215
G1 X139.524 Y91.908 E10.25856
G1 X139.379 Y92.860 E10.36252
G1 X139.194 Y93.829 E10.46892
G1 X138.977 Y94.767 E10.57287
G1 X138.718 Y95.719 E10.67928
G1 X138.431 Y96.639 E10.78323
G1 X138.102 Y97.568 E10.88964
G1 X137.746 Y98.463 E10.99359
G1 X137.347 Y99.365 E11.10000
G1 X136.924 Y100.231 E11.20395
G1 X136.458 Y101.100 E11.31036
G1 X135.971 Y101.932 E11.41431
G1 X135.441 Y102.763 E11.52072
G1 X134.892 Y103.555 E11.62466
G1 X134.301 Y104.344 E11.73107
G1 X133.694 Y105.092 E11.83503
G1 X133.044 Y105.834 E11.94143
G1 X132.383 Y106.535 E12.04538
G1 X131.679 Y107.225 E12.15179
G1 X130.966 Y107.874 E12.25574
G1 X130.212 Y108.509 E12.36215
G1 X129.452 Y109.102 E12.46610
G1 X128.652 Y109.678 E12.57250
G1 X127.850 Y110.212 E12.67646
G1 X127.009 Y110.726 E12.78287
G1 X126.168 Y111.197 E12.88682
G1 X125.290 Y111.647 E12.99322
G1 X124.417 Y112.053 E13.09718
G1 X123.508 Y112.435 E13.20358
G1 X122.606 Y112.774 E13.30754
G1 X121.670 Y113.085 E13.41394
G1 X120.745 Y113.355 E13.51789
G1 X119.789 Y113.595 E13.62430
G1 X118.846 Y113.795 E13.72825
G1 X117.874 Y113.962 E13.83466
G1 X116.919 Y114.089 E13.93861
G1 X115.938 Y114.182 E14.04502
G1 X114.976 Y114.237 E14.14897
G1 X113.990 Y114.255 E14.25538
G1 X113.026 Y114.237 E14.35933
G1 X112.042 Y114.181 E14.46573
G1 X111.083 Y114.090 E14.56969
G1 X110.105 Y113.960 E14.67609
G1 X109.156 Y113.797 E14.78004
G1 X108.191 Y113.593 E14.88645
G1 X107.256 Y113.358 E14.99040
G1 X106.310 Y113.082 E15.09681
G1 X105.396 Y112.777 E15.20076
G1 X104.738 Y112.530 E15.27655
G1 X103.584 Y112.057 E15.41110
G1 X102.690 Y111.642 E15.51751
G1 X101.832 Y111.203 E15.62146
G1 X100.972 Y110.720 E15.72787
G1 X100.150 Y110.218 E15.83182
G1 X99.329 Y109.672 E15.93822
G1 X98.547 Y109.108 E16.04218
G1 X97.770 Y108.502 E16.14859
G1 X97.033 Y107.881 E16.25254
G1 X96.304 Y107.218 E16.35895
G1 X95.616 Y106.543 E16.46289
G1 X95.134 Y106.032 E16.53868
G1 X94.304 Y105.101 E16.67324
G1 X93.683 Y104.335 E16.77964
G1 X93.105 Y103.564 E16.88359
G1 X92.543 Y102.754 E16.99000
G1 X92.025 Y101.941 E17.09395
G1 X91.670 Y101.335 E17.16974
G1 X91.072 Y100.241 E17.30430
G1 X90.639 Y99.355 E17.41070
G1 X90.249 Y98.474 E17.51465
G1 X89.885 Y97.558 E17.62106
G1 X89.563 Y96.649 E17.72501
G1 X89.269 Y95.708 E17.83142
G1 X89.017 Y94.778 E17.93537
G1 X88.795 Y93.818 E18.04178
G1 X88.614 Y92.871 E18.14573
G1 X88.465 Y91.896 E18.25214
G1 X88.356 Y90.939 E18.35609
G1 X88.281 Y89.956 E18.46250
G1 X88.245 Y88.993 E18.56645
G1 X88.245 Y88.007 E18.67285
G1 X88.281 Y87.044 E18.77680
G1 X88.356 Y86.061 E18.88322
G1 X88.465 Y85.104 E18.98716
G1 X88.571 Y84.409 E19.06295
G1 X88.795 Y83.183 E19.19750
G1 X89.017 Y82.222 E19.30392
G1 X89.269 Y81.292 E19.40786
G1 X89.563 Y80.351 E19.51427
G1 X89.885 Y79.442 E19.61822
G1 X90.249 Y78.526 E19.72463
G1 X90.639 Y77.645 E19.82858
G1 X91.072 Y76.759 E19.93499
G1 X91.527 Y75.910 E20.03894
G1 X92.025 Y75.059 E20.14535
G1 X92.543 Y74.246 E20.24930
G1 X93.105 Y73.436 E20.35570
G1 X93.651 Y72.707 E20.45399
G1 E17.45399 F12000.00000

becomes:

G1 X115.938 Y62.818 E5.73464 F1200.000
G1 X116.919 Y62.911 E5.841
G3 X93.651 Y72.707 I-2.924 J25.589 E20.454
G1 E17.45399 F12000.00000

If you'd be interested in the code, I can upload to GitHub if you want (although it's pretty raw at the moment, it does seem to do the job).

@furynick
Copy link

furynick commented Feb 2, 2016

yes please share your code, I'm highly interested.

@manticorp
Copy link

Okay, here you go:

https://github.com/manticorp/GCodeArcOptimiser

All the main working code is in:

https://github.com/manticorp/GCodeArcOptimiser/blob/master/functions.php

It's written in PHP (sorry!) but should be fairly easily translatable to Perl/C++.

One problem I'm having is testing it - its hard to know where it's going wrong, I've never got a fully working print out of it, but a lot of the movements seem right - of course any number of tiny things can make a print fail, though...

@furynick
Copy link

furynick commented Feb 2, 2016

PHP isn't a bad choice :)
I'll get an eye on it and give it a try, thanks for your work.

@manticorp
Copy link

That's okay - I'll update the README in a moment with a basic overview of how it works - I know how cryptic it can be reading someone else's hacky code...

@lordofhyphens
Copy link
Member

@qharley there's a Smoothieware gcode flavor now, so you can work on arcs for it if you'd like.

@PurpleSensation
Copy link

@phord have a look on the code capsule https://codeocean.com/2018/09/07/polyline-approximation-with-arcs-and-segments/code.

With very little tweaks you can modify the formatting script (inside the FitPolyline script) to write gcode instructions. I'll make it eventually but right now I'm busy with the starting course.

@Leozolt
Copy link

Leozolt commented Feb 19, 2019

this all sounds interesting and i was looking for g2 g3 in a slicer. I also discovered that it is key to detect arcs in a polyline environment (stl) before it was confirmed in this post. i would think of a way of telling if 3 consecutive lines share a common tangential radius and have about the same length, it could be an arc? but how could this be computed?

@Leozolt
Copy link

Leozolt commented Feb 19, 2019

I would also suggest that paths or path segment (lines) can be selected and "tagged as arc" so the slicer has more information on where to g2/g3.

@lordofhyphens
Copy link
Member

@Leozolt there is a branch on @TheThirdOne GitHub fork where the work was being done to get it into Slic3r.

@Leozolt
Copy link

Leozolt commented Feb 19, 2019

does a file format exist that can be used by slic3r to communicate 3d with arcs? stl is lines only if i remember well.

@lordofhyphens
Copy link
Member

@Leozolt no, which is why the work of @PurpleSensation was prompted.

If someone wants to build a replacement for TriangleMesh and the related Polygon-based code to be able to use STEP or something related.

@PurpleSensation
Copy link

I don't have te time to code the thing into slic3r, but I know someone who might be. I'll tell him. What should I explain to him? I don't know the structure of slic3r. Would this be a post processing script?

@lordofhyphens
Copy link
Member

@PurpleSensation it would be an extension of https://github.com/slic3r/Slic3r/blob/master/xs/src/libslic3r/PrintGCode.cpp very likely.

https://github.com/TheThirdOne/Slic3r/tree/arc-fitting is probably a good initial baseline (take a look at this files touched in that branch), and I would expect self-tests to be written according to expectations of how the arc fitter would work for a few example geometries.

@Jch24
Copy link

Jch24 commented Feb 2, 2020

Hi
I've been working on a gcode curve detector for implementing G2 and G3 code arcs for a while, and it seems to be coming along nicely and completely stops stuttering over USB.
An example of the change it can make:
G1 X115.938 Y62.818 E5.73464 F1200.000
G1 X116.919 Y62.911 E5.84105
G1 X117.874 Y63.038 E5.94500
G1 X118.846 Y63.205 E6.05141
G1 X119.789 Y63.405 E6.15536
G1 X120.745 Y63.645 E6.26177
G1 X121.670 Y63.915 E6.36572
G1 X122.606 Y64.226 E6.47213
G1 X123.508 Y64.565 E6.57608
G1 X124.417 Y64.947 E6.68248
G1 X125.290 Y65.353 E6.78644
G1 X126.168 Y65.803 E6.89284
G1 X127.009 Y66.274 E6.99679
G1 X127.850 Y66.788 E7.10320
G1 X128.652 Y67.322 E7.20716
G1 X129.452 Y67.898 E7.31356
G1 X130.212 Y68.491 E7.41751
G1 X130.966 Y69.126 E7.52392
G1 X131.679 Y69.775 E7.62787
G1 X132.383 Y70.465 E7.73428
G1 X133.044 Y71.166 E7.83823
G1 X133.507 Y71.694 E7.91402
G1 X134.301 Y72.656 E8.04857
G1 X134.892 Y73.445 E8.15498
G1 X135.441 Y74.237 E8.25893
G1 X135.971 Y75.068 E8.36534
G1 X136.458 Y75.900 E8.46929
G1 X136.924 Y76.769 E8.57570
G1 X137.347 Y77.635 E8.67964
G1 X137.746 Y78.537 E8.78605
G1 X138.102 Y79.432 E8.89001
G1 X138.431 Y80.361 E8.99641
G1 X138.718 Y81.281 E9.10036
G1 X138.977 Y82.233 E9.20677
G1 X139.194 Y83.171 E9.31072
G1 X139.379 Y84.140 E9.41713
G1 X139.524 Y85.092 E9.52108
G1 X139.636 Y86.072 E9.62749
G1 X139.709 Y87.033 E9.73144
G1 X139.746 Y88.018 E9.83784
G1 X139.746 Y88.982 E9.94180
G1 X139.709 Y89.967 E10.04821
G1 X139.636 Y90.928 E10.15215
G1 X139.524 Y91.908 E10.25856
G1 X139.379 Y92.860 E10.36252
G1 X139.194 Y93.829 E10.46892
G1 X138.977 Y94.767 E10.57287
G1 X138.718 Y95.719 E10.67928
G1 X138.431 Y96.639 E10.78323
G1 X138.102 Y97.568 E10.88964
G1 X137.746 Y98.463 E10.99359
G1 X137.347 Y99.365 E11.10000
G1 X136.924 Y100.231 E11.20395
G1 X136.458 Y101.100 E11.31036
G1 X135.971 Y101.932 E11.41431
G1 X135.441 Y102.763 E11.52072
G1 X134.892 Y103.555 E11.62466
G1 X134.301 Y104.344 E11.73107
G1 X133.694 Y105.092 E11.83503
G1 X133.044 Y105.834 E11.94143
G1 X132.383 Y106.535 E12.04538
G1 X131.679 Y107.225 E12.15179
G1 X130.966 Y107.874 E12.25574
G1 X130.212 Y108.509 E12.36215
G1 X129.452 Y109.102 E12.46610
G1 X128.652 Y109.678 E12.57250
G1 X127.850 Y110.212 E12.67646
G1 X127.009 Y110.726 E12.78287
G1 X126.168 Y111.197 E12.88682
G1 X125.290 Y111.647 E12.99322
G1 X124.417 Y112.053 E13.09718
G1 X123.508 Y112.435 E13.20358
G1 X122.606 Y112.774 E13.30754
G1 X121.670 Y113.085 E13.41394
G1 X120.745 Y113.355 E13.51789
G1 X119.789 Y113.595 E13.62430
G1 X118.846 Y113.795 E13.72825
G1 X117.874 Y113.962 E13.83466
G1 X116.919 Y114.089 E13.93861
G1 X115.938 Y114.182 E14.04502
G1 X114.976 Y114.237 E14.14897
G1 X113.990 Y114.255 E14.25538
G1 X113.026 Y114.237 E14.35933
G1 X112.042 Y114.181 E14.46573
G1 X111.083 Y114.090 E14.56969
G1 X110.105 Y113.960 E14.67609
G1 X109.156 Y113.797 E14.78004
G1 X108.191 Y113.593 E14.88645
G1 X107.256 Y113.358 E14.99040
G1 X106.310 Y113.082 E15.09681
G1 X105.396 Y112.777 E15.20076
G1 X104.738 Y112.530 E15.27655
G1 X103.584 Y112.057 E15.41110
G1 X102.690 Y111.642 E15.51751
G1 X101.832 Y111.203 E15.62146
G1 X100.972 Y110.720 E15.72787
G1 X100.150 Y110.218 E15.83182
G1 X99.329 Y109.672 E15.93822
G1 X98.547 Y109.108 E16.04218
G1 X97.770 Y108.502 E16.14859
G1 X97.033 Y107.881 E16.25254
G1 X96.304 Y107.218 E16.35895
G1 X95.616 Y106.543 E16.46289
G1 X95.134 Y106.032 E16.53868
G1 X94.304 Y105.101 E16.67324
G1 X93.683 Y104.335 E16.77964
G1 X93.105 Y103.564 E16.88359
G1 X92.543 Y102.754 E16.99000
G1 X92.025 Y101.941 E17.09395
G1 X91.670 Y101.335 E17.16974
G1 X91.072 Y100.241 E17.30430
G1 X90.639 Y99.355 E17.41070
G1 X90.249 Y98.474 E17.51465
G1 X89.885 Y97.558 E17.62106
G1 X89.563 Y96.649 E17.72501
G1 X89.269 Y95.708 E17.83142
G1 X89.017 Y94.778 E17.93537
G1 X88.795 Y93.818 E18.04178
G1 X88.614 Y92.871 E18.14573
G1 X88.465 Y91.896 E18.25214
G1 X88.356 Y90.939 E18.35609
G1 X88.281 Y89.956 E18.46250
G1 X88.245 Y88.993 E18.56645
G1 X88.245 Y88.007 E18.67285
G1 X88.281 Y87.044 E18.77680
G1 X88.356 Y86.061 E18.88322
G1 X88.465 Y85.104 E18.98716
G1 X88.571 Y84.409 E19.06295
G1 X88.795 Y83.183 E19.19750
G1 X89.017 Y82.222 E19.30392
G1 X89.269 Y81.292 E19.40786
G1 X89.563 Y80.351 E19.51427
G1 X89.885 Y79.442 E19.61822
G1 X90.249 Y78.526 E19.72463
G1 X90.639 Y77.645 E19.82858
G1 X91.072 Y76.759 E19.93499
G1 X91.527 Y75.910 E20.03894
G1 X92.025 Y75.059 E20.14535
G1 X92.543 Y74.246 E20.24930
G1 X93.105 Y73.436 E20.35570
G1 X93.651 Y72.707 E20.45399
G1 E17.45399 F12000.00000

becomes:
G1 X115.938 Y62.818 E5.73464 F1200.000
G1 X116.919 Y62.911 E5.841
G3 X93.651 Y72.707 I-2.924 J25.589 E20.454
G1 E17.45399 F12000.00000

If you'd be interested in the code, I can upload to GitHub if you want (although it's pretty raw at the moment, it does seem to do the job).

Hello,

I'm very interested in your G1 to G2/G3 converter. Unfortunately I cannot run it.

Is my way of running the software correct?
I take the index.php and drag&drop it into Firefox.

Now i have a page which asks me to browse for a .gcode file.
I select my GCODE from the HDD and click Submit.

Now it asks me again to browse for a GCODE file.

What am I doing wrong? I don't get a converted file.

Cheers from Germany

@thierryzoller
Copy link

Any Luck so far getting proper ARC support 9 years later? I agree that it would improve a lot of prints.

@Decstasy
Copy link

Decstasy commented Jun 28, 2020

I think that arc support needs a proper s curve acceleration to have good results which must result in stronger chips. I know it's off topic but arc support in combination with non planar 3d printing moves must be the next level sh*t in a few years for fdm printers.
I would like to have some more thoughts to this, lets start a discussion.
Nevertheless which engine of an existing slicer would be the best basis to start such an implemention? There is a topic in the cura project where one of the developers said they would have to redesign the whole engine; it's designed to work layer by layer.

@PurpleSensation
Copy link

Hi, I've working on the topic for several years now professionally. 3D segmentation is already a thing, we just need someone doing an implementation. Sadly I Can't take that task on myself for being too busy, but I can help with the algorithms.

@thierryzoller
Copy link

Reviving

@christianlupus
Copy link

The question is: How would such a feature be implemented (in the main core or as external program/library/plugin/....) and what are the ingredients? One thing is, of course, the arc detection from the mathematical/algorithmic perspective. The second thing is how to connect things in Slic3r. Can someone implementing this use support from the main development team (like how to integrate in the rest of the system)?

@PurpleSensation What would have to be implemented? If things are somewhat confidential, you can find a mail address in my Github profile. I would like to have a quick look into things if I might be able to help here a bit.

@PurpleSensation
Copy link

Mmmmmm I am definitively not a software engineer, and I have little idea on how to integrate this into the main core. The ideal would be to code the methods on a low level and not as a post processing thingy, but that is a possibility. Someone getting into experimentation is all we need. I can provide the algorithms coded in python / MATLAB. The first approach would be to apply only on perimeters.

@christianlupus
Copy link

I am both capable of Mathlab as well as C++. So my personal thinking is that It might be best to go this way: Reimplement the proposed algorithm as a "library" in C++. This allows testing and all fancy things. As the STL files are only polyhedrons/polytopes. So the arc information was already lost during the CAD-to-STL conversion. So it might be best to work on each layer independently to detect any arcs.
A second step would be to implement this into the GUI and make the functionality be used by Slic3r.

For my own reference see here.

@PurpleSensation
Copy link

I get your point. This incoming year I might have some extra time to work on this (also, I need a new printer because my self-made delta is in terrible condition). If anyone (like you) wants my direct assistance and the original code, I am more than pleased. Also, since I am working with C++ right now for my PhD, it might be possible that I build such library myself. Hope this issue is pushed forward.

@lordofhyphens
Copy link
Member

@christianlupus the work done by @PurpleSensation involved an algorithm to curve fit in 2d.

See GCode.cpp in libslic3r. Slic3r has all of the polygons already present in each layer (and each layer is done in parallel) as read from the 3d model as ExtrusionEntities.

When I looked at it last, it was more work than I was willing to put into it (especially since I want reproducible tests), and there's still some guesswork involved with the termination clause.

My thoughts on the matter were to implement it into GCodeWriter (immediate use) or to detect the arcs from ExtrusionEntities embedded polygons and extend Polyline, etc to store the arc information for later rendering with GCodeWriter.

The SVG output is probably a good place to start, to be honest, as it will give you a cleaner representation of how Slic3r sees it (and that code has less going on).

@lordofhyphens
Copy link
Member

Any tests you would write can test it in libslic3r, no need to reinvent your primitives.

@Floppy
Copy link

Floppy commented Jul 14, 2020

@FormerLurker is working on https://github.com/FormerLurker/ArcWelderPlugin, an Octoprint plugin that postprocesses uploaded files to generate arcs; the core algorithm is I think already in C, so porting the code across might be feasible?

@FormerLurker
Copy link

@Floppy, the console version can already be used as a post processor, fyi.

@FormerLurker
Copy link

@Floppy, also, you might want to look at ArcWelderLib, which contains the console app and various CMake scripts (not verified in all OSs). I've got a few commits to push that keep case and formatting consistent, which I will push in the next couple days.

@uis246
Copy link

uis246 commented Jan 31, 2022

CSG format contains enough info. STEP format AFAIK contains too.

@adras
Copy link

adras commented Jul 31, 2022

I think a way better option would be to not generate arcs at all and leave that to the program which generates the 3d model in the first place. For instance if a file format is supported which already has arc capability, that file format can be used by the 3d model program to save the file. When reading that file is supported by the slicer, arcs won't need to be generated because they already exist.
It seems like that's the approach the new Bambulab printer is going to use.

@bubnikv
Copy link
Contributor

bubnikv commented Aug 1, 2022

Bambula integrated OpenCascade kernel, that is half of FreeCad. Bambula use OpenCascade to tesselate STEP files into triangle models, thus the smooth arches are lost.

@adras
Copy link

adras commented Aug 1, 2022

Ok, that's very interesting. But I think, even with arcs from a step file it's probably quite a pain to calculate the infill between the curves. Well, not necessarily pain, but probably quite expensive to calculate because of all the sine and cosine functions that would be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests