Dogbone dressup problem (again)

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Dogbone dressup problem (again)

Post by sliptonic »

Giulio Buccini wrote: Tue Jan 18, 2022 12:07 pm Again:
there is not a valid reason why changing the mill-direction from CW to CCW even the two correctly done dogbones disappear... :shock:

This leads me to think that the problem is not caused by the liearity and the length of the segments in the corners: if the corners was valid in CW direction then they should stay valid even if I switch to CCW direction... I'm right?

I suspect that there is some bug in the algorithm used for calculation. :?
I suspect that there's two distinct problems so let's not assume they're connected.
In the first case of the ignored corner, the dressup is still doing exactly what it was designed to do. If you inspect the gcode at that corner, you have a G2/G3 meeting a G1. Dressup always ignores this. (hard limitation). It isn't the dressup, it's the underlying profile operation that generates those moves. Once they're both offset by the tool diameter the profile logic evaluates the long curve and the short straight segment together. Since there isn't enough deflection between them, it collapses them into one G2/G3 move. So here you have three options:

1) change your geometry so there's enough deflection.
2) Up the tolerance to the point that the profile generates a distinct G1 move for the short segment.
3) rewrite the dogbone logic so it can handle arcs.

#3 is best but dogbone is a tricky bit of code and I don't understand it well enough myself to tackle a rewrite yet. It was writtten by mlampert.

The other thing is more interesting. Those are both G1 moves regardless of direction and tolerance. I'm not sure why they're being ignored. This might be a valid bug.
Giulio Buccini
Posts: 541
Joined: Fri Aug 26, 2016 9:07 pm
Location: Munich - Gemany

Re: Dogbone dressup problem (again)

Post by Giulio Buccini »

sliptonic wrote: Tue Jan 18, 2022 9:50 pm If you inspect the gcode at that corner, you have a G2/G3 meeting a G1.
True. But the not-mirrored object has G1 meeting a G1 at the same corner.



sliptonic wrote: Tue Jan 18, 2022 9:50 pm It isn't the dressup, it's the underlying profile operation that generates those moves.
So the bug (better, the "loss of accuray") is hidden in the code of the profile operation. As I understand, for obscure reasons, the mirrored shape is profiled with a G2 meeting a G1. That is, an arc has substituted a straight path.
sliptonic wrote: Tue Jan 18, 2022 9:50 pm 1) change your geometry so there's enough deflection.
Not so easy. The design of the bracket is a cumulative work based on photos. After the first sketch, many others was added until the desired form was reached.
That short rectilinear side is used as reference for other sketches added after it. Elongating it will results in a complete mess + headache.

In an ideal world you start your design from a blank-sheet, make all parametric, and everything is perfectly know from the beginning. In the real world instead... well... it us a complete different story.
sliptonic wrote: Tue Jan 18, 2022 9:50 pm 2) Up the tolerance to the point that the profile generates a distinct G1 move for the short segment.
That could be a solution, but it is not elegant... it is like doing a strange ritual and crossing the finger. Also my PC is enough slow as it is, it doesn't need further motivations to make me frustrated! : )
sliptonic wrote: Tue Jan 18, 2022 9:50 pm 3) rewrite the dogbone logic so it can handle arcs.
You said that! :D :D :D
Now you're in serious troubles! :lol:
sliptonic wrote: Tue Jan 18, 2022 9:50 pm The other thing is more interesting. Those are both G1 moves regardless of direction and tolerance. I'm not sure why they're being ignored. This might be a valid bug.
Yes. It appears in both cases, that is on the mirrored and not-mirrored object. I cannot understand why it happens...
Giulio Buccini
Posts: 541
Joined: Fri Aug 26, 2016 9:07 pm
Location: Munich - Gemany

Re: Dogbone dressup problem (again)

Post by Giulio Buccini »

P.S.

You have to excuse me. I had not fully understood that the dressup-code looks only at the g-code instructions generated by the underlaying profile-operation.
In other words, the dressup code has not idea of the original shape of the object.

This means that you have a limited range of freedom in trying to solve bugs and problems. Not an ideal position for you. I understand this.
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Dogbone dressup problem (again)

Post by sliptonic »

Giulio Buccini wrote: Tue Jan 18, 2022 10:35 pm You have to excuse me. I had not fully understood that the dressup-code looks only at the g-code instructions generated by the underlaying profile-operation.
In other words, the dressup code has not idea of the original shape of the object.

This means that you have a limited range of freedom in trying to solve bugs and problems. Not an ideal position for you. I understand this.
That is correct. And yet it has proven to be remarkably powerful. Dressups are really meant to be tweaks to the base path. By doing it this way, they can be applied to any kind of base path. That means the logic for things like ramp entry doesn't get repeated into every operation.

It isn't perfect but it does the job (most of the time).

Giulio Buccini wrote: Tue Jan 18, 2022 10:30 pm That is, an arc has substituted a straight path.
Yep, this is deeper logic in PathArea related to curve fitting. It's removing extraneous segments that are outside the tolerance threshold. The result is much more efficient gcode.

One thing you could possible try: Without lengthening the small segment, can you add tiny segment orthogonal to both? In other words if the curve and the tiny segment are both parallel to X where they meet, can you move tiny 0.01mm in Y direction and connect their endpoints with an even tinier segment.? As long as the segment is below your needed accuracy in the part and above the tolerance threshold, it might force the G1 to be generated.
2022-01-18_17-36.png
2022-01-18_17-36.png (5.93 KiB) Viewed 1314 times
Giulio Buccini
Posts: 541
Joined: Fri Aug 26, 2016 9:07 pm
Location: Munich - Gemany

Re: Dogbone dressup problem (again)

Post by Giulio Buccini »

sliptonic wrote: Tue Jan 18, 2022 11:38 pmOne thing you could possible try: Without lengthening the small segment, can you add tiny segment orthogonal to both? In other words if the curve and the tiny segment are both parallel to X where they meet, can you move tiny 0.01mm in Y direction and connect their endpoints with an even tinier segment.? As long as the segment is below your needed accuracy in the part and above the tolerance threshold, it might force the G1 to be generated.
I tried already to add a small additional straight segment in the sketch. Unfortunately this is not possible due to the Freecad original sin: the fixed and unmutable numbering/naming of the edges.
After adding a new segment all of the overlying sketches are broken, and are producing a total mess in the overall geometries of the object... :(
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Dogbone dressup problem (again)

Post by sliptonic »

Alright. I got one more trick up my sleeve. I'm sure you're going to remember my kindness with a gigantic Patreon donation, right? :lol:

I just merged PR 4425. If you build from source you can grab master now. Otherwise you'll have to wait until it shows up in the appimages or daily build.

When it does, check the Profile properties. There's a new one called 'split arcs'. Set it to True and recompute. You won't get any G2/G3 moves for the entire profile. They'll be discretized to G1 moves. But now the dogbone will process the corner correctly.

2022-01-19_14-06.png
2022-01-19_14-06.png (114.5 KiB) Viewed 1191 times
Giulio Buccini
Posts: 541
Joined: Fri Aug 26, 2016 9:07 pm
Location: Munich - Gemany

Re: Dogbone dressup problem (again)

Post by Giulio Buccini »

:o :o :o
Amazing!!!!

P.S.
I'm already a patreon of Freecad with a monthly donation. But I will try to increase my quote if my wife does not discover it! :D

P.P.S.
I don't know how to recompile all of the executable, and I have zero free time for that at the moment. I will wait for the next build to test you solution.
Giulio Buccini
Posts: 541
Joined: Fri Aug 26, 2016 9:07 pm
Location: Munich - Gemany

Re: Dogbone dressup problem (again)

Post by Giulio Buccini »

In the meanwhile, I adopted a workaround: I have added some "home-made" T-bones at my object.

My solution seems working quite weel, even if adding two more sketches to my object has increased his "vulnerability" against future modifications of the underlying features.
I think that now the geometries of my object will get broken even if I look at it for too much time on the monitor... :lol:

Question: T-Bones are now working well as dog-bones with the new version? Did you tested it?
.
.
.
---------------------------------------------------------
Selection_7711.jpg
Selection_7711.jpg (44.08 KiB) Viewed 1125 times
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Dogbone dressup problem (again)

Post by chrisb »

Giulio Buccini wrote: Thu Jan 20, 2022 11:28 am I'm already a patreon of Freecad with a monthly donation. But I will try to increase my quote if my wife does not discover it! :D
Good guy! You can disguise the donation as alimonies. Your wife will never suspect that it is actually for FreeCAD.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Dogbone dressup problem (again)

Post by sliptonic »

Giulio Buccini wrote: Thu Jan 20, 2022 11:28 am I'm already a patreon of Freecad with a monthly donation. But I will try to increase my quote if my wife does not discover it! :D
Are you supporting a specific creator? FreeCAD doesn't have a community account. There's someone claiming to be the FreeCAD community with only a single 1$ patron. I have no idea who that is.
Post Reply