You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\page model_and_optimize_meshes Model and optimize meshes in blender for simulations
1
+
\page model_and_optimize_meshes Model and optimize meshes in Blender for simulations
2
2
3
-
3d shapes created for simulation serve the purpose of bringing realism to a scene. It also helps identify everything in the scene easier. If for example all of the objects in a scene were simple shapes like cubes and circles it can be difficult to distinguish objects in the simulation.
3
+
3D shapes created for simulation serve the purpose of bringing realism to a scene. It also helps identify everything in the scene easier. If for example all of the objects in a scene were simple shapes like cubes and circles, it can be difficult to distinguish objects in the simulation.
4
4
5
5
## Collision shapes vs Visual shapes
6
-
Simple shapes like cubes and spheres, better known as “primitives”, are often used as collision pieces. Collision shapes use simplified geometry compared to the visual mesh because they serve different purposes in simulations.
6
+
Simple shapes like cubes and spheres, better known as “primitives”, are often used as collision geometry. Collision shapes use simplified geometry compared to visual mesh because they serve different purposes in simulations.
7
7
8
8
Collision models are important because they interact with the physics environment. They require less computation if they use primitive shapes.
9
9
10
-
Visual shapes are detailed meshes. These shapes are made with the goal of bringing realism to a simulated scene. These shapes are more dense in polygons and usually have textures attached to them. These shapes are what camera sensors pick up and are also what the viewer sees when viewing simulations.
10
+
Visual shapes are detailed meshes. These shapes are made with the goal of bringing realism to a simulated scene. These shapes are often more detailed and usually have textures attached to them. These shapes are what camera sensors perceive, and also what is visualised when viewing simulations.
11
11
12
12
## Creating Models
13
-
Blender has many tools to create simple/complex models. A great way to create complex objects is to start with something simple. In the example below we see a complex model created from a simple primitive. Although this is a great strategy for modeling, going from a simple mesh to a complex one usually requires a lot of tools to be used.
13
+
Blender has many tools to create simple/complex models. A great way to create complex objects is to start with something simple. In the example below, we see a complex model created from a simple primitive. Although this is a great strategy for modeling, going from a simple mesh to a complex one usually requires a lot of tools to be used.
14
14
15
15
@image html files/model_and_optimize_meshes/1_wheels.jpg width=600px
16
16
17
17
Because we used the example of the wheel above, I will be using that shape to go over my modeling workflow. I will also explain some of the tools and modifiers that I use. A basic understanding of the movement keys should be known prior to starting this tutorial: [Recommended beginner guide](https://www.youtube.com/watch?v=K6Sm7DAPTGE&ab_channel=TutsByKaiTutsByKai)
18
18
19
19
### Create/add simple mesh
20
-
For this model cylinder mesh is used as a starting point.
20
+
For this model, cylinder mesh is used as a starting point.
21
21
--> `(Add>Mesh>Cylinder)`
22
22
23
23
@image html files/model_and_optimize_meshes/2_cylinder.jpg width=600px
24
24
25
-
Having reference images of what you are planning to model can be a great help too, and is alway recommended.
25
+
Having reference images of what you are planning to model can be a great help too, and is always recommended.
26
26
27
-
The move, rotate, and scale are used throughout most 3d modeling processes. These three actions are commonly known as the transform gizmos.
27
+
The move, rotate, and scale operations are used throughout most 3d modeling processes. These three actions are commonly known as the transform gizmos.
28
28
29
-
@image html files/model_and_optimize_meshes/3_transform_gizmos.png "(Transform gizmos hotkeys: (G, R, S))" width=600px
Oftentimes, problems after importing models into a program occur because of simple mistakes related to these gizmos.
34
-
These problems are fairly common, but aren't hard to fix. Changing one of those attributes accordingly and exporting it out with the updates fixes most issues.
34
+
These problems are fairly common but aren’t hard to fix. Changing one of those attributes accordingly and exporting it out with the updates fixes most issues.
35
35
36
-
-**Move Gizmo**: allows you to change the location of an object along the x,y,z axis.`(Hotkey G)`
36
+
-**Move Gizmo**: allows you to change the location of an object along the x,y,z axis `(Hotkey G)`.
37
37
38
38
@image html files/model_and_optimize_meshes/4_move.png width=600px
39
39
40
-
- Rotate Gizmo: allows you to rotate object orientation along the x,y,z axis `(Hotkey R)`
40
+
- Rotate Gizmo: allows you to rotate object orientation along the x,y,z axis `(Hotkey R)`.
41
41
This was used to rotate the cylinder upright for the wheel.
42
42
43
43
@image html files/model_and_optimize_meshes/5_rotate.jpg width=600px
44
44
45
-
- Scale Gizmo: allows you to scale an obj. Objects can also be scaled along a single axis if desired.`(Hotkey S)`
45
+
- Scale Gizmo: allows you to scale an obj. Objects can also be scaled along a single axis if desired `(Hotkey S)`.
46
46
47
47
@image html files/model_and_optimize_meshes/7_scale.jpg width=600px
48
48
49
-
- Bevel: allow you to create curved/chamfered edges
49
+
- Bevel: allow you to create curved/chamfered edges`(Hotkey Ctrl B)`.
50
50
This was used to create the curved sides of the wheel.
51
51
52
52
@image html files/model_and_optimize_meshes/8_bevel.jpg width=600px
53
53
54
-
- Extrude: adds additional geometry along a selected face/edges. The extrude tool can be used to push out a face or to push in one. Both examples are given here.
54
+
- Extrude: adds additional geometry along a selected face/edges`(Hotkey E)`. The extrude tool can be used to push out a face or to push in one. Both examples are given here.
55
55
56
56
@image html files/model_and_optimize_meshes/9_extrude.png width=600px
57
57
58
58
This was used to create the indents of the wheel.
59
59
60
60
`(Mesh > Extrude > Extrude Region)`
61
61
62
-
- Loop cut: allows you to split a face with a new looped edge. This then allows for more detailed manipulation of faces to take place.
62
+
- Loop cut: allows you to split a face with a new looped edge`(Hotkey Ctrl R)`. This then allows for more detailed manipulation of faces to take place.
63
63
64
-
This with a combination of the extrude tool you can make small ridges to your shape.
64
+
With a combination of the extrude tool, you can make small ridges to your shape.
65
65
66
66
@image html files/model_and_optimize_meshes/10_loop_cut.jpg width=600px
67
67
@@ -70,60 +70,61 @@ This with a combination of the extrude tool you can make small ridges to your sh
70
70
@image html files/model_and_optimize_meshes/11_duplicate.jpg width=600px
71
71
72
72
- Other Modifiers:
73
-
Some other commands that were used during a modeling process are: lattice functions,booleans, smooth, decimate.
73
+
Some other commands that were used during a modeling process are: lattice functions,booleans, smooth, and decimate.
74
74
75
75
@image html files/model_and_optimize_meshes/12_other_modifiers.png width=600px
76
76
77
-
#### More polygons less performance
77
+
#### More polygons – less performance
78
78
79
-
Shapes are made out of polygons. The higher the polygons on a shape the more detailed it is. A shape with too many polygons can overcomplicate mesh editing or can make simulations run very slowly. This is why it is important to optimize a shape so that it keeps most of its details but without making the poly count too high.
79
+
Shapes are made out of polygons. The higher the polygons on a shape, the more detailed it is. A shape with too many polygons can overcomplicate mesh editing or can make simulations run very slowly. This is why it is important to optimize a shape so that it keeps most of its details but without making the poly count too high.
80
80
81
81
@image html files/model_and_optimize_meshes/13_polygons.jpg "Left: Low Poly | Right: High Poly" width=600px
82
82
83
83
84
-
If you find that your model is too dense to work with. The “decimate” command can be used to lower the polycount of said mesh, while still keeping its general shape.
84
+
If you find that your model is too dense to work with, the “decimate” command can be used to lower the polycount of said mesh while still keeping its general shape.
85
85
86
-
Creating a complex model requires a good understanding of many tools in a 3d modeling program. They all serve their specific purposes and are extremely powerful. They have to be used on top of each other in different ways to get to an end result. The more you add/edit your shape the better it will look in the long run.
86
+
Creating a complex model requires a good understanding of many tools in a 3d modeling program. They all serve their specific purposes and are extremely powerful. They have to be used on top of each other in different ways to get to an end result. The more you add/edit your shape, the better it will look in the long run.
87
87
88
88
## Exporting models
89
89
90
-
When you export a model for Gazebo, the .dae (COLLADA) file type is recommended.
91
-
STL and OBJ files are also supported, but are less common for imports into Gazebo.
90
+
When you export a model for Gazebo, the `.dae` (COLLADA) file type is recommended for visual geometry.
91
+
If you experience issues while importing materials from a COLLADA mesh to Gazebo, you can try the `.obj` (Wavefront) exporter instead.
92
+
STL meshes can be used for the collision geometry, as these do not contain information about the material.
92
93
93
94
To export: select your shape and then `File>Export>Collada(Default)(.dae)`
94
95
95
96
@image html files/model_and_optimize_meshes/14_export_model.png width=600px
96
97
97
-
After you hit export in whatever file format you decide to go with, the "Blender File View" will appear. This is where you choose the location of your file. You can also choose how you want to export your model.
98
+
After you hit export in whatever file format you decide to go with, the “Blender File View” will appear. This is where you choose the location of your file. You can also choose how you want to export your model.
98
99
99
-
Double checking the “global Orientation” can save time and here you can quickly change the “Up Axis” to Z up. This is the standard orientation in Gazebo
100
+
Double checking the “Global Orientation” can save time and here you can quickly change the “Up Axis” to Z up. This is the standard orientation in Gazebo.
100
101
101
-
Equally make sure that the If the shape is meant to stand on the ground, place the origin on the base, and make the model face X (Forward Axis)
102
+
Equally, make sure that the If the shape is meant to stand on the ground, place the origin on the base, and make the model face X (Forward Axis)
102
103
103
104
@image html files/model_and_optimize_meshes/15_axis.png width=200px
104
105
105
106
## Troubleshooting
106
107
107
-
There are a few things to take account of when creating a 3d shape for use in simulations. Making sure your scale and orientation are set to Gazebo standards can save you a lot of time.
108
+
There are a few things to take into account when creating a 3d shape for use in simulations. Making sure your scale and orientation are set to Gazebo standards can save you a lot of time.
108
109
109
110
- Check Scale/Location: If an imported shape is brought into Gazebo with the wrong units, it might be too big/small for the scene. Make sure that your modeling units are 1:1 with what is in Gazebo (Gazebo uses meters).
110
111
111
112
@image html files/model_and_optimize_meshes/16_check_scale.png width=600px
112
113
113
-
To change the units in Blender to match Gazebo go to “Scene Properties”. Change the “unit Systems” to Metric and change the “Length” to Meters.
114
+
To change the units in Blender to match Gazebo, go to “Scene Properties”. Change the “unit Systems” to Metric and change the “Length” to Meters.
114
115
115
-
To change the grid size go to “Show Overlays” and change the “Scale” amount.
116
+
To change the grid size, go to “Show Overlays” and change the “Scale” amount.
116
117
117
118
-**Check Pivot Point/Shape Origins:**: When exporting a shape it is usually best practice to make sure that your model is in the middle of your grid `(0,0,0)`, unless said model is part of a bigger scene.
118
119
119
120
@image html files/model_and_optimize_meshes/17_check_pivot_point_a.jpg width=600px
120
121
121
-
The Pivot Point of a shape is the point from which the shape moves, rotates, and scales from.
122
+
The Pivot Point of a shape is the point from which the shape moves, rotates, and scales.
122
123
123
124
Not only do you need to make sure that your shape is in the right location prior to export, but you also need to make sure that the pivot points are in the right positions as well.
124
125
125
126
@image html files/model_and_optimize_meshes/18_check_pivot_point_b.jpg width=600px
126
127
127
128
Complex shapes often have a child/parent relationship. This is when a smaller part of a shape is attached to a larger piece, but they have different pivot points.
128
129
129
-
For example: The wheel used for this tutorial would be a child shape. It would “parented” to the body of a car. The pivot point of the wheel is in its center axis as shown, but the general pivots of the whole shape would be attached based on the parent shape, around the joint origin. When you export to `Gazebo` make sure that the whole shape is selected and that the main body is on the origin `(0,0,0)`, and X Axis facing forward.
130
+
For example: The wheel used for this tutorial would be a child shape. It would be “parented” to the body of a car. The pivot point of the wheel is in its center axis as shown, but the general pivots of the whole shape would be attached based on the parent shape, around the joint origin. When you export to `Gazebo` make sure that the whole shape is selected and that the main body is on the origin `(0,0,0)`, and X axis facing forward.
0 commit comments