# Some problem with HLR

Hi, guys !
I have some problem with use HLR algoritm.
When I try to hide the pipe, created with BRepPrimAPI_MakePrism, I have next view.

Attachments:

Also, here how It most be.

Attachments:

Also I try to make some optimization with HLR Algo, because It's work very slowly and I can't understand what is 0x80008000 in HLRBRep_InternalAlgo.cxx:

if (((MaxShBJ1 - MinShBI1) & 0x80008000) == 0 &&
((MaxShBI1 - MinShBJ1) & 0x80008000) == 0 &&
((MaxShBJ2 - MinShBI2) & 0x80008000) == 0 &&
((MaxShBI2 - MinShBJ2) & 0x80008000) == 0 &&
((MaxShBJ3 - MinShBI3) & 0x80008000) == 0 &&
((MaxShBI3 - MinShBJ3) & 0x80008000) == 0 &&
((MaxShBJ4 - MinShBI4) & 0x80008000) == 0 &&
((MaxShBI4 - MinShBJ4) & 0x80008000) == 0 &&
((MaxShBJ5 - MinShBI5) & 0x80008000) == 0 &&
((MaxShBI5 - MinShBJ5) & 0x80008000) == 0 &&
((MaxShBJ6 - MinShBI6) & 0x80008000) == 0 &&
((MaxShBI6 - MinShBJ6) & 0x80008000) == 0 &&
((MaxShBJ7 - MinShBI7) & 0x80008000) == 0 &&
((MaxShBJ8 - MinShBI8) & 0x80008000) == 0) {

Also I think that is very slowly working because Hide is calling for many times without the reason with i and j :

void HLRBRep_InternalAlgo::Hide ()
{
if (!myDS.IsNull()) {
Standard_Integer i,j,n = myShapes.Length();

if (myDebug)
cout << " Total hiding" << endl;

for (i = 1; i <= n; i++)
Hide(i);

for (i = 1; i <= n; i++)
for (j = 1; j <= n; j++)
if (i != j) Hide(i,j);

Select();
}
}

Or maybe we have some optimization with new release of OCC ?

Also some memory leeks with use HLRTopoBRep_DSFiller::Insert