-
Notifications
You must be signed in to change notification settings - Fork 1
Procedure for Voronoi like auto building graph generator
First you'll want to have repository likely downloaded local on your system. Second, where ever you have downloaded the scripts, you need to put in the necessary path string to such local folder on your machine where it says '/insert/your/local/directory/here' this is the path to BlenderPythonScripts on your machine assuming you git cloned the directory, or where ever you pulled the zip file (and so forth) and unpacked this.
So assuming you have Blender installed on your machine, you'll want to pull up your 'Python Console'
At the console prompt you'll want to enter each of the following filenames:
filename2 = "/insert/your/local/directory/here/BlenderPythonScripts/CirclePack.py"
filename3 = "/insert/your/local/directory/here/BlenderPythonScripts/DrawCirclePack.py"
filename4 = "/insert/your/local/directory/here/BlenderPythonScripts/SimpleComplex.py"
filename5 = "/insert/your/local/directory/here/BlenderPythonScripts/CirclePackDualGraph.py"
filename6 = "/insert/your/local/directory/here/BlenderPythonScripts/penrose2.py"
filename7 = "/insert/your/local/directory/here/BlenderPythonScripts/DualGraphtoSubdivision.py"
filename8 = "/insert/your/local/directory/here/BlenderPythonScripts/batchrandomscaledextrusion.py"
So the execution goes as follows. You'll need a complex generated (I have random complex generator), to produce a circle packing. This will in turn be used to produce the Voronoi-like Dual graph which in turn can then produce the rest of what we need from scripts.
First at prompt execute the following line:
exec(compile(open(filename4).read(), filename4, 'exec'))
Next at prompt:
interior1 = packs[0][0]
exterior1 = packs[0][1]
exec(compile(open(filename2).read(), filename2, 'exec'))
cpack = CirclePack(interior1,exterior1)
Next at prompt:
exec(compile(open(filename5).read(), filename5, 'exec'))
This should produce the Dualgraphobject in your Blender 3D view session. You'll want to toggle this into edit mode, deselect everything, then reselect the object ('A')
Next at prompt:
exec(compile(open(filename6).read(), filename6, 'exec'))
If you want to build terracing on the DualGraphobject, you can run this at prompt:
exec(compile(open(filename8).read(), filename8, 'exec'))
faces,vertices = batchrextrude(height = .25, scaleon = False, setFV = True)
Again 'edit mode' on this DualGraph object deselect and reselect everything. You'll also want to toggle into 'Edge Select' (although this is not critical for running the remainder of scripts). You may want to toggle back into 'Object' Mode as I've seen the scripts sometimes being fussy here depending on the mode.
Next at prompt:
exec(compile(open(filename7).read(), filename7, 'exec'))
Now this should generate an object called 'Penrose' even though technically it is not (misnomer), go ahead and verify that the 'Penrose' object is centered about the Dual graph object. If it is not, you can delete the object and run the following at prompt to recenter your scene object cursor properly at the point of origin with the following command:
bpy.context.scene.cursor_location = (0.0, 0.0, 0.0)
Then rerun the exec command above again (if you need a proper recenter of the penrose object to the Dual graph object).
With the 'Penrose' object selected go ahead and toggle into 'Edit' mode deselect everything then reselect everything, then toggle back into 'Object' mode. Now at prompt run:
exec(compile(open(filename8).read(), filename8, 'exec'))
batchrextrude()
This should generate on the Penrose object a series of randomly scaled extrusions. Basically I have designed this to produce terraced and non terraced style scaled extrusions 'E + S' or something like inset (on a face) 'I + E' along the planar normals. I've kept this limited to up to 5 steps although you can likely find this in filename8 if you want to modify this yourself.
If you want to further create trim like edge work around the buildings, something basically framing glass like structures, you can do this by first select in 3D view, in 'Edit' Mode make sure 'Face Select' is enabled on the 'Penrose' object the top face or z normal face of any building. Then go to Select>Select Similar (Shift+G) and choose Normal. This should populate every top facing z normal face on the penrose object, or if you were looking top down everything would appear to be selected (top down perspective view). You can now go to Select>Inverse and this will select all of the building sides. Next, press 'I + I" If you like the default amount of Inset on individual faces for window trim amount, go ahead and press enter. Otherwise, I recommend you fiddle with you numeric pad for precise numbers given the amount of faces and vertices that could encumber your system with any mouse movements in so far as demonstrated graphical amounts. Next, you if you want to shrink/fatten to recess (or the opposite) the buildings windows by pressing 'Alt + E' then select 'Individual faces', you can adjust via mouse or number pad as desired.
Be sure also to assign these selected faces to a given desired windows material. You can inverse this selection or save this to Vertex group if you like for quick reselection, and assign this inverse to its own default material.