Function Request - Draw line from equation inside Sketcher

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!
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Function Request - Draw line from equation inside Sketcher

Post by abdullah »

lordsansui wrote: Sat Jan 21, 2023 5:04 pm I think 10 points might be enough, but talking with other loudspeaker builder I can check if we might need more or less points.

Yes, I used Bspline to connect all points, besides the curve do not exactly pass in the points and think for a real purpose is accurate enough.
I liked your model to check Ajinkya's latest PR (point on b-spline). Actually it seems to be that with this new ability, you will be able to do much of what you want with about 3 or 4 well selected sections:
Screenshot_20230121_195122.png
Screenshot_20230121_195122.png (56.76 KiB) Viewed 688 times
Here there is a single B-Spline of 4 poles. The first three vertical lines and the last one have the endpoint, point on object (point on B-Spline). As you can see this (much simpler) B-Spline passes through all the other endpoints of the other vertical lines, even if there is no constraint at all on them. This could simplify the sketch quite a lot:
Screenshot_20230121_200151.png
Screenshot_20230121_200151.png (22.7 KiB) Viewed 688 times
Of course, this selection of which segments to constraint, as well as the number of poles, is for me "random", as I do not know much about the real problem you are trying to solve. But it may suggest 4 uniformly distributed vertical lines may be enough for approximating the exponential...

I think we will have this new ability in master pretty soon.
User avatar
onekk
Veteran
Posts: 6206
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Function Request - Draw line from equation inside Sketcher

Post by onekk »

lordsansui wrote: Sat Jan 21, 2023 5:04 pm ...
It seems that posing the correct questions, some results have been achieved, or in the near future will be achieved.

There are only "correct questions" to be posed and maybe "correct answers" will arrive. This thing is happening quite often last times.:lol:

As usual with "correct people" in the discussion the level will be "decently high".

Thanks to @chrisb and @abdullah I think the discussion is near to be solved.

Regards to all.

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/
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

chrisb wrote: Sat Jan 21, 2023 6:46 pm care to describe it in the wiki of Sketcher RestoreInternalAlignmentGeometry?
I can try with some guidance, I don't have access to it, when I open that page it didn't recognize my user used in the Forum. Take also into account that English isn't my main language.
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

abdullah wrote: Sat Jan 21, 2023 7:05 pm Of course, this selection of which segments to constraint, as well as the number of poles, is for me "random", as I do not know much about the real problem you are trying to solve. But it may suggest 4 uniformly distributed vertical lines may be enough for approximating the exponential...

I think we will have this new ability in master pretty soon.
Nice, thank you for your feedback about future changes and new stuffs.

Also providing more feedback here for who is following the discussion, while trying to implement in a real loudspeaker model with Bspline it didn't work well, I can't use orthogonal constrain between a line and and Bspline, so It was not possible to proper emulate the offset profile nether to guarantee correct thickness for the wood, at the end It was needed to implement as a discrete exponential profile with 10 segments connected with straight lines. It's a good approximation and work well.
005.png
005.png (61.67 KiB) Viewed 623 times
006.png
006.png (12.55 KiB) Viewed 623 times
If I change the area size of the Mouth (bigger) and the Throat (smaller) the model adjust itself automatically, see below :)
007.png
007.png (17.84 KiB) Viewed 623 times
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Function Request - Draw line from equation inside Sketcher

Post by chrisb »

How about using tangentially connected arcs?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Function Request - Draw line from equation inside Sketcher

Post by abdullah »

lordsansui wrote: Sat Jan 21, 2023 8:16 pm Nice, thank you for your feedback about future changes and new stuffs.
Just merged Point-on-BSpline support. So that is in master now.
lordsansui wrote: Sat Jan 21, 2023 8:16 pm Bspline it didn't work well, I can't use orthogonal constrain between a line and and Bspline
Yes, this does not exist yet, but I think Ajinkya (@jnxd) wanted to pursue this path and he is fast...
lordsansui wrote: Sat Jan 21, 2023 8:16 pm so It was not possible to proper emulate the offset profile nether to guarantee correct thickness for the wood
There is some work to create static offset curves in the pipeline. Hopefully over the year.
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

chrisb wrote: Sat Jan 21, 2023 8:26 pm How about using tangentially connected arcs?
I would still need a good way to determine the proper thickness to get a good point, not being able to constrain versus bspline didn't gave me alternative.

Using discrete segments is good enough for a while, if needed we can increase of decrease the amount of segments, let see we the updated tool we get in the future so we improve the models.
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

abdullah wrote: Sat Jan 21, 2023 8:50 pm
lordsansui wrote: Sat Jan 21, 2023 8:16 pm Nice, thank you for your feedback about future changes and new stuffs.
Just merged Point-on-BSpline support. So that is in master now.
lordsansui wrote: Sat Jan 21, 2023 8:16 pm Bspline it didn't work well, I can't use orthogonal constrain between a line and and Bspline
Yes, this does not exist yet, but I think Ajinkya (@jnxd) wanted to pursue this path and he is fast...
lordsansui wrote: Sat Jan 21, 2023 8:16 pm so It was not possible to proper emulate the offset profile nether to guarantee correct thickness for the wood
There is some work to create static offset curves in the pipeline. Hopefully over the year.
A lot of improvements going on, very exciting.

I'd like again to thanks to everyone that contributes in this discussion witch leads me to find a good solution with the tools currently available.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Function Request - Draw line from equation inside Sketcher

Post by jnxd »

abdullah wrote: Sat Jan 21, 2023 8:50 pm
lordsansui wrote: Sat Jan 21, 2023 8:16 pm Bspline it didn't work well, I can't use orthogonal constrain between a line and and Bspline
Yes, this does not exist yet, but I think Ajinkya (@jnxd) wanted to pursue this path and he is fast...
lordsansui wrote: Sat Jan 21, 2023 8:16 pm so It was not possible to proper emulate the offset profile nether to guarantee correct thickness for the wood
There is some work to create static offset curves in the pipeline. Hopefully over the year.
"Orthogonal" can be temporarily achieved by creating a "tangent-at-knot" constraint with a line and then making a perpendicular constraint with that line.

I'm slightly skeptical of offsets, because in general they are more complex. For example offsets to ellipses aren't ellipses and offsets to B-splines cannot be described by NURBS in general. So we might be taxing the gcs infrastructure a whole lot by saying "make an offset to this curve and make that offset pass through this point".

As for b-splines to represent exponential functions, note that bsplines are polynomials, so they can't do that exactly. However, we only need a few degrees to approximate them well, since taylor series of exponentials converges quite fast. Depending on the use case (how much smoothness you want for your speaker) other alternatives like the line segments you're using could either be sufficient or lacking. I suspect you're planning to 3D print it anyway?
My latest (or last) project: B-spline Construction Project.
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

The major ones are made by plywood as you can see below.
P_20170305_101222.jpg
P_20170305_101222.jpg (115.62 KiB) Viewed 469 times
The examples I posted in this thread are: Altec816 and Altec817 as you can also see below, they have exponential horn. There are others project but I'm not planing to cover all.
altec816.jpg
altec816.jpg (47.47 KiB) Viewed 469 times
Altec 817 - 01-me.jpg
Altec 817 - 01-me.jpg (72.87 KiB) Viewed 469 times
Discrete horn / line segment probably give enough information for the user to bend the wood. People use different Technics to bend wood like indicated below.
Kerflor-Timberflex.jpg
Kerflor-Timberflex.jpg (191.73 KiB) Viewed 469 times
One thing that people do a lot is to machine some panels using CNC, I personally didn't had the needs to do it, but people who likes to use FreeCAD could learn more about his integration with CNC machines. There are so many potential here.
post-15193-13819738616936.jpg
post-15193-13819738616936.jpg (603.58 KiB) Viewed 469 times
Post Reply