For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Export HLR shape to iges/step

AP's picture


I am trying to export the result of executing the HLR(Polygonal version) on a shape to an IGES/STEP/STl file,
1 - the HLR works as should.
2 - the TopoDS_Shapes resulting from the HLRBRep_HLRToShape work, and they can be visualized with AIS_Shape in the viewport.
3 - But when exporting the TopoDS_Shape to iges/step/stl or any format, the result of the export is blank, for some reason it doesn't pickup the Linework from the TopoDS_Shape.

Any Ideas on how to solve this, would I need to post process the TopoDS_Shape and loop through its BREp mesh and extract the edges?

what kind of TopoDS_Shape result from the HLR shape extraction for example( aHLRToShape.VCompound()) are they analytical curves converted to edges using BRep builder, or are they just a blank TopoDS_Shape and the information is added to the BrepMesh of the shape?

here is my HLR code:

// although I am showing here the normal algo, I am actually using the Polygonal version of the HLR
TopoDS_Shape HSF::AddNewMake2d(TopoDS_Shape obj, gp_Pnt vieworigin, gp_Pnt viewtarget, gp_Vec viewnormal)

// Build The algorithm object
V3d_Coordinate DX,DY,DZ,XAt,YAt,ZAt, Vx,Vy,Vz ;
DX = vieworigin.X();
DY = vieworigin.Y();
DZ = vieworigin.Z();
XAt = viewtarget.X();
YAt = viewtarget.Y();
ZAt = viewtarget.Z();
Vx = viewnormal.X();
Vy = viewnormal.Y();
Vz = viewnormal.Z();

Prs3d_Projector aPrs3dProjector(false,1,DX,DY,DZ,XAt,YAt,ZAt,Vx,Vy,Vz);
HLRAlgo_Projector aProjector = aPrs3dProjector.Projector();

Handle_HLRBRep_Algo myAlgo = new HLRBRep_Algo();
// Build the extraction object :
HLRBRep_HLRToShape aHLRToShape(myAlgo);


// Add Shapes into the algorithm

// Set The Projector (myProjector is a

// Build HLR

// Set The Edge Status

// extract the results :
TopoDS_Shape result;
TopoDS_Compound folder;
BRep_Builder B;
int viscount=0;

TopoDS_Shape VCompound = aHLRToShape.VCompound();
TopoDS_Shape Rg1LineVCompound = aHLRToShape.Rg1LineVCompound();
TopoDS_Shape RgNLineVCompound = aHLRToShape.RgNLineVCompound();
TopoDS_Shape OutLineVCompound = aHLRToShape.OutLineVCompound();
TopoDS_Shape IsoLineVCompound = aHLRToShape.IsoLineVCompound();
TopoDS_Shape HCompound = aHLRToShape.HCompound();
TopoDS_Shape Rg1LineHCompound = aHLRToShape.Rg1LineHCompound();
TopoDS_Shape RgNLineHCompound = aHLRToShape.RgNLineHCompound();
TopoDS_Shape OutLineHCompound = aHLRToShape.OutLineHCompound();
TopoDS_Shape IsoLineHCompound = aHLRToShape.IsoLineHCompound();

if(!VCompound.IsNull()) B.Add(folder,VCompound);
if(!Rg1LineVCompound.IsNull()) B.Add(folder,Rg1LineVCompound);
if(!RgNLineVCompound.IsNull()) B.Add(folder,RgNLineVCompound);
if(!OutLineVCompound.IsNull()) B.Add(folder,OutLineVCompound);
if(!IsoLineVCompound.IsNull()) B.Add(folder,IsoLineVCompound);
if(!HCompound.IsNull()) B.Add(folder,HCompound);
if(!Rg1LineHCompound.IsNull()) B.Add(folder,Rg1LineHCompound);
if(!RgNLineHCompound.IsNull()) B.Add(folder,RgNLineHCompound);
if(!OutLineHCompound.IsNull()) B.Add(folder,OutLineHCompound);
if(!IsoLineHCompound.IsNull()) B.Add(folder,IsoLineHCompound);

result = folder;

return result;