Hi FC people.
I would like to submit a suggestion.
I think all the macros within section "Mathematical functions" :
https://www.freecadweb.org/wiki/Macros_recipes
... should be merged in one unique tool, having an interface like this (first screen shot) :
https://www.freecadweb.org/wiki/Macro_3 ... tric_Curve
And this tool could be called from :
menu Part -> Create primitives -> "Curve driven by equations" (or similar expression.)
This is the best place to fit it.
With this features :
Distinction between uniform cubic spline and interpolation of degree 1 (ie polyline = wireframe), chosen with a switch.
(I don't think it's a good thing to split curves of degree 1 or 3, and 2D or 3D, in separate tools.)
Give user the choice between :
Cartesian :
x(t), y(t), z(t)
Cylindrical :
r(t), alpha(t), z(t)
etc.
(and of course : t parameter range, t step, curve closed or not.)
Nota : I'm not a big fan of the second form (with a(t), b(a, t), ...) ; I would prefer a connection between this tool and a spreadsheet, if you want to introduce intermediate parameters, you just need to target three cells with valid mathematical f(t) expression.
And the curve yield would be fully editable.
I think this would be a very useful tool (I routinely need this). What do you think of this ?
[FEATURE REQUEST] Suggestion of integration (mathematicaly defined curves.)
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
[FEATURE REQUEST] Suggestion of integration (mathematicaly defined curves.)
Last edited by fcaduser on Fri Jun 05, 2020 2:01 pm, edited 1 time in total.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Suggestion of integration (mathematicaly defined curves.)
I made some changes to the 3d parametric curve macro. You can now use it with a spreadsheet. The spreadsheet must have these aliases defined:
a_cell
b_cell
c_cell
X
Y
Z
min_t
max_t
interval
Select the spreadsheet you wish to use in the tree, then run the macro with the spreadsheet selected. The macro will detect that you have a spreadsheet selected and add a new button to itself "From sheet". Press the From sheet button to update the macro contents from the spreadsheet. You have to manually update via From sheet button or close the macro and run it again to update its fields.
I also added a stay on top option to keep the macro window on top of other windows. It can still be minimized and the stay on top option can be turned off with a checkbox.
a_cell
b_cell
c_cell
X
Y
Z
min_t
max_t
interval
Select the spreadsheet you wish to use in the tree, then run the macro with the spreadsheet selected. The macro will detect that you have a spreadsheet selected and add a new button to itself "From sheet". Press the From sheet button to update the macro contents from the spreadsheet. You have to manually update via From sheet button or close the macro and run it again to update its fields.
I also added a stay on top option to keep the macro window on top of other windows. It can still be minimized and the stay on top option can be turned off with a checkbox.
- Attachments
-
- 3dparamexample.FCStd
- (1.57 KiB) Downloaded 39 times
-
- 3D_Parametric_Curve(v2).FCMacro
- (8.9 KiB) Downloaded 61 times
Re: Suggestion of integration (mathematicaly defined curves.)
Thank you for this interesting extension.
The point I really like with using a spreadsheet is that user has a full control over how mathematical expressions are generated and he can do all intermediary steps he wants, even document parameters, etc. Whatever it's Cartesian, cylindrical, spherical, etc ; you only need to target three cells with valid f(t) expressions. Very flexible.
Generally speaking, I think a tool generating mathematical (interpolating) curve is far more than anecdotal. Thus my proposition for a future closer integration. I think the general guideline I've submitted is coherent, but I would be pleased to hear suggestions about.
The point I really like with using a spreadsheet is that user has a full control over how mathematical expressions are generated and he can do all intermediary steps he wants, even document parameters, etc. Whatever it's Cartesian, cylindrical, spherical, etc ; you only need to target three cells with valid f(t) expressions. Very flexible.
Generally speaking, I think a tool generating mathematical (interpolating) curve is far more than anecdotal. Thus my proposition for a future closer integration. I think the general guideline I've submitted is coherent, but I would be pleased to hear suggestions about.
Re: Suggestion of integration (mathematicaly defined curves.)
I filled some fields to illustrate with examples.
The user ticks the CS he wants, graying others.
Idem, within the one chosen, the field are disabled or not, depending of he is directly setting the equations or targeting cells.
IMHO the interface should be minimal, if the user wants to do some intermediate "cooking" with mathematical expressions, it's better to relegate this into a spreadsheet, where he can have full latitude.
The choices about angles or dimensions for cylindrical, spherical CS may variate, it's a question of convention ; an explanatory sketch would disambiguate this.
Re: Suggestion of integration (mathematicaly defined curves.)
PS
"Adaptative" means curvature should be computed when it obviously massively varies throught the curve, thus a constant step is not adequate. (Should be placed closer to step.)
"Adaptative" means curvature should be computed when it obviously massively varies throught the curve, thus a constant step is not adequate. (Should be placed closer to step.)