1

I want to know how to model a crystal lattice with an ordered macroscopic structure. Below is an image depicting this structure, I would like to know how to draw a similar structure with the illustration. enter image description here

I tried to draw a cubic lattice structure, however, I don't know how to cut the extra parts of the spheres that are outside the cubic. At the same time, I need help on how to hollow out the spheres and create holes in it. enter image description here

Nhiem Pham
  • 13
  • 3
  • 1
    Hello and welcome to BSE. What have you tried so far? Your question is missing the part that describes what you have tried so far and where you got stuck. – Harry McKenzie Nov 28 '23 at 02:44
  • Thank you for responding to my question. I have modified my question with more specific issues. I really hope you can help me solve the problems I'm having difficulty with. – Nhiem Pham Nov 28 '23 at 03:43
  • If the structure is regular and non-deforming, I would try volume rendering instead of making it from a mesh. – Hadriscus Nov 28 '23 at 06:23

3 Answers3

4

Here is an attempt using icosphere instances on a staggered mesh made of vertices only, to carve a cube with boolean modifier. I took inspiration for the colours from this Dalmatian. I still have to improve my shading and light management skills to post a proper rendered view... MacroporousStructure I will provide a step by step procedure asap, but I am missing time right now to make it properly. Meanwhile, here is the Blender file :

StefLAncien
  • 3,377
  • 2
  • 15
2

(Using Blender 3.6.1 and Geometry Nodes)

Objective:

Mimic 3D porous Perovskite materials like this:3D porous Perovskite materials

Documentation:

Starting from this bibliography entry point, it seems that the structure is made of hollow spheres staggered in a lattice of planes with square or hexahedral tiling. Spheres diameter is slightly larger than spheres center to center distance (labeled $a$ thereafter). About Nhiem Pham illustration, assuming that the (Right (X axis), Front (Y axis), Top (Z axis)) corner is facing the observer, (X, Y) tiles are squares and (Y, Z) tiles are hexahedrons. In hexagonal tiling, adjacent rows of sphere centers are shifted by $\pm \frac{1}{2}a$ in the direction tangent to rows and by $\frac{\sqrt{3}}{2}a$ in the direction perpendicular to rows. Even rows are thus shifted only in the perpendicular direction by $\sqrt{3}a$; same for odd rows.

Approach:

Use spheres to carve holes in a cube. Steps are:

  1. build the lattice odd layers as copies of a regular (X, Y) grid shifted along Z axis;
  2. build the lattice even layers as copy of the odd layers, shifted in Y and Z directions;
  3. place spheres on lattice vertices;
  4. remove the spheres volume by Boolean difference from the cube.

Setup preview

Parameters:

To setup the configuration, inputs of the Geometry Nodes graph are:

  • Distance ($a$): spheres center to center distance
  • Count ($N$): Number of spheres per direction (minimum 2, to make a 2x2x2 lattice)
  • Shift: Offset of the lattice reference corner relative to the cube reference corner
  • Scale: Sphere diameter divided by $a$ (1.0 yields tangent spheres)
  • Subdivision: refinement level of sphere skin
  • Noise ($\epsilon$): Randomization of spheres diameter and position (0.0 yields perfect stacking and uniform diameter)
  • Preview: ON: Display spheres only (fast); OFF: Compute Boolean difference (slow)

Procedure:

Here is an overview of the Geometry Nodes graph, with 4 major steps after the initialization in Object Mode: GN graph overview

1. Initializing in Object Mode:
1.1. Add a cube and select Shade Flat.
1.2. Set its origin to the (Right, Front, Top) corner, facing the observer (NB: All coordinates afterwards are relative to this origin).
1.3. Add a GeometryNode modifier.

2. Building the lattice:
GN graph lattice builder 2.1. Build the template:
2.1.1. Add a Grid builder node.
2.1.2. Set both sizes to $(N-1)a$ (minimal tile is a single square with $N=2$ and edge length equal to $a$).
2.1.3. Set both numbers of vertices to $N$.
2.2. Build the set of odd layers:
2.2.1. Compute the number of copies as $(N-1)/2+1$ (2 layers yield 1 copy; 3 and 4 layers yield 2 copies; 5 and 6 layers yield 3 copies).
2.2.2. Compute the unitary offset between odd layers as $(X, Y, Z)=(0, 0, \sqrt{3})a$.
2.2.3. Add a Duplicate Elements node to make copies of the template (NB1: the template is not included in the output geometry; NB2: duplicate ONLY the Points).
2.2.4. Add a Set Position node to shift each copy, using the Duplicate index output (starting at 0) to scale the unitary offset.
2.3. Build the set of even layers:
2.3.1. Compute the offset between adjacent layers as $(X, Y, Z)=(0, \frac{1}{2}, \frac{\sqrt{3}}{2})a$.
2.3.2. Make a single copy of the set of odd layers.
2.3.3. Shift the set of even layers.
2.4. Finalize:
2.4.1. Join both sets in a single geometry.

3. Positioning the lattice:
GN graph lattice positioner 3.1. Change the lattice origin:
3.1.1. Add a Bounding Box node to get the lattice corners coordinates.
3.1.2. Shift the Min Y value by $\frac{1}{2}a$ because the top layer is always even.
3.1.3. Assemble the position of the (Right, Front, Top) corner as (Max X, shifted Min Y, Max Z).
3.1.4. Reverse the sign of this corner position to bring it at the cube origin after that offset is added.
3.2. Add the shift from the inputs.
3.3. Randomize vertex positions:
3.3.1. Draw a random vector with components between $-a$ and $a$ for every vertex.
3.3.2. Scale it by $\epsilon$.
3.3.3. Add it to the whole lattice offset.
3.4. Add a Set Position node to shift every lattice vertex.

4. Building and positioning the spheres:
GN graph lattice cutter 4.1. Build the sphere:
4.1.1. Compute its radius from half $a$ and the inputs scaling factor.
4.1.2. Follow with a Icosphere builder node. Subdivisions number is controlled from the inputs.
4.1.3. Objects built inside a GeometryNode modifier have no material. To singularize faces generated by Boolean difference during the inputs tuning, a Switch node is added to control a Set Material node configured with a predefined material. This switch must be unchecked for final rendering.
4.1.4. Add a Set Shade Smooth node, controlled by the inputs, to shade smoothly the faces generated by Boolean difference. Activating this behaviour for the cube has no effect inside the GeometryNode modifier.
4.2. Randomize spheres radius:
4.2.1. Draw a random number between $1-\epsilon$ and $1+\epsilon$ to scale every sphere.
4.3. Add an Instance on Points node to place a sphere at every vertex of the lattice.

5. Cutting the spheres out of the cube:
Final geometry is controlled by a Switch node to save time during inputs tuning.
5.1. With Preview mode ON, the output geometry is the superposition of all the spheres on the unmodified cube.
5.2. With Preview mode OFF, the output geometry is returned by a Mesh Boolean node removing the spheres volume from the cube volume.

6. Shading:
enter image description here 6.1. Controlling purple spots: see How do I add random spotting to the same face in cycles?
6.2. Controlling rugosity: see How do I make a rough plastic surface?

Resources:

StefLAncien
  • 3,377
  • 2
  • 15
0

(Using Blender 3.6.1 and Modifiers)

[Objective, documentation, approach, parameters and shading are described here.]
Thereafter, the distance between adjacent sphere centres ($a$) is assumed to be 1 m.

Procedure:

1. Building the sphere template:
Sphere template 1.1. Add an Ico Sphere with Subdivisions adjusted between 2 and 4, and Radius set at 0.5 m.
1.2. Scale it by 1.13, and apply the Scale.
1.3. Select Shade Auto Smooth with the threshold angle set to 45 degrees.
1.4. Set the material.

2. Building the spheres generator:
Modifiers: Arrays, Displacement with Texture 2.1. Add a Grid with 5 X/Y Subdivisions and Size set to 5 m. It is extended with Modifiers to build the lattice supporting the spheres.
2.2. To build odd layers, add an Array modifier with Constant Offset set to $(0, 0, \sqrt{3})$.
2.3. To build even layers, add an Array modifier with Constant Offset set to $(0, \frac{1}{2}, \frac{\sqrt{3}}{2})$.
2.4. Position the 3D cursor at the resulting lattice (Right, Front, Top) corner and select Set Origin/Set Origin to 3D Cursor.
2.5. Position the 3D cursor at the cube origin and move the lattice to the 3D cursor position.
2.6. In the Transform/Location panel, enter the shifts as $(X, Y, Z)=(-0.27\ m, 0.16\ m, -0.33\ m)$.
2.7. To randomize the centre positions:
2.7.1 Add a Texture of Type set to Clouds and set Color to Color to get 3 components.
2.7.2 Add a Displace modifier using the previous texture, set Direction to RGB to XYZ to randomize along all 3 axes and adjust the Strength parameter.
ParticuleSystem and Modifiers stack 2.8. To spawn the spheres, add a Particule System modifier with:
2.8.1. Emission/Number set to $6^3 = 216$.
2.8.2. Emission/Frame End set to 1.
2.8.3. Emission/Source/Emit From set to Vertices.
2.8.4. Emission/Source/Use Modifier Stack checked otherwise emission is from the original, not duplicated, grid.
2.8.5. Render/Scale set to 1.
2.8.6. Render/Scale Randomness set to 0.025, to slightly alter the spheres diameter.
2.8.7. Render/Object/Instance Object set to the sphere template built at step 1.
2.8.8. Render/Object/Global Coordinates is unchecked otherwise the displacement between the sphere template origin and the world origin is applied.
2.9. Click on Make Instances Real at the bottom of the Particule System modifier, and without deselecting the spheres, press M to move these in a new collection.

3. Cutting the cube:
Boolean difference 3.1. Make the shading option and the material of the cube to be the same as those of the sphere template, set at steps 1.3 and 1.4.
3.2. Add a Boolean modifier to the cube with:
3.2.1. Operation set to Difference.
3.2.2. Operand Type set to Collection.
3.2.3. Collection set to the collection created at step 2.9.

Resources:

StefLAncien
  • 3,377
  • 2
  • 15