TechDraw scale bugs

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
user1234
Veteran
Posts: 3319
Joined: Mon Jul 11, 2016 5:08 pm

TechDraw scale bugs

Post by user1234 »

Hello!

When i scale drawings, then it happens:

- the hatching is different
- the face dedection does not work anymore (for hatching)

See the video, a pictures are hard to follow:

1.webm
(354.36 KiB) Downloaded 41 times


files:

CylinderCover.FCStd
(242.48 KiB) Downloaded 36 times

2D_CylinderCover.FCStd
(131.75 KiB) Downloaded 39 times

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.20.28763 (Git)
Build type: Release
Branch: master
Hash: f8f3ba7a04f85ba379e68c624557d1d053013ef5
Python 3.9.2, Qt 5.15.2, Coin 4.0.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * Curves 0.4.2

Thanks!


Greetings
user1234
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: TechDraw scale bugs

Post by balrobs »

Can confirm here with:

Code: Select all

OS: Ubuntu 20.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.27936 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 66f3474)
Hash: 66f34746c8e8e2b18f308d705b6a98d9d6942791
Python 3.9.10, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * Plot 2022.4.17
  * Reinforcement
  * CfdOF 1.14.5
  * FreeCAD_SketchArch
  * Curves 0.3.0
For the specific case Scale=1,59 is fine while Scale=1,6 gives the strange behavior.
Edit:
Scale=3,19 leads to wrong result but Scale=3,20 is again ok :?:
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw scale bugs

Post by wandererfan »

user1234 wrote: Wed Apr 27, 2022 3:06 pm - the hatching is different
- the face dedection does not work anymore (for hatching)
Thanks for the report. We scale the input shape first and then give to the HLR algorithms, so it is possible HLR is giving back a different pile of edges at different scales. I'll look to see if scaling is possible after HLR, which should give us the same pile of edges at any scale.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: TechDraw scale bugs

Post by Shalmeneser »

Same problem with :

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28717 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: French/France (fr_FR)
Installed mods: 
  * fasteners 0.3.40
  * Manipulator 1.4.3
  * sheetmetal 0.2.49
(btw, why do you not use Hole tool instead of groove ?)
user1234
Veteran
Posts: 3319
Joined: Mon Jul 11, 2016 5:08 pm

Re: TechDraw scale bugs

Post by user1234 »

Thanks all for confirming!

wandererfan wrote: Wed Apr 27, 2022 7:12 pm We scale the input shape first and then give to the HLR algorithms, so it is possible HLR is giving back a different pile of edges at different scales.
Really? I did not know that, because i never noticed that. When scaling, all dimension and elements always still stick on the correct place, also in this case except the hatching (normally i preparing, like scaling, before doing other things on the drawing, maybe this is the reason why i never noticed that).

So i always thought, that the scale happens after the HLR. Is scaling not much faster after the HLR anyway? More TNP resistant it is for sure.

Thanks!

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

Re: TechDraw scale bugs

Post by wandererfan »

user1234 wrote: Wed Apr 27, 2022 10:44 pm So i always thought, that the scale happens after the HLR. Is scaling not much faster after the HLR anyway? More TNP resistant it is for sure.
Compared to projecting and finding all the intersections etc in HLR, the scaling operation is very quick.

In any case moving the scaling after the HLR didn't fix the problem. Another good theory down in flames. :(

The good news is that there is a new face detection algorithm in the queue and it doesn't have a problem with this file.
Attachments
newFaceFinderScale3.19.png
newFaceFinderScale3.19.png (56.83 KiB) Viewed 1579 times
user1234
Veteran
Posts: 3319
Joined: Mon Jul 11, 2016 5:08 pm

Re: TechDraw scale bugs

Post by user1234 »

wandererfan wrote: Thu Apr 28, 2022 12:56 pm The good news is that there is a new face detection algorithm in the queue and it doesn't have a problem with this file.
Very good! Thanks!

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

Re: TechDraw scale bugs

Post by user1234 »

@wandererfan: have you somewhere the a branch of the work in progress new face detection algorithm? I want to test it. I have here assemblies (which i can not post here), where i want to test it. TechDraw seems to have problems with slanted sections of cylinders and ellipses generally, see only the bearing in the attechment.

Greetings
user1234
Attachments
22226_E_K_W33.FCStd
(165.79 KiB) Downloaded 25 times
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw scale bugs

Post by wandererfan »

user1234 wrote: Wed May 25, 2022 1:46 pm have you somewhere the a branch of the work in progress new face detection algorithm? I want to test it.
The branch is here: https://github.com/WandererFan/FreeCAD/tree/newFaceAlgo

You should check "Allow Crazy Edges" on the Advanced tab in Preferences. This can improve face finding even with the old algorithm (except when all the tiny edges break everything).

You will need to add a boolean parameter in Tools/Edit parameters for Mod/TechDraw/General/NewFaceFinder and set it to true. You can compare old and new algorithms by toggling this setting and recomputing the view.

Thanks for testing!
user1234
Veteran
Posts: 3319
Joined: Mon Jul 11, 2016 5:08 pm

Re: TechDraw scale bugs

Post by user1234 »

It compiles fine, many thanks! It seems to work extreme better! Two bearing complicated combination (to deviate complicated) with all splines, ellipses and whatever seems to work really good (and from the feeling, a little bit faster faster). I will test it more and give you feedback later (and the model to test via pm).

Greetings
user1234
Post Reply