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!
User avatar
Chris_G
Veteran
Posts: 2572
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

Click an axis key while you are dragging points (or blue lines between points) to enable / disable axis constraint.
drmacro
Veteran
Posts: 8806
Joined: Sun Mar 02, 2014 4:35 pm

Re: Curves workbench

Post by drmacro »

Chris_G wrote: Sat Jan 15, 2022 6:52 pm Click an axis key while you are dragging points (or blue lines between points) to enable / disable axis constraint.
Aha! That's what I was missing. I need to start the drag first then hit the axis key.

Thanks!
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
pafurijaz
Posts: 66
Joined: Sun Dec 18, 2016 6:04 pm

Re: Curves workbench

Post by pafurijaz »

Hi, I wanted to know if there is a method to modify the BSplines created from surface edges or those created with other workbenches, for example like the Mesh Remodel.


Thanks and I hope to see more news in this useful Workbench with which I am creating complex surfaces.

Made with Curve

Image

And here some others image created almost with Curve Workbench https://forum.freecadweb.org/viewtopic.php?f=24&t=64136
User avatar
Chris_G
Veteran
Posts: 2572
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

No. Not yet.
I would need a good freehand mouse manipulation library.
I gave a try at pivy.graphics library (used in Freehand_BSpline / Splitcurve tools for example), but I am not totally satisfied with it.
I also gave a try at Pivy_Trackers but didn't managed to get what I was looking for.
pafurijaz
Posts: 66
Joined: Sun Dec 18, 2016 6:04 pm

Re: Curves workbench

Post by pafurijaz »

Thanks,I hope you can find a way, since there is the command to create editable curves it would be nice to at least convert the curves in order to edit them like those of the Workbench Curve.
pafurijaz
Posts: 66
Joined: Sun Dec 18, 2016 6:04 pm

Re: Curves workbench

Post by pafurijaz »

Hi I often encounter this problem when I try to Blend between two curves from edges generated by objects, as in this case, which is not successful in creating the curve.

Code: Select all

20:12:45  Traceback (most recent call last):
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 168, in onChanged
    self.execute(fp)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 115, in execute
    bc = self.compute(fp)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 98, in compute
    c1 = blend_curve.PointOnEdge(e1)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 48, in __init__
    self.edge = edge
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 79, in wrapper
    self.set_vectors()
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 73, in set_vectors
    self.size = self._size
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 173, in size
    self._scale = val / self._vectors[1].Length
<class 'ZeroDivisionError'>: float division by zero
20:12:45  Traceback (most recent call last):
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 168, in onChanged
    self.execute(fp)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 115, in execute
    bc = self.compute(fp)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 98, in compute
    c1 = blend_curve.PointOnEdge(e1)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 48, in __init__
    self.edge = edge
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 79, in wrapper
    self.set_vectors()
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 73, in set_vectors
    self.size = self._size
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 173, in size
    self._scale = val / self._vectors[1].Length
<class 'ZeroDivisionError'>: float division by zero
20:12:45  Traceback (most recent call last):
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 168, in onChanged
    self.execute(fp)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 115, in execute
    bc = self.compute(fp)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 98, in compute
    c1 = blend_curve.PointOnEdge(e1)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 48, in __init__
    self.edge = edge
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 79, in wrapper
    self.set_vectors()
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 73, in set_vectors
    self.size = self._size
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 173, in size
    self._scale = val / self._vectors[1].Length
<class 'ZeroDivisionError'>: float division by zero
20:12:45  Running the Python command 'ParametricBlendCurve' failed:
Traceback (most recent call last):
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 680, in Activated
    bc = obj.Proxy.compute(obj)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/ParametricBlendCurve.py", line 98, in compute
    c1 = blend_curve.PointOnEdge(e1)
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 48, in __init__
    self.edge = edge
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 79, in wrapper
    self.set_vectors()
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 73, in set_vectors
    self.size = self._size
  File "/home/guest/.local/share/FreeCAD/Mod/Curves/freecad/Curves/blend_curve.py", line 173, in size
    self._scale = val / self._vectors[1].Length
float division by zero
Image
Attachments
Ball-corner.FCStd
(26.29 KiB) Downloaded 28 times
drmacro
Veteran
Posts: 8806
Joined: Sun Mar 02, 2014 4:35 pm

Re: Curves workbench

Post by drmacro »

pafurijaz wrote: Mon Jan 17, 2022 7:16 pm ...
This is just a wild thought, so...

There is a macro in the Addon manager called Bevel. You might be able to modify it to handle ball ends like this...

But, I might be crazy. :mrgreen:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
pafurijaz
Posts: 66
Joined: Sun Dec 18, 2016 6:04 pm

Re: Curves workbench

Post by pafurijaz »

Thanks, I found a solution about that, I think this i due to my Bspline that has only two CV, I added an other one in the middle and now seem working..

Image
User avatar
Sabm01
Posts: 58
Joined: Sun Jun 21, 2020 7:43 pm
Location: Canada
Contact:

Re: Curves workbench

Post by Sabm01 »

Sweep on 2 rails.
I need a hint.
sw.png
sw.png (17.08 KiB) Viewed 1500 times
DessinHydraulique6.FCStd
(63.72 KiB) Downloaded 25 times
Trying to generate the sweep surface I obtain errors.
7:44:52 Proxy changed
17:44:52 Blending changed
17:44:52 Blending changed
17:44:52 ProfileSamples changed
17:44:52 RailSamples changed
17:44:52 Parametrization changed
17:44:52 Extend changed
17:44:52 Label changed
17:44:52 updateDate : Label
17:44:52 Change property: DisplayMode
17:44:52 Change property: DisplayMode
17:44:52 Change property: DisplayMode
17:44:52 updateDate : Birail
17:44:52 updateDate : Blending
17:44:52 updateDate : ExpressionEngine
17:44:52 updateDate : Extend
17:44:52 updateDate : Label
17:44:52 updateDate : Label2
17:44:52 updateDate : Parametrization
17:44:52 updateDate : Points
17:44:52 updateDate : ProfileSamples
17:44:52 updateDate : Profiles
17:44:52 updateDate : Proxy
17:44:52 updateDate : RailSamples
17:44:52 updateDate : Shape
17:44:52 updateDate : Visibility
17:44:52 Change property: Proxy
17:44:52 Birail changed
17:44:52 updateDate : Birail
17:44:52 Profiles changed
17:44:52 updateDate : Profiles
17:44:52
Profile parameters :
0.0
1.0
17:44:52
Profile parameters :
0.0
0.0
17:44:52
Matrix 1
Matrix ((-1222.05,167.008,-0,611.027),(0,-2.6386e-13,-1,-2.66454e-13),(0,-1188.32,2.22045e-16,-1200),(0,0,0,1))
17:44:52
Matrix 2
Matrix ((1222.05,-167.008,-0,-611.027),(-0,-2.6386e-13,-1,-2.66454e-13),(-0,-1188.32,2.22045e-16,-1200),(0,0,0,1))
17:44:52
Profile : 0.000000 - 0.000000
17:44:52
Matrix 1
Matrix ((123.726,570.634,-0,1438.14),(-1.0253e-13,4.11693e-14,-1,-4.8356e-13),(-461.753,185.41,2.22045e-16,-2177.76),(0,0,0,1))
17:44:52
Matrix 2
Matrix ((-105.099,2500.13,-5.83444e-32,1537.2),(1.03258e-13,1.17763e-13,-1,-5.87252e-13),(465.033,530.358,2.22045e-16,-2644.75),(0,0,0,1))
17:44:52 Traceback (most recent call last):
File "C:\Users\miche\AppData\Roaming\FreeCAD\Mod\Curves\.\freecad\Curves\Sweep2Rails.py", line 49, in execute
s2r.setProfiles(self.setProfiles(obj.Profiles)) # ((e1,e2,e3))
File "C:\Users\miche\AppData\Roaming\FreeCAD\Mod\Curves\.\freecad\Curves\libS2R.py", line 139, in setProfiles
self.getLocalProfile(p)
File "C:\Users\miche\AppData\Roaming\FreeCAD\Mod\Curves\.\freecad\Curves\libS2R.py", line 175, in getLocalProfile
pro.localCurve1 = Part.Edge(c1, pro.FirstParameter, pro.LastParameter)
<class 'Part.OCCError'>: BRep_API: command not done
17:44:52 Recompute failed! Please check report view.
My configuration
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.26761 (Git)
Build type: Release
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: French/Canada (fr_CA)
Thanks for your help,



Michel
Michel Sabourin (Sabm01)
www.simturb.com
User avatar
Vincent B
Veteran
Posts: 4711
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Curves workbench

Post by Vincent B »

Use Joincurve to build spline. Then the sweep on 2 rails works. ;)
Attachments
sweep.FCStd
(104.73 KiB) Downloaded 32 times
Capture2.JPG
Capture2.JPG (22.65 KiB) Viewed 1476 times
Post Reply