Prs3d_TOH_PolyAlgo vs Prs3d_TOH_Algo

Hi. I try to use both algorithms for hidden line removal for wireframe: Prs3d_TOH_PolyAlgo and Prs3d_TOH_Algo. Why is the result of Prs3d_TOH_PolyAlgo worse than the result of Prs3d_TOH_Algo? Please see the results in the attached files. Thanks.

TopTools_SequenceOfShape MyShapeArray;

TopoDS_Shape Bottle, Bottle_;

TopoDS_Solid aBottle0 = BRepPrimAPI_MakeBox(40, 20, 40).Solid();

TopoDS_Shape aBottle4 = MakeBottle(50, 70, 30);

Bottle = aBottle0;

Bottle_ = aBottle4;

gp_Pnt aOrigin(-30, -0, 10);

gp_Trsf aTrsf;

aTrsf.SetTranslation(gp::Origin(), aOrigin);

Bottle.Location(TopLoc_Location(aTrsf));

aOrigin.SetCoord(10, -50, 0);

aTrsf.SetTranslation(gp::Origin(), aOrigin);

Bottle_.Location(TopLoc_Location(aTrsf));

MyShapeArray.Append(Bottle_);

MyShapeArray.Append(Bottle);

TopoDS_Compound aHlrShape;

BRep_Builder aBuilder;

aBuilder.MakeCompound(aHlrShape);

Standard_Integer n = MyShapeArray.Length();

for (Standard_Integer i = 1; i <= n; i++) aBuilder.Add(aHlrShape, MyShapeArray(i));

//With Prs3d_TOH_PolyAlgo (default) :

Handle(AIS_Shape) Shape1 = new AIS_Shape(aHlrShape);

myAISContext->Display(Shape1, true);

myView->SetComputedMode(true);

myView->FitAll();

myView->Redraw();

//And with Prs3d_TOH_Algo:

Handle(AIS_Shape) Shape1 = new AIS_Shape(aHlrShape);

Shape1->SetTypeOfHLR(Prs3d_TOH_Algo);

myAISContext->Display(Shape1, true);

myView->SetComputedMode(true);

myView->FitAll();

myView->Redraw();

Attachments: 
Kirill Gavrilov's picture

Why is the result of Prs3d_TOH_PolyAlgo worse than the result of Prs3d_TOH_Algo?

Because these two algorithms are completely independent, and one of them has a bug?

If the problem is reproducible on actual version of OCCT - consider reporting an issue on Bugtracker, preferably with Draw Harness script rather than C++ code:
https://dev.opencascade.org/index.php?q=home/get_involved