Smooth lofting

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!
freecad-heini-1
Posts: 6003
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Smooth lofting

Postby freecad-heini-1 » Tue Dec 26, 2017 3:02 pm

You can find a great feature inside Chris_G curves-workbench, "Joins the selected edges into bspline curve".
So you can draw sketches out of lines and arcs and with this tool you can convert it into bsplines. Please try to use this trick to create lofts or sweeps and compare it with the regular sketches. The result is more smooth.
User avatar
Chris_G
Posts: 1164
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Smooth lofting

Postby Chris_G » Tue Dec 26, 2017 5:35 pm

I gave a try at generating a transition part with the Curves Workbench tools.

bottom5.jpg
bottom5.jpg (16.09 KiB) Viewed 783 times

- I created a bunch of BlendCurves from red part to blue part.
- I filled these curves with PartWB Ruled Surfaces and SurfaceWB Filling Surfaces.
- Finally I created a CurvesWB Parametric Solid from these faces
Here is the result.
What is funny is that you can, for example, move the red part, or modify its sketches, and the grey transition part should change and modify itself accordingly.
( The attached file needs FreeCAD v0.17 and the Curves WorkBench )

bottom5.gif
bottom5.gif (645.69 KiB) Viewed 783 times

bottom5.FCStd
(217.38 KiB) Downloaded 26 times
freecad-heini-1
Posts: 6003
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Smooth lofting

Postby freecad-heini-1 » Tue Dec 26, 2017 6:45 pm

Very nice Chris. That is what I understand under parametric modelling. 8-)
darahan
Posts: 9
Joined: Tue Dec 05, 2017 12:07 am

Re: Smooth lofting

Postby darahan » Wed Jan 03, 2018 12:34 am

Hi ChrisG,
I know this is still a beta, but for some reason it is not working as you displayed in your post. when I change the dimensions of the semi cylinder (I realized I made the hole too large) to 6 mm, the surface part gives an error and does not want to play nicely. Could you explain me why this is happening?
Cheers
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12852 (Git)
Build type: Release
Branch: master
Hash: 8e3b2d7e84924444bc219133a7e0bbd07413cf4f
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
bottom5 (1).FCStd
(204.34 KiB) Downloaded 18 times
User avatar
Chris_G
Posts: 1164
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Smooth lofting

Postby Chris_G » Wed Jan 03, 2018 4:30 pm

darahan wrote:
Wed Jan 03, 2018 12:34 am
I know this is still a beta, but for some reason it is not working as you displayed in your post. when I change the dimensions of the semi cylinder (I realized I made the hole too large) to 6 mm, the surface part gives an error and does not want to play nicely. Could you explain me why this is happening?
Hi,
It looks like you did not installed the Curves WB, so the BlendCurves ( and the surface that is built on them ) are broken.
You can install Curves WB from Tools - Addon Manager (Warning this is an EXPERIMENTAL workbench)

CurvesWB.jpg
CurvesWB.jpg (27.31 KiB) Viewed 672 times
darahan
Posts: 9
Joined: Tue Dec 05, 2017 12:07 am

Re: Smooth lofting

Postby darahan » Sat Jan 06, 2018 12:35 am

Thanks, it looks great. However, I am trying to edit my existing geometry in V0.17, but I am unable to. It says that I should migrate the old body to V0.17. How do I achieve this?
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Smooth lofting

Postby NormandC » Sat Jan 06, 2018 1:15 am

darahan wrote:
Sat Jan 06, 2018 12:35 am
However, I am trying to edit my existing geometry in V0.17, but I am unable to. It says that I should migrate the old body to V0.17.
It seems that Chris_G's file was started in 0.16, then completed in 0.17, but not by going through the PartDesign workbench.

In 0.17, the new PartDesign workbench requires that the chain of PD features for a single contiguous solid be nested under the new Body container. A Body exclusively contains sketches (and possibly some other 2D geometry), construction (datum) geometry and PD features. Everything else will be kept out of the body. For people used to work with many workbenches at a time (Part, PD, Draft), this has been a source of frustration.

darahan wrote:
Sat Jan 06, 2018 12:35 am
How do I achieve this?
When trying to edit a PartDesign feature, you should be presented with a dialog offering you to automatically migrate your project. Failing that, there is a Migration utility in the Part Design menu. Beware though, it's not 100% reliable right now.

I opened Chris_G's "bottom5.FCStd" file, switched to the PD wb then went to Part Design --> Migrate. It created at the bottom of the tree a Part container (a new container that can, contrary to Body, contain any type of object) that includes a Body, in which all PD features from Pad to Pad001 were placed. Unfortunately, this makes the "Surface" object fail with an error icon. And drag&dropping Loft004, the Surfaces, Ruled_Surfaces and "Solid" into the Part container creates a complete mess in the tree, with all the PD features getting ousted of the Body. Trying to move the PD features in the Body makes FreeCAD crash. :?

Chris, I get the impression that your Curves wb is not really compatible with the new PartDesign workflow?
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Smooth lofting

Postby NormandC » Sat Jan 06, 2018 6:16 am

Just for the fun of it, I redid your file, but with tanderson69's tool body (widget) approach. I worked in 0.17 mostly in PartDesign, so the new work flow needs getting used to.

First of all, the most important advice I can give you :D : centre your model on the origin! I cannot stress that enough, in any CAD program I've worked with it almost always makes things easier in the long run. You don't have to centre it in reference to all planes (XY, XZ, YZ), but at least, centre it on the YZ plane, considering XZ is "front".

When sketching, use geometrical constraints whenever possible instead of dimensional constraints. In your first Sketch under Pad, you used two 45deg angle constraints, and two 30mm vertical distance constraints. Three of these constraints can advantageously be replaced with:
  • A perpendicular constraint between the two angled lines (perpendicular means 90 degrees ;) )
  • An equal length constraint between the two angled lines
  • An equal length constraint between the two vertical lines
  • You keep only a single 30mm vertical distance constraint.
  • Also, centre the 220mm long line to the sketch vertical axis with a symmetric constraint, laying on the sketch horizontal axis.
I changed the first sketch to add a solid projection at the rear where the inlet should be, which the tool body will cut through.

About the curved grooves: this model is symmetric in regard to the YZ plane, take advantage of that, and instead of recreating mirrored sketches and their pockets on the other side of the plane, use a Image PartDesign Mirrored feature; in v0.17, it can operate on multiple features (in 0.16, only one can be used at once). This is where first centring the first sketch and pad is useful.

Another thing: I went against the advice always given up to v0.16, and created linked external geometry to the first Pocket in all my groove sketches. Up to 0.16, it would not be possible because you would fork your model in as many branches as there are sketches; in the new 0.17 work flow, I feel that doing so may give a more robust model, less sensitive to changes. And rather than map my sketches to the top faces, I attached them to a datum plane I had created beforehand. Maybe I'm mistaken, this is an entirely new work flow that we need to explore and get used to, and it will take some time to figure out the most reliable methods.
FC017_darahan_bottom_01.png
FC017_darahan_bottom_01.png (9.9 KiB) Viewed 615 times

Then I created Body001 as a tool body to be used in a PartDesign Boolean feature; I modelled it according to tanderson69's suggestion,
tanderson69 wrote:
Tue Dec 05, 2017 2:38 pm
I created a tool body by subtracting boxes and adding simple blends. Then put 1 complex variable blend for difficult transition area.
I created a Shapebinder, which is a reference object that can copy faces from another body. Then, rather than using primitives, I created a Pad between the copied faces, and made a pocket to get this shape (the wide trans-lucid yellow rectangle is part of the Shapebinder):
FC017_darahan_bottom_02.png
FC017_darahan_bottom_02.png (5.56 KiB) Viewed 615 times

Next, the fillets. Unfortunately, Image PartDesign Fillet only provides constant radius fillets, not variable radii fillets; so I only made the needed constant radius fillets.
FC017_darahan_bottom_03.png
FC017_darahan_bottom_03.png (6.06 KiB) Viewed 615 times

Now for the trickier part: to get the variable radii fillets (the blends tanderson69 mentioned), I needed to switch to the Part workbench; but in 0.17, Part tools cannot work directly on a PartDesign Body. So I created a Image Draft Clone of Body001. Then, I could create a Image Part Fillet on it. I'll admit I had to fiddle quite a lot with the start/end radii for the selected edges to get something that worked, and that looked good. Surprisingly, I was able to finish the blend to a zero radius.
FC017_darahan_bottom_04.png
FC017_darahan_bottom_04.png (16.75 KiB) Viewed 615 times
After that, to use this tool body in a Boolean cut on the first Body, I needed to get it back into PartDesign. So I selected Fillet002 and this time created a PartDesign Clone. Only PD Clones and Bodies can be used in PartDesign Boolean features.

And finally, I activated the first Body, selected the PD Clone and created a PD Boolean feature. And the model was completed.
FC017_darahan_bottom_05.png
FC017_darahan_bottom_05.png (22.94 KiB) Viewed 615 times

Of course, it doesn't look half as good as Chris_G's loft! :D

OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: None
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: French/Canada (fr_CA)
Attachments
FC017_darahan_bottom2_normandc2.fcstd
(371.4 KiB) Downloaded 18 times
User avatar
Chris_G
Posts: 1164
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Smooth lofting

Postby Chris_G » Sat Jan 06, 2018 7:48 am

NormandC wrote:
Sat Jan 06, 2018 1:15 am
It seems that Chris_G's file was started in 0.16, then completed in 0.17, but not by going through the PartDesign workbench.
I don't know, I just started from the file supplied in the first post.
I never use Part Design WB. So, even though I have heard and read many times about these compatibility things between 0.16 and 0.17, I forget to check when needed ... :oops:
NormandC wrote:
Sat Jan 06, 2018 1:15 am
Chris, I get the impression that your Curves wb is not really compatible with the new PartDesign workflow?
Probably not. I'll need to check and test.
User avatar
tanderson69
Posts: 1500
Joined: Thu Feb 18, 2010 1:07 am

Re: Smooth lofting

Postby tanderson69 » Sat Jan 06, 2018 1:26 pm

NormandC wrote:
Sat Jan 06, 2018 6:16 am
Of course, it doesn't look half as good as Chris_G's loft! :D
I will take the ugly, tight ones over the pretty, loose ones any day. ;)

Code: Select all

tanderson@debian:~/temp$ draw
Draw[1]> Draw[2]> pload ALL
1
Draw[3]> restore chris.brep
chris
Draw[4]> restore norm.brep
norm
Draw[5]> tolerance chris
Tolerance MAX=0.466804575911137 AVG=0.0062267823244015093 MIN=9.9999999999999995e-08
FACE    : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08
EDGE    : MAX=0.035131647230164001 AVG=0.00043410541581067122 MIN=9.9999999999999995e-08
VERTEX  : MAX=0.466804575911137 AVG=0.0096946520065405717 MIN=9.9999999999999995e-08

Draw[6]> tolerance norm
Tolerance MAX=0.00012391214704300001 AVG=1.0888191463430911e-05 MIN=9.9999999999999995e-08
FACE    : MAX=9.6987540330000007e-06 AVG=5.0715972482353011e-07 MIN=9.9999999999999995e-08
EDGE    : MAX=9.6987540330000007e-06 AVG=6.5644993077876182e-07 MIN=9.9999999999999995e-08
VERTEX  : MAX=0.00012391214704300001 AVG=1.6980154815798609e-05 MIN=9.9999999999999995e-08

Draw[7]>
it is interesting that norms is failing the bopcheck but chris' passes. at least here with occt 7.2