Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem] Sketcher: Rounded corners frame rectangle with negative thickness crashes FreeCAD #15834

Closed
2 tasks done
MiqCG opened this issue Aug 8, 2024 · 4 comments · Fixed by #16140
Closed
2 tasks done
Labels
Mod: Sketcher Related to the Sketcher Workbench Type: Bug This issue or PR is related to a bug Type: Crash For issues describing crashes or PRs fixing one

Comments

@MiqCG
Copy link

MiqCG commented Aug 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

In Sketcher, when drawing a "Centered rectangle" with modes "Rounded corners" and "Frame" activated, and On-View-Parameters (OVP) "Dimensions only", FreeCAD crashes when entering the final number for the thickness with a negative value (decimal numeral or not). See attached video.

With commercial tubes you normally know the external dimensions and the thickness.
The result is correct if "Rounded corners" are deactivated (only Frame mode). FreeCAD neither crashes if no numeral is entered in thickness OVP and it is latter assigned with a Construction line; then in the Report view appears this:

00:43:02 Sketch: Solving the sketch failed
00:43:02 Sketch: Solving the sketch failed

Attached the file with this last method that doesn't crash, if it helps.

Tested and found in 0.22 revisions 38419, 38385, 37543 and 35966. I suspect that somebody has spotted this problem before but I haven't found any related issue.

Full version info

OS: Devuan GNU/Linux 5 (daedalus) (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.38419 (Git) AppImage
Build type: Release
Branch: main
Hash: 270bb0122ea15bbc562942b9d0756fabb89362c0
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: Catalan/Spain (ca_ES)
Installed mods: 
  * Movie 2024.2.15
  * sheetmetal 0.4.21
  * FreeCAD-motion-workbench-master
  * dodo 1.0.1
  * PieMenu 1.2.7
  * fasteners 0.5.24

Subproject(s) affected?

Sketcher

Anything else?

Rounded-2.mp4

Crash.FCStd.zip

Code of Conduct

  • I agree to follow this project's Code of Conduct
@MiqCG MiqCG added the Status: Needs triage Missing triage label Aug 8, 2024
@FEA-eng
Copy link
Contributor

FEA-eng commented Aug 9, 2024

As usual, no crash but errors (plus Sketcher closes and leaves no sketch) on Windows:

11:56:57  Unnamed#Sketch: Failed to add box
11:56:57  Tool execution aborted
11:56:57  Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Access violation
OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.38419 (Git)
Build type: Release
Branch: main
Hash: 270bb0122ea15bbc562942b9d0756fabb89362c0
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: Polish/Poland (pl_PL)

@maxwxyz
Copy link
Collaborator

maxwxyz commented Aug 9, 2024

@PaddleStroke FYI

@maxwxyz maxwxyz added Type: Bug This issue or PR is related to a bug Mod: Sketcher Related to the Sketcher Workbench and removed Status: Needs triage Missing triage labels Aug 9, 2024
@PaddleStroke
Copy link
Contributor

It appears that it bugs only if the radius and the negativ internal thickness are equal.
So radius = 2, thickness = -2 for example.

@PaddleStroke
Copy link
Contributor

PaddleStroke commented Aug 29, 2024

Ok I see why.
When you use a negativ thickness, there are 2 cases possible. Either thickness is more than radius, then the inner rectangle is a rectangle. Either it's less than radius, then it has round corners.
image

The case where thickness = radius is problematic because you either have null arcs. Or the construction lines that are null.
So what currently happens is that it is creating null construction lines.
So this case needs to be handled specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: Sketcher Related to the Sketcher Workbench Type: Bug This issue or PR is related to a bug Type: Crash For issues describing crashes or PRs fixing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants