This week focused on learning how to use 2d and 3d programms vectorizing, drawing, and painting, as well as modeling pieces or objects. All of this with the aim of implementing it in our final project, or similarly, learning something new that might be useful to us in the future.
2D softwares, such as Affinity or Inkscape, are primarily used to create and edit vector graphics, allowing users to work with images that retain their quality when scaled. One of their most important functions is image vectorization, as they allow users to transform raster images into editable shapes using precise lines and curves, facilitating their use in logos, illustrations, and graphic design. Furthermore, they incorporate drawing tools that allow users to create elements from scratch with a high degree of control over strokes, colors, and geometry, making them ideal for creative and technical design processes.
Both softwares can be used to do the same tasks but they have different interfaces which can makes them not friendly to all users or maybe they can more or less things than the other software, we will find it out. I will focus only on vectorizing images and drawing because these are the tools I might use most in my final project or in other subjects.
Inkscape is a free vector graphics software that allows you to create and edit illustrations using scalable shapes, strokes, and curves without loss of quality. It is widely used for 2D drawing and image vectorization in digital design and graphics projects.
Insert the image you want to vectorize into Inkscape; if it's too large, scale it to the desired size.
Go to Stroke, then Vectorize Bitmap. This will give us a preview to see how our image will be vectorized. Once we're happy with the result, we'll click Apply.
After we click apply we just have to move the vectorized image to other side of the page so we can see it better.
Now I want to vectorize this spiderweb image, but when I vectorize it normally and get the borders, I get details I don't need, like the detail in the spiderwebs or the square border surrounding the pattern.
For these details, you need to modify the default vectorization provided by Inkscape. Go to the "Single Pass" tab and adjust the threshold option until it's the one you want.
We can also use the "invert image" option, which inverts the blacks and whites; depending on our needs, this may or may not be useful.
After playing with the threshold there is less detail in both images, in the spiderweb (which is what I wanted) and you can also see the image with inverted colors.
To crop an image, you need to insert any shape, as that is the shape that will be cropped from the image.
We select the shape with which we will cut the image, right-click, select crop and apply crop.
Only the area within the shape we have made will be preserved.
To combine images, select both images with shift, right click and click group.
To save an image, go to File, then Export. A tab will open on the right.
There are different options for saving, allowing you to save the entire document, a specific page, a custom page, or a selection (which I will use) that allows you to specifically save the image you clicked on. When you clicked on it, you select export.
Allow to draw draw bezier curves and straight lines, after you finish drawing the shape that yu draw will be filled.
Allows to draw freehand strokes and it doesn't fill after finishing
Draw calligraphic strokes
Affinity is a professional graphic design software focused on creating and editing high-performance vector and raster graphics. It is used for illustration, 2D drawing, and vectorization, and is known for its precision and efficient workflow.
We insert our image, select our image, then click on the vector tab, look for the image trail option and click on it.
The Image Trace tab will appear with two options: Threshold Limit and Curve Fit Tolerance. A helpful tip is that you can click the button in the middle of the left corner of the window (the one that looks like a circle cut in half) to see the before (right) and after (left) of the image. Threshold Limit allows for more vectors at a lower percentage, which is useful when working with a color image. However, as mentioned before, vectorizing color images is not recommended because they can end up containing a large number of vectors. Curve Fit Tolerance varies depending on the number of vectors applied, so both parameters are related and will differ depending on the needs of each image, click Apply.
When you click, it seems as if the image hasn't been vectorized, but you have to double-click on the shape you want to modify (in my case, the spider) and move it wherever you want.
To save our file, go to "File", "Export", "Export", select the "SVG" option to save our file in that format. To save only the area of our vectorized image, click on the box next to "Area" and choose "selection only" or "selection area" (either one works) and save it.
When trying to vectorize an image with defined contours, Affinity literally cuts each section, allowing you to separate them one by one, as in the image. It's not possible to vectorize this type of image so directly, but it's quite useful if you want to modify a specific section or something else.
With this other example we can see again that it does the same thing of separating each figure individually and by color, although in this image it seems that the colors of the spider web are the same, they are not, since it separates between gray and black of the spider web.
We have 2 drawing tools, which are:
We can conclude that Inkscape is more efficient for vectorizing images because it allows us to vectorize directly, separating similar colors and offering the option to invert colors and other editing options in an easy and user-friendly way. In contrast, Affinity vectorizes simple images (those with only one shape) like Inkscape, but when you import a more complex image, it separates by specific shapes and colors. Therefore, if there's a slight variation of gray, black, etc., or multiple shapes within the same object, it will separate shape by shape, which is very useful for color images, as these are the ones where we typically want to change a specific color.
3D modeling programs are used to digitally create, visualize, and modify three-dimensional objects, allowing for the highly accurate representation of shapes, volumes, and assemblies. They are key tools for technical design and engineering, as well as for animation and digital art, since they facilitate the simulation, analysis, and realistic presentation of products and scenes before their final manufacturing or production.
The aim is to create symmetrical parts in both programs to demonstrate which program is better for each task, although it is already known that Blender is more commonly used for freehand modeling or animations, while SolidWorks is a recommended program for creating symmetrical parts.
SolidWorks is a computer-aided design (CAD) software focused on parametric 3D modeling of parts and assemblies. It is widely used in engineering to design, simulate, and document products with high accuracy.
When we open SolidWorks, we are greeted with this tab; we will click on "Part" because we are going to model it.
To activate our drawings if they are not already activated, we will right-click on them and click the eye icon.
To start a sketch, go to the sketch tab and click on sketch. If you have already clicked on a plane, the sketch will start automatically; otherwise, you just need to select a plane.
This toolbar is what we'll use to draw and modify our sketch until we're happy with it. We can insert lines, circles, rectangles, splines, points, and predefined shapes, as well as create symmetries (to make identical shapes on opposite sides) or matrices (creating circular or linear patterns of shapes), and more.
In order to extrude a shape correctly, it must be well defined; otherwise, we may encounter problems when making modifications later. To define it, we will use smart dimensioning and click on the line of our shape until it has black borders and is shaded on the inside.
Next, we'll use extrude boss to turn our sketch into 3D.
To make a cut, we will repeat the process, only at the end, after having our shape defined, we will use extrude cut.
After modifying our figure this is the result with the basic stuff but the necessary to start modeling in SolidWorks.
I modeled the tibia of my spiderbot which is a piece easily recognizable because it is the piece that gives hexapods that spider appearance. This a first idea of how it could look like but I definitely know I can do it better so I want to improve the model on the next weeks.
Blender is a free and open-source 3D creation software that allows users to model, sculpt, animate, and render three-dimensional objects and scenes. It is widely used in animation, video games, and visualization due to its versatility and power.
To enable measures, go to scene properties
Let's go to the units tab to change our unit system and what we want to measure in.
The 3D view overlay needs to be modified to our scale so that the mesh appears in the 3D view.
Next, we select the object whose measurements we want to know, switch to edit mode, and go to the "overlay" tab. There, in the measurements section, we activate "Border Length".
We add objects in the add tab and from there we choose what we want to add, although those that already come with a body are the mesh objects, the ones from the other tabs will have to be extruded and are a bit more complicated.
When we change the measurements and insert a new object, we have to modify it from its tab that appears so that it measures what we want.
| Command | Function |
|---|---|
| G + Y | Will move on the Y axis |
| G + X | Will move on the X axis |
| G + Z | Will move on the Z axis |
We can move a specific amount by typing it with the numbers on the numpad, so if we type G + X + 5 it will move from the object's origin (usually its center) to having traveled 5 units in Blender (the visible mesh).
| Command | Function |
|---|---|
| R + Y | Will rotate on the Y axis |
| R + X | Will rotate on the X axis |
| R + Z | Will rotate on the Z axis |
Specific angles can be rotated by typing the angle on the numpad, just like movement commands.
Edit mode allows us to model by modifying the faces, vertices, and edges of the object, either by moving them with the mouse or by moving them along the axes using the commands mentioned above.
It's more free because we can deform the object we have however we want, although this does add more polygons and makes the meshing a bit more complicated when transferring it to another application, but this is usually never a problem.
I modeled a parametric servomotor of 40kg, which is the one I will be using in my final project, to demonstrate that is posible to model this kind of things.
As it was a comparisson I tried to model the tibia of the spiderbot to see which software suits me better.
SolidWorks is better for creating the tibia structure, as its parametric nature makes it easier to establish size relationships. While Blender can be parametric, working with complex shapes becomes difficult when dealing with specific measurements. It's more of a software I would use to give each part of the Spiderbot a nice design by modeling the "shell" of each part, such as the tibia shell.
We must have a piece if we want to render so, in my case I going to render the servomotor piece I modeled.
On the right side we will click on the Appearance, Scenes and Decals button, and there we can select the material and/or the scenewe want our object to be made of or to be in; we just need to grab the material or the background and drag it to the object.
After we drag the material on the object it should turn the color of the material, my case it turned red.
SolidWorks visualize is not activated by default, therefore we will have to activate it. For this we go to tools, add-ons.
We activate it and wait a moment for the tab to appear in our taskbar.
We need to go to our SolidWorks visualize tab and select simple export.
After a moment, this menu will open.
You can modify the appearance, lighting, and background of the render using the menu options on the far right. In my case, I changed the background and increased the reflection for a more noticeable result.
SolidWorks even give us a preview of how it would look like the final render
Using the tab at the top right (pink), we will generate our render. We click it and it will appear the next tab.
Allowing you to change the format of the rendered image, its size, quality, and where it will be saved.
It is automatically saved in the folder we have chosen.
GIMP is a free and open-source raster image editing software that allows users to retouch photographs, create compositions, and perform basic graphic design. It is an open-source alternative to commercial editors and is widely used for image editing and manipulation.
Insert your image, go to the image tab and click on scale image.
We need to lower the resolution in x and y.
To export, go to file, export ss, and in extension select WebP.
FFMPEG is an open-source toolkit for processing audio and video from the command line. It allows you to convert formats, compress, record, and manipulate multimedia files with great flexibility and precision.
Click on Windows builds by BtBN, download the .zip file by clicking on it, and extract it to a folder you'll remember.
We open our terminal and use ffmpeg -version to call it, then we access our folder where the videos are located.
| Command | Function |
|---|---|
| ffmpeg -i input.mp4 | Call the program and define the input file (videoname.mp4) |
| -vf "scale=-2:720 | Change the video resolution |
| c:v libx264 | Universal compatibility standard |
| preset slow | Determine the compression speed; the slower the speed, the better the compression. |
| crf 30 | Constant Rate Factor (CRF) value for quality control.The range is from 0 to 51, where 0 is lossless and 51 is worst quality. |
| pix_fmt yuv420p | Ensures compatibility with most players and browsers |
| movflags +faststart | Optimizes the video for streaming by placing metadata at the beginning of the file. |
| an | Removes audio from the output video. |
| output_new.mp4 | Name of the output file. |
We open our terminal and use ffmpeg -version to call it, then we access our folder where the videos are located.
The basic formula to compress any video is "ffmpeg -i input.mp4 -vf "scale=-2:720" -c:v libx264 -preset slow -crf 30 -pix_fmt yuv420p -movflags +faststart -an output_new.mp4"
It will be automatically be saved on the same carpet
Click on the "Download ZIP" to download all the files I made in the 4 softwares