Parametric Curve FP discussion board
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Parametric Curve FP discussion board
... OK, calling a "fresh" parametric-curve, renaming it and delete the surplus formulas, seems to be the save way!
- Attachments
-
- PC_Helix_3.FCStd
- FC.19.4
- (178.29 KiB) Downloaded 69 times
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Parametric Curve FP discussion board
What is an unsafe way? I want them all to be safe.
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Parametric Curve FP discussion board
New version 0.2022.05.04
Fixes a bug where if the previously active object is deleted, then the fc() function fails. fc() uses DocumentObject.evalExpression(), but for some reason the static function fails, and it's not compatible with earlier versions anyway, so I was using FreeCAD.ActiveDocument.ActiveObject.evalExpression(), but if the active object is deleted then evalExpression fails. The workaround is to use FreeCAD.ActiveDocument.Objects[0].evalExpression() instead.
Fixes a bug where if the previously active object is deleted, then the fc() function fails. fc() uses DocumentObject.evalExpression(), but for some reason the static function fails, and it's not compatible with earlier versions anyway, so I was using FreeCAD.ActiveDocument.ActiveObject.evalExpression(), but if the active object is deleted then evalExpression fails. The workaround is to use FreeCAD.ActiveDocument.Objects[0].evalExpression() instead.
Re: Parametric Curve FP discussion board
Need a comma here and a point here...? should have both choices isn't it?
other thinking: it need have more precision like 4 or 5 beyond the comma. And can use "pi" expression with t parameter.
other thinking: it need have more precision like 4 or 5 beyond the comma. And can use "pi" expression with t parameter.
- Attachments
-
- Capture.JPG (23.76 KiB) Viewed 10005 times
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Parametric Curve FP discussion board
Updated to version 2022.12.16
There was a bug in updating from spreadsheet function when using d1, d2, d3, etc.
There was a bug in updating from spreadsheet function when using d1, d2, d3, etc.
Re: Parametric Curve FP discussion board
Finally got the macro to do what I want. It seems that t_max cannot refer to a previous [fixed] value and must be numeric. I am laying out a 2D cam profile, so I had a #pitch and #base radius as the built-in example, but instead of #height I had a value for the arc angle of the cam (75 degrees) in b. I tried to use that as the t-max limit (ie. "=b"), but it throws an error.
The error can be reproduced by simply replacing the t-max value in the built-in example by "=b" instead of 6.28. I know its a slightly different value but its just to demonstrate the point.
In other words, I wanted to have all my user accessible parameters in the Equation1(a,b,c) fields. Can t_max and t_min not refer to the Equation1 values or the Floats?
The error can be reproduced by simply replacing the t-max value in the built-in example by "=b" instead of 6.28. I know its a slightly different value but its just to demonstrate the point.
In other words, I wanted to have all my user accessible parameters in the Equation1(a,b,c) fields. Can t_max and t_min not refer to the Equation1 values or the Floats?
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Parametric Curve FP discussion board
The T params are floating point property types whereas the others are string property types that are interpreted during the loop. In the editor dialog (double click the Parametric Curve object) you can use something like 2*pi for the t_max value, which gets evaluated when the dialog closes. But I don't think you can refer to a, b, c, etc. from there. It's been a while since I worked on this and the code is not as fresh in my mind.
Re: Parametric Curve FP discussion board
... trying to calculate the lifting force of a hydrofoil, dependent of speed (quadratic) and area,
by using Parametric_Curve and a FreeCAD presentation.
https://de.wikipedia.org/wiki/Dynamischer_Auftrieb
For e.g.: https://forum.freecadweb.org/viewtopic. ... 84#p655384
First using only a series of parabola in Parametric_Curve,
than trying to do that with the Link feature - but that didn't work (???).
Finding that this also could be done with only 1 Parametric_Curve and an edge in Ruled_Surface.
Better using plane, array => section AND approximate = true
by using Parametric_Curve and a FreeCAD presentation.
https://de.wikipedia.org/wiki/Dynamischer_Auftrieb
For e.g.: https://forum.freecadweb.org/viewtopic. ... 84#p655384
First using only a series of parabola in Parametric_Curve,
than trying to do that with the Link feature - but that didn't work (???).
Finding that this also could be done with only 1 Parametric_Curve and an edge in Ruled_Surface.
Better using plane, array => section AND approximate = true
- Attachments
-
- Lifting_Force_Map.FCStd
- FC.20.1
- (246.15 KiB) Downloaded 46 times
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Parametric Curve FP discussion board
New version: 2023.05.06
Thanks to Ed for adding the copysign() function and for documenting previously undocumented sgn() function in the readme.
Thanks to Ed for adding the copysign() function and for documenting previously undocumented sgn() function in the readme.
-
- Veteran
- Posts: 3106
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: Parametric Curve FP discussion board
Cool. Takes advantage of the linearity with Area, so you can construct with a Ruled Surface. viewtopic.php?t=75242 is a more general but related method, where the second variable dependence is non-linear - say with angle of attack. Using Sections is a nice way to get the coordinate lines! Curves|isoLines would also do it as long as even spacing is OK.