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

### Our Solutions

Need professional assistance?
Consider our:

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

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

# BRepTool::Curve() question ???

Forums:

Hi !

If the BRepTool::Curve( edge, l, m) failes, does this mean that the edge is just a straight line or are there other reasons that this call may fail ?

Mikael

### Re: BRepTool::Curve() question

Hello,

If BRepTool::Curve fails. There are two possibilities the Edge is Null or the Edge has no 3dCurve, In this last case there are two possibilities the edge is not correctly built. the other is E can be a degenerated Edge. A degenerated edge has only a 2d representation and has'nt got 3dCurve. An example of degenerated Edge is the Pole of a sphere, or the top of a cone. To test if an edge is degenerated you have the method BRep_Tool::Degenerated().

Best regards Yves

### Re: BRepTool::Curve() question

Hi !

Is it possible to display the 2D curve ?

In my case I have a sphere and I get a Geom_SphericalSurface from the face and a Geom2d_Curve for the degenerated curve.

Then I try to map the 2D curve into the parametric space of the face but that does not work.

I get the X,Y values from the 2d curve with Geom2d_Curve::D0( p, pt) and then I use Geom_SphericalSurface::D0( pt.X(), pt.Y(), pt2) to try to get the 3D coordinate, pt2.Z() is ok, but the X and Y values are all just very, very close to zero ?

Could someone tell me which class takes care of displaying edges in Open CASACDE, I mean where the edge is coverted to OpenGL format ?

Mikael

### Re: BRepTool::Curve() question

Hi!

You can display the 2d curve in the plan. But it's normal that on the degenerated edge, all the points of the Geom2d_curve give the same point in 3d. (a pole of the sphere).

To manage edge representation see AIS_Shape.

Yves