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: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Post by fc_tofu »

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
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Curves workbench

Post by microelly2 »

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 1538 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 51 times
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Post by fc_tofu »

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: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Post by fc_tofu »

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

Re: Curves workbench

Post by Chris_G »

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 55 times
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

… 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 1412 times
Attachments
HQ_rule_sw2r_test_2.FCStd
(33.61 KiB) Downloaded 56 times
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Curves workbench

Post by fc_tofu »

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 1366 times
fsc_2020-04-27_214845b.jpg
fsc_2020-04-27_214845b.jpg (34.97 KiB) Viewed 1366 times


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

Re: Curves workbench

Post by fc_tofu »

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

Re: Curves workbench

Post by fc_tofu »

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
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Curves workbench

Post by Zolko »

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 1334 times
offset3DCurve_sketch.png
offset3DCurve_sketch.png (339.1 KiB) Viewed 1334 times
Attachments
offset3DCurve.svg
(3.26 KiB) Downloaded 63 times
offset3DCurve.FCMacro
(15.35 KiB) Downloaded 53 times
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply