百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

ArcWelderLib

> 编程语言
开源

用于将G0/G1命令转换为G2/G3命令的工程集.

380 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于将G0/G1命令转换为G2/G3命令的工程集.

ArcWelderLib: Anti Stutter Libraries and Binaries

Converts G0/G1 GCode commands to G2/G3 (arc) commands and back again. This can greatly compress most GCode files and potentially improve quality by preventing planner starvation. It is especially useful when streaming over a serial connection (OctoPrint, Pronterface, Slicer Direct Printing), but has some potential advantages in other cases too depending on your firmware and board.

This software was designed for 3D printers but should also be useful in other cases.

Important Notes Regarding G2/G3 (arc) GCode Commands

In order for ArcWelded gcode files to work on your printer, arcs must be enabled. If these gcodes aren't enabled, the arc commands will be skipped, resulting in a mess. I plan to add instructions for detecting whether or not arc gcodes are enabled in the future.

Gcode Visualization for G2/G3 (arc) GCode Commands

Most gcode visualizers do NOT correctly display G2/G3 commands. This will cause the output to look like a mess, but it does NOT mean the ArcWelded GCode commands are incorrect or broken. It is likely that they will print just fine provided arc commands are enabled within your printer's firmware.'

GCode Visualizers That Do NOT support G2/G3 commands

Here are some common visualizers that do NOT support G2/G3 commands:

  • Cura
  • PrusaSlicer
  • Slic3r
  • Slic3r PE
  • SuperSlicer

GCode Visualizers that DO Support G2/G3

Here are a few that DO support G2/G3 commands:

  • Simplify3D
  • OctoPrint's built in 2D GCode Viewer
  • PrettyGCode plugin for OctoPrint
  • ncviewer.com - Note that this viewer has some issues with embedded thumbnails. It sometimes renders certain gcodes as arcs or circles as well, which can cause confusion. You can click on odd looking arcs and check out the gcode. If it's not a G2/G3, it's just a rendering bug.

Installation

Installation is a simple matter of downloading and extracting the latest release. You can find all of the releases here, with the latest release on top. Simply scroll to the bottom of the release and download the proper archive for your OS.

The archive will contain two folders:

  • bin - Here you will find the two console applications: ArcWelder and ArcStraightener. Just copy these to your local machine and you can run them from the command line, from a script, or directly within most slicers. See the sections below for instructions on how to use these applications.
  • lib - This folder contains pre-compiled ArcWelder libraries that can be integrated into applications. The GcodeProcessorLib library has functions for parsing gcode, tracking the printer's state and position, as well as several other goodies. The ArcWelder library (requires GcodeProcessorLib) contains the core welding algorithm.

Building from source

From the repository root, create a build directory, generate makefile, and build:

bash
mkdir build
cd build
cmake ..
make

The resulting console application is located in build/ArcWelderConsole/. You might want to create the build directory out of the repository, or make git ignore it, to avoid a dirty tree.

ArcWelder Console Application

This is a multiplatform console application that can be used to run the ArcWelder algorithm from a command prompt. Binaries are available for Windows, Linux, Raspbian, and MacOs. See the [installation][#installation] section for information on how to download the console application.

Running ArcWelder Console

Once ArcWelder (or ArcWelder.exe for Windows) is downloaded and copied to your machine, you can execute it in the following form:

{Path_To_Arc_Welder} {Options_Parameters} {Source_Path} {Optional_Target_Path}

Overwriting the source file

If you want to overwrite the source file, no target path is needed. For example, if you are running the Windows version from the root of your C drive and want to weld a file called C:\thing.gcode, you could run the following command from the terminal:

C:\ArcWelder.exe C:\thing.gcode

That will replace thing.gcode with a welded version of the file.

Creating a new file

If you want your original file preserved, you can specify a target path.

Windows example:

ArcWelder thing.gcode thing.aw.gcode

Linux/Raspbian example:

./ArcWelder thing.gcode thing.aw.gcode

That would create a new file called thing.aw.gcode and would leave the thing.gcode file alone.

You can also supply a path for the source and target gcode files:

ArcWelder c:\my_gcode\thing.gcode c:\my_gcode\arc_welded_files\thing.aw.gcode

Note: You may need to enclose the paths in quotes, for example, if there are any spaces.

ArcWelder Console Help

The console program will output all of the options with the following command for Windows:

ArcWelder --help

Arcwelder Version Information

Run the following command to view the current version, which is very useful for debugging purposes, or if you submit a github issue:

ArcWelder --version

Arcwelder Console Arguments

ArcWelder has good defaults for most applications, but occationally you may want more control. Many options are available that might be helpful depending on your situation.

ArcWelder uses the TCLAP Templatized C++ Command Line Parser for implementing the arguments, and I've been most impressed with it.

G90 Influences Extruder

For some printers, sending a G90 or G91 command also changes the E axis mode. This is required for any printer running Marlin 2+ or a fork of Marlin 2, for Smoothieware, and for Prusa Buddy Firmware (Prusa Mini). Do NOT add this flag if you are running any other firmware. If your firmware is not on this list but requires this parameter, please create an issue, and I will update the documentation.

  • Type: Flag
  • Default: Disabled
  • Short Parameter: -g
  • Long Parameter: --g90-influences-extruder
  • Example: ArcWelder "C:\thing.gcode" -g

Resolution (Maximum Path Deviation)

ArcWelder is able to compress line segments into gcode by taking advantage of the fact that a bunch of tiny line segments can, when viewed from a distance, approximate a curve. However, a true curved path will never match up exactly with a bunch of straight lines, so ArcWelder needs a bit of play in order to create arc commands. The resolution argument tells ArcWelder how much leeway it has with the original toolpath to make an arc. Increasing this value will result in more compression, and reducing it will improve accuracy. It is a trade-off, but one that most slicers implement anyway in order to prevent too many tiny movements from overwhelming your firmware. In fact, ArcWelder can produce toolpaths that are more accurate than simply merging short segments together, making it less 'lossy' than slicer resolution settings.

The default resolution is 0.05mm, which means your toolpaths can deviate by plus or minus 0.025mm. In general, this produces excellent results and toolpaths that are indistinguishable from the originals with the naked eye. For extremely high precision parts, you may decrease this value, but this will reduce the amount of compression that can be achieved.

Values above 0.1 are not recommended, as you may encounter overlapping toolpaths. When using values above 0.1, I recommend you use a visualizer that supports arcs before running your print.

  • Type: Value (millimeters)
  • Default: 0.05 (+- 0.025)
  • Restrictions: Only values greater than 0 are allowed.
  • Short Parameter: -r=
  • Long Parameter: --resolution-mm=
  • Example: ArcWelder "C:\thing.gcode" -r=0.1

Path Tolerance Percent (length)

This parameter allows you control how much the length of the final arc can deviate from the original toolpath. The default value of 5% is absolutely fine in most cases, even though that sounds like a lot. The key thing to remember here is that your firmware will break the G2/G3 commands into many small segments, essentially reversing the process, so the path length in your firmware will match the original path much more closely.

Originally, this setting was added as a safety feature to prevent prevent bad arcs from being generated in some edge cases. However, since then a new error detection algorithm was added that makes this unnecessary. In some cases, especially if your resolution parameter is large (above 0.1), this setting can be used to fine tune the generated arcs, so I left this setting in as is. 99+% of the time, no adjustments will be necessary here.

  • Type: Value (percent)
  • Default: 0.05 (5%)
  • Restrictions: Only values greater than 0 (0%) and less than 1.0 (100%) are allowed.
  • Short Parameter: -t=
  • Long Parameter: --path-tolerance-percent=
  • Example: ArcWelder "C:\thing.gcode" --path-tolerance-percent=0.10

Maximum Arc Radius

Allows you to control the maximum radius arc that will be generated with ArcWelder. This was added as a safety feature to prevent giant arcs from being generated for essentially straight lines. ArcWelder does have built-in detection to prevent colinear lines from being turned into arcs, but slight deviations due to the precision of the gcodes (usually fixed to 3 decimal places) can cause arcs to be generated where straight lines would do. Typically no adjustments are necessary from the defaults, but you can adjust this value if you want.

  • Type: Value (decimal, millimeters)
  • Default: 9999.0mm
  • Restrictions: Only values greater than 0.0 are allowed.
  • Short Parameter: -m=
  • Long Parameter: --max-radius-mm=
  • Example: ArcWelder "C:\thing.gcode" --max-radius-mm=1000.0

Allow 3D Arcs

This option allows G2/G3 commands to be generated when using vase mode. This is an experimental option, and it's possible that there are some unknown firmware issues when adding Z coordinates to arc commands. That being said, I've gotten pretty good results from this option. At some point, this will be enabled by default.

  • Type: Flag
  • Default: Disabled
  • Short Parameter: -z
  • Long Parameter: --allow-3d-arcs
  • Example: ArcWelder "C:\thing.gcode" --allow-3d-arcs

Allow Travel Arcs

This option allows G2/G3 commands to be generated when for travel moves (moves without any extrusion). In general, most travel moves will not be converted for the average 3D print. However, for plotters or CNC, or certain slicers that perform wipe actions while retracting, this feature can be useful. This is an experimental option.

Note: When using the allow-travel-arcs option, you will see separate statistics for the travel move conversion, or a message indicating that no travel moves were converted.

  • Type: Flag
  • Default: False
  • Short Parameter: -y
  • Long Parameter: --allow-travel-arcs
  • Example: ArcWelder "C:\thing.gcode" --allow-travel-arcs

Allow Dynamic Precision

Not all gcode has the same precision for X, Y, and Z parameters. Enabling this option will cause the precision to grow as ArcWelder encounters gcodes with higher precision. This may increase gcode size somewhat, depending on the precision of the gcode commands in your file.

Important Note: This option used to be the default, but in some cases I've seen files with unusually high precision. If it gets too high, the resulting gcode may overrun the gcode buffer size, causing prints to fail. For that reason, this option has been disabled by default. I've only seen a few cases where this happens, and it's always been due to custom start/end gcode with extremely high precision. See the Maximum Gcode Length section for more details.

  • Type: Flag
  • Default: Disabled
  • Short Parameter: -d
  • Long Parameter: --allow-dynamic-precision
  • Example: ArcWelder "C:\thing.gcode" --allow-dynamic-precision

Default XYZ Precision

ArcWelder outputs fixed precision for X, Y, Z, I, and J parameters. 99% of the time the default of 3 decimal places is just fine. If you

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++3d-printer3d-printingarc-movementsarc-support

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言