Brick rowlock in Blender
Not really a BIM question, more a Blender question. But I think the question suits more here than on a generic Blender forum. I am really struggling with this one, how would you model a brick rowlock like this in Blender?
On this blog someone someone successfully manages to make different brick rowlocks with Revit using adaptive components:
I really have no idea where to start. Drawing two straight curves on top of each other and divide points on both curves?
This was my attempt using a curve modifier:
Any suggestions/ideas are more than welcome. I think this should be easily possible in Blender.
Tagged:
Comments
It's not parametric but using that curve modifier and then deforming using a lattice? Like tthis:

You can use the Simple Deform modifier set to taper. You might have to tweak the axis depending on your spanning direction.


It's similar to the Shear Tool, in that geometry that is orthogonal to the deformation axis stays orthogonal after deformation.
In order to create the dircular deformation, you can create an empty, add some geometry to the bricks with a subdivision modifier (if needed), and add a Cast modifier and play with the settings.
@Gorgious
Yes, thank you. Now I am going to think of way to make this parametric with a Python script. And test it with an export to IFC with BlenderBIM.

This method works great, it's exactly what I need. It even seems to warp the brick instead of the horizontal joints. Exactly what I need.
The export to IFC also worked:
Glad to see it worked out :)

Depending on your workflow a 2D lattice with shapekeys might also do the trick and be more usable.
It's a bit convoluted to get/set a particular shape key value :
Don't hesitate to crosspost these modeling problems on https://blender.stackexchange.com/ there are people there with a lot of experience in modeling, and there is a huge bank of existing solutions too.
I made a python script which makes a single brick parametric rowlock.

Here is the code, the basis is one single brick which I used to copy and modify.
The script is far from perfect and it needs a lot of refactoring, but I think it's a good basis for all kind of variations of rowlocks or other brick detailing.
You also may rely on a "surface deform" modifier, basically works like "lattice" but using a 2d surface.
@Coen Just as a heads-up and general advice for python scripting, there are a number of keywords that should not be overwritten unless you know what you are doing.
object
is not a keyword but it's a builtin base class in python so you should avoid using it. That's why you seeobj
orob
instead of the clearerobject
in most scripts.eg
object = bpy.data.objects[str(obj.name)]
redefines theobject
base class.In most cases it will work because python is smart enough to know when you're defining a local variable that happens to overwrite a gobal builtin, but it will cause headaches down the line. Do yourself a favor and try to avoid it ^^
I'm saying that because your script gave me an error which is caused by this caveat :
That's also why your last line doesn't throw an error when it tries to call an object that doesn't exist, it's actually passing the builtin class.
Hehe, I am a hobbyist. Thank you for the explanation. Fixed it.
EDIT: I think I should rewrite the entire script using the bmesh module.
I am starting to figure out how to program in Blender with updating and creating meshes within a collection.
I made a little demo on youtube, it's in Dutch though:

here is the code:
https://github.com/C-Claus/02_Blender_Python_scripts/blob/master/add_rollaag_hanekam.py
and several IFC results with BlenderBIM making this parametric rowlock:



I think I could do some refactoring with creating and stacking the bricks, maybe also make arched rowlocks.
Would you be interested in using Blender UI elements to streamline the test process (using a Panel in the interface, and dynamically update the mesh with sliders instead of having to re-run the script) ? I can give you pointers if you want.
I would be very interested, and I think many people on this forum with me. :-)
Which modifier should I use to make the underside of the bricks arched?
Using a Cast modifier set to sphere and making it affect only the bottom row of vertices with a custom Vertex Group could do it. Although it's not that easy to set up in code.

You could also use a different approach with a Lattice modifier and a single modifier. The behaviour is a lot more predictable than the simple deform or cast modifiers.
See :
You can do the same with the Surface deform modifier which takes a mesh instead of a lattice like Stephen suggested. It has its pros but I don't like having to click to "Bind" the mesh.
However since you're mathematically initializing the vertices anyways you could also do it in your script. The equation will look like
co = (x, y, sin(t) / b)
with t the interpolated x over your row length remapped to [0;π] and b a value to "squash" the wave.How would I store/set the location of the object when it's moved? Because I delete and make new mesh every time in the script.
@Coen you shouldn't need to store / set anything - just reuse the existing object but update the mesh in place - no need to delete the old mesh.