OCCT 7.8.0 Geometric masking result is incorrect

BRepPrimAPI_MakeBox makeBoxxx(50, 50, 80);
BRepPrimAPI_MakeCone makeCone(50, 25, 100);
gp_Trsf trsfx1;
trsfx1.SetTranslation(gp_Vec(-(50 / 2), -(50 / 2), -(80 / 2)));
TopoDS_Shape Box = BRepBuilderAPI_Transform(makeBoxxx, trsfx1);

gp_Trsf trsfx;
trsfx.SetTranslation(gp_Vec(0, 0, -(100 / 2)));
TopoDS_Shape Cone = BRepBuilderAPI_Transform(makeCone, trsfx);

Handle(HLRBRep_Algo) pHLRAlgo = new HLRBRep_Algo();
pHLRAlgo->Projector(algoProjector);
pHLRAlgo->Add(Box);
pHLRAlgo->Add(Cone);
pHLRAlgo->Update();

HLRBRep_HLRToShape hlrToShape(pHLRAlgo);
TopoDS_Shape shape = hlrToShape.HCompound();

Executing the above code did not result in the hidden geometric edges of BOX. May I ask if this writing style is correct

gkv311 n's picture

Have you tried combining shapes into a single TopoDS_Compound? Does it make any difference?

pload MODELING VISUALIZATION

box b 50 50 80
pcone c 50 25 100
ttranslate b -50/2 -50/2 -80/2
ttranslate c 0 0 -100/2
compound b c cc
vinit View1
vcomputehlr cc h -algoType algo -showHiddenEdges 1

同礼 张's picture

I want to obtain the occlusion relationship between them. HLRBRep-PolyAlgo can get the result I want, but unfortunately it only gets line segments

Mikhail Sazonov's picture

Why not to use Boolean operations for that?