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_CreateBSplineByInterpolation Unhandled unknown C++ exception if grid snap is on #12480

Closed
2 tasks done
Roy-043 opened this issue Feb 17, 2024 · 2 comments · Fixed by #12999
Closed
2 tasks done
Labels
Bug This issue or PR is related to a bug Snapping WB Sketcher Related to the Sketcher Workbench

Comments

@Roy-043
Copy link
Contributor

Roy-043 commented Feb 17, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

  1. Enable grid snap.
  2. Call Sketcher_CreateBSplineByInterpolation or Sketcher_CreatePeriodicBSplineByInterpolation.
  3. Pick a point, no need to actually snap.
  4. Move the cursor.
  5. Result: Unhandled unknown C++ exception

Full error message:

21:36:15  Unhandled unknown C++ exception in ViewProvider::eventCallback 
(Event type: SoLocation2Event, object type: SketcherGui::ViewProviderSketch)

Full version info

OS: Windows 8 build 9600
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.35994 (Git)
Build type: Release
Branch: main
Hash: 69097667df47b2cc86d8688d2dbb545319e33e68
Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3
Locale: C/Default (C) [ OS: Dutch/Netherlands (nl_NL) ]
Installed mods:

Subproject(s) affected?

Sketcher

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Roy-043 Roy-043 added Bug This issue or PR is related to a bug WB Sketcher Related to the Sketcher Workbench labels Feb 17, 2024
@luzpaz luzpaz added the Snapping label Mar 6, 2024
@wwmayer
Copy link
Contributor

wwmayer commented Mar 16, 2024

Enable grid snap.

Where and how? I cannot find this option any more.

Edit: Found it in the toolbar now. Anyway the issue can also be reproduced without enabling grid snapping.

The problem is inside drawBSplineToPosition() that tries to interpolate the spline using GeomBSplineCurve::interpolate() that calls GeomAPI_Interpolate. This class can throw an OCC exception that isn't handled anywhere.

wwmayer added a commit to wwmayer/FreeCAD that referenced this issue Mar 16, 2024
…handled unknown C++ exception

The interpolation of a BSpline can fail and then OCC throws an exception. Because this OCC exception isn't handled by the DrawSketchHandler the core system handles it as unknwon C++ exception
@wwmayer
Copy link
Contributor

wwmayer commented Mar 16, 2024

#12999

wwmayer added a commit that referenced this issue Mar 16, 2024
… unknown C++ exception

The interpolation of a BSpline can fail and then OCC throws an exception. Because this OCC exception isn't handled by the DrawSketchHandler the core system handles it as unknwon C++ exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug Snapping WB Sketcher Related to the Sketcher Workbench
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants