# To Convert BSpline Curve to analitical curve

hi
i m trying to convert a BSpline Curve into any analitical curve which is represented as BSpline in STEP file..
i got a OCC class ShapeCustom, but dont know the implementation.
can any one help me how to go about this class.
or suggest some other way to convert BSpline Curve?
thanx
deepali

Hi,
you will propably need "canonical recognition"
http://www.opencascade.org/support/products/canrec/
But if the degree of the BSpline is 1, then it is a line (or LineSegments) and if degree is 2 and the weights are 1 and sqrt(2) (alternating) then it is most probably a circle or an ellipse. Then take a few points, calculate the circle and test, whether other points coincide with that circle.
best regards
Gerhard

hi
thanx very much
with ur given information i was able to check if given BSpline curve as Linear and Circular curve.
but nw i want to check if identified circular curve is elliptical or any other circular curve?
is there any condition where i culd check the above curve exist?

Regards
deepali

hi,
if it is a 3D curve find the plane in which is resides. Then take 2 sample points and two directions of the curve and find the intersection of the lines from the sample points perpendicular to the sample directions. If it is a cricle then this point is the center, the distances to the sample points must be equal. If they are not equal, it is an ellipse. I also have the algorithm to construct an ellipse from two points and two directions, but it is too complex to write it down here.
best regards
Gerhard

hi,
realy thnx for ur constant n valuable information.
whatever algorithm u told me to identify the ellipse is also i tried.
but i modified it slightly.
i was having a BSpline Curve n also the plane in wthich it ws lying.
i ws also having Start n End points of that curve, so i culd directly compute the few sample points on curve.
so first i constructed a circle and then calculated the Centre point of it then i caculated the distance from centre to those sample points.(i.e radius of circle)
if distance ws equal then i culd conclude as circle otherwise ellipse.
these now working fine .
thnx for ur idea form which i culd procede with it.
Regards
deepali