Part Thickness Study - Observation about Calculability (using Part Loft)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
quiret
Posts: 72
Joined: Wed Jun 15, 2022 1:23 pm
Location: Germany
Contact:

Part Thickness Study - Observation about Calculability (using Part Loft)

Post by quiret »

I tried to use the Part Thickness tool and have found it very powerful in creating hollow shapes. Then I started to study the limitations of the tool by trying really complicated FreeCAD document hierarchies, for example Part Lofts. Here I want to share my observations with you guys and I would greatly appreciate your contributions. In my opinion the Thickness tool is a very important component of FreeCAD.

Example #1: very corrupted Thickness on a rotated-non-ruled Loft:
Image
https://green-candy.osdn.jp/external/fo ... le_1.FCStd

Example #2: working Thickness Loft on non-rotated three-section:
Image
https://green-candy.osdn.jp/external/fo ... __ok.FCStd

Example #3: working Thickness Loft on non-rotated three-section (non-ruled):
Image
https://green-candy.osdn.jp/external/fo ... __ok.FCStd

Example #4: working Thickness Loft on non-rotated offsetted three-section:
Image
https://green-candy.osdn.jp/external/fo ... __ok.FCStd

Example #5: broken Thickness Loft on rotated three-section:
Image
https://green-candy.osdn.jp/external/fo ... le_5.FCStd

Comment: I am getting a "BRep_API: command not done" error message window when trying to apply a Thickness between the two faces. Thus the FreeCAD document file does not contain a Thickness node.

Example #6: working Thickness Loft on rotated two-section:
Image
https://green-candy.osdn.jp/external/fo ... __ok.FCStd

I can see the following pattern: three rotated faces as sections in a Loft break the calculation.

I would like to know more about the limitations of the Part WB Thickness tool. Hopefully this information will help further development of FreeCAD.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/Germany (en_DE)
chrisb
Veteran
Posts: 53932
Joined: Tue Mar 17, 2015 9:14 am

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by chrisb »

A very serious limitation is the topological naming problem, which makes it often nearly impossible to create a fully parametric model.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
quiret
Posts: 72
Joined: Wed Jun 15, 2022 1:23 pm
Location: Germany
Contact:

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by quiret »

chrisb wrote: Mon Aug 15, 2022 7:29 pm A very serious limitation is the topological naming problem, which makes it often nearly impossible to create a fully parametric model.
I agree! Are you suggesting that this naming problem is causing problems inside of the FreeCAD calculations themselves?
chrisb
Veteran
Posts: 53932
Joined: Tue Mar 17, 2015 9:14 am

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by chrisb »

quiret wrote: Mon Aug 15, 2022 7:32 pm Are you suggesting that this naming problem is causing problems inside of the FreeCAD calculations themselves?
No, it's serious enough if a model breaks.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by onekk »

quiret wrote: Mon Aug 15, 2022 7:32 pm I agree! Are you suggesting that this naming problem is causing problems inside of the FreeCAD calculations themselves?
Welcome to study FC behaviour an reporting flaws and impressions, as this could lead to some more knowledge maybe to amend some part of wiki or more in general FC documentation, maybe to make more "caveats to user" to lessen the frustration of new users coming here from other CAD systems.

My very personal considerations:

TNP is present, but I think is not a problem when doing "not to difficult" things.

Main problem is in my knowledge is that for some models, the complexity is way beyond any GUI approach, if you don0t want to fiddle with too much dialogs and settings.

I use a different approach that is scripting, and rarely I meet the TNP as in python a variable could mean a whole solid, so there is no need to make assumptions, every length is a variable and could be reused to make different things.

For some "problems" the whole point is that there are some "difficult calculations" and sometimes "race conditions" to be sorted out and a simple button could not take in account these difficulties as he cannot guess "what you want to do" when you hit that button.

Take in account that many buttons are implemented using some "sane assumptions" on which the user want, and if you are lucky there is a dialog or a property somewhere to tune things, but not every aspect of a complex operation is usually implemented. (for many complex things there is scripting).

Another considerations is that FC have as a goal to "maintain compatibility" with older version so some aspect could not be changed without breaking "old models", as some recent discussion have shown (sadly I don't remember the thread link, but it was related to threads if I remember well).

Part Loft is one of these things, as there are many aspect to be considered and some aspect are related to order of edges and probably some other geometric consideration,

In case of Loft there is not more exposed in Scripting than in GUI, but you could use some more complex things to make "Lofts" and you could control things in a more finer way, using maybe a "Sweep" that use BRepOffsetAPI.makePipeShell usage defining a proper path to follow and properly made profiles as you can state many way to "manage corners" and rotations see maybe these links, that I have noted as they involve some discussions I have had :

BRepOffsetAPI.makePipeShell usage
https://forum.freecadweb.org/viewtopic.php?f=22&t=65467

Use of Geom2D and Part.BRepOffsetAPI.MakePipeShell() to make Threads
https://forum.freecadweb.org/viewtopic.php?f=22&t=65875

maybe it will be interesting to read:

https://dev.opencascade.org/doc/occt-7. ... algos.html

When speaking about thickness in the caption Mechanical Features (sorry if the typographic term is not exact)

Sadly some of these operations are difficult with complex forms different from "cube type shapes" with right angles.


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by dprojects »

chrisb wrote: Mon Aug 15, 2022 7:29 pm A very serious limitation is the topological naming problem, which makes it often nearly impossible to create a fully parametric model.
PartDesign has a lot of nice functionalities and they are programmed in C ++ which is respectable. So, it is even more beyond my mind, they created so advanced features in C++ but they talk about this ridiculous problem of the TNP. Is it like this intentionally goes unresolved in FreeCAD so that you can scare rebellious programmers who want to do something more? Such Baba Yaga who scares little children? ;-)

That's why I created a wiki page: https://wiki.freecadweb.org/TNP_solution so that everyone could solve this problem.

Regarding parameterization in FreeCAD, the TNP is not a problem, you can approach things differently to avoid the TNP. The real problem is only describing any curve with mathematical formulas. This is the level of the math scientists, not of FreeCAD living users. If you want scale your model you need to invent all mathematical formulas. This is not like that, you create model, FreeCAD make formulas automatically, and you can scale it and the parts will be in the same place.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by onekk »

dprojects wrote: Tue Aug 16, 2022 12:51 pm The real problem is only describing any curve with mathematical formulas. This is the level of the math scientists, not of FreeCAD living users. If you want scale your model you need to invent all mathematical formulas. This is not like that, you create model, FreeCAD make formulas automatically, and you can scale it and the parts will be in the same place.

Scaling is not a problem as you could do simply with matrices, even with different scale factors.

But I could not imagine a CAD without mathematical formulas behind, how do you define a circle if not using:

x = r cos(t)
y = r sin(t)

?
Not speaking of BSPlines and Bezier curves, or other more complex things.

Even in nature many things are "conceived" using mathematics, or better they obey to mathematical rules, even if the animal or the plant will not know mathematics, like some shells, and some plants, that make flowers following strict mathematical rules to place their petals.

A computer is simply a "machine that take numbers" as input and "spit out numbers"as output.

This is the point of many problems, as some calculations are "not defined" for some points, so if you are unlucky enough and you want to place a thing in this "undefined places" the algorithm that maybe has to calculate a derivative in this exact place will fail.

But I'm not a math expert, and these are very superficial considerations, some more skilled user could answer in a more correct a surely better manner.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by Jee-Bee »

onekk wrote: Tue Aug 16, 2022 3:37 pm But I could not imagine a CAD without mathematical formulas behind, how do you define a circle if not using:

x = r cos(t)
y = r sin(t)

Not speaking of BSPlines and Bezier curves, or other more complex things.
There is a difference between being a mathematician and being an engineer. that the circle i / we want internally is created via a mathematical formula don't mean i'm busy with math.
onekk wrote: Tue Aug 16, 2022 3:37 pm Even in nature many things are "conceived" using mathematics, or better they obey to mathematical rules, even if the animal or the plant will not know mathematics, like some shells, and some plants, that make flowers following strict mathematical rules to place their petals.
This is kind of reversing the situation. physics exist before the math. the nature don't follow math, we (as the human race) created math as result what we see in nature...
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by onekk »

Jee-Bee wrote: Tue Aug 16, 2022 5:38 pm ...
I appreciate your collaboration (I'm a simple user so it maybe worth nothing) so this is not a critics, only to make clear some of my affirmations.

I see your points here especially the second, that was simply an example maybe not the most smart, but I remember that some ancient greek have studied some seashell to derive some formula.

I agree that you have not to calculate everything, as FC is doing this for you, most of the time.

I'm struggling with FC very often and I try to search even in FC sources or even in OCCT documentation and sources, for solution to my specific problems.

It is not an easy task, but this has permitted to make some works with FC for my personal use and for others, investing only my time and not my money in FC, so I'm quite happy with it.

As I'm using almost exclusively scripting to model with FC, probably I'm biased as many problems are "naturally" solved with some maths when creating models, GUI approach is different, and I haven't been able to learn properly the GUI part, or maybe I've not spent my energies on learning it.

In the meantime I've tried to "repay" FC trying to help others, writing a "Scripting Guide" and posting some code on the "Python scripting and macro" forum but much frequently bothering "skilled users" and developers to obtain informations to make things with FC.

I hope some users have found my efforts usable and helpful.

So I could speak only using my experience (not very long).

Sometimes having some knowledge of "what is happening behind the curtains" will make some solution more clear.

If you know that in FC a Cylinder is made of three faces:
  • Lower face (a circle)
  • Upper face (another circle)
  • Cylinder side that is like a bend surface that has a "seam" where the bend will join.
You also know that placing something that depends on some calculations like a derivative on the "seam" will result in some strange behaviour or errors, so if you rotate to some degree the cylinder on his axis the "operation" will succeed.

You have not to calculate the cylinder by hand, but this knowledge will permit to "make the job"

I think that these "peculiarities" are in a way or another in every CAD engine, maybe some are more "refined" or are using other robust algorithm, or maybe check if something similar will happen and rotate the cylinder for you.

Everything could be improved, but usually this involve coding or participate in a constructive way to some discussion about "possible solutions".

What I'm seeing here, is that this forum part, is becoming a place were many "not productive" discussion are made, but even this thing was predicted by some user.


I hope that my English is good enough to avoid misunderstandings (sometimes I could use terms or phrases that could have some implications that i don't know, or that have "weight" I'm not aware of.)

Sorry for the long post, and thanks for your kindness (or at least for not being too rude)

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Part Thickness Study - Observation about Calculability (using Part Loft)

Post by dprojects »

onekk wrote: Tue Aug 16, 2022 3:37 pm Scaling is not a problem as you could do simply with matrices, even with different scale factors.
For example if you create chair, and you change the seat size the legs should change place. This is not about scaling, this is about references. Knowing what element is where. If you want to move object at face you don't even know if you should add value to the X axis or minus the value to get offset from edge.

If people hear that FreeCAD is parametric modeling they think they will create model and they can change any part size and the FreeCAD will re-scale all other elements automatically. This would be possible if the FreeCAD would have reference system.

If you have model why FreeCAD cannot show all dimensions automatically? This is the same problem...

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
Post Reply