Masonry wizard, (walls, castles, etc)

NOTE:
The best way to access the script at this point is to enable the “Add Mesh: Extra Objects” add-in, and then Add > Mesh > Extras > Wall Factory

The UI code I used in the linked code below is long depreciated, so if you want to use any of this stuff that isn’t in the pack-in add-in, you’re going to be up to your elbows in Python. That said, if you want any help, let me know in a PM and I’ll see what I can do.

Note:
This project now has a SorceForge account. I’ll keep up with the thread too, but I’m trying to move operations over that way.

Latest development version, may produce strange results

Stable version, w/ GUI

I looked around a bit for a scrip that would do this, but couldn’t find one. It seems that someone must have done this before, maybe I wasn’t looking hard enough.
Anyhow, I decided to make a wizard that will build stone/brick masonry walls, paths, towers, etc. Here’s my first pass at one, about a week and a half of work in this script so far. All the pictures are of the plain untextured geometry. All the walls seen can be made using the current GUI. Everything is properly registered, copy the script to your “scripts” folder:
(note, the code is too long to paste into a block, here is the link)
http://www.peripheralarbor.com/Auto_Masonry.py
Go to the “Python Window” Scripts->Wizards->Auto Masonry
http://www.peripheralarbor.com/gallery/d/2682-2/wall06.jpg
http://www.peripheralarbor.com/gallery/d/2666-2/wall02.jpg
http://www.peripheralarbor.com/gallery/d/2684-1/wall08.jpg
A few questions:
Would assigning each block it’s own UV cords on a UV layer be helpful for texturing? Should I spend a lot of time improving the current GUI? Will you power users just hardwire the code to get the extra functionality you want? Are there other scripts which do the same/similar things, perhaps that could be merged? Would anyone be interested in a version which makes a lot of individual linked blocks for physics experiments? Comments, suggestions, critiques are welcome.
EDIT:
A few responses to comments:
The pathway was made by creating a tall narrow “wall” and rotating it to a horizontal position. Afterwords I added the Curve modifier (the script didn’t do the pathway automatically).
The “inner” mesh is actually the grout, while the outer one is the stones. This way you can sub-surf and smooth the stones and grout seperately. It also allows easier texturing.

Hoehrer
Quick guide to use the script (with paths):

  • Add a Path (Add->Curve->Path)
  • Select the path
  • Go to the “Python Window” Scripts->Wizards->Auto Masonry
  • Tweak settings and click “Make this wall”

Thanks Hoehrer! Forgot to mention that…

Wow! what a neat idea!

Please make a nice GUI :smiley:

Well, it already has (I think) a “pretty nice GUI”. The trick is getting at the guts of functionality (multiple door placement, preset offset values for edges, overhangs, etc) without overloading the user. Perhaps popup menus are the way to go.
I forgot to mention (for those who don’t code) It’s all properly registered, so all you have to do is copy it into the ‘scripts’ folder and Blender will pick it up. It shows up under the “wizards” submenu.

Wow, that works great, Blender 2.44 & Blender 2.45.
Made some great towers just using a bezier circle.
Closed curves gave a weird result. (but still awesome)
How did you do the path?
Can 2 or four sides be made at once? (as in a whole building)
Even as it is, it’s really great.
Why does it make two mesh? Inner & Outer.
Roof tiles for towers, other wall types would be great.
btw, gui is ok, well commented.
I look forward to any updates.
m.a.

This really is very sweet and for me it clearly has a future so keep up the coding…

So when I tried it, I hadn’t read any docs (if there is any) so here are my thoughts…

The link should for the script should be http://www.peripheralarbor.com/Auto_Masonry.py (because file:// does not work)

Once I had managed to get a download of the script, I built a little castle turret, selected it and ran the script… The script created me a new wall all together, which looked good, but was not what I expected. So I opened the script up and it says it needs paths… OK fair enough… but is there any chance you can get it to fill a surface (a bit like discombobulator does?)

I like Meta ^^^ above cannot fathom how you did the path :frowning:

A great start to a useful script none the less… Maybe some presets would also help… “Lego, Red Brick, Breeze Block” etc…

J

hi,
sounds very interesting!will try.:slight_smile:

Wow, very nice script. Kudos to you for creating this dudecon :slight_smile:

I would even go so far as to propose this for inclusion in blender :wink:

Quick guide to use the script (with paths):

  • Add a Path (Add->Curve->Path)
  • Select the path
  • Go to the “Python Window” Scripts->Wizards->Auto Masonry
  • Tweak settings and click “Make this wall”

Werner

Making along blender path is not a problem,
as above, best results in object mode.
You can actually make a castle to plan.
how did the flat pathway be made so it curves through so beautifully.
m.a.

I vote for GUI. The actual results are already VERY impressive!

I updated the first post with some responses to common questions: curves, the pathway, etc. It seems I gave the impression that there is no GUI, which is not true. It just doesn’t access all the values that should be accessible for customization.(yet)
The way I’m finding the length of the curve is by converting it to a mesh and then measuring the length of the sides. Because of this, if a curve is closed it measures all the edges inside the surface as well, so I trap closed curves and assume that any closed curve is a perfect circle. That’s why closed curves don’t quite work the way they should. If anyone can tell me how to find the length of a curve some other way I’d love to hear it.
I’d like to make the option to make subsequent walls interlocking. That way you could make nice four sided buildings, very long walls, etc. For walls of very large dimension or small bricks I suggest creating several smaller walls and stringing them together. It is possible to crash Blender by making a wall too large (Is there a way to check for this?).
I’d like to be able to call the “Gothic Vaults” script from this one to get vaulted corridors. I’d like to add archways also (round and pointed). At some point the “grout” should be looked at. I’d like to make the grout a single surface instead of lots of blocks, but implementing that is going to take a bit more thought.

This looks like Wizard’s 2D procedural tiles texture in 3D, what about herringbone and freedom to make complex patterns. What about hexagonal and octagonal patterns?

Forgot to mention in the previous post: Thanks for all the positive feedback guys! I hope this script can help build some sweet castles some day.
Cyborg Dragon:
Wizard’s 2D procedural tiles texture is great (looking forward to using it). Often, all you need for a floor is a good texture, so the actual geometry would be unneccesary. Actually, you often only need textures for walls too, but I digress.
Rows of rectangular blocks can have blocks of random width (because they are all the same height). As far as I know square tiling (like herringbone and octagonal) and hex tiling must have tiles of the same dimension (correct me if I’m wrong on this one). Bottom line is it eliminates the block randomization, which is pretty much all the Auto Masonry script does (apart from edge effects like doors, windows, and seamless wrapping). The exception would be mathematical tesselations (see Escher’s “circle limit” series and others) but I’m not sure I want to tackle non-uniform tesselation…

However, making hexagonal, octagonal, and herringbone patterns in 3d is already pretty simple using an ‘array’ and ‘mirror’ modifier, since element spacing must remain the same to maintain the pattern. I think all of the stanard uniform tilings can be created (in realtime too!) using the builtin modifiers. I’ll try it and report back later this afternoon.
Perhaps a similar but seperate script would be better for uniform (or hemi-uniform) tilings, as they are often used for floors, but not often for walls (other than the rectangular pattern). Perhaps an “Auto Paving” script that fills a pre-defined area? It could randomize the scaling, and height of individual paving stones and perhaps add random flaws (which I’d also like to re-introduce into Auto Masonry).

You could very well create a small suite of scripts that would allow for all sorts of patterns, pavings, and walls, with flaws and such as well.

Wizard’s tiles don’t have random flaws and they don’t have edge features, a suite of these scripts could be very interesting.

I worked up a script to do some complex tiling as a first step toward Cyborg Dragon’s suggestion. It’s still very beta, but I figured it needed it’s own thread.
http://blenderartists.org/forum/showthread.php?t=105564

Could somebody send new link to script? I can’t donwload it, it seems like server is down. I will try it tomorrow again, but if somebody could upload it, it would be cool :slight_smile:

Found out about this script in the BlenderArts Magazine article.
Very nice! Thank you for all of the work you put into this :slight_smile:

Now it’s time to get medieval :wink:

I also found the script via BAM. Dudecon, thank you for your work and for sharing it! I played around with it today and had a lot of fun. I’m sure I will find great use of it.

http://farm3.static.flickr.com/2297/2094935695_0379126cbf.jpg

A paved street I made in a snap, about one hour after having downloaded the script.

Thanks again
/ Mats

That’s a great script! Thanks for sharing it with us.

Just found out about it in the Blenderart Magazine and gave it a try.
It would be great to generate a sidewalk, but there is one problem, because sidewalks usually have rather regular patterns. So every other row starts at the same point of length and then the next row starts “half a stone later”. Not sure, if anyone understands what I mean, I find it hard to explain in English.

Do you think it would be possible to have a button in that script which allows this type of regularity (which I guess is a rather common type for many walls)?

MD

Hey you’re welcome guys! Thanks for the encouragement.
Master Domino: Currently I believe the script will do what you are asking for. Try setting the min width and max width to the same value. All the stones will then be the same width (like bricks) and the offsets (full brick/half brick alternating) should show up. Let me know if this works for what you wanted. If not I’ll see if I can make a work-around.

This is very nice!!!
(Sorry for bump :stuck_out_tongue: )

I made this:
http://img257.imageshack.us/img257/6821/coolik6.jpg