Rotation between elements

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: 
JuryS's picture

Hi, you make get the angle with using gp_Vec.

gp_Vec myVec;
myVec.angle(gp_Vec other);

JuryS's picture

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.

Brambilla Cristian's picture

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?

Brambilla Cristian's picture

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.

JuryS's picture

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....