Part Fillet/Chamfer - Length based on dynamic formula?

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!
Post Reply
User avatar
quiret
Posts: 72
Joined: Wed Jun 15, 2022 1:23 pm
Location: Germany
Contact:

Part Fillet/Chamfer - Length based on dynamic formula?

Post by quiret »

I have looked into the Part Chamfer and Fillet tools and wanted to apply a length that is half of the edge that I apply it to. The problem I encounter is that the length of the edge is based on a formula, thus a constant field in the Part Chamfer tool would not adjust to a change in my Spreadsheet. Take a look at how the current version of FreeCAD exposes the parameters of the tools:

Part Chamfer Task pane:
Image

Part Fillet Task pane:
Image

PartDesign Fillet Task pane:
Image

Comment: Here you can apply a formula-based, dynamic length which is much appreciated. But mixing Part WB and PartDesign WB too frequently is creating very awkward FreeCAD document graphs.

No Combo View Data pane for Part Chamfer and Fillet:
Image

Comment: I would greatly appreciate the addition of Combo View Data pane parameters of the tool parameters for natural workflow ambiguity/choice. Newcomers sure could be confused about the possibility of a double-click on a Part Chamfer to edit it again since that UI action does not expose properties for all tools.

-------------

There are tiny oddities due to the age of the Part WB which should be improved to make the Part WB not look as aged in comparison to the currently-being-expanded PartDesign WB. I hope that my exposition of those details will aid developers improve 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: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Part Fillet/Chamfer - Length based on dynamic formula?

Post by chrisb »

You can have different radii for different edges. An expression cannot do this without a complete rework of the Part fillets.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Part Fillet/Chamfer - Length based on dynamic formula?

Post by TheMarkster »

In Part workbench the Chamfers have a hidden property called Edges. This is a special property type that does not have a built-in property editor. To see this for yourself right click in the combo view and choose show all. You can then right click on the Edges property label and select Expression to get to the expression engine.

The property is a list of tuples in the form of:

[(1,2,3),(2,1,4),(3,2,2)]

The first value of each tuple is the edge to chamfer, above example is edges 1, 2, and 3. The 2nd and 3rd values are the values for the chamfers, usually the same where only one value is used.

The syntax to use for setting these is somewhat complicated. Instead of commas, semicolons are used and the words list and tuple are used in place of [] and (). Here is the above in the format that the expression engine can understand:

Code: Select all

list(tuple(1;2;3);tuple(2;1;4);tuple(3;2;2))
In this example numbers are used, but these can be cells in a spreadsheet instead.
User avatar
quiret
Posts: 72
Joined: Wed Jun 15, 2022 1:23 pm
Location: Germany
Contact:

Re: Part Fillet/Chamfer - Length based on dynamic formula?

Post by quiret »

TheMarkster wrote: Tue Aug 16, 2022 5:24 pm In Part workbench the Chamfers have a hidden property called Edges. This is a special property type that does not have a built-in property editor. To see this for yourself right click in the combo view and choose show all. You can then right click on the Edges property label and select Expression to get to the expression engine.

The property is a list of tuples in the form of:

[(1,2,3),(2,1,4),(3,2,2)]

The first value of each tuple is the edge to chamfer, above example is edges 1, 2, and 3. The 2nd and 3rd values are the values for the chamfers, usually the same where only one value is used.

The syntax to use for setting these is somewhat complicated. Instead of commas, semicolons are used and the words list and tuple are used in place of [] and (). Here is the above in the format that the expression engine can understand:

Code: Select all

list(tuple(1;2;3);tuple(2;1;4);tuple(3;2;2))
In this example numbers are used, but these can be cells in a spreadsheet instead.
Thank you very much! I will use your post as reference material in case I ever have to look back at it. To me this unnecessaringly complex syntax does not matter as long as I get the result done.
User avatar
quiret
Posts: 72
Joined: Wed Jun 15, 2022 1:23 pm
Location: Germany
Contact:

Re: Part Fillet/Chamfer - Length based on dynamic formula?

Post by quiret »

TheMarkster wrote: Tue Aug 16, 2022 5:24 pm (...)

The property is a list of tuples in the form of:

[(1,2,3),(2,1,4),(3,2,2)]

(...)
Do you happen to have a solution for when the display in the Combo View is cut off? Like this...

Image

Take a look at those dots in the list. The list is supposed to hold 4 tuples but the string display is only showing 4 of them.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Part Fillet/Chamfer - Length based on dynamic formula?

Post by adrianinsaval »

I don't know how to make it display in property view but if you access that property in the python console it will be shown in full

Code: Select all

App.ActiveDocument.ObjectName.PropertyName
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Part Fillet/Chamfer - Length based on dynamic formula?

Post by TheMarkster »

Right click context menu -> expressions.
Post Reply