Stegreifentwerfen "gesteckt nicht geschraubt 2.0"

digitales Stegreifentwerfen
G. Wurzer, W.E. Lorenz, S. Swoboda. Im Zuge der Lehrveranstaltung wird die Digitalisierung vom Entwurfsprozess bis zur Produktion an Hand einer selbsttragenden Holzstruktur untersucht: vom Stadtmöbel über die Skulptur zur Brücke. ...

dap – digital architecture and planning

TU Wien | dap – digital architecture and planning
Logo und CI Entwicklung (Logo, Briefpapier, Visitenkarte)

SimAUD 2020:
Proceedings

2020 Proceedings of the Symposium on Simulation for Architecture and Urban Design
A. Chronis, G. Wurzer, W.E. Lorenz, C.M. Herr, U. Pont, D. Cupkova, G. Wainer (ed.)
SimAUD, Vienna (online), 2020, ISBN: 978-1-56555-371-2; 622 pages
zu den Proceedings

Menger Sponge

This project uses three.js. Make your choice and press reset.

code

///////////////////////////////////////////////////////////////////////
////////////////// MENGER SPONGE //////////////////
/* recursive */

function mengerSponge(posI, posJ, posK, boxSize, iteration, maxIterations) {
  /* construction of menger sponge */
  for (var i = 1; i <= 3; i++) {
    for (var j = 1; j <= 3; j++) {
      for (var k = 1; k <= 3; k++) {
        if (
            ( i != 2 && j != 2 && k != 2 ) ||
            ( i != 2 && j != 2 && k != 1 ) || ( i != 2 && j != 2 && k != 3 ) ||
            ( i != 2 && j != 1 && k != 2 ) || ( i != 2 && j != 3 && k != 2 ) ||
            ( i != 1 && j != 2 && k != 2 ) || ( i != 3 && j != 2 && k != 2 )
           ) {
          if (iteration < maxIterations) {
            mengerSponge((posI + i * boxSize), (posJ + j * boxSize), (posK + k * boxSize),
                                    (boxSize / 3), (iteration + 1), maxIterations);
          } else if (iteration = maxIterations) {
            drawCube( i, j, k, posI, posJ, posK, boxSize );
          }
        }
      }
    }
  }
}
function drawCube(i, j, k, posI, posJ, posK, boxSize) {
  /* construct object */
  var object = new THREE.Object3D();
  /* cube */
  var mGeometry = new THREE.BoxGeometry( boxSize, boxSize, boxSize );
  var mMaterial = new THREE.MeshLambertMaterial( { color: 0xffff00 } );
  var cube = new THREE.Mesh( mGeometry, mMaterial );
  cube.position.set(posI + ((i + 1) * boxSize) - 3, posJ + ((j + 1) * boxSize) - 1, posK + ((k + 1) * boxSize));
  /* casting shadows */
  cube.castShadow = true;
  object.add ( cube )
  scene.add ( object );
}