How would I be able to create a grill of sorts found on the front of some computer cases such as this one
-
$\begingroup$ You mean the grid in the front or the alveolus behind ? $\endgroup$– AlephCommented Nov 3, 2015 at 20:21
-
$\begingroup$ Basically just the air filter grills you see on the front of computer cases. the very fine grill. at the front $\endgroup$– ReiCommented Nov 3, 2015 at 20:22
-
1$\begingroup$ Looks like a lot of geometry. If you want to minimize your poly-count, You're probably better off creating a flat grid in an external program (Photoshop/Gimp) with holes of alpha = 0. Make it seamless. Apply as texture. Scale so the holes are small enough. $\endgroup$– Mickael CarusoCommented Nov 3, 2015 at 20:45
-
1$\begingroup$ Unless that computer is hot enough to cook a steak on, it's a grille. $\endgroup$– KevinCommented Nov 4, 2015 at 6:46
-
$\begingroup$ @Kevin I've personally never seen that variant before. It seems both spellings are applicable $\endgroup$– gandalf3Commented Nov 4, 2015 at 9:58
6 Answers
Here's a way to do this using modifiers:
- Add a circle (⇧ ShiftA> Mesh > Circle) and set the number of Vertices to 6 in the redo panel to make a hexagon:
Take note of the X dimension of the object. With the default radius of 1 it should be 1.732
:
- Add an Array modifier with a relative offset of
.5
and.75
to create a tile-able section with two offset hexagons:
- Add an array modifier to tile the object along the X axis.
Note the X dimension of the object now with the modifier. It should be equal to 1.5 * original_x
(2.598
with the default radius):
Set the relative X offset of the array modifier to original_x / (1.5 * original_x)
, or .666...
:
Add yet another array modifier to tile the object along the Y axis, with a Y offset of
.857
, or(1.5 * original_y) / modified_y
.Increase the Count of the last two array modifiers as desired:
- Now you have a wireframe, but it needs thickness. Switch to edit mode (↹ Tab), select all (A) and extrude (E). Cancel the transform part of the extrude (Esc) and scale down (S):
Enable Merge on all the array modifiers.
Add a solidify modifier (and optionally a bevel modifier):
In case you might want something more rounded, you can adjust the angle limit on the bevel modifier and toss a subsurf modifier on the end:
-
$\begingroup$ Nice technique ! (even if actually the initial question was about the grid from the front on the image, & not the "alveolus" one, which the edited title has overlapped :) - actually the "weaved" wasn't so bad to describe it) $\endgroup$– AlephCommented Nov 4, 2015 at 1:11
-
-
$\begingroup$ I don't know, maybe you're right, in fact there's two grids on the ref image, and the one front the front ground is so thin that I can't clearly see its shape. $\endgroup$– AlephCommented Nov 4, 2015 at 9:46
-
-
2$\begingroup$ Excellent tutorial! Provides a lot of room for customisation. Note: On Blender 2.93 for the Solidify modifier, I had to choose the Complex instead of the Simple method to get there, otherwise I would have gotten uneven solidified edges. $\endgroup$ Commented Aug 26, 2021 at 11:55
Lazy me going for the shortcut again...
Enable add mesh extra objects (Access the system preferences with Ctrl Alt U):
Then just press ShiftA Add->Mesh->Extras->Honeycomb
And set the controls in the toolshelf to something that suits for your project.
EDIT : I just realised that I hadn't included the .blend file for this (I had intended to... why did nobody mention it ;-) ) making it a whole lot of effort to replicate it to use in your own projects!
I realise that there are already 4 answers to this question but they all address it by creating it as new geometry. I wanted to provide a different approach by using a procedural texture to give the appearance of the grill. In this way we only need to add a single plane - rather than geometry for each individual cell of the grill.
Here's the final result :
This answer https://blender.stackexchange.com/a/67654/29586 developed a material that defined the cells of a regular hexagonal grid. It produces two outputs - a measure of the distance to the edge of a hexagonal 'cell' (used to drive the Strength of the Emission shader in the original solution) and the Vector coordinates of the centre of the corresponding cell (used as the input to a Noise Texture to generate colors of the cells in the original solution). The following Node Group takes this a stage further by also providing the distance to the centre of the cell, the distance to the centre of the next closest cell and the Vector coordinates of the next closest cell.
By using the Edge Distance to mix between a Transparent and Diffuse shader we can produce the following simple effect :
For a more convincing grid we need to add depth. For a ray to pass through the grill it would need to pass through the 'hole' at the surface and out the corresponding hole on the other side. The depth of the grill will determine how perpendicular the ray must be to be able to pass through the surface. To achieve this we can use two identical hexagonal grids - one to represent the 'top' surface of the grid and the second to represent the bottom surface of the grid. The path of each ray can then be determined by considering how it interacts with each of those grids.
By 'sliding' the second grid to the side based on the angle of the ray and the depth of the grill we can simulate where it would be when the ray reaches the 'bottom' of the grid. In a 'real' grill the ray will only pass through if it is at a steep enough angle to pass through the top and bottom surfaces. The calculation of the position of the second grid can be done as shown below :
There are two parts to this calculation. The first part (top row) determines the direction of the offset parallel to the surface. This is achieved with a pair of Cross Product nodes. The first combines the Incoming ray with the Normal to generate a ray parallel with the surface but at right-angles to the incoming ray. The second Cross Product flips it around the Normal again - by 90 degrees - so it is along the line of the incoming ray (but still parallel to the surface). The bottom row of the calculation determines the magnitude of the required offset based on the incoming angle (determines via the Dot Product with the Normal) and the set Thickness of the grill. The results of these branches are Multiplied together to give the required offset.
The following image shows the interesting regions based on where it strikes the top and bottom grids.
The colors represent the following :
- White - The ray is close to a top cell 'edge' and so has hit the top surface of the grill
- Red - The passes through one cell on the surface but would be 'out' of a different cell - ie, it must have hit the side of a cell.
- Green - The ray is close to the cell 'edge' on exiting the grill and so has still hit the side of the cell (but almost got through)
- Blue - The ray enters through one cell and exits through the corresponding cell in the other grid - ie, it's passed all the way through.
Shading the White region with one material for the surface of the grill, Red and Green with another for the edges of each 'hole', and Blue as Transparent we get the following result :
The above material does produce more convincing results - especially in the way more oblique angles result in less light passing through the grill - but the surfaces are still 'flat'. To improve this further we can generate Normals based on where the grill is struck - ie, on an inside edge it will be angled parallel to the surface (perpendicular to the side of the 'cell') while on the top surface (the edge of a cell) it will be closer to the surface Normal. In addition, we can add a curve or bevel to the top surface of the cells.
To achieve this we can use the following material :
Note the calculation of the Normal using a combination of the Cell Vector and 2nd Cell Vector to determine the direction of the Normal of the corresponding cell wall. The Vector Transform node is used to transform the calculated Normal (which will be in Object space) into World space as required for the Normal passed to the Shader.
And this produces the following results :
The material can be used on more complicated shapes - although, as it stands, care needs to be taken since the calculated Normal for the inner edges and upper surface of the cells does not take the actual surface normal into account (I'm sure this could be improved by tweaking the calculation but haven't yet had the chance to look into it in much depth). However, it still produces reasonable results as shown with this 'wireframe' Suzanne.
Limitations
Note that the shading on the edges of the cells isn't perfect - it can produce odd results with thick grills when viewed at an oblique angle - where the calculated normal is miscalculated as the wrong edge. This is due to the 'second nearest' being the incorrect cell to use for the angle of the ray and is difficult to correct for as it is dependent on the 'depth' through the grill where the ray hits the side. The problem is illustrated by this image :
The result is sufficient for this slight discrepancy to not be generally noticable but if anyone has any suggestions on a way to address this then please do let me know! One potential solution is to calculate the depth at the point the ray hit the cell and to position a third hex grid at that depth to determine which cell boundary is most relevant. However, this would have an impact on efficiency as the hex grid is already quite computationally intensive.
Another limitation is that currently the Normal calculation assumes that the surface is oriented in the X/Y plane. For more complicated surfaces (such as Suzanne), this is not always the case and the calculated normals may produce odd results (such as when viewed from behind). This is generally not noticable but can result in incorrect lighting and/or incorrect reflections - especially on the 'internal' surfaces of the cells. Also, this means it is not suitable to UV unwrapped meshes (stick to Generated or displaced Object coordinates).
Note also that nodes that generate the hexagon pattern require positive X/Y coordinates only. When using Object coordinates (or any other coordinates that could result in negative values), use a Mapping node to shift the coordinates a suitable amount to make sure they're always positive.
-
1$\begingroup$ That is brilliant - I was looking for something like this a while back. Thanks! $\endgroup$ Commented Mar 16, 2021 at 17:17
Ok, one solution, for creating a simple grid. If you need a grid which will be filmed from close up, it'll need more tweaks. But for a quite simple one: create a Plane, Subdivide it once, select the center vertex.
Still in edit mode, hit Space, select Bevel, and fill the settings like in the image below:
Delete the faces selected:
Select all the inner vertices, and hit Space> To Sphere, to make it round shaped:
Now you have your basic hole shape. in Object mode apply 2 Array modifiers to it, one for the vertical repetition, one for the horizontal one
and you have your (simple) grid !
-
$\begingroup$ Using the bevel made no changes to the mesh at all $\endgroup$– ReiCommented Nov 3, 2015 at 20:48
-
$\begingroup$ you must be in edit mode, and then set up the config on the left panel, as it is shown on my 2nd image, surrounded in red. If my explanation has been helpful, feel free to accept the answer :) (blender.stackexchange.com/help/someone-answers) $\endgroup$– AlephCommented Nov 3, 2015 at 21:00
-
$\begingroup$ Still nothing i dont even have the loop slide option $\endgroup$– ReiCommented Nov 3, 2015 at 21:05
-
-
Using geometry nodes:
- Shift-A -> Mesh -> Extras -> Honeycomb
(make sure you have "extra objects" enabled in add-ons)
- Add a plane and a geometry modifier with this node setup:
- add a solidify modifier
result:
-
$\begingroup$ Honeycomb is not one of the base meshes of Blender. You should edit your answer to include instructions on how to add that into Blender. $\endgroup$– DitiCommented Jan 9 at 12:06
-
-
$\begingroup$ Thank you! It will be very useful for users of Kiwix (offline
blender.stackexchange.com
), for they can immediately implement your (good) solution without having to search (and struggle with Kiwix’s search)/troubleshoot why there is no honeycomb mesh by default! $\endgroup$– DitiCommented Jan 10 at 12:37
Here's what you can do:
Make a plane, subdivide (Simple subdivision)
Make a cylinder (or any shape you want to punch out of the plane)
Apply scale to both plane and cylinder
Make cylinder child of plane
Set plane to duplicate faces (serach for duplifaces)
Select plane
Press spacebar -> Make Duplicates Real
Select all objects that were created, Join them (spacebar -> Join)
Add Boolean Modifier (Difference) to plane, set it to subtract the "holes'" solid
Apply subdivision
Apply Boolean
-
2$\begingroup$ How do i make the cylinder a child of the plane and how do i set it to duplicate faces? $\endgroup$– ReiCommented Nov 3, 2015 at 20:39
-
$\begingroup$ Switch to object properties (cube icon, in the same set where the modifiers tab is). To set a parent select Cylinder and then Plane in Object Mode and press Ctrl+P, or you have a "Parent" voice under the "Relation" dropdown. To duplicate faces you have a "Duplication" dropdown, where you can select wether to duplicate None, Frames, Verts, Faces or Group $\endgroup$– torelsCommented Nov 3, 2015 at 22:55