Hello, I am trying to calculate the normal and the tangent to a curve belonging to a surface in a given point. COuld some one point me out which package of classes to use ??? I tried using BRepLProp, and GeomProp, but it didn't work. Any help would be appreciated. Thanxs. Omar Author
Discussion
5 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hi Omar,
Have a look at the following classes: GeomLProp_CLProps and GeomLProp_SLProps.
For example: gp_Pnt p1(0,0,1);
gp_Pnt p2(1,2,2);
gp_Pnt p3(2,3,3);
gp_Pnt p4(4,3,4);
gp_Pnt p5(5,5,5);
TColgp_Array1OfPnt array1(1,5); // sizing array
array1.SetValue(1,p1);
array1.SetValue(2,p2);
array1.SetValue(3,p3);
array1.SetValue(4,p4);
array1.SetValue(5,p5);
Handle(Geom_BezierCurve) Curve1 = new Geom_BezierCurve(array1);
gp_Pnt P1 = Curve1->EndPoint();
GeomLProp_CLProps analyse1(Curve1,
Curve1->LastParameter(),
1,
Precision::Confusion());
gp_Dir T1;
analyse1.Tangent(T1);
It should be similar with a surface (GeomLProp_SLProps)
Regards, Commenter-1
02Commenter-2
Hello!
The simpliest way is to use directly the methods of Geom_Curve and Geom_Surface:
for the Curves : see the method Geom_Curve::D1 (which returns vector of first derivative, i.e tangent).
for the Surfaces : see the method Geom_Surface::D1 (which returns two tangent vectors D1U and D1V). Normal is the vector product of two tangencies:
gp_Vec aNorm = aD1U^aD1V;
Best regards.
03Commenter-3
Normally you want to have the main normal. You are able to compute it with a given parameter u: