Extrusion
-
Prerequisite
Description
Extrusion means converting a 2D image to a 3D object by giving it some thickness. For example, you can extrude this apple image into a 3D apple “board” with thickness:
To create an extruded object, you first need to add the image to the sprite’s costume. You can either select an image from the costume library, or draw the costume yourself, or upload an image file. Please make sure the costume is in the Vector format. That is, if you see the blue button at the bottom of the costume says “convert to vector”, you need to click on it.
Once the costume image is ready, you can run the following block to extrude it into a 3D object:
Costume Name
The first input is a dropdown for you to select the name of the costume that contains the image you want to extrude.
Thickness and Side Color
The extruded 3D object will have a flat side face around its contour. These 2 inputs allow you to control how thick the object is, and the color of the side face. Here are some examples with different thicknesses and colors:
Granularity
When we extrude an image, the contour of the image is first converted to many small line segments. The granularity value controls the length of these line segments, it can be any value greater than 0, such as 0.1 or 50. The larger the value, the longer lines are used, which simplifies the 3D object, but also makes the curves less smooth. Here are some examples with a granularity of 30, 10 and 1:
Notes on Extruded Objects
The extruded object will be facing the same direction as the Y axis, which is also called the “Positive Y” direction.
In addition, the center of the costume image will be located at the center of the 3D world. In other words, you can shift the position of the image in the costume editor, and it will not affect the extrusion result:
Demo: 3D Text with Thickness
You can use extrusion to create 3D text that has some thickness. You just need to write the text in the costume editor, then extrude it with the desired thickness. Note that to retain the special fonts of your text costume, you need to convert it to the bitmap format then convert it back to the vector format:
https://play.creaticode.com/projects/fd767ae1db92bb63b909ca57
-