g | x | w | all
Bytes Lang Time Link
175Scala 3250525T021807ZAhamad
145Ruby250327T213930ZLevel Ri

Scala 3, 175 bytes

Scala port of @Mukundan314's Python answer.


Golfed version. Attempt This Online!

for(i<-"KOOKJNOKIMOKHLOKIMNJJNNJJN(,>:IM(,>:8<-)OK8<(=)>:(,.*".getBytes)println(("  "*(i%4))+(("- +|"*6).substring(i/4).grouped(2).map(_.head).mkString))

Ungolfed version. Attempt This Online!

object Main {
  def main(args: Array[String]): Unit = {
    val bytes = "KOOKJNOKIMOKHLOKIMNJJNNJJN(,>:IM(,>:8<-)OK8<(=)>:(,.*".getBytes
    val pattern = "- +|" * 6
    
    for (i <- bytes) {
      val spaces = "  " * (i % 4)
      val chars = pattern.substring(i / 4).grouped(2).map(_.head).mkString
      println(spaces + chars)
    }
  }
}

Ruby, 159 152 145 bytes

s='%16s'%$/*75
96.times{|j|s[(6&'$s210"!b! H'[k=j/9].ord>>h=j%9/3*2-1)|k-j*2/-3<<4,d=(6&"UJXLL"[k/-3].ord>>h)+3]=("+-| "[-j%3&2,2]*6)[0,d]}
$><<s

Try it online!

We create a string containing 75 lines of 15 spaces + newline then modify it row by row. The data is stored in 2 magic strings. It's important that exactly the right number of lines to show all output are used, because otherwise bad data will be shown for the skinny S shape (last net above, and last one printed.)

The first uses 1 character per net to encode the start position of the (up to 3) rows, a number from 0 to 3 in base 4. For this 11 different characters are used.

The second encodes number of squares in each row - 1, again from 0 to 3 in base 4. There a total of 4 possibilities, used in 1+6+3+1 = 11 nets. The magic string has 5 characters (the character for the 2nd possibility is repeated. We divide k (the index of the cube we are on) by -3 to get the index, giving the index value 0,-1,-1,-1,-2,-2,-2,-3,-3,-3,-4 (taking advantage of the fact that Ruby rounds integer division down towards negative infinity.) Also the index -1 wraps round to the the last character in the string.

This code uses integer division of negative numbers several times.

Commented code

s='%16s'%$/*75                     #Make a string of 75 newlines, padded to length 16 with 15 leading spaces.
96.times{|j|                       #Iterate 9 times for the first 10 cubes and 6 for the last one.
s[(6&'$s210"!b! H'[k=j/9].ord>>    #k is the index of the current cube. get an ascii code from the magic string. AND by 6 to extract 2 bits.
    h=j%9/3*2-1)|                  #but first shift it by the row of the current cube j%9/3, times 2 bits, offset by -1 because we always want an even number.
                                   #The above gives the x coordinate to start modifying the canvas. OR it by the y coordinate, shifted <<4 to mulitply by 16. 
    k-j*2/-3<<4,                   #-(j*2/-3) advances 2 lines for 3 values of j, so that +-+ gets overplotted between rows. k advances by 1 for the next cube. 
    d=(6&"UJXLL"[k/-3].ord>>h)+3]= #find d, how many chars to replace. Get number from the magic string, shift by h, AND by 6. Add 3 chars for the 1st square.
    ("+-| "[-j%3&2,2]*6)[0,d]      #make a string of 6 "+-" or "| " (use [-j%3&2,2] to select the characters.) Copy d characters into s[] 
}                                  #close the loop
$><<s                              #dump s to $> (identifier for stdout.)