Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Export HLR shape to iges/step

Export HLR shape to iges/step
AlexP 2012/11/03 09:25
Hi,

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);

myAlgo->Projector(aProjector);

// Add Shapes into the algorithm

myAlgo->Add(obj,0);
// Set The Projector (myProjector is a



// Build HLR
myAlgo->Update();

// Set The Edge Status
myAlgo->Hide();



// extract the results :
TopoDS_Shape result;
try
{
TopoDS_Compound folder;
BRep_Builder B;
B.MakeCompound(folder);
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;
}
catch(...){}

return result;

}
You have to be logged in to download the attached file
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map