Accessibility tools

European Commission Joinup  
News

Blogs and news

Create, read and comment on news and blogs about interoperability solutions for public administrations.

Rating: 2/5 (based on 1 votes) | 142 reads

ifc sdk and section profile rotation

hello.
I'm creating an ifc importer in c++ with the ifc sdk.
Now I imports beam,column,wall and slab.
But I have a problem with import rotation of the section in beams and columns.
Now I imports a polyline that is the profile of the section (a std::vector of 2d cartesian points).
The problem is how get a rotation angle of the section when is rotated.
Now i have this code:
[code]
//leggo le matrici
    Step::RefPtr<C3DMatrixIfc> pmxRes = m_pPositionAndAxis->GetRotationMatrix();
    
    C3DMatrixIfc mx = *pmxRes;

    mx = mx.Tras();
    C3DVectorIfc axis;
    double dAngle;
.
.
.
and??????????????
[/code]
where pmxRes is the ifc matrix readed from
[code]
int CIfcTrasformation3d::InitPositionAndRotation( IfcAxis2Placement3D* pAxis3dplacement)
{
    int nid = pAxis3dplacement->getKey();    
    //translation vector
    RefPtr< IfcCartesianPoint > pLocation = pAxis3dplacement->getLocation();
    
    //read the position
    m_pPosition = CIfcUtility::TransformIfcCartesianPointToVector(pLocation.get());
        //"The axis is the placement Z axis direction and the ref_direction is an approximation to the placement X axis direction".
    Step::RefPtr< C3DVectorIfc > pAxisZ = CIfcUtility::TransformIfcDirectionToVector(pAxis3dplacement->getAxis());
    Step::RefPtr< C3DVectorIfc > pAxisX = CIfcUtility::TransformIfcDirectionToVector(pAxis3dplacement->getRefDirection());

    //I do the cross product for find the Y axis
    C3DVectorIfc* pAxisY = &( *pAxisZ ^ *pAxisX);
    m_pRotationMatrix = new C3DMatrixIfc();
    //creo la matrice dagli assi
    m_pRotationMatrix->m_X = *pAxisX.get();
    m_pRotationMatrix->m_Y = *pAxisY;
    m_pRotationMatrix->m_Z = *pAxisZ.get();
    
    return 1;
}
[/code]

Now , my problem is:
If you multiply all the 2d profile points for the rotation matrix , it work,but only for a beam or column oriented in x/y plane (the extruding direction is on the z axis but these values can change according to the application that exports the ifc file).
If i change the extruding direction i change the x,y,z of the multiplied 2d points(the profile of the section)
i can have if the extrusion direction is on z axis , for a point that is 122,122,0 for the z direction :
0, 122 ,122
or for a y direction:
122, 0 , 122
or x
122,122,0 ecc.......
in the rotation matrix there is the rotation of the profile(around the z axis) and the rotation of the beam or column.
How i can extract only the section rotation?
I see that is sufficient get the correct pair of coords , but how i can create an algorithm in c++ that select the correct coordinates pairs?
x,y
x,z
or
y,z?
thanks.

 

Information

Country:
Italy
Domains:
Architecture