DiscussionsIssue archiveOCCT:Visualization

Archived issue #0029791

Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped

CommunityOCCT:Visualizationclosed10 public notes

Search issues

Description

I faced with a problem with function SelectMgr_RectangularFrustum::IsClipped.

So when the clip plane has been added to the bottle, one can see a highlighting, when mouse cursor on the clipped part of a shape.

If you look at SelectMgr_ViewerSelector::checkOverlap you could see a call of mySelectingVolumeMgr.IsClipped (*aSelectable->ClipPlanes(), aPickResult.Depth()). Where mySelectingVolumeMgr is of SelectMgr_RectangularFrustum

This function returns wrong results sometimes (e.g. when you add plane or several parallel planes perpendicular to the view plane)

Steps to reproduce

pload MODELING VISUALIZATION
restore [locate_data_file bottle.brep] b
vclear
vinit View1
vdisplay -dispMode 1 -highMode 1 b
vfit
vzbufftrihedron
vviewparams -scale 14.7435 -proj 0.193921 -0.891229 0.410007 -up -0.0205984 0.414149 0.909976 -at 11.3689 1.32152 24.9954
vclipplane p -equation 1 0 0 -20 -set
vmoveto 150 200
vstate -entities
vselect 150 200
if { [vreadpixel 150 200 rgb name] != "BLACK"      } { puts "Error1" }
if { [vreadpixel 300 200 rgb name] != "GOLDENROD1" } { puts "Error2" }



To represent a problem, one can try this code:

    TopoDS_Shape bottle = MakeBottle(70, 100, 30);
    Handle(AIS_Shape) aBottle = new AIS_Shape(bottle);
    Handle(Graphic3d_ClipPlane) planeLeft = new
    Graphic3d_ClipPlane(gp_Pln(gp_Pnt(20, 0, 0), gp::DX()));
    aBottle->AddClipPlane(planeLeft);

    myContext->Display(aBottle, true);
(MakeBottle - simple function from OCCT docs making sample bottle).

Additional information

Public activity

10 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Thu May 24 20:01:48 2018 +0300

    0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
    
    SelectMgr_RectangularFrustum::computeClippingRange() - do not skip depth range starting behind the ray.

Author: Commenter 3
Date: Fri Apr 27 20:53:50 2018 +0300

    0029729: Visualization, Graphic3d_ClipPlane - add support of clipping plane chains
    
    Graphic3d_ClipPlane now can define a Chain of Planes (logical AND).
    OpenGl_ShaderManager - added new GLSL sub-programs for clipping plane chains.
    Bnd_Range::TrimFrom(), ::TrimTo() - added auxiliary methods for trimming the range.
    SelectMgr_ViewClipRange now handles non-continuous clipping range.
    Graphic3d_SequenceOfHClipPlane now aggregates NCollection_Sequence instead of inheritance.
    OpenGl_CappingPlaneResource - triangulation has been adjusted to make front face following CCW order.

02Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 3.

[revision removed]
03Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Thu May 24 20:10:32 2018 +0300

    0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
    
    SelectMgr_RectangularFrustum::computeClippingRange() fix skipping depth range starting behind the ray.
04Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 3.

[revision removed]
05Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 3.

[revision removed]
06Commenter 3
07Commenter 7
Branch CR29791_2 reviewed without remarks.
08Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18226.470000000027 / 18176.60999999981 [+0.27%]
Products
Total CPU difference: 7428.720000000049 / 7438.350000000027 [-0.13%]
Windows-64-VC10:
OCCT
Total CPU difference: 18017.819098098553 / 17976.931235998483 [+0.23%]
Products
Total CPU difference: 8197.072544999859 / 8185.31006959986 [+0.14%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
09Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]
10Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]

Related records