sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
neil neil is offline
Member
 
Join Date: Nov 2002
Location: Scotland
Posts: 64
This is a script I have written to create gothic vaults (specifically domical vaults - one of the early forms). It creates quarter of a vaults which if you make four linked mirrored copys gives you a whole vault. It is my first useful script, with major credit to the potatoid tutorial and S68s knife script which I based the GUI on.


Code:
############################################################# # # # Blender Domical Vault Script # # # # (C) December 2003 Neil McAllister # # # ############################################################# # History # # V: 0.0.1 - 27-12-02 - First Working Version # ############################################################# import Blender from Blender import * from Blender.Draw import * from math import * BL_VERSION = Blender.Get('version') if (BL_VERSION<=223): import Blender210 pointy=Create(0.5) length=Create(4.0) breadth=Create(6.0) ############################################################# # MAIN # ############################################################# def ConstructVault(): global pointy, length, breadth me=NMesh.GetRaw() i=0.0 j=0.0 n=32.0 l=length.val b=breadth.val p=pointy.val d=sqrt(l*l+b*b) alpha=acos(1-1/(2*p)) theta=alpha/n rl=l*p*2 rb=b*p*2 rd=d*p*2 for i in range(0,n+1): for j in range(0,n+1): x=(cos(alpha)-cos(theta*i))*rb y=(cos(alpha)-cos(theta*j))*rl if i<j: z=sin(theta*i)*(rd-rl)+sin(theta*j)*rl else: z=sin(theta*j)*(rd-rb)+sin(theta*i)*rb v=NMesh.Vert(x,y,z) me.verts.append(v) n0=len(range(0,n+1)) for i in range(0,n): for j in range(0,n): if i==j: f=NMesh.Face() f.v.append(me.verts[i*n0+j]) f.v.append(me.verts[i*n0+j+1]) f.v.append(me.verts[(i+1)*n0+j+1]) me.faces.append(f) f=NMesh.Face() f.v.append(me.verts[i*n0+j]) f.v.append(me.verts[(i+1)*n0+j+1]) f.v.append(me.verts[(i+1)*n0+j]) me.faces.append(f) else: f=NMesh.Face() f.v.append(me.verts[i*n0+j]) f.v.append(me.verts[i*n0+j+1]) f.v.append(me.verts[(i+1)*n0+j+1]) f.v.append(me.verts[(i+1)*n0+j]) me.faces.append(f) NMesh.PutRaw(me,"plane",1) Blender.Redraw() ############################################################# # Graphics # ############################################################# def Warn(): BGL.glRasterPos2d(115, 23) Blender.Window.Redraw(Blender.Window.Const.TEXT) def draw(): global pointy, length, breadth BGL.glClearColor(0.5, 0.7, 0.5, 1) BGL.glColor3f(1,1,1) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) BGL.glColor3f(1, 1, 0) BGL.glRasterPos2d(8, 153) Text("Blender Domical Vault Script") BGL.glRasterPos2d(8, 133) Text("(C) Dec. 2003 Neil McAllister") length=Slider("Length ",2,10, 100, 200, 20, length.val, 0, 100) breadth=Slider("Breadth ",2,10, 75, 200, 20, breadth.val, 0, 100) pointy=Slider("Pointiness ",2,10, 50, 200, 20, pointy.val, 0.5, 4) Button("Exit", 1, 100, 10, 40, 20) def event(evt, val): if (evt== QKEY and not val): Exit() def bevent(evt): if (evt== 1): Exit() elif (evt== 2): ConstructVault() Draw() elif (evt== 3): ConstructVault() Redraw() ConstructVault() Register(draw, event, bevent)
Comments please...

Neil

Updated for 2.44 on page 3

http://bartius.crouch.googlepages.com/vault_download

Last edited by Fligh; 31-May-07 at 18:04. Reason: Posted update
#1   Old 29-Dec-02, 23:45   
Reply With Quote


emtilt emtilt is offline
Member
 
Join Date: Jun 2002
Posts: 184
Well, I don't know anything about python itself. But I played with it in blender a bit, seems to work fine. Interesting, even though I am not sure how useful it will be...
#2   Old 30-Dec-02, 00:55   
Reply With Quote
Enzoblue's Avatar
Enzoblue Enzoblue is offline
Member
 
Join Date: Jun 2002
Location: Pennsylvania, USA
Posts: 1,307
To make vaulted ceilings with a perfect, no hassle, takes 2 seconds to make vault ?

Works really nice Neil

Our train station in Philadelphia has a multi vaulted ceiling I can duplicate with this using a very low pointedness setting. The ceiling itself uses hundreds of these vaults like a texture.
#3   Old 30-Dec-02, 02:07   
Reply With Quote
IamInnocent's Avatar
IamInnocent IamInnocent is offline
Member
 
Join Date: Mar 2002
Location: Montreal, Qc, Canada
Posts: 2,523
It's just beautiful, I love it.

Thanks a bunch for sharing.
............................................
-----------------------------------------------
Just be.
#4   Old 30-Dec-02, 03:47   
Reply With Quote
asdf_46's Avatar
asdf_46 asdf_46 is offline
 
Join Date: May 2002
Location: Farmington, New Mexico
Posts: 43
Hey where can I see some stuff that you have done with it? asdf_46
............................................
Let\'s not bicker and argue about who killed who, this is supposed to be a happy occation!
#5   Old 30-Dec-02, 04:48   
Reply With Quote
S68's Avatar
S68 S68 is offline
Member
 
Join Date: Mar 2002
Location: Florence - Italy
Posts: 5,663
Hoho,

very nice, and usefull could be expanded to many other different kind of vaults!

Thanx for crediting me too...

Stefano
............................................
** You cannot make foolproof stuff - fools are too smart. **
#6   Old 30-Dec-02, 08:46   
Reply With Quote
Schlops's Avatar
Schlops Schlops is offline
Member
 
Join Date: Nov 2001
Location: LocX = 8158.2 LocY = 1516.4 LocZ = 9660.9
Posts: 668
HeyHo!

Nice script, thank you!
............................................
Stay Rude!
#7   Old 30-Dec-02, 15:29   
Reply With Quote
seval's Avatar
seval seval is offline
 
Join Date: Oct 2002
Posts: 241
Very nice. Good to see someone working on scripts like this one. Thanks.
............................................
The paradoxes of consciousness arise because a conscious being can be aware of itself.
#8   Old 30-Dec-02, 20:15   
Reply With Quote
Tol's Avatar
Tol Tol is offline
Member
 
Join Date: Mar 2002
Location: Czech republic
Posts: 356
Thanx it´s really nice! You have no idea how much will this script make my life easier
#9   Old 01-Jan-03, 14:35   
Reply With Quote
dante's Avatar
dante dante is offline
Member
 
Join Date: Dec 2002
Posts: 2,278
I tried it out using the defualt settings on the defualt plane. I'm not sure what this script does, as Im not really sure what a gothic vault is :-| .
............................................
germanSpeak: These are quite level.
#10   Old 06-Jan-03, 22:39   
Reply With Quote
trevs trevs is offline
 
Join Date: Aug 2002
Location: London
Posts: 50
I can't get this to work. Tried it in 2.23 and 2.25.
Alt-p brings up the settings screen, I can change the settings but nothing appears on the drawing screen. Am I missing something?

Cheers
#11   Old 13-Jan-03, 14:05   
Reply With Quote
neil neil is offline
Member
 
Join Date: Nov 2002
Location: Scotland
Posts: 64
Trevs: I'm sorry, I don't know what the problem might be. Does it give any errors on the console thingy? Do any of the gurus out there know what the problem might be?

Dante: What happens when you run it - are you having the same problem as Trevs? A gothic vault is like the ceiling of medieval cathedrals - pointed arch sort of thing.

Neil.
#12   Old 14-Jan-03, 12:07   
Reply With Quote
trevs trevs is offline
 
Join Date: Aug 2002
Location: London
Posts: 50
Got it to work!!!!!
In fact it was working all the time except it was drawing the vault on the 3D screen at such a large default size it was off-screen.
Silly me, and I thought I knew quite alot about Blender.

Cheers
#13   Old 15-Jan-03, 09:19   
Reply With Quote
jazzroy's Avatar
jazzroy jazzroy is offline
Member
 
Join Date: Jan 2003
Location: Torino - Italy
Posts: 465
hi neil I really like your script, but it doesn't work entirely for me.
changing the first param. (length) the script halts and comes back to the text editor.

maybe you know way..

jzr
............................................
Riccardo Covino
#14   Old 30-Oct-03, 09:13   
Reply With Quote
Modron's Avatar
Modron Modron is offline
Member
 
Join Date: Aug 2003
Posts: 10,726
I also have this problem with the vault script but constrained scaling seems to straighten it out, so i just stay away from that parameter. I'll check the py console next time I have it out.
............................................
Here's a nodes tutorial on Using UV mapping to define material values: http://blenderartists.org/forum/showthread.php?t=73088
And here's another nodes tutorial on how to do a custom sequence wipe: http://blenderartists.org/forum/showthread.php?t=90989
#15   Old 16-Mar-04, 13:03   
Reply With Quote
reed's Avatar
reed reed is offline
Member
 
Join Date: Oct 2002
Posts: 251
I also was having problems, which I fixed by adding an "Update" button instead of rebuilding the vault section whenever the slider moved. I guess blender doesn't like it when you change stuff during the scale event.

I also made some other random changes that may or may not make any difference like calling "me.update()" in the ContructVault function. Also renamed the labels because I keep forgetting which slider does what :)

I can either post the URL to my hacked version or PM or email it to you if you want Neil.

Also if you post a new version, can you put a link to a file? Cutting and pasting adds all kinds of strange characters in the text that I have to filter out.

Fun and useful script though!
............................................
VOS - Interreality:
Virtual Object System - Internet Virtual Reality
http://interreality.org
#16   Old 30-Apr-04, 01:11   
Reply With Quote
denshidan's Avatar
denshidan denshidan is offline
Member
 
Join Date: Feb 2005
Location: Nottingham, England
Posts: 630
Thats brilliant and very useful for me as Im modelling our church at the moment.. so

DSD
#17   Old 03-Mar-05, 14:02   
Reply With Quote
Crouch's Avatar
Crouch Crouch is offline
Member
 
Join Date: Oct 2004
Location: the Netherlands
Posts: 993
I've made some additions to the script, but let me start with thanking Reed for his version of the code. He changed the code so the mesh wasn't constantly being updated.

You can download the new file here.
The general page can be found over here.

Here is a list of the changes I made:

* Added the possibility to set the resolution of the vault
* Square-button: easier to create square vaults
* Lowered the minimum pointiness to the absolute minimum
* Real-time button: choose between real-time or update on demand
* Reset button

If you find any mistakes in the code, or have any suggestions, please let me know. I'm completely new to python (this is the first thing I ever did with it), so any comments are welcome.

EDIT: If you wish to create a new vault, change the Datablock name of the old vault in the 'links and materials' section (F9). I'm also still busy with this in python.
EDIT2: This problem is solved in version 0.0.2
#18   Old 24-Mar-05, 15:09   
Reply With Quote
reed's Avatar
reed reed is offline
Member
 
Join Date: Oct 2002
Posts: 251
Great changes Crouch, I think I'll use them to make some vauts in my Round Table (king arthur style) hall.
............................................
VOS - Interreality:
Virtual Object System - Internet Virtual Reality
http://interreality.org
#19   Old 24-Mar-05, 17:06   
Reply With Quote
Crouch's Avatar
Crouch Crouch is offline
Member
 
Join Date: Oct 2004
Location: the Netherlands
Posts: 993
I'm glad you like the changes. There was still one thing bothering me though: the fact that the script replaced the existing vault. I've fixed that now.
I guess the next step will be to make it possible to edit previous made vaults and to save settings, but that might take some time.

You can find the new script over here.
The general page can be found over here.

Before I forget it: post some pictures of the things you make with it!
#20   Old 24-Mar-05, 20:03   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:41.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists