Cut corners #1178

Open
opened 2026-04-05 16:57:09 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pi-squared-studio on 1/5/2026

image

Caution

After conducting several tests, I came to the conclusion that in this form, this PR is not effective enough. This PR is relevant only for models not exceeding 2-3 cm in size with a standard nozzle of 0.4. In addition, it turned out that in addition to improving, this PR introduces small other impairments that do not cover the positive effect. All visible improvements made by this PR are private, and are eliminated using other methods:

  • The main problem is the protruding corners when the lines are superimposed. They do not always occur, but only when the exterior wall is printed first and at certain printing speeds. This is not a mathematical (geometric) defect, but rather akin to a mechanical ringing. It is easily eliminated by selecting the Junction Deviation, PA parameter, changing the wall printing order or decreasing printer speed.
  • Forming the inner and outer corners - you can simply reduce the printing speed or use a smaller diameter nozzle.
  • Precision of lines and smooth surfaces for artistic printing - reducing the flow by 3-5%.

There were also positive aspects in the implementation of this PR, they can already be applied in completely different conceptual additions, these are:

  • Deliberately installing the nozzle in a corner for the predicted flow near. Some kind of analogue of canceling Junction Deviation or similar algorithms.
  • The correct formation of the ends of the printed track for the implementation of "beautiful" seams.
  • Formation of an acute corner more than 135 degrees.

At the moment, the project remains open for about a week (starting on January 20) to complete the discussion and close some issues. Next, I'll close it.

On the left is the usually maded print, on the right with the Improved Corners function enabled. Printed on one bed side to side. You can see that the angle on the modified sample is completely even. But this example is not perfect, as there are also defects caused by the resonance of the extruder. But this is already a significant result, because the basic negative factor for other settings has been eliminated. This resonance has also become easily detectable - you can see the downward waves at the bottom of the right sample, as they were masked by excessive extrusion during normal printing. This PR generally enhances the geometric characteristics of the print.

The preamble

All the time I've been doing 3D printing, I've noticed that the corners оа prints always turn out to be convex. This is especially noticeable when using silk plastics. Previously, I always associated this effect with transients in the extruder. I also thought that various parameterization methods such as Jerk, Junction Deviation, Pressure Advance and Input Shaping... But, as it turned out, it was difficult to remove the protruding corners. In some ways, I was getting better results, but in another place there was a severe deterioration.
I began to analyze this problem, and came to the conclusion that it is purely mechanical, but all the above methods of adjustment manipulated the speed. When I printed the same models at a very low speed, these defects did not go away, which means they did not depend in any way on the speed changes in the movement of the printhead and the extrusion speed.

Theory

If we analyze the path of the nozzle movement near the corner, we can see that excessive plastic extrusion occurs at a short distance. It comes from the fact that the Slicer operates with a certain ideal algorithm, which in practice turns out to be not exactly like that.

image image image image

In these drawings, areas with denser coloring show an overflow of material at the the lines junctions or in the their corners.

The line in the slicer is filled with some rectangular segments, which, when intersected, give a small area of a quarter of the nozzle area where 2 times more filament is squeezed out, the volume of which would be enough to fill an empty square. But since the nozzle has a circular cross-section, and the slicer operates with rectangular paths, more plastic is obviously squeezed out in the corners about by 21%. Moreover, the angle formed by the nozzle is not straight, but at least repeats the roundness of the nozzle.

That is, in real conditions, excess plastic will not flow towards the corner, but a kind of plaque will be formed that will distort the correct shape of the corner.

image

I tried several algorithms for forming an angle, including creating a flow gradient on the approach to this angle, but they did not produce the expected result. And reproducing the gradient at such distances turned out to be even more problematic, since it was necessary to dose volumes comparable to single steps of the extruder. I decided to make an algorithm that simply symmetrically shortens the extruded lines depending on the angle. But at the same time, the nozzle still makes its previous trajectory into the corner.

image image image

Realization

image

In the process of long research, I came to the conclusion that the formation of the exact angle is influenced by 2 factors - the superposition of lines near the junctions, and the superposition of lines at the formed corner. Separating these factors allowed me to write very simple and lightweight code without much mathematical calculations.

Superposition of lines near the junctions

This factor is always applied when there is a connection between two lines. It is very difficult to calculate the required volume for extraction, knowing that many other transients may occur, so there is a changeable overlap parameter cut_corners_overlap for more precise adjustment.

image image image

Mathematical calculations indicate an optimal value of 0.79, but it can be reduced to 0.5 depending on the material properties. If you select a value of 1.0, the corner overlap will be the same as when cut_corners is disabled, but the flow compensation will remain when overlapping lines at sharp angles.
Default value is 0.785398 - the difference between the area of a real round and square nozzle hole. The last statement is used as the basis for calculating of filament consumption volume of any slicer.

Warning

Since the ends of the lines are cutted by this method, in the g-code viewer may contain an unusual picture. But it everything is as it should be. With this method, the lines are shortened to compensate for excess material at the ends, but for the shortest segments, the flow density decreases without affecting the print accuracy. The prints will turn out to be smooth in reality without these visible tears.

image image
Figure: The flow rate map with disabled (at left) and enabled (at right) option "Cut Corners"
It is possible that the position of the seams will not be displayed. To configure them, disable this option for a while.

Superposition of lines at the formed corner

image image image

At this stage, the refilling area is simply tracked through the tangent of the angle and the superimposed line is filled using a flow gradient.

image

Usage

This option eliminates overflow in the connection of two printed lines when excessive material is extruded at their ends.
Positive moment is especially noticeable on the protruding corners of the model.
This also affects to decrease the overflow of a solid infill (like as Archimedean Chords) if it consists of many small segments.

Caution

The actions of this option are basic for others additional flow- and speed- shapers such as Jerk, Junction Deviation, Pressure Advance, and Input Shaping... Therefore, when calibrating, first set the cut_corners_overflow parameter and then recalibrate the rest from this list. Also set new values of the overlapping of seams, infills and perimeters.
The effect of this option does not depend on the print speed, but choose slow speeds for calibration to eliminate other factors that affect accuracy.
The correct results will be on the side that is less affected by the resonance effect of the print head.

Conclusion and plans

At the moment, some types of lines, such as sloping ones and arcs, fall under the influence of this PR, but this is only a small part of all prints. Maybe I'll try to implement this in the future.

*Originally created by @pi-squared-studio on 1/5/2026* <img width="1826" height="1015" alt="image" src="https://github.com/user-attachments/assets/2531eefe-305f-44cb-a90e-664d6f9e15bc" /> > [!CAUTION] > After conducting several tests, I came to the conclusion that in this form, this PR is not effective enough. This PR is relevant only for models not exceeding 2-3 cm in size with a standard nozzle of 0.4. In addition, it turned out that in addition to improving, this PR introduces small other impairments that do not cover the positive effect. All visible improvements made by this PR are private, and are eliminated using other methods: > - The main problem is the protruding corners when the lines are superimposed. They do not always occur, but only when the exterior wall is printed first and at certain printing speeds. This is not a mathematical (geometric) defect, but rather akin to a mechanical ringing. It is easily eliminated by selecting the Junction Deviation, PA parameter, changing the wall printing order or decreasing printer speed. > - Forming the inner and outer corners - you can simply reduce the printing speed or use a smaller diameter nozzle. > - Precision of lines and smooth surfaces for artistic printing - reducing the flow by 3-5%. > > There were also positive aspects in the implementation of this PR, they can already be applied in completely different conceptual additions, these are: > - Deliberately installing the nozzle in a corner for the predicted flow near. Some kind of analogue of canceling Junction Deviation or similar algorithms. > - The correct formation of the ends of the printed track for the implementation of "beautiful" seams. > - Formation of an acute corner more than 135 degrees. > > At the moment, the project remains open for about a week (starting on January 20) to complete the discussion and close some issues. Next, I'll close it. On the left is the usually maded print, on the right with the Improved Corners function enabled. Printed on one bed side to side. You can see that the angle on the modified sample is completely even. But this example is not perfect, as there are also defects caused by the resonance of the extruder. But this is already a significant result, because the basic negative factor for other settings has been eliminated. This resonance has also become easily detectable - you can see the downward waves at the bottom of the right sample, as they were masked by excessive extrusion during normal printing. This PR generally enhances the geometric characteristics of the print. # The preamble All the time I've been doing 3D printing, I've noticed that the corners оа prints always turn out to be convex. This is especially noticeable when using silk plastics. Previously, I always associated this effect with transients in the extruder. I also thought that various parameterization methods such as Jerk, Junction Deviation, Pressure Advance and Input Shaping... But, as it turned out, it was difficult to remove the protruding corners. In some ways, I was getting better results, but in another place there was a severe deterioration. I began to analyze this problem, and came to the conclusion that it is purely mechanical, but all the above methods of adjustment manipulated the speed. When I printed the same models at a very low speed, these defects did not go away, which means they did not depend in any way on the speed changes in the movement of the printhead and the extrusion speed. # Theory If we analyze the path of the nozzle movement near the corner, we can see that excessive plastic extrusion occurs at a short distance. It comes from the fact that the Slicer operates with a certain ideal algorithm, which in practice turns out to be not exactly like that. <img width="183" height="170" alt="image" src="https://github.com/user-attachments/assets/57e8abc1-8c03-45f7-955a-83a781105db6" /> <img width="182" height="170" alt="image" src="https://github.com/user-attachments/assets/af49f3ba-d198-4dab-aa59-c9cbf8c750a1" /> <img width="183" height="170" alt="image" src="https://github.com/user-attachments/assets/6322b48e-1068-42b0-9d23-3836e10534cb" /> <img width="183" height="169" alt="image" src="https://github.com/user-attachments/assets/91f202e4-c5f3-42bc-9103-f4861d45db70" /> In these drawings, areas with denser coloring show an overflow of material at the the lines junctions or in the their corners. The line in the slicer is filled with some rectangular segments, which, when intersected, give a small area of a quarter of the nozzle area where 2 times more filament is squeezed out, the volume of which would be enough to fill an empty square. But since the nozzle has a circular cross-section, and the slicer operates with rectangular paths, more plastic is obviously squeezed out in the corners about by 21%. Moreover, the angle formed by the nozzle is not straight, but at least repeats the roundness of the nozzle. That is, in real conditions, excess plastic will not flow towards the corner, but a kind of plaque will be formed that will distort the correct shape of the corner. <img width="182" height="170" alt="image" src="https://github.com/user-attachments/assets/bb03b075-4717-48c3-ba13-ee2099e41883" /> I tried several algorithms for forming an angle, including creating a flow gradient on the approach to this angle, but they did not produce the expected result. And reproducing the gradient at such distances turned out to be even more problematic, since it was necessary to dose volumes comparable to single steps of the extruder. I decided to make an algorithm that simply symmetrically shortens the extruded lines depending on the angle. But at the same time, the nozzle still makes its previous trajectory into the corner. <img width="183" height="169" alt="image" src="https://github.com/user-attachments/assets/63e58cfb-981e-4df0-9004-5d75437588ec" /> <img width="183" height="170" alt="image" src="https://github.com/user-attachments/assets/a4b60674-ed4d-4587-87fe-9fb384fd4a17" /> <img width="183" height="169" alt="image" src="https://github.com/user-attachments/assets/c2c4f813-bc43-410b-897f-3a5cee312b56" /> # Realization <img width="420" height="371" alt="image" src="https://github.com/user-attachments/assets/e09fdc06-5f40-499c-9af9-50fca938c87e" /> In the process of long research, I came to the conclusion that the formation of the exact angle is influenced by 2 factors - the superposition of lines near the junctions, and the superposition of lines at the formed corner. Separating these factors allowed me to write very simple and lightweight code without much mathematical calculations. ## Superposition of lines near the junctions This factor is always applied when there is a connection between two lines. It is very difficult to calculate the required volume for extraction, knowing that many other transients may occur, so there is a changeable overlap parameter **cut_corners_overlap** for more precise adjustment. <img width="182" height="169" alt="image" src="https://github.com/user-attachments/assets/6efe153f-0ca3-48e7-8323-0bd34423ec15" /> <img width="183" height="169" alt="image" src="https://github.com/user-attachments/assets/91ee69f6-6555-409a-80d6-d8936af60b94" /> <img width="183" height="169" alt="image" src="https://github.com/user-attachments/assets/8d88f2e9-a4b9-4e18-bd99-19d3dfb1ee67" /> Mathematical calculations indicate an optimal value of 0.79, but it can be reduced to 0.5 depending on the material properties. If you select a value of 1.0, the corner overlap will be the same as when cut_corners is disabled, but the flow compensation will remain when overlapping lines at sharp angles. Default value is 0.785398 - the difference between the area of a real round and square nozzle hole. The last statement is used as the basis for calculating of filament consumption volume of any slicer. > [!WARNING] > Since the ends of the lines are cutted by this method, in the g-code viewer may contain an unusual picture. But it everything is as it should be. With this method, the lines are shortened to compensate for excess material at the ends, but for the shortest segments, the flow density decreases without affecting the print accuracy. The prints will turn out to be smooth in reality without these visible tears. > > <img width="350" alt="image" src="https://github.com/user-attachments/assets/829a913f-8657-4df8-b1f0-637351069296" /> <img width="350" alt="image" src="https://github.com/user-attachments/assets/5e04528c-4f75-4392-9a66-a36f5b1fc236" /> > Figure: The flow rate map with disabled (at left) and enabled (at right) option "Cut Corners" > It is possible that the position of the seams will not be displayed. To configure them, disable this option for a while. ## Superposition of lines at the formed corner <img width="298" height="96" alt="image" src="https://github.com/user-attachments/assets/b1f138de-d1f8-476a-87fe-f6e35c22f802" /> <img width="181" height="174" alt="image" src="https://github.com/user-attachments/assets/3f5676dd-0d2e-41a3-a123-defbd758e723" /> <img width="181" height="174" alt="image" src="https://github.com/user-attachments/assets/90488712-b6e9-4070-8014-ee44131f4a92" /> At this stage, the refilling area is simply tracked through the tangent of the angle and the superimposed line is filled using a flow gradient. <img width="679" height="714" alt="image" src="https://github.com/user-attachments/assets/1c6be7d4-f026-4474-a2a4-8f4d10727da6" /> # Usage This option eliminates overflow in the connection of two printed lines when excessive material is extruded at their ends. Positive moment is especially noticeable on the protruding corners of the model. This also affects to decrease the overflow of a solid infill (like as Archimedean Chords) if it consists of many small segments. > [!CAUTION] > The actions of this option are basic for others additional flow- and speed- shapers such as Jerk, Junction Deviation, Pressure Advance, and Input Shaping... Therefore, when calibrating, first set the **cut_corners_overflow** parameter and then recalibrate the rest from this list. Also set new values of the overlapping of seams, infills and perimeters. > The effect of this option does not depend on the print speed, but choose slow speeds for calibration to eliminate other factors that affect accuracy. > The correct results will be on the side that is less affected by the resonance effect of the print head. ## Conclusion and plans At the moment, some types of lines, such as sloping ones and arcs, fall under the influence of this PR, but this is only a small part of all prints. Maybe I'll try to implement this in the future.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#1178