3D Coding, Modeling, and Printing with Beetle Blocks (Video Tutorial)

3D Coding, Modeling, and Printing with Beetle Blocks (Video Tutorial)


Welcome to this video, which is designed to
introduce you to Beetle Blocks. Beetle Blocks is a new tool for making 3D
models. It offers some unique and exciting ways to
use simple blocks of code to generate models that can range from simple to incredibly complex. Beetle Blocks is different from most traditional
3D design tools, such as Autodesk 123D Design, currently being shown on the screen. These tools are great for building simple
and complex models that start with geometric shapes, and typically we interact with those
kinds of models by either dragging out 2D or 3D objects, defining their size, and then
using various tools such as fillet, currently being shown on the screen, to modify those
shapes. Beetle Blocks is totally different from this
approach, however, and we’ll see some differences in the ways that we use Beetle Blocks, along
with examples of the kinds of models that it can produce, in this first video. One big difference between Beetle Blocks and
lots of other 3D design tools is that Beetle Blocks is software that runs in a Web brower. Currently, it only runs in Google Chrome,
but once you have the web site pulled up, you can launch Beetle Blocks directly inside your browser
without having to install special software. You can create an account in Beetle Blocks, and use this
to save your projects directly to your browser, or to the cloud. Let’s take a look at an example of a first
Beetle Blocks project. You’ll notice there are three main sections
to the Beetle Blocks window. There’s the code blocks on the far left,
the area where we can connect code blocks in the middle, and then the 3D window on the
right. Above the 3D window are several tools, including
the green flag and a red stop button. This is how we will generate our 3D models,
and where we’ll see them. To start creating a 3D model, we’ll start
dragging blocks out of the code column in the left, and into the code creation area
in the middle. As you might’ve guessed from the name, the
star of the show in Beetle Blocks is the beetle. The beetle is the object that we use to move
around and generate 3-D objects, and if we zoom in, you can see the beetle itself, sitting
there in the 3-D window. Now, in order to make 3-D object in Beetle
Blocks, we need to tell the beetle how to move, where to move, and how often to do it. So we’ll start with the code block from the
left. Typically we’ll start a program in Beetle
Blocks by using some kind of event. The most common event that we use is when
the green flag is clicked, so I’ll drag the “When green flag clicked” block into the code
window. Now I need to tell the beetle what to do,
so I’ll go to the Motion category on the left, and drag out a block the tells the beetle
how far to move. If I press the green flag, we can see the
beetle move one space By changing this number, I can make the beetle move further
distances, such as three spaces. You’ll notice that the beetle starts moving
from the last position that it was at, so rather than going back to the origin in the center, the beetle will continue
moving from wherever it’s currently placed. If I want the beetle to go back to the center and
to clear out anything I’ve done I can use a special block called reset. Often times in Beetle Blocks programs we’ll use reset
as a way to make sure that whatever thing we’re generating starts from the beginning
and clears out anything that might’ve been there before. So now when I press the green flag the beetle
will start at the origin and then move three spaces. So far you’ve seen the beetle move in just one direction. But because Beetle Blocks is a 3-D program, the beetle can move in any of three
dimensions. Let’s tell the beetle to slow down a little
bit in between moves so that we can see this a little more easily. I’ll drag out a “wait one second” block in
between each of our blocks of code, so we see the beetle return to the origin, and then
move three spaces. After the beetle moves, let’s tell it to rotate
around the Z axis, and let’s tell it to rotate 90°. So now our beetle will return to the origin
with its reset, wait one second, move three spaces, wait one second, and then rotate around
the Z axis by 90°. The Z axis is the blue axis that we see right
around here and we’ll see what that looks like. So I’ll press the green flag, and let’s take
a look. Notice that the beetle has now turned 90°
and if we move three spaces again we can see that the beetle will now be moving in that
direction. Again, I’ll add a “wait one second” block
so we can watch the beetle a little more easily. Now, in addition to simply moving, we can
tell the beetle to start generating a 3-D object, and that’s where the real power of
Beetle Blocks starts to come in to play. Let’s take a look at Shapes. In our Shapes category, we can tell the beetle
to start extruding, and extruding simply means leaving a trail of three-dimensional shape
behind it as it moves on its path. So after our reset here, let’s add a new block
called “start extruding”. I’ll drag this block in here and now reconnect
our wait block, and let’s take a look at what our beetle does now. You’ll notice that our beetle has now left
a trail of solid three-dimensional object. I can orbit around that in our 3-D window
and we can see what that looks like. That’s not the only way our beetle can move,
however. In addition to extruding curves, it can also
extrude lines. Let’s take a look at the difference between
those two. You may have noticed that instead of trying
to make a curve between the points, our beetle is now moving in straight lines. There are curves at the edges but that’s simply
because what our beetle is extruding looks like a tube or a sphere. If I wanted to complete a three dimensional
square, I could simply tell my beetle to move and turn two more times. One powerful tool in Beetle Blocks, however,
is the ability to tell it to do those things multiple times with code instead of having
to simply drag out blocks multiple times. In coding, a common control structure for
doing that is a repeat. We want to move and rotate around the z-axis
four times to make our square so we’ll drop just those blocks into our repeat. Once we connect up the repeat, we’ll take
a look at the entire piece of code. We can see now that our beetle has moved all
the way around our square, leaving a trail of 3-D object behind it. We can always run our code and change it to see what that
would look like with a curve instead. As you can see, we’ve now made a relatively
simple three-dimensional object with just a few blocks of code. Let’s take a look at some more advanced examples
using these same techniques. We’ll start our next program in the same way
that we started the first program, which is using the control block “when green flag clicked”
to start the program. Each time our program runs, we’ll want to
reset the beetle, so we’ll drag a “reset” block out as well. Now what we’d like to do in this program is
have the beetle move in a circle, or at least close to a circle. A circle has 360°, so we need to tell the
beetle to move 360° in a circle which means a combination of moving and turning to do
that. Just like before, we’ll use a control block
called “repeat” in order to tell the beetle to keep doing the same motions over and over. Let’s drag our repeat out and, since 360°
divided by 10 is 36, we’ll tell the beetle how to move using that number. We’ll tell the beetle to move one space and
then rotate Z by 36°. 36 times 10 gives us 360, so let’s take a
look. In order to see more clearly what the beetle
is doing we’ll use the same technique as we did earlier, and we’ll ask the beetle to simply
wait .5 seconds in between each of these moves. Let’s take a look and see if the beetle moves
in a circle. It’s not a perfect circle but we can see the
general outline. This will be easier to see if we go into our
Shapes menu and tell the beetle to start extruding. That will leave the shape behind so we can
more easily tell if the beetle is doing what we want it to do. Let’s take a look now. As you can see, the beetle definitely moves in
a circular direction, but we can see lots of the angles where each of those turns occurs. Let’s tell it to do 20 repetitions and change
this by half. Now the beetle will make twice as many moves
and turns, but each one will be smaller, getting us closer to a perfect circle. Let’s take a look now. Because we can pretty easily see what the
beetle is doing, let’s get rid of those wait blocks. One thing that can be a little tricky with
Beetle Blocks is that we have to detach the blocks that we don’t want from the bottom
to get rid of them, and then drag them away. So I’d like to get rid of both wait blocks;
I’ll drag them back over to the side and then reattach my rotate block. That will make our beetle move a little bit
faster, so we can test this out. So we’ve made a pretty nice looking ring but
let’s add a few layers going up of the same ring. If we want the beetle to do that, we need
to tell it to not turn but move its Z position. In another words we want to beetle to move
up in the z-axis after it’s made this first ring. We can do that with a different motion block. Instead of turning or rotating in the Z axis,
we’d like to change the absolute Z position of the beetle, meaning we want it to move
up one space in the z-axis. So after it does, this let’s change the absolute
Z position of the beetle. Let’s run this and take a look. You notice that, as the beetle moves up one,
it already starts extruding this little bit right in here in the next layer. And let’s see what this would look like if
we did this two times. Just like before, when we want something to
happen more than once, instead of dragging out those same blocks over and over, we’ll
go to our control structure and we’ll use a repeat. We’ll put both of these blocks inside of our
repeat and let’s look at what this would look like if we did this three times. Here, you can see that our beetle has left
three sets of trails, but because we’re doing our “change absolute Z” inside our repeat,
what’s happening is that the beetle is using this to rotate and move in its circle and
then change this, we’re getting an extra little nub at the top. So let’s do this: after our beetle moves in
its circular pattern, let’s tell it to stop extruding. That way, when it moves up, it won’t leave
that extra little nub at the top. In order to do this, we’re going to move our
“start extruding” block into this repeat. And what we’ll do is tell it to stop extruding
before it changes its position. So now what our code says is to repeat this
three times: start extruding, move in a circular pattern, stop extruding, move up by one. Let’s take a look. You’ll notice that our beetle is still there
in the middle, hanging out right above our rings. Now, if we’d like to take this one step further,
we can get some input from the person that’s running the program, so instead of three layers
high, our ring structure can be as many as we like. And we can do that by getting some input from
the person that’s running the program. Let’s say that when the green flag is clicked,
we’d like to find out how many layers this structure should be. When the person types in an answer, that will
appear as this block right here. This is a variable that Beetle Blocks comes
with that just lets us get the information that the user typed in. One thing that would make sense here is to
switch the positions of our reset block and our request for user input, so that the screen
is cleared before we get our user input. Let’s click the green flag now. How many layers high? Let’s try five this time. So what you’ve seen now is a powerful way
to use a few relatively simple blocks of code to make a relatively complex object. We could do this with a traditional 3-D modeling
tool as well, but this give us a very different way to approach 3-D modeling. Since one of the really interesting uses of
3-D modeling is 3-D printing, let’s take a look at what it takes to export a Beetle Blocks
model and get it ready for 3-D printing. To do this is very simple. We’re going to come up to the menu here in
Beetle Blocks, we’re going to choose “download 3-D model as STL”, and our STL file will download. At this point depending on the type of software
we’re using to control our 3-D printer, the process will look a little different, but
I’ll show what it looks like using the software Cura. Cura is software that lets us take a 3D model
file that’s been saved as an STL file, and send it to our 3-D printer. In Cura, I’ll place the 3-D model file that
we downloaded as an STL file file so that it can be 3D printed. So I’ll load the model file, and now we can
see the object that we modeled in Beetle Blocks represented on the bed of our 3-D printer. Because it’s relatively small, I can scale
our model some, in order to make it a little easier to see, and bigger, as we 3-D print
it. Using Cura’s controls, I can also change its
orientation by rotating it, and it will automatically update to show me how much time it estimates
this file will take to 3-D print. Currently it’s showing that this will take
53 minutes to 3-D print this object. Let’s watch as the 3-D printer generates a
physical representation of what we made in Beetle Blocks. The printer I’m using here is a Printrbot
Simple, which is an inexpensive 3D printer that my son and I actually assembled together. If you’re interested, I’ll put a link to that
video in the description of this video. Many 3D printers use this same type of technology,
called Fused Deposition Material, or FDM. Basically, these printers work by heating
up plastic filament, squeezing it through an extruder, which is the red end shown in
the video here, and repeating that process over and over to build up very thin layers
over time. So an object begins from the bottom, and then
is built up with those layers of plastic, building one on top of the other. Let’s watch the 3D printer as it goes. You can see the 3D printer moving in all 3
dimensions. The bed of the printer, with the blue tape
and the object, is moving in the X direction. The head of the 3D printer is moving back
and forth in the Y direction. And, although it’s hard to see, over a timelapse
like this you can start to see the object itself being built up, which is a result of
the arm of the 3D printer moving up in the Z dimension, just like we saw in Beetle Blocks. So here’s the finished printed object. You can see that it has five layers of rings,
just like the object that we designed in Beetle Blocks. And it’s pretty amazing to be able to pick
this up, hold it, and move it around, to see something that started out as code turned
into a 3D object. Thanks for watching this video! If you enjoyed it, leave a comment below,
and I may be able to produce more videos demonstrating some of the amazing things you can do with
code and 3D modeling using Beetle Blocks.

10 thoughts on “3D Coding, Modeling, and Printing with Beetle Blocks (Video Tutorial)”

  1. Bill, this is a fantastic project. I help run a STEM center and just about a month ago, I needed to teach a group of 4-7 graders to do some 3D modelling as part of their FIRST Lego League project.I struggled with teaching them the 3D concepts (they are really smart, I'm just not a good teacher, LOL). This would have been PERFECT to help them.

    They already know Scratch. Is this based on Scratch? It looks very similar. I can see us using this in addition to Scratch. It's a perfect complement.

    I tried to fill out the form, but I couldn't figure out how to mark the answers.

  2. We'd like a tutorial that would cover how to give the beetle a shape to extrude and set a path that is more complex, mirror an action and join the resulting mirrored parts. Thanks!

  3. Hi Bill Van Loo,

    By all means, please do more Beetle Block tutorials!

    I have just come across BeetleBlocks and I am hoping I can use it in our elementary school to teach 2D & 3D graphic design to interested students. I had been looking for a graphical block-oriented "front-end" to Processing and Processing.JS, but so far this is the closest thing I found. Ideally, my front end would lead smoothly into processing, but I think BeetleBlocks will help in presenting 3D graphic concepts more clearly than Processing. Once they get these basic concepts, Processing should be easier for them to grasp.

    I am already using BlocklyDuino (BlocklyDuino-Enhanced and TUNIOT (at http://easycoding.tn) as a Scratch-like "easy in" to Arduino C for both the Arduino Uno and the ESP8266_WiFi_SoC-based NodeMCU boards. Interest in this area is growing, but I thought if I could get students interested in Processing with 2D & 3D Graphics programming as the "hook", then these students would have an "easy in" for Arduino C as Processing and Arduino IDE share a lot in common. Also, Processing is a good lead-in to C/C++. What I like about BlocklyDuino as compared to Scratch is the resulting code is Arduino C which students can analyze to learn C. My ideal "front-end" for Processing should yield Processing compatible Java source code. If you have come across such a block-oriented language let me know. Until then, I think BeetleBlocks comes the closest to what I'm looking for.

    A good collection of tutorial videos would also be a great resource for the students, and help me justify the use of BeetleBlocks at our school. Likely I will have to produce all my own teaching materials and will be relying a lot on materials already on the Internet.

    Sincerely,

    Wm. Moore

  4. Great quality video. That is the type of video we need on YT on the topic of 3d printing, not some Rah Rah "this printer or filament is great type," but actual how to step by step educational content!!!. Your attention to detail and content is PERFECT and best of luck in your master's thesis you are amazing. I found you thru Caleb Fairres and very glad he introduced me
    Dr D

  5. Stories, EdTech & Digital Media with Ahimsa Media

    Great tutoriaL Adding this video to a new monthly playlist I am creating of EdTech on YouTube.

Leave a Reply

Your email address will not be published. Required fields are marked *