Curvature comb of curve

Hi All,

I am trying to design curvature comb of curve. Attachment has two figures. One is the curvature comb from Creo. Another is from mine. When I use the same scale length, I find they are different at the end region. I am using OCC6.5.3. My persudocode of calculating curvature comb lists as follows:
for(i=0; i {
hCur->D2(u, pnt, vec1, vec2);
u+=du;
double radius = vec2.Magnitude();
vec = vec1.Crossed(vec2);
// double radius = vec.Magnitude();
vec2 = vec.Crossed(vec1);
vec2.Normalize();
pnt2 = pnt.XYZ()+vec2.XYZ()*(scale*radius);
AddLine(pnt.X(), pnt.Y(), pnt.Z(), pnt2.X(), pnt2.Y(), pnt2.Z());
}
If you think my method is wrong, please kindly figure it out. Thanks in advance.

Regards.

Ding

Attachments: 
Cauchy Ding's picture

API GeomLProp_CLProps can do it well.