Even if it's not rectangular you can still find horizontal and vertical faces of an enclosing rectangle for its main faces.
horizontal>>> face.normal.z==-1 >>>down ...==1 >>>up
vertical>>> face.normal.z==0
you can find the bottom down face (faceh), find its edges, then find an edge that matches in the se of vertical faces' edge (if you might have say several vertical faces then find the one with the longer edges if that's the one you need etc...)
you now have a long bottom face (faceh) and an adjoining vertical face (facev) that's sharing a (long) edge.
faceh.bounds.max.x-faceh.bounds.min.x and similarly for .y give the plan size (x & y) and facev.bounds.max.z-facev.bounds.min.z give the overall height (z) ?