Feature #5780 - X-ray draw style

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
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: X-ray draw style

Post by NormandC »

It's been discussed before, and may require quite a bit of coding, and a good understanding of Coin...

silopolis wrote: Sat Mar 31, 2018 5:29 am Deserves a feature request
Agreed, but who will do it? ;)

Please search the tracker first, it may exist already...
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: X-ray draw style

Post by Chris_G »

Coin nodes have a "override" property that could be useful for that purpose.
But I am not sure it would offer enough flexibility, because the whole materials of the objects are overridden, while we would probably want to override the transparency only.
Here is a little piece of code to give a try :

Code: Select all

from pivy import coin

# create a coin material with transparency and override property

mat = coin.SoMaterial()
mat.setOverride(True)
mat.transparency = 0.8

# insert the material at the top of the scenegraph

sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg.insertChild(mat,1)

# uncomment the last line to remove the material
# and to get back the objects in their original state

#sg.removeChild(mat)

xray-1.jpg
xray-1.jpg (23.39 KiB) Viewed 2453 times
xray-2.jpg
xray-2.jpg (16.25 KiB) Viewed 2453 times
User avatar
silopolis
Posts: 74
Joined: Thu Oct 20, 2016 10:06 pm

#3414: Add X-ray draw style

Post by silopolis »

NormandC wrote: Sat Mar 31, 2018 6:27 am ...
Agreed, but who will do it? ;)

Please search the tracker first, it may exist already...
Politeness made me leave this for the OP ;)
Made a few searches with what I thought to be relevant keywords but couldn't find existing issues, so here it is https://freecadweb.org/tracker/view.php?id=3414

Chris_G wrote: Sat Mar 31, 2018 8:37 am Coin nodes have a "override" property that could be useful for that purpose.
But I am not sure it would offer enough flexibility, because the whole materials of the objects are overridden, while we would probably want to override the transparency only.
True that it would be better, but it would nevertheless be handy in many cases !

Chris_G wrote: Sat Mar 31, 2018 8:37 am Here is a little piece of code to give a try :

Code: Select all

from pivy import coin
...
Great ! Just a test to add for a toggle behaviour and link this to a toolbar button and voilà :)

Thanks
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: X-ray draw style

Post by chrisb »

Wow! The concise code has approximatly the same size as a ticket would have.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
silopolis
Posts: 74
Joined: Thu Oct 20, 2016 10:06 pm

Re: X-ray draw style

Post by silopolis »

chrisb wrote: Sat Mar 31, 2018 9:52 am Wow! The concise code has approximatly the same size as a ticket would have.
Indeed, my ticket is much longer actualy ! :D

Wonder if this could be combined with wireframe display to get click access to "background geometries" ?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: X-ray draw style

Post by Kunda1 »

silopolis wrote: Sat Mar 31, 2018 3:06 pm
Take a look at https://gitlab.com/sanguinariojoe/freecad.xray
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: X-ray draw style

Post by Kunda1 »

Advice requested for what to do concerning ticket associated with this thread: issue #3414: Add "X-Ray" display mode
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: X-ray draw style

Post by Kunda1 »

Closed issue #5780

Official repo for the x-ray external addon is at https://gitlab.com/sanguinariojoe/freecad.xray/
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Feature #5780 - X-ray draw style

Post by adrianinsaval »

I don't think that is what was meant here, the "x-ray" term used is just some stupid fancy name borrowed from sketchup, in my interpretation the request was just for a draw style that forces transparency on all objects.
Post Reply