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!
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Postby fc_tofu » Fri Apr 24, 2020 6:07 pm

microelly2 wrote:
Fri Apr 24, 2020 11:18 am
The better way to create such volumes (tubes) is to see them as variant of a torus.
Could you please figure out G1 connection at Gordon rim? I made a test with perpendicular profile way, but failed to get G1 connection at mirror rim.

https://forum.freecadweb.org/viewtopic. ... &start=270


Image

Image
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Curves workbench

Postby microelly2 » Sat Apr 25, 2020 4:26 am

fc_tofu wrote:
Fri Apr 24, 2020 6:07 pm
Could you please figure out G1 connection at Gordon rim? I made a test with perpendicular profile way, but failed to get G1 connection at mirror rim.
The mathematics of a gordon surface does not allow to create such a tangent constraint with these profiles.
You need other profiles.

If you want such a helmet the simplest way is to use another model to create the surface.
here an example how I create tangent helmets
I use a bottom border sketch and some sketches to create the dome.
To get the tangent I insert a lifted bottom.
dp_04_25_001.png
dp_04_25_001.png (48.06 KiB) Viewed 505 times

Code: Select all


import numpy as np

hh=3
poles=np.zeros((5,5,3))


ptsa=np.round(np.array([v.Point for v in App.ActiveDocument.Sketch.Shape.Wires[0].Vertexes]),1)


poles=poles.swapaxes(0,1)
poles[0,0:-1]=ptsa[12:17][::-1]
poles[4]=ptsa[4:9]
poles=poles.swapaxes(0,1)
poles[0]=ptsa[0:5]
poles[4]=ptsa[8:13][::-1]

ptsa=np.array([v.Point for v in App.ActiveDocument.Sketch001.Shape.Wires[0].Vertexes])
poles[1,1:4]=ptsa

ptsa=np.array([v.Point for v in App.ActiveDocument.Sketch002.Shape.Wires[0].Vertexes])
poles[2,1:4]=ptsa

ptsa=np.array([v.Point for v in App.ActiveDocument.Sketch003.Shape.Wires[0].Vertexes])
poles[3,1:4]=ptsa


ud=3
vd=3
mu=[4,1,4]
mv=[4,1,4]
uk=range(len(mu))
vk=range(len(mv))

sf=Part.BSplineSurface()
sf.buildFromPolesMultsKnots(poles,mu,mv,uk,vk,False,False,ud,vd)

a=FreeCAD.ActiveDocument.getObject("ShapeA")
if a is None:
	a=FreeCAD.ActiveDocument.addObject("Part::Feature","ShapeA")

a.Shape=sf.toShape()


polesb=np.zeros((7,7,3))
print (polesb.shape)

polesb[1:-1,1:-1]=poles
polesb[0]=polesb[1]

polesb[-1]=polesb[-2]

polesb=polesb.swapaxes(0,1)
polesb[0]=polesb[1]
polesb[-1]=polesb[-2]
polesb=polesb.swapaxes(0,1)


polesb[1,1:-1,2] += hh
polesb[-2,1:-1,2] += hh
polesb[2:-2,1,2] += hh
polesb[2:-2,-2,2] += hh


polesb[0,0]=polesb[0,1]
polesb[-1,-1]=polesb[-1,-2]
polesb[0,-1]=polesb[0,-2]
polesb[-1,0]=polesb[-1,1]


ud=3
vd=3
mu=[4,1,1,1,4]

mv=[4,1,1,1,4]
uk=range(len(mu))
vk=range(len(mv))

sf=Part.BSplineSurface()
sf.buildFromPolesMultsKnots(polesb,mu,mv,uk,vk,False,False,ud,vd)

a=FreeCAD.ActiveDocument.getObject("ShapeB")
if a is None:
	a=FreeCAD.ActiveDocument.addObject("Part::Feature","ShapeB")

a.Shape=sf.toShape()


Attachments
helmet3.FCStd
(20.12 KiB) Downloaded 11 times
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Postby fc_tofu » Sat Apr 25, 2020 12:28 pm

microelly2 wrote:
Sat Apr 25, 2020 4:26 am
The mathematics of a gordon surface does not allow to create such a tangent constraint with these profiles.
You need other profiles.
Quite thank you. I need some time to digest your sample file.
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Postby fc_tofu » Sun Apr 26, 2020 4:23 pm

Chris_G wrote:
Wed Nov 07, 2018 9:00 pm
Sweep2Rails doesn't work on Wire Profiles, but only on profiles made of a single edge.
So you need to join each wire first.
Hello, Chris_G,
I'm curious about the usage of "HQ rule surface".
I modified your sample file, replace rule surface with HQ rule surface as rail object.
But Sweep2Rail command fail to generate point matrix object.
So, what's wrong in my operation, please?
fsc_2020-04-27_001232.jpg
fsc_2020-04-27_001232.jpg (105.8 KiB) Viewed 433 times

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20514 (Git)
Build type: Release
Branch: master
Hash: a05ffd499366ab12fa1b43f37db73f4f1e9c332d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Chinese/China (zh_CN)
Attachments
HQ_rule_sw2r_test.FCStd
(21.06 KiB) Downloaded 14 times
User avatar
Chris_G
Posts: 1503
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Sun Apr 26, 2020 5:38 pm

fc_tofu wrote:
Sun Apr 26, 2020 4:23 pm
I'm curious about the usage of "HQ rule surface".
I modified your sample file, replace rule surface with HQ rule surface as rail object.
I made this tool for very specific cases where the parametrization of the 2 curves were not matching correctly.
This was just an experiment (The whole workbench should be considered experimental, by the way).
So, you'd better not use it.
For PipeShell, the profiles need to be "PipeShell Profiles" (the icon on the left of the Pipeshell one).
See example file attached.
Attachments
pipeshell-example.FCStd
(91.65 KiB) Downloaded 13 times
User avatar
hammax
Posts: 1212
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: Curves workbench

Postby hammax » Mon Apr 27, 2020 10:16 am

… why not Gordon-Surface?
HQ stands rather for "straight profiles", like "Ruled_Surface" in PartWB.

HQ-Gordon.PNG
HQ-Gordon.PNG (37.34 KiB) Viewed 379 times
Attachments
HQ_rule_sw2r_test_2.FCStd
(33.61 KiB) Downloaded 16 times
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Postby fc_tofu » Mon Apr 27, 2020 1:25 pm

Chris_G wrote:
Sun Apr 26, 2020 5:38 pm
...
I made a revision to your "info.svg" icon.
The original "info.svg" icon is beautiful. But its light color border made it looks smaller than neighbouring icons.
I remove its border and enlarged it. Now, I looks almost the same size as neighbouring icons.
I also removed its shadow like decoration beside "i" letter, in order to get a sharper looking in small size disaply (16px).
Hope your suggestions.

1. Original "info.svg"
fsc_2020-04-27_214507.jpg
fsc_2020-04-27_214507.jpg (20.95 KiB) Viewed 333 times
fsc_2020-04-27_214845b.jpg
fsc_2020-04-27_214845b.jpg (34.97 KiB) Viewed 333 times


2. Revised "info.svg"
fsc_2020-04-27_214515.jpg
fsc_2020-04-27_214515.jpg (20.01 KiB) Viewed 333 times
fsc_2020-04-27_214652b.jpg
fsc_2020-04-27_214652b.jpg (34.22 KiB) Viewed 333 times
Attachment is my revised version.
Attachments
info.svg
(2.98 KiB) Downloaded 9 times
Last edited by fc_tofu on Mon Apr 27, 2020 2:07 pm, edited 8 times in total.
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Postby fc_tofu » Mon Apr 27, 2020 1:25 pm

hammax wrote:
Mon Apr 27, 2020 10:16 am
… why not Gordon-Surface?
Thank you, just for curiosity.
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Postby fc_tofu » Mon Apr 27, 2020 2:09 pm

Chris_G wrote:
Sun Apr 26, 2020 5:38 pm
This was just an experiment (The whole workbench should be considered experimental, by the way).
So, you'd better not use it.
For PipeShell, the profiles need to be "PipeShell Profiles" (the icon on the left of the Pipeshell one).
Thank you, I got what you mean.

Another question. Could you please add "Reverse Normal" option for surface making commands in CurvesWB, such as, Aproximate Loft, PipeShell, Sweep2Rail, Gordon Surface.
It is defficult to decide generated surface normal in CurveWB (and also other workbenches in FreeCAD). So, there often need lot of "PartWB >Reverse Shape" operations before final step (Union), which make history tree quite a mess.
In FreeCAD 0.18, where "Lighting = Two Sides" is default pref, this looks not obvious in viewport. But in FreeCAD 0.19pre, where "Lighting = One Side" is default pref, you will quite know what I means. Also, in FreeCAD 0.19pre, "Reverse Shapes" command is more tiresome, for it can not handle moved objects easily.
https://forum.freecadweb.org/viewtopic. ... 78#p384478
User avatar
Zolko
Posts: 1101
Joined: Mon Dec 17, 2018 10:02 am

Re: Curves workbench

Postby Zolko » Mon Apr 27, 2020 6:21 pm

Chris_G wrote:
Sun Apr 26, 2020 5:38 pm
I made this tool for very specific cases
Hello Chris,

I've made a very specific tool that I really needed and couldn't find in the Curves workbench: it allows to offset 3D curves that are planar, in their own plane. The very specific use-case is to make ribs in aircraft wings. The resulting curve can be either a 3D wire (Part.line) or a sketch. It is not perfect, it's quite brute-force, but should be good enough for many people. It can't handle curves, only poly-lines.

I attach the macro, if you think it could be useful to provide it (or an improved version of it) with the Curves workbench, please feel free to do it. I have absolutely no pretence about this little script. I also attach an icon for convenience.

These are the things that make FreeCAD really enjoyable. All comments are welcome.


offset3DCurve.png
offset3DCurve.png (380.98 KiB) Viewed 301 times
offset3DCurve_sketch.png
offset3DCurve_sketch.png (339.1 KiB) Viewed 301 times
Attachments
offset3DCurve.svg
(3.26 KiB) Downloaded 8 times
offset3DCurve.FCMacro
(15.35 KiB) Downloaded 14 times
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here