GeomLProp_CLProps props(myCurve, 2);
// props.SetParameter(u);
Standard_Real mycurvature = props.Curvature();
i want to select a edge and gain its curvature,but the code don't work.
error:C:\OpenCASCADE5.1\projects\STViewer\STViewerDoc.cpp(1009) : error C2664: '__thiscall GeomLProp_CLProps::GeomLProp_CLProps(const int,const double)' : cannot convert parameter 1 from 'class Handle_Geom_Curve' to 'const int'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Mon, 11/29/2004 - 10:36
Hello,
You can have a look at GeomLProp_CLProps class and LProp_CLProps.
Regards.
Jean Michel.
Thu, 06/09/2005 - 16:59
can anyone show how to use the function LProp_CLProps::curvatures().
i try to use it as the function ::mass() but it's wrong.
Thu, 06/09/2005 - 18:02
Try this (note-curvature requires the first & second derivatives). "u" should be set to the parameter along the curve where you want the curvature.
GeomLProp_CLProps props(myCurve, 2);
props.SetParameter(u);
Standard_Real curvature = props.Curvature();
Note the exception of LProp_NotDefined. This can happen if the curvature can not be computed at the specified parameter.
Don't use LProp_CLProps directly. It is a base class intended to be used from its derived classes like GeomLProp_CLProps and BRepLProp_CLProps.
Fri, 06/10/2005 - 07:19
TopoDS_Edge E;
E = TopoDS::Edge(aShape);
Standard_Real First;
Standard_Real Last;
Handle(Geom_Curve) myCurve =BRep_Tool::Curve (E, First, Last);
GeomLProp_CLProps props(myCurve, 2);
// props.SetParameter(u);
Standard_Real mycurvature = props.Curvature();
i want to select a edge and gain its curvature,but the code don't work.
error:C:\OpenCASCADE5.1\projects\STViewer\STViewerDoc.cpp(1009) : error C2664: '__thiscall GeomLProp_CLProps::GeomLProp_CLProps(const int,const double)' : cannot convert parameter 1 from 'class Handle_Geom_Curve' to 'const int'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
help me ,,thanks in advance!!
Fri, 06/10/2005 - 07:46
hi wyiya,
GeomLProp_CLProps props(myCurve, 2);
you have used it incorrectly
GeomLProp_CLProps (const Handle(Geom_Curve)& C,
const Standard_Integer N,
const Standard_Real Resolution);
and I think you are missing one of the parameter
or
you might have used a wrong type
GeomLProp_CLProps (const Standard_Integer N,
const Standard_Real Resolution);
hope this helps
good luck
Fri, 06/10/2005 - 08:13
thanks John W:
i edit the code.
Standard_Real Resolution;
GeomLProp_CLProps props(myCurve, 2,Resolution);
Standard_Real mycurvature = props.Curvature();
TCollection_AsciiString string("Curvature of the selected edge :");
TCollection_AsciiString string1(" Curvature=");
string +="\n";
string += string1;
string1 = props.Curvature();
it's successful to execute.but it don't output the Curvature when i select a edge (line or circle). any idea? thanks^
Fri, 06/10/2005 - 09:06
i think the key is how to deal with the current point,in the other woed , how to deal with the parameter U. i'm not sure.