LegoMockupVisualizer

Creates a Three.js scene for visualizing Lego mockups

Constructor

new LegoMockupVisualizer(domElement)

Sets up a Three.js scene to visualize the lego mock up.

Parameters:
NameTypeDescription
domElementHTMLElement

HTML element that will be used as the container for the Three.js scene.

Classes

LegoMockupVisualizer

Members

camera :PerspectiveCamera

Type:
  • PerspectiveCamera

cameraCadastre :OrthographicCamera

Type:
  • OrthographicCamera

domElement :HTMLDivElement

Type:
  • HTMLDivElement

mockUpLego :Group.<Object3DEventMap>

Type:
  • Group.<Object3DEventMap>

otbitControls :OrbitControls

Type:
  • OrbitControls

scene :Scene

Type:
  • Scene

sceneCadastre :Scene

Type:
  • Scene

Methods

addLegoPlateSimulation(heightMap)

Adds Lego blocks to threejs scene based on a given heightmap.

Parameters:
NameTypeDescription
heightMapArray.<Array.<number>>

2D array representing the height values of the terrain.

createTHREEScene()

Creates a three.js scene with a camera, renderer, lights, and orbit controls.

dispose()

Clears the inner HTML of a DOM element and disposes of an orbit object.

generateCadastre(heightMap)

Generate cadastre image from lego mockup

Parameters:
NameTypeDescription
heightMapArray.<Array.<number>>

2D array representing the height values of the terrain.