Hi,
I wish to create a 3D lattice formed by joining together many 8-node cubic elements (see figure). I wish to define the number of cubic elements I want in the x, y and z direction whilst also being able to obtain the coordinates for each node in an array C. Where C(:,1) refers to the x coordinates, C(:,2) refers to the y and C(:,3) to the z and where C(1,:) refers to the first node, C(2,:) the second etc.
My script thus far is attached. I am struggling with two key issues:
- Creating a loop that adds additional elements with the correct node assignments.
- Assuring that the code is robust such that the entire structure maintains its cubic/cuboidal shape despite varying user inputs.
Any help would very much be appreciated.
Sam
Note: The figure represents the desired output when the user defines 2 elements in the x, y and z axis.
Note: This figure denotes the preferred node arrangement for a 3x2x1 cubic lattice.