Here's a bit of code that creates a new IFC (it's C# but the calls and types will map directly onto the python macro language).
IFCMesh newShell = worldView.Add<IFCMesh>();Point3D normals = new Point3D;var newShellColor = mesh.Color;newShell.CreateShell(0, Guid.Empty, verticies.ToArray(), faces.ToArray(), normals, newShellColor);newShell.Mode = mesh.Mode;newShell.Name = mesh.Name;newShell.Description = mesh.Description;newShell.Color = newShellColor;
Let me explain the parameters to the CreateShell method (to the best of my knowledge!)…
vertices – an array of all the Point3D vertices that make up the object (no particular order)
faces – an array of integers that describe all of the different faces that make up the IFC. It consists of the number of points for that face, followed by the list of vertex indexes, then repeat… I've only dealt with data that has sets of 3 vertices (triangles) but I assume if there are more than 3 vertices in a face then they have to be co-planar. (I'm pretty sure from memory the indices into the vertices parameter are 0 based btw).
I've always just passed an empty array in for the normals argument. Perhaps this defines the inside versus outside for a each face or something… I'm not sure.
Hope this helps!