Sometimes I wonder if this couldn't be solved by "just" changing the behavior when an arc is moved. Eg. when you move the center of an arc, try to preserve the sector angle rather than "the current something" (can't determine it ATM).abdullah wrote: ↑Mon Jun 24, 2019 12:15 pmWe could start by defining examples of such controlled movements, and try to see if we can define some points to fix, for example, select some points (to be locked) before starting the dragging (some kind of giving a context to the dragging operation so that it can now what you want).chrisb wrote: ↑Sun Jun 23, 2019 8:52 am
Use case:
I recommend to place the geometric elements as near as possible to their final destination. Alas sometimes this is rather difficult. If arcs are involved it is often almost impossible to move them to an appropriate position, because they either don't move at all or they do very fancy things with flipping around.
A solution is to lock one or two points, adjust the arc and remove the dimensional constraints again.
Sketcher: Deactivate constraints
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: Sketcher: Deactivate constraints
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Sketcher: Deactivate constraints
I actually have an idea about how to do that elegantly. Dragging stuff does not change selection, so selection can act as a gentle lock constraint.
Like so for example:
* if I drag a non-selected thing, all the selected elements are locked in place
* if I drag one of the selected things, FreeCAD tries to drag all the selected elements as one.
Re: Sketcher: Deactivate constraints
Yup, something like this I had in mind.DeepSOIC wrote: ↑Mon Jun 24, 2019 1:24 pm I actually have an idea about how to do that elegantly. Dragging stuff does not change selection, so selection can act as a gentle lock constraint.
Like so for example:
* if I drag a non-selected thing, all the selected elements are locked in place
* if I drag one of the selected things, FreeCAD tries to drag all the selected elements as one.
Basically, we can start by one geometry, for example, the arc of circle that seems to be one of the naughty ones.
First, how should we move it without context (with nothing selected) when dragging: a) the start point, b) the end point, c) the center point.
Second, do we need a different behaviour? If yes we can try something with context, such as DeepSOIC's idea.
I do not fully understand DeepSOIC's idea with respect to the edge selected or not and edge dragging. I think I understand it when "elements" are points. For points there is a gotcha. Care should be taken when programming as when the position of a point is selected and there is a coincidence constraint, the constraint is selected instead. I am not sure if this point selecting will drive users crazy, as many, I guess, are used to select and the drag.
So, DeepSOIC's idea for points is (correct me if wrong):
1. If all points selected (arc of circle), dragging by edge nothing moves.
2. If all points selected (arc of circle), dragging one point makes all points move as a whole.
3. If start point selected (arc of circle), dragging the start point makes all move as a whole.
4. If end point selected (arc of circle), dragging the start point makes the endpoint to be fixed at the given position and the rest tries to follow the movement of the start point (as if one had a coincidence constraint between the point and the mouse).
What do you think?
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Sketcher: Deactivate constraints
No. Instead, it should behave the way it does now, as if nothing is selected.
Neither do I. Just ignore selection of edges altogether for beginning, maybe.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Sketcher: Deactivate constraints
Nice idea to have a tool to deactivate non datum constraints. I see a use case that I can activate the constraints in a wished order.
Maybe this can be used to implement basinhopping strategies (https://docs.scipy.org/doc/scipy/refere ... pping.html)
Maybe this can be used to implement basinhopping strategies (https://docs.scipy.org/doc/scipy/refere ... pping.html)
Re: Sketcher: Deactivate constraints
Let's try. Define the basics : Arc is defined with :
- Center position (CP) : =(10,10) mm in the example
- Radius (R) : =20 mm in the example)
- Base/middle angle (BA) : =15+60/2 = 45 ° in the example
- Sector angle (SA) : =60 ° in the example
What I want to change by order of priority when I move :
- Curve : R > BA > CP > SA
- Center point : CP > R > BA > SA
- Endpoint (any) : SA > BA > R > CP
Re: Sketcher: Deactivate constraints
I would not distinguish between the dragged point being selected and not selected, because it would be rather finicky to intuitively decide if the point to be moved is selected right in the moment of grabbing it.abdullah wrote: ↑Mon Jun 24, 2019 3:03 pm 1. If all points selected (arc of circle), dragging by edge nothing moves.
2. If all points selected (arc of circle), dragging one point makes all points move as a whole.
3. If start point selected (arc of circle), dragging the start point makes all move as a whole.
4. If end point selected (arc of circle), dragging the start point makes the endpoint to be fixed at the given position and the rest tries to follow the movement of the start point (as if one had a coincidence constraint between the point and the mouse).
1. If nothing is selected behaviour is the same as it is now (sigh!)
2. All selected points besides the point being moved stay in place
3. If all points are selected dragging by the arc moves the whole element with all its points keeping their relative positions.
Examples:
- select the two endpoints of the arc and move the center: center moves on the middle line between the fixed endpoints
- select one endpoint and move the center: the selected point stays where it is, the center can be moved freely, the third point moves as it does now when one endpoint is locked
- select one endpoint and move the other endpoint: the selected point stays where it is, the endpoint can be moved freely, the center point moves as it does now when one endpoint is locked
- select center and an endpoint and move the other endpoint: the point moves on a fixed radius around the fixed circle.
- select center and move endpoint: the point can be moved freely, the other point moves only in its distance to the center, the angle stays fixed. That is how it works now.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Sketcher: Deactivate constraints
I expected nothing less from youmicroelly2 wrote: ↑Mon Jun 24, 2019 5:17 pm Nice idea to have a tool to deactivate non datum constraints. I see a use case that I can activate the constraints in a wished order.
Maybe this can be used to implement basinhopping strategies (https://docs.scipy.org/doc/scipy/refere ... pping.html)
The problem there may be to control the movement when they are deactivated... or it may hop out of the basin...