MantisBT - Community
View Issue Details
0030309Community[OCCT] OCCT:Visualizationpublic2018-10-26 10:572020-09-21 17:52
BenjaminBihler 
kgv 
normalminor 
feedbackopen 
ALL
[OCCT] 7.3.0 
[OCCT] 7.6.0* 
0030309: AIS_Shape, Visualization - Free Boundary Aspect Is Not Correctly Used in Shaded Display Mode
I am aware of the test script test/bugs/vis/bug23407_2. It seems to prove that my error report is wrong, because there the free boundary aspect setting in shaded display mode does exactly what it should.

Yet I have spent many hours to get it to work in my application - and I just couldn't (neither on Windows nor on Linux). Therefore I have modified the Tutorial sample to prove that there is something wrong within OCCT and it seems as if there is indeed a problem. Setting the aspect does not correctly modify the display. Only when hovering with the mouse over the shape, the highlighted border has the line type set in the free boundary aspect.

When the display is set to wireframe mode, the free boundary aspect is correctly used. But not in shaded mode.
Please put the uploaded source file into the Tutorial sample, compile the sample and run it. When you click on the bottle button, a simple shell is created. Its free boundary is not displayed as expected.
No tags attached.
related to 0030598assigned  Open CASCADE Visualization - redesign Prs3d_Drawer as aspects map 
related to 0030689closed bugmaster Community Visualization - Free edges disappear depending on viewing perspective 
cxx DocumentTut.cxx (1,907) 2018-10-26 10:57
https://tracker.dev.opencascade.org/
Issue History
2018-10-26 10:57BenjaminBihlerNew Issue
2018-10-26 10:57BenjaminBihlerAssigned To => kgv
2018-10-26 10:57BenjaminBihlerFile Added: DocumentTut.cxx
2018-10-26 11:24kgvNote Added: 0080360
2018-10-26 11:24kgvAssigned Tokgv => BenjaminBihler
2018-10-26 11:24kgvStatusnew => feedback
2018-10-26 11:25kgvRelationship addedrelated to 0023407
2018-10-26 11:26kgvNote Edited: 0080360bug_revision_view_page.php?bugnote_id=80360#r20213
2018-10-26 12:13BenjaminBihlerNote Added: 0080361
2018-10-26 12:13BenjaminBihlerAssigned ToBenjaminBihler => kgv
2018-10-26 12:20kgvNote Added: 0080363
2018-10-26 12:20kgvRelationship addedrelated to 0025773
2018-10-26 12:27kgvNote Added: 0080364
2018-10-26 12:30kgvNote Added: 0080365
2018-10-26 12:38BenjaminBihlerNote Added: 0080368
2019-03-25 14:25kgvRelationship addedrelated to 0030598
2019-05-02 17:15BenjaminBihlerRelationship addedrelated to 0030689
2019-09-04 17:38kgvTarget Version7.4.0 => 7.5.0
2020-09-21 17:52kgvTarget Version7.5.0 => 7.6.0*

Notes
(0080360)
kgv   
2018-10-26 11:24   
(edited on: 2018-10-26 11:26)
I don't see any issues with the sample.

UnFreeBoundaryAspect()/FreeBoundaryAspect() are not used for Shaded presentation of AIS_Shape at all (as far as shape has triangulation) - they have effect only in Wireframe presentation mode (StdPrs_WFShape builder).

Instead, FaceBoundaryAspect() has been introduced by patch #0023407 mentioned by you, which is used only within Shaded presentation (StdPrs_ShadedShape builder).

If you found current documentation unclear / confusing in this aspect - patches improving documentation are welcome.

(0080361)
BenjaminBihler   
2018-10-26 12:13   
Thank you for your answer.

I have three remarks:

- The documentation of SetFreeBoundaryDraw(...) state explicitely "Enables or disables drawing of free boundaries for shading presentations". If it has only effect in wireframe presentation mode, this is even more than "unclear", it is misleading, isn't it?
- If the un-/free boundary aspects are not used for shaded presentation at all, is it correct then that they influence highlighting? The line style is used for highlighting. This is inconsistent.
- You are right, with SetFaceBoundaryAspect(...) I can enable face boundaries in shaded presentation mode. But it seems as if I could not enable them only for free boundaries, which would be a pity. It is quite common in other CAD programs (CATIA) to have the possibility to display free shell boundaries without displaying all face boundaries. Or is there a way to do that?
(0080363)
kgv   
2018-10-26 12:20   
> The line style is used for highlighting. This is inconsistent.
This is used only in case if Wireframe display mode is forced for highlighting.
(0080364)
kgv   
2018-10-26 12:27   
> - The documentation of SetFreeBoundaryDraw(...) state explicitely
> "Enables or disables drawing of free boundaries for shading presentations".
> If it has only effect in wireframe presentation mode,
> this is even more than "unclear", it is misleading, isn't it?
This is a design issue of Prs3d_Drawer - it specifies a constant list of presentation properties, while only part of them / none are actually taken into account within specific Display Mode and specific AIS_InteractiveObject implementation. Logically, this class should be rather a map of arbitrary aspects, so that each AIS_InteractiveObject implementation could define which properties are supposed to be used and extend the list of options at application side without modifying OCCT.

In particular, the misleading comment to method SetFreeBoundaryDraw() about Shaded presentation was added by patch for #0025773, where supposedly OCCT-based application used this aspect within a **custom** AIS_InteractiveObject implementation (or AIS_Shape subclass) computing combined Wireframe+Shaded presentation (hence, independently from FaceBoundaryAspect()).
(0080365)
kgv   
2018-10-26 12:30   
> But it seems as if I could not enable them only for free boundaries,
It is quite straightforward sub-classing AIS_Shape and overriding Compute() to add different presentations as desired by application (like calling StdPrs_ShadedShape/StdPrs_WFShape tools or ::Compute() method of base class with different options).
(0080368)
BenjaminBihler   
2018-10-26 12:38   
Okay, that sounds promising. I will try it.

Still, to be honest, I don't have a good feeling about the current state of Prs3d_Drawer. I am quite sure that another one would also get a wrong impression of how to use it and might also think that the free boundary aspect defines free boundary display in shaded mode.

Thanks for your help!
Benjamin