FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

PartDesign: Additive Helix with negative Cone Angle breaks with height over one revolution

Open schulzh opened this issue 1 year ago • 16 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Problem description

I am trying to edit this model in FC 1.0: https://www.printables.com/model/826091

Here is what the file looks like in 0.21.2: image

When opening the file in 1.0 the threads are reversed, they go down and expand outward. Also the settings of the helix: image

Playing around with the settings, the helix is correct up to (not including) a height of 6.0mm, which is exactly one revolution: image

Full version info

OS: KDE Flatpak runtime (GNOME/gnome/xcb)
Architecture: x86_64
Version: 1.0.0.39109 (Git) Flatpak
Build type: Release
Branch: (HEAD detached at 2fcc531)
Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20
Python 3.11.10, Qt 6.7.3, Coin 4.0.3, Vtk 9.2.6, OCC 7.8.1
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/
Installed mods: 
  * fasteners 0.5.31

Also tried this on Windows, same result

Subproject(s) affected?

None

Anything else?

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

schulzh avatar Nov 24 '24 15:11 schulzh

@schulzh could it be the same as https://github.com/FreeCAD/FreeCAD/issues/18072 @FlachyJoe FYI

maxwxyz avatar Nov 24 '24 16:11 maxwxyz

I don't think so, I don't get any error message related to the helix (it just computes wrong) and the linked issue states that cone angle 0 does not work, which is not the case in this model.

schulzh avatar Nov 24 '24 16:11 schulzh

I confirm. The behavior is strange. At a negative angle, the direction of the spiral changes. I am not sure how it was before 1.0

Checked with:

FreeCAD 1.0.0.39109 (Git), Arch Linux (KDE/plasma/wayland)
OS: Arch Linux (KDE/plasma/wayland)
Architecture: x86_64
Version: 1.0.0.39109 (Git)
Build type: Release
Branch: makepkg
Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20
Python 3.12.7, Qt 6.8.0, Coin 4.0.3, Vtk 9.3.1, OCC 7.8.1
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/
Installed mods: lattice2 1.0.0; CurvedShapes 1.0.13; MeshRemodel 1.10.34; freecad.gears 1.3.0; fasteners 0.5.31; sheetmetal 0.5.7; Silk 0.1.5; Curves 0.6.51
FreeCAD 1.1.0dev.39240 (Git) Conda AppImage, Arch Linux (KDE/plasma/xcb)
OS: Arch Linux (KDE/plasma/xcb)
Architecture: x86_64
Version: 1.1.0dev.39240 (Git) Conda AppImage
Build type: Release
Branch: main
Hash: f9ba94c70b139ece6ba5ffba47632d91b5c9c645
Python 3.11.9, Qt 5.15.13, Coin 4.0.3, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion
Installed mods: lattice2 1.0.0; CurvedShapes 1.0.13; MeshRemodel 1.10.34; freecad.gears 1.3.0; fasteners 0.5.31; sheetmetal 0.5.7; Silk 0.1.5; Curves 0.6.51

Screenshot_20241124_180649_hor

tarman3 avatar Nov 24 '24 16:11 tarman3

I think it is a previously fixed bug (before the TNP mitigation), the fix was certainly lost. Can someone search on closed issues?

FlachyJoe avatar Nov 24 '24 17:11 FlachyJoe

@FlachyJoe yes: https://github.com/FreeCAD/FreeCAD/issues/10284

maxwxyz avatar Nov 24 '24 17:11 maxwxyz

I've noticed another strange thing about this bug: The helix actually extrudes in the correct direction for the remainder of a revolution, only the full revolutions extrude downwards: image image image

schulzh avatar Nov 24 '24 17:11 schulzh

I'll confirm

https://github.com/user-attachments/assets/82d08f82-a7b5-4d5e-a95d-b3a0b70a3bcc

tarman3 avatar Nov 24 '24 17:11 tarman3

PR is ready to merge

luzpaz avatar Dec 10 '24 18:12 luzpaz

In last dev negative cone angle still mirroring helix if cross-section is circle. With rectangle no issue.

https://github.com/user-attachments/assets/32f6235c-649b-4e7c-b5e9-526d90780368

tarman3 avatar Dec 17 '24 18:12 tarman3

@FlachyJoe :point_up_2:

luzpaz avatar Dec 18 '24 12:12 luzpaz

@luzpaz @tarman3 Grlmbrgrlm ! 😤

FlachyJoe avatar Dec 18 '24 21:12 FlachyJoe

The problem occurs when the profile center is on the sketch X axis. It can be reproduced with a centered rectangle too. I still investigate.

@maxwxyz please reopen

FlachyJoe avatar Dec 21 '24 10:12 FlachyJoe

If the profile center is below the 179.6725° construction line then the helix fails. image

The computed path is good so it seems an OCC bug.

@AIRCAP may it be solved with another tolerance fix ?

FlachyJoe avatar Jan 07 '25 22:01 FlachyJoe

Now I understand the issue better.

Maybe it would be good that the user could have an warning or an info message or have the tooltip of the cone angle stating that negative values can make the helix/thread/feature self interact and then produce unexpected/broken results?

leoheck avatar Apr 18 '25 13:04 leoheck

I confirm. The behavior is strange. At a negative angle, the direction of the spiral changes. I am not sure how it was before 1.0

I found this issue because I am encountering the same problem (Version: 1.0.0.39109 (Git), Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20)

If the profile center is below the 179.6725° construction line then the helix fails.

I could not reproduce this behaviour with my more complex profile. No matter which Quadrant I put it in, it always does this.

PC4-01_Nut_BSPT_Rc1-8.zip

binomnom avatar May 10 '25 17:05 binomnom

I work around this bug for now by just starting the helix from the other end.

I have found another weird behavior with the taper angle in PartDesign Helix that I'd like to show here, so you can tell me whether this is the same issue or if I should open another issue for it: PC4-01_Nut_BSPT_Rc1-8_V2.zip

If and only if there is a value other than 0 in the taper field, the helix fails as soon as it reaches an edge in the tip's geometry:

Height set so that edge of the object is not intersected: Image

Increased height by 0.1mm, helix reaches edge and fails: Image

But when angle is reset to 0, helix works without issue: Image

What do you think of this? I'm guessing @FlachyJoe, you could know?

EDIT: On further tinkering, it is not just an issue with PartDesign Helix. I tried the same thing with a Part Helix and a PartDesign Pipe, and it shows the same behaviour (PC4-01_Nut_BSPT_Rc1-8_v3.zip). Am I doing something wrong?

binomnom avatar May 10 '25 17:05 binomnom

@binomnom

  1. disable the auto-refine preferences when you work with helix: #17846
  2. switch off all the Refine properties of your model
  3. PC4-01_Nut_BSPT_Rc1-8_v3 is now working when you set Helix001.SegmentLength=1

I've not tested your other files but I'm confident Refine is the major issue.

FlachyJoe avatar May 11 '25 09:05 FlachyJoe

@FlachyJoe thank you for taking the time to have a look! So I am not doing anything fundamentally wrong, but the issue is well known. Very grateful for your help!

binomnom avatar May 11 '25 11:05 binomnom

I can confirm that on 21.2,the file foamscrew.zip looks good:

[code]
OS: Windows 11 build 26100
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git)
Build type: Release
Branch: releases/FreeCAD-0-21
Hash: b9bfa5c5507506e4515816414cd27f4851d00489
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
[/code]
Image

pieterhijma avatar Aug 31 '25 10:08 pieterhijma

I check with the latest main:

OS: Arch Linux (tty)
Architecture: x86_64
Version: 1.1.0dev.43162 (Git)
Build date: 2025/08/31 03:10:14
Build type: Unknown
Branch: main
Hash: 9d806694ffe4245e2d6ad11abda406a9b076872f
Python 3.13.5, Qt 6.9.1, Coin 4.0.3, Vtk 9.5.0, boost 1_88, Eigen3 3.4.0, PySide 6.9.1
shiboken 6.9.1, SMESH 7.7.1.0, xerces-c 3.3.0, OCC 7.9.1
Locale: English/United States (en_US)
Navigation Style/Orbit Style/Rotation Mode: CAD/Trackball/Drag at cursor
Stylesheet/Theme/QtStyle: OpenDark.qss/OpenDark/
Logical DPI/Physical DPI/Pixel Ratio: 96/92.6073/1.33333
Installed mods: 
  * OpenTheme 2024.5.16
  * Ondsel-Lens 2024.10.21.01
  * fasteners 0.5.34
  * WebTools 1.0.0
  * osh-autodoc-workbench 0.2.3
  * DynamicData 2.70.0
  * Curves 0.6.61
  * freecad.gears 1.3.0
  * sheetmetal 0.7.24

The fusion seems to give problems in rendering, but if I check the geometry, then all is fine. Before the fusion:

Image

After the fusion:

Image

The same is true for the whole screw:

Image

However, if I export the screw as a brep and then import it as a brep, all looks good:

Image

There are no errors when I do Part -> Check geometry.

What to do with this issue?

pieterhijma avatar Aug 31 '25 11:08 pieterhijma

If the profile center is below the 179.6725° construction line then the helix fails. image

The computed path is good so it seems an OCC bug.

I cannot reproduce this on main either:

OS: Arch Linux (tty)
Architecture: x86_64
Version: 1.1.0dev.43162 (Git)
Build date: 2025/08/31 03:10:14
Build type: Unknown
Branch: main
Hash: 9d806694ffe4245e2d6ad11abda406a9b076872f
Python 3.13.5, Qt 6.9.1, Coin 4.0.3, Vtk 9.5.0, boost 1_88, Eigen3 3.4.0, PySide 6.9.1
shiboken 6.9.1, SMESH 7.7.1.0, xerces-c 3.3.0, OCC 7.9.1
Locale: English/United States (en_US)
Navigation Style/Orbit Style/Rotation Mode: CAD/Trackball/Drag at cursor
Stylesheet/Theme/QtStyle: OpenDark.qss/OpenDark/
Logical DPI/Physical DPI/Pixel Ratio: 96/92.6073/1.33333
Installed mods: 
  * OpenTheme 2024.5.16
  * Ondsel-Lens 2024.10.21.01
  * fasteners 0.5.34
  * WebTools 1.0.0
  * osh-autodoc-workbench 0.2.3
  * DynamicData 2.70.0
  * Curves 0.6.61
  * freecad.gears 1.3.0
  * sheetmetal 0.7.24

This is the file I used (rename the file to remove .zip): neg-angle-helix.FCStd.zip

pieterhijma avatar Aug 31 '25 11:08 pieterhijma

when we are going to have the occt upgraded?

leoheck avatar Aug 31 '25 21:08 leoheck

when we are going to have the occt upgraded?

That is a challenging question. Linux distributions can ship any OCCT they deem fit. We are planning to target the latest stable from OpenCascade for the full builds that we do ourselves but that hasn't happened yet.

pieterhijma avatar Sep 01 '25 14:09 pieterhijma