Before you start
- You did the installation and the geometry kernel is running.
- You have a Three.js scene.
Make the building
1
Write an empty model
The model has one building with the id
building and one storey with the id ground. The storey is 3 metres high.2
Open a session
A session builds the geometry and applies your edits. Add its
root to your scene one time. The root stays the same after each edit.Change the document
Each element has edit commands. You send a command to the session, and the session changes that element. You keep the session and its undo history. The guides for slabs, roofs, stairs, columns and rooms add their element with theadd-element command. This function removes one element with remove-element:
snapshot()gives you a copy of the model. You can change the copy safely.- If the new model is not valid,
new BuildingSessionthrows an error. The old session is still in the scene. - A new session starts with an empty undo history.
replaceBuilding to load or replace a whole building. Model a mass uses this function.