#### Description of the problem that is addressed in the patch.
With geometry node mesh primitives, it is currently possible to create a cube and then scale it arbitrarily along X, Y and Z axes. You can also subdivide the mesh but the number of subdivisions is equal along all axes. This means that making the basic frame for something like modular buildings isn't trivial.
#### Description of the proposed solution, and a motivation as to why this is the best solution.
This mesh primitive createsenhances the Cube mesh primitive and allows the creation of a cuboid with a configurable size and number of vertices in all 3 directions. It isThe Cube primitive is now similar to the Grid primitive except that it works in 3 dimensions. Inspired by watching the modular building creation tutorials and looking at the demo files for the same.
The cuboid is created using the `Mesh` class, and so that large meshes with millions of faces are created quickly, I've used `parallel_for` to plot the vertices and Edges are calculated using `BKE_mesh_calc_edges`.
#### List of alternative solutions, and a motivation as to why these are undesirable
The alternative to a mesh primitive is to use multiple Grid primitives and rotate them into shape, which can get cumbersome and makes the node tree even harder to read.
#### Limitations of the proposed solution
The only thing that has not been tested is the calculation of UVs,As with other geometry nodes, UV maps don't work. This was tested in development using the following fragment of code, applying the Geometry nodes modifier and inspecting the UVMap of the resulting mesh.
```
MLoopUV *mloopuv = static_cast<MLoopUV *>(CustomData_get_layer(&mesh->ldata, CD_MLOOPUV));
if (!mloopuv) {
mloopuv = static_cast<MLoopUV *>(CustomData_add_layer(&mesh->ldata, CD_MLOOPUV, CD_CALLOC, NULL, config.loop_count));
}
for (int i=0; as it looks like it doesn't work on any of the mesh primitives that use `Mesh` to create meshes.i<config.loop_count; I'd be happy to be told how to make this work right.i++) {
mloopuv[i].uv[0] = uvs[i].x;
mloopuv[i].uv[1] = uvs[i].y;
}
```
#### Screenshots
Here is an example of the node in action.
{F10216158}
And an example of what is possible when combined with some attribute math
{F10216157}