MantisBT - Community
View Issue Details
0007691Community[OCCT] OCCT:Visualizationpublic2005-01-11 14:242012-03-29 17:26
abv 
bugmaster 
normaltrivial 
closedfixed 
All
 
[OCCT] 6.5.2[OCCT] 6.5.2 
chl 934 B4
0007691: Wrong hidden lines computed by HLRBRep_PolyAlgo and HLRBRep_PolyHLRToShape in OCC 5.1
This bug has been reported on OCC Forum by Paul Borowski, see thread 6628:
http://www.opencascade.org/org/forum/thread_6628 [^]

The fix is suggested by the same person, see below both description and fix:

--------------------

My application was written under OCC 50 and uses HLRBRep_PolyHLRToShape and
HLRBRep_PolyAlgo to compute hidden lines.
The code looks like this:
for (int i = 0; i < n; i++)
{
BRepMesh::Mesh(Shape(i), Deflection);
.....
m_HLR_Algo.Load (Shape(i));
}

m_HLR_Algo.Update();
m_aHLRToShape.Update(&m_HLR_Algo);
.....

// Create the result shape
TopoDS_Compound Shape;
BRep_Builder B;
B.MakeCompound(Shape);

TopoDS_Shape VCompound = m_aHLRToShape.VCompound(S);
if (!VCompound.IsNull())
{
B.Add(Shape, VCompound);
}

VCompound = m_aHLRToShape.OutLineVCompound(S);
if (!VCompound.IsNull())
{
B.Add(Shape, VCompound);
}
It works great under OCC50. Under OCC51, however, all shapes, which were added
to the HL algorithm seems to be transparent and all lines are returned as
visible! Any ideas, what can be a problem?

Regards,

Paul

----------

I spend a lot of time trying to fix the bug I have reported, but at last I had
success with it!

A solution for my problem:
Open ModellingAlgorithms project and take a look in the
OCC5.2\src\HLRBRep\HLRBRep_PolyAlgo.cxx file:

...
3654 // Tri1Flags &= ~FMskBack;
3655 Tri1Flags |= FMskBack;//OCC349
...

now comment out the line 3655 and restore the line 3654:

3654 Tri1Flags &= ~FMskBack;
3655 // Tri1Flags |= FMskBack;//OCC349

Recompile TKHLR.dll.

That's all.

-----------------

Note that according to information from VTN, this bug is likely a consequence of
fixing some other bug in HLR (probably OCC349?).
Changes:
There are following changes in packages:
ViewerTest package:
New DRAW command vcomputehlr has been added to display result of HLR algo for shape object in v3d view:

vcomputehlr ShapeName HlrName [ EyeX EyeY EyeZ LookX LookY LookZ ] ,

where ShapeName is the name of initial shape being processed by HLR algo; HlrName is the name of interactive object that will be created to display result of HLR algorithm in v3d view; { EyeX, EyeY, EyeZ }, { LookX, LookY, LookZ } is the position of projector and direction of projection.
If position and direction are not defined command takes a position and view direction of an active v3d view.
No tags attached.
gz HLRBRep_PolyAlgo.cxx.gz (18,932) 2008-08-13 14:27
https://tracker.dev.opencascade.org/
7z HLRBRep_PolyAlgo.7z (14,804) 2011-04-28 17:54
https://tracker.dev.opencascade.org/
? 7691test.tcl (1,340) 2011-09-06 13:37
https://tracker.dev.opencascade.org/
? bottle.brep (405,604) 2011-09-09 13:01
https://tracker.dev.opencascade.org/
gz chl_934_B4.tar.gz (742) 2011-09-09 13:59
https://tracker.dev.opencascade.org/
Issue History
2005-01-11 14:38bugmasterChannel => Internal
2005-01-12 16:13bugmasterStatusclosed => assigned
2005-01-12 16:13bugmasterResolutionsuspended => @0@
2005-01-12 16:13bugmasterAssigned Tobugmaster => san
2008-08-13 16:48bugmasterAssigned Tosan => ifv
2008-08-13 16:48bugmasterStatusassigned => resolved
2011-04-06 18:46bugmasterAssigned Toifv => szy
2011-04-06 18:46bugmasterStatusresolved => assigned
2011-04-07 15:31szyAssigned Toszy => kgv
2011-04-07 18:10bugmasterAssigned Tokgv => apl
2011-04-21 14:39bugmasterAssigned Toapl => vsv
2011-04-28 17:53vsvStatusassigned => resolved
2011-08-02 11:24bugmasterCategoryOCCT:VIZ => OCCT:Visualization
2011-08-09 12:39bugmasterNote Added: 0017936
2011-08-09 12:39bugmasterAssigned Tovsv => apl
2011-08-09 12:39bugmasterStatusresolved => assigned
2011-08-11 14:38aplNote Added: 0017960
2011-08-11 14:39aplStatusassigned => reviewed
2011-08-31 11:03mivNote Added: 0018042
2011-09-01 11:57mivNote Added: 0018051
2011-09-01 15:54aplNote Added: 0018058
2011-09-06 13:37aplDescription Updatedbug_revision_view_page.php?rev_id=502#r502
2011-09-06 13:37aplAdditional Information Updatedbug_revision_view_page.php?rev_id=504#r504
2011-09-06 13:37aplFile Added: 7691test.tcl
2011-09-06 13:41aplNote Added: 0018076
2011-09-09 13:01aplFile Added: bottle.brep
2011-09-09 13:32mkvNote Added: 0018100
2011-09-09 13:32mkvStatusreviewed => tested
2011-09-09 13:59mkvTest case number => chl 934 B4
2011-09-09 13:59mkvFile Added: chl_934_B4.tar.gz
2011-09-09 14:15bugmasterNote Added: 0018101
2011-09-09 14:15bugmasterStatustested => verified
2011-09-09 14:16bugmasterFixed in Version6.3.0 =>
2011-09-09 14:16bugmasterTarget Version => 6.5.2
2011-11-25 11:43szyNote Edited: 0018042bug_revision_view_page.php?bugnote_id=18042#r1070
2011-11-25 11:44szyNote Edited: 0018051bug_revision_view_page.php?bugnote_id=18051#r1072
2011-11-25 11:44szyNote Edited: 0018058bug_revision_view_page.php?bugnote_id=18058#r1074
2011-11-25 11:44szyNote Edited: 0018100bug_revision_view_page.php?bugnote_id=18100#r1076
2011-11-25 11:45szyNote Edited: 0018100bug_revision_view_page.php?bugnote_id=18100#r1077
2012-03-29 17:26bugmasterChangeset attached => occt master 3fc57801

Notes
(0017936)
bugmaster   
2011-08-09 12:39   
Dear Anton,

Please prepare branch for bug , merge with files from
HLRBRep_PolyAlgo.7z and then make revision in order to tests this
fix for development version
(0017960)
apl   
2011-08-11 14:38   
Dear bugmaster,

SVN branch http://svn/svn/occt/branches/OCC7691 [^] has been created and reviewed.
The branch passed review without remarks and ready for test.
(0018042)
miv   
2011-08-31 11:03   
(edited on: 2011-11-25 11:43)
Dear Anton,

Please provide the test script for this bug.
--
Regards,
Mike

(0018051)
miv   
2011-09-01 11:57   
(edited on: 2011-11-25 11:44)
Dear BugMaster,

The wokbench KAS:dev:mkv-OCC7691-products was tested on linux platform.

Regressions cases were not found.

--
Regards,
Mike

(0018058)
apl   
2011-09-01 15:54   
(edited on: 2011-11-25 11:44)
Dear Mike,

It is necessary to write an additional test command for testing this issue, this command will be based on same code as in comments. Writing a test script will be possible only if command will produce bad result without this fix.

At the moment I begin to write this command, but of course, this will take an additional time, so I'll provide such a command/script soon.

Regards,
APV

(0018076)
apl   
2011-09-06 13:41   
Dear Mike,

You can use test script for this issues "7691test.tcl";

New DRAW command vcomputehlr has been added: file ViewerTest_ObjectCommands.cxx has been modified in SVN branch http://svn/svn/occt/branches/OCC7691 [^]
(0018100)
mkv   
2011-09-09 13:32   
(edited on: 2011-11-25 11:45)
Dear BugMaster,
Workbench KAS:dev:mkv-OCC7691-occt has been created from SVN branch http://svn/svn/occt/branches/OCC7691 [^]
(and mkv-OCC7691-products from trank) and compiled on Linux platform.

Test case for this bug is chl/934/B4 is OK in mkv-OCC7691-products.
There are not regressions in mkv-OCC7691-products regarding to KAS:dev:products-20110902-opt

See results in /QADisk/occttests/results/KAS/dev/mkv-OCC7691-products_08092011/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20110902-opt_05092011/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification [^]

(0018101)
bugmaster   
2011-09-09 14:15   
Date: 2011-09-09 14:14:53 +0400 (Fri, 09 Sep 2011)
New Revision: 8991

Modified:
   trunk/src/HLRBRep/HLRBRep_PolyAlgo.cxx
   trunk/src/ViewerTest/ViewerTest_ObjectCommands.cxx