Magnetic Sculptures... in Space! Background

This is a continuation of my earlier challenge, where the task was to compute the shape of a sculpture obtained by dropping magnets into a huge pile.

Good news: the eccentric artist liked your work, and has another project for you. He still works with magnetic sculptures, but has decided to expand his art studio -- into space! His current method is to blast a single cube-shaped magnet into the orbit, and shoot other magnets at it to create a huge magnetic satellite.

Input

Your input is a finite list of 0s and 1s, given either in the native list format of your language, or a string. It is interpreted as a "blueprint" of a work of art, and is processed in order from left to right as follows.

You start with a single magnet floating at some integer coordinate of the 2D plane, and keep adding more magnets as per the directives. The directive 0 rotates the entire sculpture 90 degrees in the counter-clockwise direction. In the case of the directive 1, the artist finds the leftmost column of the sculpture, and shoots a new magnet to it from below. The new magnet sticks to the bottom-most existing magnet in the column, and becomes a part of the sculpture. Note that the magnet does not stick to other magnets in the neighboring column, unlike in the earlier challenge; its speed is now astronomical!

Output

The artist wants to know whether the complete sculpture will fit into his garage (how he'll get it down from the orbit remains unclear). Thus, your output is the width and height of the sculpture, ordered from lower to higher. They can be given as a two-element list, a pair, or as a string separated by a comma.

Example

Consider the input sequence

[1,0,1,1,0,1,0,0,1,1]


To process it, we start with one magnet floating in space:

#


The first directive is 1, so we shoot a new magnet from below:

#
#


The next directive is 0, so we rotate the sculpture:

##


The next two directives are 1,1, which means we'll shoot two magnets to the leftmost column:

##
#
#


Then, we rotate again and shoot once, as directed by 0,1:

#
###
#


Finally, we rotate twice and shoot twice:

  #
###
# #
#


The resulting sculpture has width 3 and height 4, so we output [3,4].

Rules

You can give either a function or a full program. The lowest byte count wins, and standard loopholes are disallowed.

Test Cases

[1,0,1] -&gt; [2,2]
[1,0,1,1,0,1,0,0,1,1] -&gt; [3,4]
[1,1,0,1,1,0,1,0,1,1] -&gt; [4,5]
[1,1,0,1,1,0,1,0,1,1,0] -&gt; [4,5]
[1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1] -&gt; [3,3]
[0,1,0,1,1,1,1,0,0,1,0,1,0,0,1,1,0,1,0,1,0,0,1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,1,1] -&gt; [5,7]
[1,0,1,1,1,1,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,0,1,1,1,0,1,1,0,0,1,0,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0] -&gt; [11,12]
Pyth: 34 33 bytes

Sml{dCuS?+G,hhGtehGHm,_ekhkGQ],ZZ


Input is a list of ones and zeros, like in the question. Try it online: Pyth Compiler/Executor 

Explanation:

It's a one-on-one translation of the following Python 2 code (126 bytes). 

print sorted(map(len,map(set,zip(*reduce(lambda s,i:([[-b,a]for a,b in s],s+[[min(s)[0],min(s)[1]-1]])[i],input(),[[0,0]])))))


I create a list of coordinates of the single magnets. This is initialized with the magnet [0,0]. Then for each of the integers of the blueprint I manipulate the list in the following way. If the next integer is 0, I rotate the sculpture by changing the coordinates for each magnet [a,b] to [-b,a] (basically multiplying with a rotation matrix). If the next integer is a 1, I search for the minimal piece [a,b] (which is automatically the lowest magnet of the leftmost column) and append the magnet [a,b-1] to the list. 

After all the input is processed, I create 2 sets (for removing duplicates), one for the x-values and one for the y values, and print the sizes of them in sorted order. 

Sml{dCuS?+G,hhGtehGHm,_ekhkGQ],ZZ
                             ],ZZ  starting list G=[(0,0)]
      u                     Q],ZZ  for H in input(): manipulate G
       S                              Sort G after each manipulation
        ?          H                  G = ... if H==1 else ...
                    m,_ekhkG            [(-b,a) for a,b in G)] (rotate)
         +G,hhGtehG                     G+[(G[0][0],G[0][1]-1)]
                                        (G[0] is the lowest magnet in the leftmost column)
     C                             Zip the coords together
                                    (creates 2 lists, x- and y-coords)
 ml{d                              for each of those list compute number of unique values
S                                  sort and print


An idea for improvement: Using complex numbers as coords for the magnets. A rotation is just a multiplication by j and subtracting j from the lowest magnet in the leftmost column. Sadly finding this lowest leftmost magnet takes way too many chars in Python, not even talking of finding the rectangle.