Select "hidden" Sub-Objects

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Select "hidden" Sub-Objects

Postby m42kus » Mon Jul 03, 2017 9:57 am

Hey,

I'm about to add more advanced multiphysics capabilities to the FEM workbench as part of my GSoC project. A feature missing in FreeCAD highly valuable for the multiphysics workflow is the capability to select sub objects (vertices, faces, solids) not directely visible. For example I would like to select a inner face of the following cube:
select_box.png
select_box.png (3.81 KiB) Viewed 1594 times
I think one of the easiest ways to do so in most cases would be have a "Cycle-Preselect" feature. It would cycle through all sub-objects below the curser at the press of a key (e.g. Tab).

I am willing to spend one or two days implementing such a feature, but I would rather concentrate on getting foreward with my GSoC project. Also I don't know a thing about coin so it would take me a while to get started. Is someone else willing to do the work or at least help me out a little?

My backup plan is to add a command to the FEM workbench only, which opens a dialog similar to what HoWil already implemented (https://forum.freecadweb.org/viewtopic. ... 81#p151950).
My GSoC Devlog: ceeli.github.io/gsoc
User avatar
looo
Posts: 3106
Joined: Mon Nov 11, 2013 5:29 pm

Re: Select "hidden" Sub-Objects

Postby looo » Mon Jul 03, 2017 10:22 am

the simplest way is to temporary add a coin.SoClipPlaneManip() which already has all the handles needed to navigate to an inner face.

Code: Select all

from pivy import coin
import FreeCADGui as gui
sg = gui.ActiveDocument.ActiveView.getSceneGraph()
manip = coin.SoClipPlaneManip()
sg.insertChild(manip, 0)
ps.: https://forum.freecadweb.org/viewtopic. ... 10#p170965
please help with my conda-packaging efforts: https://liberapay.com/looooo/
minimalistic blog: https://looooo.github.io/mini-blog/
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Select "hidden" Sub-Objects

Postby m42kus » Mon Jul 03, 2017 10:43 am

looo wrote:
Mon Jul 03, 2017 10:22 am
the simplest way is to temporary add a coin.SoClipPlaneManip() which already has all the handles needed to navigate to an inner face.
Hi, thanks for the tip. Yes, it's very simple to implement but I don't really like if from the usability point of view. I would rather have a feature specifically targeted at selecting sub-objects. However this is a good workaround till a better feature is implemented.
My GSoC Devlog: ceeli.github.io/gsoc
Jee-Bee
Posts: 1986
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Select "hidden" Sub-Objects

Postby Jee-Bee » Mon Jul 03, 2017 12:05 pm

I know from CREO that press long the right mouse button gives an small menu with all parts, faces, edges and nodes in that sequence and than by pressing in the menu or just right-clicking after it starts moving down thru all objects.
I miss kind of functionality in FreeCAD also when using assembly tool. So if something similar would be implemented i'm really happy :D
peterl94
Posts: 1000
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Select "hidden" Sub-Objects

Postby peterl94 » Mon Jul 03, 2017 4:30 pm

I seem to remember realthunder experimenting with something like this when working on his Link stuff, but I can't find the post.
realthunder wrote:ping
realthunder
Posts: 1339
Joined: Tue Jan 03, 2017 10:55 am

Re: Select "hidden" Sub-Objects

Postby realthunder » Mon Jul 03, 2017 4:41 pm

See here https://forum.freecadweb.org/viewtopic. ... 7&p=175589

I'm currently busy with something else. I'll soon able to spend some time to sync my Link branch to master and continue the work. Trying to back port this to the current master requires too much effort and is going to be a waste if my branch is to be merged.
Try Assembly3 (latest version 0.10.2) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
saso
Posts: 1382
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Select "hidden" Sub-Objects

Postby saso » Mon Jul 03, 2017 4:43 pm

In general I like the idea of cycle through sub-objects using Tab. It would however probably also make sense to use our existing "Selection view" for this in some way, for example having a check box or maybe holding down some key when selecting objects it would also list sub-objects and then user could pick or refine the selection from the Selection View list... ?
User avatar
DeepSOIC
Posts: 7291
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Select "hidden" Sub-Objects

Postby DeepSOIC » Tue Jul 04, 2017 3:32 pm

didn't microelly2 do something like that as an add-on already?
User avatar
DeepSOIC
Posts: 7291
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Select "hidden" Sub-Objects

Postby DeepSOIC » Tue Jul 04, 2017 3:37 pm

m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Select "hidden" Sub-Objects

Postby m42kus » Fri Jul 07, 2017 8:29 am

Because there aren't enouth similar project already :P I created my own selection macro: https://forum.freecadweb.org/viewtopic.php?f=22&t=23307.

Features:
- Select solid/face/edge/vertex from a list (context menu).
- List only shows sub-objects intersecting a imaginary ray from the camara through the cursor.
- Highlight with preselect (not select). The item is not selected until the user clicks on the item in the context menu.
- Make object tranparent if it isn't already for the duration of the list select.
- Activate preselect for the duration of the list select.
- Only python.

However, highlighting of solids and edges don't work atm. I'm running out of time and don't know of an easy solution for that problem. If you know of something please let me know in the topic I posted above. There I also posted a more detailed description of the problem. As soon as that is fixed I'm going to convert it to a module and provide a settings page to make it easier to use. Also I'm going to try to get it into the Addon manager.
My GSoC Devlog: ceeli.github.io/gsoc