Hi Arciera,
Post 22 Oct 2024 06:03
This go trough workplane bottom problem can be avoided by checking :
1.If you have a trim lenght of 5mm. And the line is 15mm, then the line will be trimmed at the ends, resulting a netto line length 5mm.
2.In the case of your post, the trim dist is divided to fit. The line is for example 5mm. Trimming 5mm both ends will fail, then the trim is
divided to fit, wich results for example in a trim 2.4mm x 2 = 4.8mm, Then the netto line is 0.2mm.
Related calculation:
Code:
if (trim_distance >= seg.length / 2.0) {
trim_distance = (seg.length / 2.0)-1e-3;
}
Solution:
When a trim distance has to be lowered to fit, this then can be a reason to skip this line trim. Let the line as is.
When a full trim fit can be done, the clothoid has no reason to go trough the bottom of the workplane. This then is valid.
Post 22 Oct 2024 07:50
The function loops to all the segments. Here it sets one exception:
Do not trim this line end if upcoming line is colinear to this.
We can add more exceptions here.
Is there a particular reason for not handling one fillet after the other?
In a other function, we start with a list of segments. (gcode input) .
They then already have a flag if they may be trimmed front & back.
It this point the empty fillet segments are inserted inbetween. This is a vector insert operation.
Once the empty segments are in place. Then we add the values to the fillet by looking, what kind of fillet we are going to produce.
We now have 3 types : line, bspline or clothoid.
Nice you are digging into the code!
Are you using qt for it as viewer and editor? This should be the nice as you can load the cmakelists directly in qt.
Good luck.