First time here? Check out the Help page!
1 | initial version |
Solved it! So in analysing this, I realised that if a surface group has a parent space, it should be transformed by the transformation matrix of the parent space. Thus, I modified my code as such and it worked perfectly.
for aShadingSurface in shadingSurfaces:
shadingFace = surfaceToFace(aShadingSurface)
if aShadingSurface.shadingSurfaceGroup().is_initialized():
shadingGroup = aShadingSurface.shadingSurfaceGroup().get()
if shadingGroup.space().is_initialized():
space = shadingGroup.space().get()
osTransformation = space.transformation()
osTranslation = osTransformation.translation()
osMatrix = osTransformation.rotationMatrix()
rotation11 = osMatrix[0, 0]
rotation12 = osMatrix[0, 1]
rotation13 = osMatrix[0, 2]
rotation21 = osMatrix[1, 0]
rotation22 = osMatrix[1, 1]
rotation23 = osMatrix[1, 2]
rotation31 = osMatrix[2, 0]
rotation32 = osMatrix[2, 1]
rotation33 = osMatrix[2, 2]
shadingFace = topologic.TopologyUtility.Transform(shadingFace, osTranslation.x(), osTranslation.y(), osTranslation.z(), rotation11, rotation12, rotation13, rotation21, rotation22, rotation23, rotation31, rotation32, rotation33)
shadingFaces.append(shadingFace)