Tinkercad's new Codeblocks computational design workspace is the simplest place to make 3D models using draggable blocks of code.
Learn basic design and coding principles in an easy-to-learn workspace using Scratchblocks 3.0 as seen in MIT's Scratch application.
Let's get started!
Codeblocks is a new workspace for Tinkercad and is still in development, but you can enter it in the same way as the 3D and Circuits workspaces.
Instructions
This area is where you come to find existing Codeblocks Designs, create New Designs or open Starters Designs.
Let's create a New Design to introduce you to the workspace.
Instructions
This will close the Mini-dashboard and open the Code workspace.
(Note: At the top, you can see a variety of fun Starter Designs. These sample designs show different ways of using code to assemble Shapes. Once you finish the Quick Start lessons drop back here and have a look at them.)
When you drop into the workspace, you can see it is very similar to Tinkercad's 3D editor workspace, but broken up into several sections.
Navigation (Nav) Bar- Macro controls that are used across all Tinkercad workspaces.
Tool Bar- View, Name, Edit and Export your Design.
Blocks Panel- Scroll to view a variety of Codeblock options.
Blocks Editor- Stack your Codeblocks here to define and refine your Design.
3D Viewer- See the results of what you built in the Block Editor.
Now that we know the layout, let's begin building!
Design is a process of making creative decisions to create something and then refining those decisions until you, as the creator, determines the project is complete.
The same thing is true for coding, it is a process where you make decisions, using commands, until you have achieved the outcome that you are looking for.
In Codeblocks, there is a repeating rhythm to this process. Let's take a look at the steps-
1. Select- You start by Selecting a Codeblock, preferably a Shape Block, like the Box from the Block Panel on the far left side.
2. Stack- Click and drag it from the Block Panel into the middle of the Block Workspace, as shown above. This is where you Stack the blocks to create a script.
3.Run- Once you have placed the Shape, you look to the upper right hand corner for the Run Button and click it.
4. Review- Below the Run button is the 3D Viewer where you view your work or Review any changes you have made to your design. In the 3D viewer, you should see a 3D version of the Shape that you selected in Step 1.
5. Adjust- From here, you would go back to the Block workspace and Adjust your Design by dragging in another block or making changes to the Shape that you have already selected.
As mentioned, you will continue this process - Select, Stack, Run, Review, Adjust - until your design is finished.
Now that you have a feel for the process, let's take a closer look at the most common features of the Codeblocks Workspace.
To design things in Codeblocks, you snap blocks of code together to form a Stack of sequential commands or actions. These actions control the Shapes and the result is a 3D Design that you can view in the 3D Viewer.
Let's start by dragging in the 'Box' Shape block.
Instructions
(Note: To work properly, there must always be at least one Shape in your stack.)
Since we are using code to create our design, we need to Run that code see your result in the 3D Viewer. This is an important process and one that you will repeat over-and-over as you update your design.
Instructions
(Note: See how your Box has loaded in the very center of the grid and is 1/2 above and 1/2 below the Workplane? This is normal and slightly different than Tinkercad's regular 3D workspace, where Shapes load on top of the Workplane.)
Now you have seen your 3d Shape load in the 3D Viewer, let's look at how to view it from a variety of angles.
There are 2 main ways to control the camera in the 3D Viewer-
Instructions
The ViewCube is like a mini controller for the screen. It has labels of the various view angles (front, top, etc.) that match the workspace. 'Grab' it by clicking your mouse on it and dragging to rotate.
For quick view changes, you can click the various labels or fields. Hover your cursor or finger over top of the ViewCube and you can see the fields highlight. Click any of the fields to see your model from that angle.
To Zoom in and out, click the '+' and '-' Zoom buttons
Orbit- Used to rotate around the model. To Orbit, hold own the Control key, while dragging your mouse anywhere within the Viewer area. For touch controls, drag one finger anywhere outside your design.
Pan- Used to move sideways or up and down to center your model in the Viewer. To Pan, press and hold the 'Shift' and 'Control' key while using the mouse to click and drag anywhere within the View area. For touch control, use two fingers and drag anywhere outside your design.
Zoom- Zoom in and out to view small details. To Zoom, use the scroll wheel on your mouse. For touch, use two fingers to pinch or pull on your trackpad or touch screen.
Most Shapes have onboard controls that let you modify the Shape to fit your needs.
Instructions
To move Shapes in the workspace, you use the Move block. It works like taking steps along a path starting at the Shape's current location on the grid, which for your Box is 0.
Instructions
Important tip: All non-Shape blocks require a Shape to do their action. Many blocks take action on only the nearest Shape above them. If there is only one Shape in the workspace, attaching the Move block on top of a Shape won't effect an action on that Shape.
(Note: You can see which direction the X axis runs by looking at the Red line near the center of the Workspace. You can also see the direction of the Y axis in Green and the Z axis, that runs up and down, in Blue.)
You can attach the Rotate block to your stack to add a rotation movement.
At this point, your stack should have a Box block with a Move block snapped to it.
Instructions
Color adds a new dimension to the look of your models and its easy to change.
Instructions
Since every Shape loads at the origin point at the center of the workspace, it's pretty easy to align Shapes, by stacking them on top of one another. Let's make a quick rocket to show how.
If you have any blocks in your Block Editor, drag them all to the Trash icon in the bottom right corner.
Instructions
This step is sort of a trick since Tinkercad automatically Saves your Designs while you work, but its important to know when a Design might be finished and when to start a new one.
Instructions
Grouping is one of the most important actions in Tinkercad because it allows you combine parts of your design for easy movement or modification. This will also help prepare them for 3d printing.
Instructions
A Hole is a Shape that has been changed to cut into another Shape. It is activated when you use a Group block to combine regular Shapes and Holes.
Instructions
If you have access to a 3D printer, you can export your Design as an .stl file for printing.
Instructions
It's fun to watch your Codeblocks Designs auto-build as an animation. You can share animations of your Design building using the .GIF creation tool.
Instructions
The PartMaker tool will turn your design into a single, combined part and send it to your Parts Collection in Tinkercad's 3D workspace for adding to other Designs.
Instructions
(Note: Making and using Parts can save you a lot of time and effort on your design, especially with things that you do over-and-over. What other kind of things would you make and use in the 3D editor?)
We've covered the basic functions of the Codeblocks workspace. This should give you the perfect launch point for exploring the rest of the blocks and workspace features.
To learn more about Codeblocks, give us feedback, or suggest new features, drop by our Codeblocks Community Forum and take a look around. It's a great place to meet other Codeblocks users, share your work, and find solutions to the parts of the app that don't quite make sense.
Happy Coding!