Dimension Reference Error Detection and Correction

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
aapo
Posts: 612
Joined: Mon Oct 29, 2018 6:41 pm

Re: Dimension Reference Error Detection and Correction

Post by aapo »

wandererfan wrote: Sat Mar 25, 2023 8:30 pm The error detection and correction algo works for 3d dimensions also. It doesn't know about projection or hidden lines. It just compares the current referenced shape with the saved copy.
But doesn't the axonometric system depend on the 3D model for the correct distances? If the 3D model changes, the edge numbering in the 3D model may change, too. Or did I understand wrong how the 3D length information is transferred to the axonometric dimensions?
domad
Veteran
Posts: 2029
Joined: Mon Jun 22, 2020 12:16 pm

Re: Dimension Reference Error Detection and Correction

Post by domad »

wandererfan wrote: Sat Mar 25, 2023 8:25 pm
I broke the 3d dims. :oops: https://github.com/FreeCAD/FreeCAD/pull/9053 should put things back together.
....
git commit 20e44eba50 should fix the problem with 3d dims.
Greetings to the Community!
@wandererfan, I had no doubt you'd fix it in the blink of an eye, thanks!! :D
User avatar
wandererfan
Veteran
Posts: 6238
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Dimension Reference Error Detection and Correction

Post by wandererfan »

aapo wrote: Sat Mar 25, 2023 11:39 pm But doesn't the axonometric system depend on the 3D model for the correct distances? If the 3D model changes, the edge numbering in the 3D model may change, too. Or did I understand wrong how the 3D length information is transferred to the axonometric dimensions?
Edge numbers changing in 3d is handled the same way as edge numbers changing in 2d.

We compare the saved geometry for a dimension with the current geometry pointed to by the reference. If they are different, we search for a good match to the saved geometry. In the 2d case we search the lines on the drawing. In the 3d case we search the model.

Prior to this issue #7830 being resolved, it was necessary to connect the 3d reference geometry to the corresponding 2d geometry using LinkDimension. Now, the 3d reference geometry is projected directly onto the view. This eliminates one source of mismatches.
aapo
Posts: 612
Joined: Mon Oct 29, 2018 6:41 pm

Re: Dimension Reference Error Detection and Correction

Post by aapo »

wandererfan wrote: Sun Mar 26, 2023 2:34 pm Prior to this issue #7830 being resolved, it was necessary to connect the 3d reference geometry to the corresponding 2d geometry using LinkDimension. Now, the 3d reference geometry is projected directly onto the view. This eliminates one source of mismatches.
Ah, I see, so there's already a new independent mechanism to find the 3D references without the LinkDimension mechanism. The development goes forward at so fast pace that it's difficult to even follow it! :D
User avatar
wandererfan
Veteran
Posts: 6238
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Dimension Reference Error Detection and Correction

Post by wandererfan »

Phase 2 is available here: https://github.com/WandererFan/FreeCAD/ ... toCorrect4
This phase implements "inexact" matching for lines, circles and vertices. The matching algorithm is describing in issue #8878.

Please test if you can.
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Dimension Reference Error Detection and Correction

Post by user1234 »

wandererfan wrote: Fri Mar 31, 2023 2:12 pm Please test if you can.
Definitely.

Greetings
user1234
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Dimension Reference Error Detection and Correction

Post by user1234 »

@wandererfan : i found a small issue

When you edit the sketch (Sketch_edit_me) in that way, that the recomputing does not fail, it the dimension Dimension001 does not work. Also while recompiling the message

Code: Select all

Dimension001 - no exact match for changed 2d reference: 0
Dimension001 - trying to match changed geometry - stage 2
GG::bestMatchEdges - matching for geometry type: 6 is not implemented yet
does occur. The fillets does work.

2023-03-31_22-05.png
2023-03-31_22-05.png (192.2 KiB) Viewed 830 times

2023-03-31_22-08.png
2023-03-31_22-08.png (226.38 KiB) Viewed 830 times

PistonRod.FCStd
(68.81 KiB) Downloaded 27 times


Greetings
user1234
User avatar
wandererfan
Veteran
Posts: 6238
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Dimension Reference Error Detection and Correction

Post by wandererfan »

user1234 wrote: Fri Mar 31, 2023 8:17 pm GG::bestMatchEdges - matching for geometry type: 6 is not implemented yet
Geometry type 6 is BSpline. I've only got lines and circles implemented so far. Ellipses and Splines are next.
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Dimension Reference Error Detection and Correction

Post by user1234 »

wandererfan wrote: Sat Apr 01, 2023 12:57 pm Geometry type 6 is BSpline.
Sorry, i did not know, that the HLR give here, on a simple shape like that, a b-spline output. I do not expect for this phase b-spline support.

Greetings
user1234
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Dimension Reference Error Detection and Correction

Post by user1234 »

@wandererfan : an other testfile with mwe

2023-04-01_20-02.png
2023-04-01_20-02.png (174.48 KiB) Viewed 684 times
mwe_FreeCAD_LTNPAutoCorrect4.FCStd
(18.97 KiB) Downloaded 26 times

- open file
- open techdraw to see the one dimension
- mark the body and rote it 90deg in the placement (axis z is already correct)
---> works
- change it back to 0deg
---> works

- open file
- open techdraw to see the one dimension
- mark the body and rote it 180deg in the placement (axis z is already correct)
---> does not work
- change it back to 0deg
---> "works" means it found the former incorrect reference

- open file
- open techdraw to see the one dimension
- mark the body and rote it 178deg in the placement (axis z is already correct)
---> does not work
- change it back to 0deg
---> is correct again

- open file
- open techdraw to see the one dimension
- mark the body and rote it 175deg in the placement (axis z is already correct)
---> works
- change it back to 0deg
---> does not work
the limit of this case is around 174deg, while 174deg does not work anymore


The question is, is it about rotation, is it about length to height ratio, or is it about the same as before, that the HLR craps out again and makes b-splines, but i get all center marks (maybe some does not work, but looks like, because the center is the same). Following massages occur

Code: Select all

Dimension - no exact match for changed 2d reference: 0
Dimension - trying to match changed geometry - stage 2

Greetings
user1234

edit: missung parenthesis
Post Reply