i am trying to retrieve the coordinates of different types of objects in my model. for one type of objects, ifcopenshell.util.placement.get_local_placement() returns the actual placement within the model , while for all other objects it returns the origin. therefore, i tried to workaround using object.Representation[2][0][3][0][0][0][0]. Strangely, this returns the coordinates for all objects, where get_local_placement() does not work, while for the object type where it worked, it returns the origin. I am aware that this is most probably a modelling issue, but maybe someone has experienced something similar and can help out?
code example:
object type 1:
ifcopenshell.util.placement.get_local_placement(schwelle.ObjectPlacement)
Output:
array([[ 3.53002661e-01, -9.35588086e-01, -8.00344999e-03,
3.83472340e+02],
[ 9.35347713e-01, 3.53093378e-01, -2.12066600e-02,
1.77756250e+03],
[ 2.26666701e-02, -1.23988390e-09, 9.99743078e-01,
4.50623840e+02],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00]])
np.array(schwelle.Representation[2][0][3][0][0][0][0])
Output:
array([[0., 0., 0.]])
object type 2 (and all others):
ifcopenshell.util.placement.get_local_placement(schienen[0].ObjectPlacement)
Output:
array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]])
np.array(schienen[0].Representation[2][0][3][0][0][0][0])
array([1213.69775, 1355.36921, 455.17992])
does anyone have suggestions as to why this could be? and how i could consistently handle objects and retrieve their coordinates?
thanks in advance