# Introduction to 3D Modeling. Section 1. Getting Started

### 1 Getting Started

Objectives:

• Learn basic facts about Solid Modeling and PLaSM.
• Learn to work with the PLaSM module.

#### 1.1 Solid Modeling and PLaSM

The word "solid" in this context means "an object", as in "square is a two-dimensional solid", "cube is a three-dimensional solid". Solid Modeling, sometimes also called 3D Modeling or 3D Design, is a collection of rules and techniques for mathematical and computer modeling of solids. It is distinguished from related areas such as computer graphics by its emphasis on physical fidelity. In other words, accuracy of models that are used in 3D computer games is very different from the accuracy that is required in architecture, automotive industry, and other engineering areas. Solid Modeling is the basis of computer-aided design (CAD), engineering simulations, and other disciplines.

This 3D modeling course is based on PLaSM (Programming Language of Solid Modeling), a simple and elegant scripting language with Python syntax. In fact, PLaSM is a Python library – colors, shapes, geometrical transformations and everything else is defined via simple commands. Entire designs are simple Python programs. The PLaSM module is connected to a powerful computational geometry engine on a remote cloud server where these programs are evaluated, and resulting 3D geometries are sent back to your computer or tablet, and displayed in your web browser.

#### 1.2 Launching PLaSM and running the demo script

The PLaSM module can be launched via the Creative Suite icon on Desktop:

Alternatively, one can use the Start menu located in the bottom-left corner of the browser:

The module opens with a demo script:

The purpose of the demo script is to show quickly how PLaSM works. In fact, it presents a lot of functionality:

• How to create a cube.
• How to create a cylinder.
• How to move objects.
• How to rotate objects.
• How to subtract objects from each other.
• How to display objects.

Run the demo script by pressing the Play button, and then allow few seconds for processing on the cloud and data transfer back to your computer or tablet. The resulting geometry is shown below:

Users who are familiar with Solid Modeling or have worked with another CAD system before, will probably have PLaSM figured out by now. For all others – please keep in mind that the demo script is a sneak-peek only. It’s not meant to teach you 3D modeling – that’s the purpose of this textbook.

#### 1.3 3D printing

3D printing is the feature of our time, and NCLab fully supports it! NCLab users can send their designs to support@nclab.com. We will measure the volume and provide a quotation. The NCLab 3D printing service is not-for-profit and therefore less expensive than commercial 3D printing services.

For illustration, Fig. 5 shows a 3D print of the drilled cube created by the demo script.

Fig. 6 shows a 3D print of a Roman temple model that we will build in Subsection 6.2.

Fig. 7 shows a 3D print of a gear model that we will create in Subsection 6.4.

#### 1.4 3D visualization

To better understand how 3D visualization works, imagine that your computer screen is a 2D plane that has a coordinate system (grid) attached to it: Horizontal axis X that lies in the plane of the screen and goes from left to right, vertical axis Y that also lies in the plane of the screen but goes from bottom to top, and a Z-axis that is perpendicular to the screen, as shown in Fig. 8.

The mouse can be used to rotate the object about all three axes X, Y and Z, and also to move it in all these directions. So, although the computer screen is flat, the visual experience is 3D. Before we explain how it works, run the PLaSM demo script and stop the rotation using the button in the upper right corner of the output window.

1. Turning

Hover the mouse pointer over the 3D object and press the left button. While holding it down, move the mouse to the left and to the right on the desk. The object on the screen will rotate about the Y axis. Moving the mouse up and down on the desk while holding down the left button will result in rotation about the X axis.

2. Panning

The missing rotation about the Z axis cannot be made up by combining the X and Y rotations. Therefore we use panning: Hover the mouse pointer over the object and press the left button again. While holding it down, start describing with the mouse small circles on the desk in the counter clockwise direction. The object on the screen will start tilting to the right (Z rotation). Similarly, circular motion in the clockwise direction will tilt the object to the left. Combined with the X and Y rotations described in point 1, now we have a complete set of all 3D rotations.

3. Moving

Holding down the middle button (or the mouse wheel) instead of the left one, and moving the mouse left to right will move the object on the screen in the X direction. Moving the mouse up and down on the desk will move the object in the Y direction. Missing the Z direction? That’s why we have zooming!

4. Zooming

Zooming is done via the mouse wheel or by holding down the right mouse button and moving the mouse up and down on the desk. The object on the screen moves in the Z direction. The latter option is smoother. Hence, with zooming we have a complete set of 3D motions on the computer screen.

The mouse controls only adjust the view of the model in the X, Y and Z coordinates associated with your screen. They do not make any changes to the model itself.

#### 1.5 RGB colors

According to the additive color model which is based on the human perception of colors, every color can be obtained by mixing the shades of Red, Green and Blue (R, G and B). These are called additive primary colors or just primary colors. The resulting color depends on the proportions of the primary colors in the mix. It is customary to define these proportions by an integer between 0 and 255 for each primary color. So, the resulting color is a triplet of real numbers between 0 and 255:

 Color R G B Red 255 0 0 Green 0 255 0 Blue 0 0 255

These colors are shown in the following Fig. 9.

When the proportions of all three primary colors are the same, the result is a shade of grey. With [0, 0, 0] one obtains black, with [255, 255, 255] white:

Guessing RGB codes is not easy. If you need to find the numbers representing your favorite color, the best way is to google for "rgb color palette". You will find many pages that translate colors into RGB codes. Fig. 11 shows three "easy" colors cyan, pink and yellow along with their RGB codes.

In Subsection 2.2 we will learn how colors are assigned to objects in PLaSM. In Subsection 3.1 we will see how various objects in one scene can be colored differently.