[Feature request] Clipping plane improvement

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
leoheck
Posts: 97
Joined: Tue Mar 13, 2018 5:56 pm

[Feature request] Clipping plane improvement

Postby leoheck » Tue Aug 20, 2019 1:07 pm

The clipping plane tool it really good to visualize connections and debug the part or multiples parts.

The main issue I see is that it shows solid objects empty which makes it hard to inspect the part when it is complex.

I believe that some something like this, that adds a different pattern in the face where a solid is cut, would be a very good addition to Freecad.
Image

Or even a checkbox to enable that would de good to have.

What do you think?

For comparison, right now, it shows this
Attachments
clipping_plane.png
clipping_plane.png (17.18 KiB) Viewed 616 times
User avatar
yorik
Site Admin
Posts: 11514
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: [Feature request] Clipping plane improvement

Postby yorik » Tue Aug 20, 2019 1:57 pm

This is harder than it looks. Coin3D is responsible for building these clipped views, and on our side, all we could do is calculate a set of section faces and add it to the scene graph. However, that would really slow things down a lot.

Coin has an extension called simvoleon, that is able to do just that, fill sections with volume. However, so far I have been able to compile it, but not make pivy recognize it or use it in any way (there is not much doc around :) )
leoheck
Posts: 97
Joined: Tue Mar 13, 2018 5:56 pm

Re: [Feature request] Clipping plane improvement

Postby leoheck » Tue Aug 20, 2019 2:48 pm

yorik wrote:
Tue Aug 20, 2019 1:57 pm
This is harder than it looks. Coin3D is responsible for building these clipped views, and on our side, all we could do is calculate a set of section faces and add it to the scene graph. However, that would really slow things down a lot.
Interesting, I have no doubts that this is a hard task. Thanks for your comment.

A set of section faces could be an initial solution if it came with a button to enable/disable that since you are telling that it can slow the things down a lot.

Right now, the clipping plane is harder to understand than using opacity to see through the parts.
User avatar
bejant
Posts: 5871
Joined: Thu Jul 11, 2013 3:06 pm

Re: [Feature request] Clipping plane improvement

Postby bejant » Tue Aug 20, 2019 3:49 pm

leoheck wrote:
Tue Aug 20, 2019 1:07 pm
it shows solid objects empty
This is a known problem, see issue #1208 (the ticket also links to a topic that provides some possible solutions).
leoheck
Posts: 97
Joined: Tue Mar 13, 2018 5:56 pm

Re: [Feature request] Clipping plane improvement

Postby leoheck » Tue Aug 20, 2019 7:22 pm

Oh, I see, and what is the status of this discussion? Do we have any recent idea being added here?
user1234
Posts: 181
Joined: Mon Jul 11, 2016 5:08 pm

Re: [Feature request] Clipping plane improvement

Postby user1234 » Tue Aug 20, 2019 7:29 pm

There is a macro cross section in the addon manager, but does not work on my 0.19 version.
https://www.freecadweb.org/wiki/Macro_cross_section

Greetings
user
leoheck
Posts: 97
Joined: Tue Mar 13, 2018 5:56 pm

Re: [Feature request] Clipping plane improvement

Postby leoheck » Tue Aug 20, 2019 8:07 pm

@user1234 it doesn't work for me 0.18.3 too. I mean, at least just executing it, If I have to edit the code so I am not using it right.
mario52
Posts: 2649
Joined: Wed May 16, 2012 2:13 pm

Re: [Feature request] Clipping plane improvement

Postby mario52 » Tue Aug 20, 2019 9:48 pm

hi

no problem (Macro_cross_section)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0


OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
leoheck
Posts: 97
Joined: Tue Mar 13, 2018 5:56 pm

Re: [Feature request] Clipping plane improvement

Postby leoheck » Tue Aug 20, 2019 11:22 pm

So, the issue shouldn't be on Windows.

And what about running it in Linux?
.. Hm it is running here at my home, with the same linux and freecad version

Code: Select all

OS: Ubuntu 19.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.3.
Build type: Release
Python version: 3.7.3
Qt version: 5.12.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
On one model it took time to open the settings window. It was a complex model with many parts using A2Plus Workbench.

Testing it with another module that uses only the Part Design Workbench it is not loading et al. The report output is this.

Code: Select all

Traceback (most recent call last):
  File "/home/lheck/.FreeCAD/Macro/cross_section.FCMacro", line 579, in <module>
    myWidget = CrossSectionWindow()
  File "/home/lheck/.FreeCAD/Macro/cross_section.FCMacro", line 111, in __init__
    self.child.initUI(self)
  File "/home/lheck/.FreeCAD/Macro/cross_section.FCMacro", line 149, in initUI
    self.hideObjects()
  File "/home/lheck/.FreeCAD/Macro/cross_section.FCMacro", line 365, in hideObjects
    b = self.oblist[i].Shape.BoundBox
<class 'AttributeError'>: 'App.GeoFeature' object has no attribute 'Shape'
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: [Feature request] Clipping plane improvement

Postby efyx » Wed Aug 21, 2019 10:49 am

mario52 wrote:
Tue Aug 20, 2019 9:48 pm
This macro looks cool but I have also problem with it:

Code: Select all

During initialization the error 'PySide2.QtGui.QPixmap.loadFromData' called with wrong argument types:
  PySide2.QtGui.QPixmap.loadFromData(str)
Supported signatures:
  PySide2.QtGui.QPixmap.loadFromData(typing.Char, int, str=None, PySide2.QtCore.Qt.ImageConversionFlags=PySide2.QtCore.Qt.ImageConversionFlag.AutoColor)
  PySide2.QtGui.QPixmap.loadFromData(PySide2.QtCore.QByteArray, str=None, PySide2.QtCore.Qt.ImageConversionFlags=PySide2.QtCore.Qt.ImageConversionFlag.AutoColor) occurred in C:\Users\Konstruktor\AppData\Roaming\FreeCAD\Mod\ShortCuts\InitGui.py
Please look into the log file for further information
Traceback (most recent call last):
  File "C:/Users/Konstruktor/AppData/Roaming/FreeCAD/Macro/cross_section.FCMacro", line 579, in <module>
    myWidget = CrossSectionWindow()
  File "C:/Users/Konstruktor/AppData/Roaming/FreeCAD/Macro/cross_section.FCMacro", line 111, in __init__
    self.child.initUI(self)
  File "C:/Users/Konstruktor/AppData/Roaming/FreeCAD/Macro/cross_section.FCMacro", line 149, in initUI
    self.hideObjects()
  File "C:/Users/Konstruktor/AppData/Roaming/FreeCAD/Macro/cross_section.FCMacro", line 365, in hideObjects
    b = self.oblist[i].Shape.BoundBox
<class 'AttributeError'>: 'App.GeoFeature' object has no attribute 'Shape'
on
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0


BTW. Why not rewrite this macro and add to FreeCAD default?