Fri, 06/04/2010 - 17:15
Forums:
There is a simple way to find the rotation angle between 2 arcs?
I have a path made by lines and arcs (imported from IGES). I have to find the rotation (relative) from an arc and the next one.
See attachment for a graphic explanation.
Thanks in advance.
Attachments:
Tue, 06/08/2010 - 01:20
Hi, you make get the angle with using gp_Vec.
gp_Vec myVec;
myVec.angle(gp_Vec other);
Tue, 06/08/2010 - 01:22
Or you may create the Local system coordinate with gp_Ax3 for first object and for second object. After you may translate first system coordinate by points like 0,0,0 to the first system and after get the angle.
Tue, 06/08/2010 - 13:09
Thank you JuryS.
At the moment I solved this question by calculating equations of the planes (which arcs belong) and after, calculating angle between planes, but I will try one of your solutions (the first seems quite simple)
Another little question: gp_Circ.Length() returns the entire circle lenght, how can I get the lengtt of the arc?
Tue, 06/08/2010 - 18:05
JuryS, I user vectors for getting angle of a single arc, and then calculate the lenght of the arc itself. So, thank you very much.
About the original question, I will continue with the "mathematical" method because seems to work fine.
Tue, 06/08/2010 - 22:54
double theLength, theSurfArea, theVolume;
GProp_GProps LProps, SProps;
BRepGProp::LinearProperties(myShape, LProps);
theLength = LProps.Mass();
BRepGProp::SurfaceProperties(myShape, SProps);
theSurfArea = SProps.Mass();
theVolume = 0.0;
if (myShape.ShapeType() < TopAbs_SHELL)
{
for (TopExp_Explorer Exp (myShape, TopAbs_SOLID); Exp.More(); Exp.Next())
{
GProp_GProps VProps;
BRepGProp::VolumeProperties(Exp.Current(), VProps);
theVolume += VProps.Mass();
}
}
And now you can get the Lenth, Area and Volume from all shapes that you have, not only for line or circle....