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

How to get the outline of a shape

George Feng's picture

When I project with hlr, the edge as shown in the attached picture marked with a green arrow is grouped into VCompound in the projection results, and does not appear in the OutLineVCompound. But I want to recognize the edge as an outline edge in the projection results. How can I distinguish the line with others. Can anyone give me some suggestions?

George Feng's picture

TopoDS_Shape needRotateShape = aHLRToShape.VCompound();
TopoDS_Shape OutLineShape = aHLRToShape.OutLineVCompound();
TopoDS_Shape Rg1LineShape = aHLRToShape.Rg1LineVCompound();
TopoDS_Shape RgNLineVShape = aHLRToShape.RgNLineVCompound();
TopoDS_Shape IsoLineShape = aHLRToShape.IsoLineVCompound();

George Feng's picture

The projecting direction in this problem should be from top to bottom along Z axis.

George Feng's picture

Codes to generate the cylindrical shape are as follows:

TopoDS_Shape aCylinderShape, aBoxShape;

// first Shape = Cylinder
gp_Pnt middlePoint = gp_Pnt(500, 0, 1000);
gp_Dir direction = gp_Dir(0, 1, 0);
gp_Ax2 Ax2 = gp_Ax2(middlePoint, direction);
aCylinderShape = BRepPrimAPI_MakeCylinder(Ax2, 500,2000);

// second Shape = Cone
middlePoint = gp_Pnt(0, 0, 0);
direction = gp_Dir(1, 0, 0);
Ax2 = gp_Ax2(middlePoint, direction);
//Shape2 = BRepPrimAPI_MakeCone(Ax2, 0.0635114, 0, 0.309304);
aBoxShape = BRepPrimAPI_MakeBox(2000,1000,2000);

//TopoDS_Shape aFuseShape = BRepAlgoAPI_Fuse(aCylinderShape, aBoxShape);
//TopoDS_Shape aFuseShape = BRepAlgoAPI_Cut(aCylinderShape, aBoxShape);
TopoDS_Shape aFuseShape = BRepAlgoAPI_Common(aCylinderShape, aBoxShape);

George Feng's picture

A similar problem is found and still not resolved, where OutlineVCompound also only contains part of the outline and part of outline is appeared in VCompound.