Better selection system for constraints in Sketcher

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 54313
Joined: Tue Mar 17, 2015 9:14 am

Re: Better selection system for constraints in Sketcher

Post by chrisb »

Pauvres_honteux wrote:By the way: would this by any chance cover a whish for automagic horizontal, vertical and paralell when constraining distances? As it is now one can only set a distance between a point and, at the best, a line. With a bit of automagic the work for the user would be reduced to simply select two lines and type the desired value (or if non-paralell lines and you really want a distance, right click and choose Distance).
I would like to see a distance constraint between a point and a line, but may I ask what you expect as the distance of two non-parallel lines? To me it seems to be always 0, because they are in the same plane. If the ends of the lines are considered as well it again boils down to the distance between a line and a point or the well known distance between two points.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: Better selection system for constraints in Sketcher

Post by Pauvres_honteux »

chrisb wrote:but may I ask what you expect as the distance of two non-parallel lines?
Sorry for not explaining the full working order, I'll try to elaborate it a bit.

If one like to constrain the distance between two lines with respect to each other in FreeCAD today one must first constrain them parallel (or vertical/vertical or horizontal/horizontal) then constrain the distance between one lines point and the other lines point or just the line.

My idea about, specifically, two non parallel lines was to, while the cmd Constrain is running, click on/select the lines (no CTRL) and then immediately get a constrain on the screen, but it is not set/executed yet (if you wish to set/executed it; left click). Then you do see with your own eyes that the constrain is not a distance, it's an angle. Now if you do not want an angle constraint, you right click and choose the cmd Distance and the constrain changes to a distance AND makes the lines parallel. Then you proceed as per today; the program preselects the value in the box and you type your desired value. Et Voila!

Hmm, when thinking about it, perhaps an even faster way would be to just pop up two choices at the same time as the constrain shows up. Then you just need to move the cursor to either choice and it'll be executed. A Pie-menue-ish behaviour, one might call it. This would make it the fastest constraint slinger in the west! Yeehaw!! :P
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Better selection system for constraints in Sketcher

Post by NormandC »

chrisb wrote:I would like to see a distance constraint between a point and a line
There's one already... Image Constraint Length
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Better selection system for constraints in Sketcher

Post by cox »

jnxd wrote:
cox wrote:...I guess it could be extended to increase the selection hot sones of the possible entities when choosing the constraint tool first.
I don't think I can follow you. Maybe an example of what we would have to click before, and what you want it to be after?
If I understand you correctly you want to add a new "mode" to the constraint tools, witch makes it possible to select the constraint tool before selecting any or some of the geometry that this constraint needs to be applied.
My suggestion is that when a constraint tool is selected in this way, and the constraint tool still needs more geometry to be able to work(at this point selection highlighting is only active for the types of geometry the tool needs, to aid in selection) I would wish that the selection highlighting and active area for selection is increased in size(so it is easier to hit these with the courser). The reason I think this could be a good option is that there is not so many objects available for selection anymore and increasing the size of the "selection highlighting and active area for selection" would not so easily compete with other possible selections as it would normally, when no selection possibilities is "filtered out".

I hope this helps, I am having a hard time making this moderately coherent :oops:
Need help? Feel free to ask, but please read the guidelines first
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Better selection system for constraints in Sketcher

Post by jnxd »

Whoa! I didn't know there was already so much thought given to this idea. But then again, shouldn't be surprising given that we are drawing inspiration from popular commercial programs. Maybe we should do a round-the-table survey of what other programs are doing before coming up with a plan of our own?
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Better selection system for constraints in Sketcher

Post by jnxd »

cox wrote: My suggestion is that when a constraint tool is selected in this way, and the constraint tool still needs more geometry to be able to work(at this point selection highlighting is only active for the types of geometry the tool needs, to aid in selection) I would wish that the selection highlighting and active area for selection is increased in size(so it is easier to hit these with the courser). The reason I think this could be a good option is that there is not so many objects available for selection anymore and increasing the size of the "selection highlighting and active area for selection" would not so easily compete with other possible selections as it would normally, when no selection possibilities is "filtered out".

I hope this helps, I am having a hard time making this moderately coherent :oops:
Okay I think it's clear enough: you want to increase the size of the area to be searched so that it can catch more deeply placed geometries, while the constraint tool is active. To that end, I believe there will always be cases with enough things to confuse the autohighlight tool. I think a better way would be to instead somehow expose to the users all the (relevant) geometries that can be selected and let them select whatever they want (like what Autodesk inventor does, or did around 2013).
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Better selection system for constraints in Sketcher

Post by cox »

jnxd wrote:I think a better way would be to instead somehow expose to the users all the (relevant) geometries that can be selected and let them select whatever they want
I agree, sounds like a better way to increase usability :D
Need help? Feel free to ask, but please read the guidelines first
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Better selection system for constraints in Sketcher

Post by jnxd »

cox wrote:I agree, sounds like a better way to increase usability :D
Let's maybe wait a while before we get enough input on this and then start working on the improvements. Pauvres_honteux has this great idea of unifying all the constraints. Who knows what more input can come up.

Though speaking of great ideas, does anyone know of a good way to mock up these ideas than code it in C++ of all languages?
chrisb
Veteran
Posts: 54313
Joined: Tue Mar 17, 2015 9:14 am

Re: Better selection system for constraints in Sketcher

Post by chrisb »

NormandC wrote:
chrisb wrote:I would like to see a distance constraint between a point and a line
There's one already... Image Constraint Length
Thanks for reminding me. I was pretty sure that I had used it a long time ago but when I tried recently it didn't work, so I thought I had a memory fault.
Now I think I had tried a vertical line with a horizontal distance to a point where it was only a matter of convenience selecting the line instead of one of the endpoints.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Better selection system for constraints in Sketcher

Post by jnxd »

I just completed implementing my suggestion for the lock constraint. One can now choose to use lock without having to select geometries first. Please check out the code on https://github.com/AjinkyaDahale/FreeCA ... aintselect.
Post Reply