How to make edge smooth?

jianbaoxia

CAD master
Hi Bros, I'm JianBaoXia.
Today I write a demo of create a helix edge, I do it both in Draw and BRepBuilderAPI_MakeEdge.
However, the helix create in helix is smooth, and another helix create by my code is not, look likes below:
1658303879346.png1658303960625.png
I'm looking the code of tcl, I must ignore something.
However, I really want to know why the helix create by BRepBuilderAPI_MakeEdge looks not smooth.

There is my demo:
Code:
Handle(Geom_CylindricalSurface) aCylSur = new Geom_CylindricalSurface(gp_Ax3(gp::XOY()), 6.0);
    gp_Lin2d aLine2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(1.0, 1.0));
    Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(aLine2d, 0.0, M_PI);
    TopoDS_Edge aHelixEdge = BRepBuilderAPI_MakeEdge(aSegment, aCylSur, 0.0, 6.0 * M_PI).Edge();

The tcl code for Draw:
Code:
pload MODELING VISUALIZATION
cylinder aCylinder 6
line aLine2d 0 0 1 1
trim aSegment aLine2d 0 2*pi
mkedge aHelixEdge aSegment aCylinder 0 6*pi
vdisplay aHelixEdge
 

Andrey

Active CAD practitioner
Staff member

jianbaoxia,​


Most likely you don't have a 3d curve("representation") of the edge. This must be done by yourself. After creating the edge, perform BRepLib::BuildCurves3d(aHelixEdge, Precision::Confusion());

Why does it look so bad in the viewer (I mean after saving)? Probably, the STEP-translator realized that the edge has no 3d curve("representation") and did some "smart" actions, as a result of which the original idea was lost. If you look at the edge with AnalysisSitus, you can see that the continuity is C0 and the degree is 1.

1658328136645.png

If you save the curve in brep and look at it with AnalysisSitus, you will see that there is no 3d curve("representation"), but the curve itself looks fine.

1658328318828.png

Similarly, this can be seen in Debug.

1658328452558.png


After using BuildCurves3d(), everything looks fine.

1658328514497.png


1658328631651.png
 
Top