Object Visualization

Define and visualize a tank object.

First, create an empty BaseObject to store basic properties:


				

Fill it with the identification tag and geometric data:


				

Create now an empty DerivedObject:


				

Link it to the respective BaseObject and fill it with position (in relation to the vessel):


				

Now that the derived object (myObject) was created, we will plot its 3D Visualization. However this can only be done with the tank as part of a ship object, so we need to generate a minimal ship specification:


				

Then, create a Ship object from that specification and populate it with the base and derived objects:


				

The visualization is created with an interface built to transform the Ship object above in a Three.js render. The rendering environment can be prepared by copying and pasting the following script:


				

Once the rendering environment is created, a 3D model of the ship object (which in this particular case contains only one object and no hull or structure) can be generated:


				

The "stl/" path points to the folder where the STL 3D files are stored. If no related file is specified inside the base object, as is the case here, the function will automatically create a cuboid with the specified dimensions.

Now the 3D render can be added to the scene with the relevant configurations of camera position and control target:


				

The result is: