Curves workbench

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Curves workbench

Post by keithsloan52 »

Vincent B wrote: Sat Aug 27, 2022 7:48 pm yes, why not?
So how do I make the curve in the attached file editable? or are you saying it might be possible in the future?
BezierCurve.FCStd
(4.46 KiB) Downloaded 33 times
The curve was created by importing a 3DM file (Rhino) with the Import ImportNurbs workbench.
User avatar
hammax
Veteran
Posts: 1991
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

... pointing to the behaviour of Freehand_BSpline I discretized the polycurve and applied a Freehand_BSpline.
Comb tools show the discrepancies and the "not so smooth" bending flaw.

PolyCurve.PNG
PolyCurve.PNG (35.51 KiB) Viewed 1503 times
Attachments
BezierCurve_2.FCStd
FC.20.1
(20.14 KiB) Downloaded 33 times
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Curves workbench

Post by keithsloan52 »

hammax wrote: Sun Aug 28, 2022 6:22 am ... pointing to the behaviour of Freehand_BSpline I discretized the polycurve and applied a Freehand_BSpline.
Comb tools show the discrepancies and the "not so smooth" bending flaw.


PolyCurve.PNG
I was thinking more on the lines of the PolyCurve Shape was created with a call to Part.BSplineCurve(), so it has control points, knots, period, degree's etc so it should be able to access these directly and have it editable, even if this meant adding functionality to one or both the the workbenches
User avatar
Vincent B
Veteran
Posts: 4733
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Curves workbench

Post by Vincent B »

hammax wrote: Sun Aug 28, 2022 6:22 am ... pointing to the behaviour of Freehand_BSpline I discretized the polycurve and applied a Freehand_BSpline.
great. vertexes from discretized_edge could be copied into the freehand_bspline when creating it. :D
@Chris_G
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

hammax wrote: Sun Aug 28, 2022 6:22 am ... pointing to the behaviour of Freehand_BSpline I discretized the polycurve and applied a Freehand_BSpline.
Comb tools show the discrepancies and the "not so smooth" bending flaw.
Freehand_BSpline is a cubic interpolation curve. Every interpolated point introduces a knot, that breaks down the continuity to C2.
Nothing wrong here.
If you want very high continuity, maybe you should look at approximation instead.
Vincent B wrote: Sun Aug 28, 2022 8:40 am great. vertexes from discretized_edge could be copied into the freehand_bspline when creating it. :D
I'll have a look.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Curves workbench

Post by onekk »

keithsloan52 wrote: Sat Aug 27, 2022 7:55 pm
So how do I make the curve in the attached file editable? or are you saying it might be possible in the future?
When I have problems I use the Curves WB command export to python console, that create a copy of the BSPline using definition data poles knots and similar.

Runnin the code in the macro editor will recreate the curve in 3d view and in the treeview (obviously).

The curve has to be a BSPline or could be converted to a BSPline.

Hope it helps

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
hammax
Veteran
Posts: 1991
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

... I tried onekk's recipe and created a Sketcher BSpline as an overlay.
Control/knot points position were from the "export" tool (visualized in ViewTab).
But they could not be used as external references => therefore they were only positioned by eye.
That gives a nearly identical and smooth "polyline".

PolyCurve_2.PNG
PolyCurve_2.PNG (39.57 KiB) Viewed 1355 times
Attachments
BezierCurve_3.FCStd
FC.20.1
(21.29 KiB) Downloaded 29 times
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Curves workbench

Post by keithsloan52 »

hammax wrote: Sun Aug 28, 2022 2:20 pm ... I tried onekk's recipe and created a Sketcher BSpline as an overlay.
Control/knot points position were from the "export" tool (visualized in ViewTab).
But they could not be used as external references => therefore they were only positioned by eye.
That gives a nearly identical and smooth "polyline".


PolyCurve_2.PNG
I am confused. I am not interested in re creating any overlays etc. I got the impression from these two posts
181A504E-3031-4993-8D7C-142F0B8EB0E8.jpeg
181A504E-3031-4993-8D7C-142F0B8EB0E8.jpeg (373.57 KiB) Viewed 1309 times
that there were new facilities to edit curves I am looking for a way to edit the curve.
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

keithsloan52 wrote: Sun Aug 28, 2022 7:50 pm I am confused. I am not interested in re creating any overlays etc. I got the impression from these two posts
that there were new facilities to edit curves I am looking for a way to edit the curve.
No. No curve editing has been implemented. The control points can only be displayed, not moved.
chrisb
Veteran
Posts: 54187
Joined: Tue Mar 17, 2015 9:14 am

Re: Curves workbench

Post by chrisb »

Not sure if this is a feature request: When Geominfo mode is enabled, and I'm using TechDraw, then there are lots of errors shown in report view.

To reproduce:
- create a cube
- enable Geominfo mode
- create a TechDraw page
- select the cube (what would be done in order to place it on the page).

-> errors shown in Report view:

Code: Select all

  Traceback (most recent call last):
  File "/Users/cb/Library/Application Support/FreeCAD/Mod/Curves/./freecad/Curves/GeomInfo.py", line 445, in addSelection
    self.addHUD()
  File "/Users/cb/Library/Application Support/FreeCAD/Mod/Curves/./freecad/Curves/GeomInfo.py", line 413, in addHUD
    self.sg = self.view.getSceneGraph()
<class 'AttributeError'>: getSceneGraph
00:36:12  Traceback (most recent call last):
  File "/Users/cb/Library/Application Support/FreeCAD/Mod/Curves/./freecad/Curves/GeomInfo.py", line 445, in addSelection
    self.addHUD()
  File "/Users/cb/Library/Application Support/FreeCAD/Mod/Curves/./freecad/Curves/GeomInfo.py", line 413, in addHUD
    self.sg = self.view.getSceneGraph()
<class 'AttributeError'>: getSceneGraph

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.30143 (Git)
Build type: Release
Branch: master
Hash: a72bf218f9917df37e811d7e73a36333282028f5
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * fasteners 0.3.51
  * sheetmetal 0.2.56
  * ExplodedAssembly
  * Curves 0.5.4
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply