
Wed, 03/04/2009 - 08:09
Forums:
I am having two gp_Pnt (p1 and p2) and i am drawing the line between them by,
BRepBuilderAPI_MakeEdge Line = (p1,p2);
The Line was created sucessfully. Now if i want to increase the length of the Line by 10. By extending the p1 by 5 and p2 by 5. How to do that please help.
Thanks & Regards
Vidhyan
Wed, 03/04/2009 - 09:35
Translate each point with a vector of magnitude 5, direction p1 to p2 for p2 and reversed direction for p1, then rebuild the line.
Wed, 03/04/2009 - 09:47
Can u kindly explai with a sample code
Wed, 03/04/2009 - 11:42
gp_Vec v(p1, p2); // Vector from p1 to p2
v.Normalize(); // Make magnitude equal to 1
v.Multiply(5); // Scale by 5
p2.Translate(v); // Translate p2 in the direction of v
v.Reverse(); // Reverse direction of v
p1.Translate(v); // Translate p1 in the direction of v (previously reversed)
BRepBuilderAPI_MakeEdge newLine(p1, p2); // Create new line
Wed, 03/04/2009 - 11:54
Thanks a lot Paul Jimenez... It helped... Thanks