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: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

Give a try at this one :

Code: Select all

edge = FreeCADGui.Selection.getSelection()[0].Shape.Edges[0]

sk = App.activeDocument().addObject('Sketcher::SketchObject','Sketch')

sk.addGeometry(edge.Curve, False)

# Sketcher magic fonction :
sk.exposeInternalGeometry(0)
 


It seems that Sketcher has a "magic function" that adds all the necessary geometries and constraints ...
Last edited by Chris_G on Sun Oct 29, 2017 1:34 pm, edited 1 time in total.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Curves workbench

Post by easyw-fc »

Chris_G wrote: Sun Oct 29, 2017 1:22 pm Give a try at this one :
...
It seems that Sketcher has a "magic function" that adds all the necessary geometries and constraints ...
Thanks a lot Chris!!! :D
Great coding as always!
I will update my macro.
I think this would be also a nice feature to be added to your Curves WB!

Thanks again
Maurice
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

easyw-fc wrote: Sun Oct 29, 2017 1:31 pm Thanks a lot Chris!!! :D
Great coding as always!
I will update my macro.
I think this would be also a nice feature to be added to your Curves WB!
You're welcome.
I learned new FreeCAD tricks today !
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Curves workbench

Post by UR_ »

Hello Chris_G,

some days ago i encountered that "Map sketch on surface"

Map Sketch on Surface.png
Map Sketch on Surface.png (9.75 KiB) Viewed 3371 times

doesn't work anymore.

Not even with "FreeCAD\Mod\Curves\TestFiles\Sketch_on_surface.fcstd".

Report view shows only:
Please select exactly 1 face and 1 sketch

I can't remember exactly, but i thought i've seen this working in the past.

Searched forum, but no results :(

Do i miss something? :?

Tested with:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12619 (Git)
Build type: Release
Branch: master
Hash: b3631e134be8bfade0534f2dc0ee668ae71a223f
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)


and latest curvesWB
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

Hi,
It works here.
The face must be selected in the 3D view.
The sketch can be selected in the tree view, or by one of its edges in the 3D view.
I suppose you are selecting the "face" object in the tree view ...
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Curves workbench

Post by UR_ »

Oh, sorry, my bad! :oops:

Chris_G wrote: Tue Nov 21, 2017 6:36 am The face must be selected in the 3D view.
That's the detail i didn't remember :roll:

A hint in error message probably can prevent from blocking innocent user (like me).

Please select exactly 1 face and 1 sketch (IN 3D VIEW) ;)
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

UR_ wrote: Tue Nov 21, 2017 3:41 pm A hint in error message probably can prevent from blocking innocent user (like me).

Please select exactly 1 face and 1 sketch (IN 3D VIEW) ;)
Done. Thanks.
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Curves workbench

Post by freecad-heini-1 »

I have the following configuration:

Code: Select all

OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12643 (Git)
Build type: None
Branch: master
Hash: 868d9cc6c215ce3a2ab20d454378ec00e1b9ed26
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
If I try to change into the curves-wb the following message appear:
curves_wb_message.png
curves_wb_message.png (9.01 KiB) Viewed 3207 times
I installed the curves-wb via addon-manager.
Chris_G wrote: Ping
@Chris_G, please let me know if it's possible to create the selected green curves tangent to the edges of the two solids with your curves workbench, like to see in this picture:
tangentiale_kurve_und_flaeche1.png
tangentiale_kurve_und_flaeche1.png (50.53 KiB) Viewed 3205 times
I created the curves in Pro-Engineer Wildfire 5.0.

The file for to experiment with, you can find here:
https://forum.freecadweb.org/download/file.php?id=47769
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

freecad-heini-1 wrote: Mon Nov 27, 2017 10:44 am If I try to change into the curves-wb the following message appear:

I installed the curves-wb via addon-manager.
Hi,
I just tried renaming my .FreeCAD/ folder and installed the WB with addon-manager.
I get no error ...
freecad-heini-1 wrote: Mon Nov 27, 2017 10:44 am @Chris_G, please let me know if it's possible to create the selected green curves tangent to the edges of the two solids with your curves workbench, like to see in this picture:
There is the "parametric blend curve" (6th icon).
- it takes 2 edges in the 3D view as input
- set the continuities to G1
- Parameter properties move the endPoints of the curve
- Reverse properties to reverse the orientation of the tangents
- Scale properties modify the "strength" of the tangent
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Curves workbench

Post by freecad-heini-1 »

Chris_G wrote: Mon Nov 27, 2017 1:33 pm
freecad-heini-1 wrote: Mon Nov 27, 2017 10:44 am If I try to change into the curves-wb the following message appear:

I installed the curves-wb via addon-manager.
Hi,
I just tried renaming my .FreeCAD/ folder and installed the WB with addon-manager.
I get no error ...
freecad-heini-1 wrote: Mon Nov 27, 2017 10:44 am @Chris_G, please let me know if it's possible to create the selected green curves tangent to the edges of the two solids with your curves workbench, like to see in this picture:
There is the "parametric blend curve" (6th icon).
- it takes 2 edges in the 3D view as input
- set the continuities to G1
- Parameter properties move the endPoints of the curve
- Reverse properties to reverse the orientation of the tangents
- Scale properties modify the "strength" of the tangent
Whow Chris, you are my hero. Thank you so much. This is a great and helpful feature. I renamed my .freecad folder in Xubuntu, created it new by starting Freecad and installed the curves-wb via addon-installer. Here you can see the amazing parametric blende curve on my example model:
curves-wb_parametric_blend_curve.gif
curves-wb_parametric_blend_curve.gif (601.57 KiB) Viewed 3162 times
Great!!! 8-)
Best regards
Wilfried
Post Reply