[Ticket #4678] Point on extrema

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
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

[Ticket #4678] Point on extrema

Post by Pauvres_honteux »

edwilliams16 wrote: Sat May 01, 2021 7:33 pm
@edwilliams16; you seem knowledgeable in vector calculus and programming, perhaps you can help with some pointers (pun intended) in how to make a function which create a point on an extrema in direction chosen by the user (line/edge/manually typed)?

It shall work on/for solids, surfaces and curves/lines.
Last edited by Pauvres_honteux on Sun Jun 06, 2021 7:52 am, edited 1 time in total.
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: [Ticket #4678] Point on extrema

Post by Pauvres_honteux »

As a very simple example, check out
phpBB [video]
starting at 1:12 continuing to 2:25.
Last edited by Pauvres_honteux on Sun Jun 06, 2021 7:53 am, edited 1 time in total.
LibrEars
Posts: 29
Joined: Wed Apr 14, 2021 3:43 pm

Re: [Feature request] Point on extrema

Post by LibrEars »

hey =)

I want to express support for this feature. While new to CAD, a similar idea for the sketcher came to my mind: Instead of choosing from a pre-set of achses (max in x-direction, min in z-direction), what if we introduce a sort of gravity extrema. I would display it as an arrow pointing in the desired direction (gravity) - of course you would be able to constrain it (e.g. vertically). Somehow a button would be needed to change between local and global extrema. Here is a picture:

gravity-extrema.png
gravity-extrema.png (10.72 KiB) Viewed 1666 times
Attachments
gravity-extrema.svg
(7.9 KiB) Downloaded 36 times
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: [Feature request] Point on extrema

Post by chrisb »

Let's not make things more complicated than mathematics. What you call extrema in an arbitrary direction, seems to me to be just a tangent point of a tangent with a certain direction.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
LibrEars
Posts: 29
Joined: Wed Apr 14, 2021 3:43 pm

Re: [Feature request] Point on extrema

Post by LibrEars »

I agree - mathematics is complicated enough :D - the question in my opinion is, how we can find this specific tangent point? Also what if there are more points in question and you want only one (which is the global max)? -> The gravity would be a simple and fast visualisation for userfriendliness (you turn the arrow and the point will shift its position to the position you are looking for).
Mathematically there is also a simple way to find global maxima (think of islands with different heights - now you rise the sea-level and the last island standing is you global max).
User avatar
Vincent B
Veteran
Posts: 4734
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: [Feature request] Point on extrema

Post by Vincent B »

Pauvres_honteux wrote: Sun May 02, 2021 8:44 am As a very simple example, check out
SplitCurve (CuvesWb) do that already. ;)
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: [Ticket #4678] Point on extrema

Post by Pauvres_honteux »

LibrEars wrote: Mon May 03, 2021 1:16 pm ... a similar idea for the sketcher came to my mind ...
Brilliant idea! Create the command/function in such a way it can be reused in all other workbenches!

LibrEars wrote: Mon May 03, 2021 1:16 pm ... gravity extrema ...
I feel I should point out that this feature request is a general solution and I envision "gravity"-force being a vector pointing downwards (in negative Z-direction). It will be just that, a vector pointing in the negative Z-direction, which is coverd by this feature request.
You just set the vectors to [0,0,1] or paralell to a line of your choise.

GlouGlou wrote: Mon May 03, 2021 9:19 pm
At the risk of sounding like a parrot, this feature request is not only restricted to lines or curves on a plane. It is aimed for anything, as stated in my first post:
Pauvres_honteux wrote: Sun May 02, 2021 8:18 am ... make a function which create a point on an extrema in direction chosen by the user (line/edge/manually typed)?

It shall work on/for solids, surfaces and curves/lines.
Last edited by Pauvres_honteux on Sun Jun 06, 2021 7:53 am, edited 1 time in total.
LibrEars
Posts: 29
Joined: Wed Apr 14, 2021 3:43 pm

Re: [Feature request] Point on extrema

Post by LibrEars »

Ok maybe gravity is a bit misleading. I think of it out of the perspective of physics in space: On earth it would only point into the negative Z-direction. In space (arbitrary coordinate-system) the point is 'pulled' towards the direction of the force which could be up or down etc. alike until it reaches the extrema (you choose the direction by rotating the arrow). This view holds for al shapes and dimensions. Due to its visual representation by an arrow and point the interaction with other constraints from the sketcher would be possible (or interactions in other workbenches). For example you can define a vertical constraint or angle to the arrow and attach other objects with point coincidences. Thus it can be seen as an elegant way (?) of implementing the feature request :)
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: [Ticket #4678] Point on extrema

Post by Pauvres_honteux »

LibrEars wrote: Tue May 04, 2021 12:35 pm ... (you choose the direction by rotating the arrow) ...
I interpret this as you are talking about the 3D-view?
If so, then I"d say it's a honorable forward and upward striving idea, very good sir!
You will ofcourse not get away from making some pictures with arrows and explanatory text.

LibrEars wrote: Tue May 04, 2021 12:35 pm ... its visual representation by an arrow and point the interaction with other constraints from the sketcher ...
Sorry, you lost me there. Come forth with pictures including arrows and explanatory text!

LibrEars wrote: Tue May 04, 2021 12:35 pm ... (or interactions in other workbenches). For example you can define a vertical constraint or angle to the arrow and attach other objects with point coincidences.
Same here. Come forth with pictures including arrows and explanatory text!
Last edited by Pauvres_honteux on Sun Jun 06, 2021 7:54 am, edited 1 time in total.
LibrEars
Posts: 29
Joined: Wed Apr 14, 2021 3:43 pm

Re: [Feature request] Point on extrema

Post by LibrEars »

You will ofcourse not get away from making some pictures with arrows and explanatory text.
:D - alright I try:

Lets have some extrema on a curved wire. The first picture is the sketcher view: The points with the arrows indicate the extrema. 1) is an extrema with the arrow parallel to the first axis of the hyperbole. Ok it is the same point like the intersect in this case :D - now we transfer it to 3D view and ... hoppla ... it is ambiguous (indicated with the large golden ring that marks all possible solutions) because now you have a degree of freedom more. So lets constrain it by the position in 3D-space (here you can only move it on the ring - see 1) and 2) ). This can be done by hand with a transformation on the ring or by defining e.g. the rotational angle or a plane in xz... or it is constrained on the plane of the sketch by default and you can change this later in the 3D world.

The extrema labeled 3) is pulling downwards (-z direction) being constrained vertically or by an angle. In the 2D world everything is fine. Creating the 3D shape by rotating it gets ambiguous again (indicated by the golden ring)

2D_gravity-extrema.png
2D_gravity-extrema.png (75.77 KiB) Viewed 1473 times
3gravity-extrema.png
3gravity-extrema.png (68.79 KiB) Viewed 1473 times

I guess there are still some tweaks but hopefully this helps to explain the idea.
Attachments
gravity-max.FCStd
(64.03 KiB) Downloaded 29 times
Post Reply