<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Modeling for architecture with Python scripts: Collecting ideas</title>
	<atom:link href="http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/</link>
	<description>Using Blender 3D for Architectural Visualization</description>
	<lastBuildDate>Fri, 03 Feb 2012 01:06:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: archimage</title>
		<link>http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/comment-page-1/#comment-70833</link>
		<dc:creator>archimage</dc:creator>
		<pubDate>Sun, 28 Nov 2010 02:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.blender3darchitect.com/?p=1354#comment-70833</guid>
		<description>Hi Allan, Very nice work !

Looking at revit&#039;s basic toolbox could be a good starting point : wall, floor, openings, window, door

This kind of tools are very useful to work fast in architecture, especially when they are parametric.

Using parametric dimensions between vertices, edges or faces could be also a good thing.

I think more complex tools like paneling tools but for more specific projects...

Good luck !</description>
		<content:encoded><![CDATA[<p>Hi Allan, Very nice work !</p>
<p>Looking at revit&#8217;s basic toolbox could be a good starting point : wall, floor, openings, window, door</p>
<p>This kind of tools are very useful to work fast in architecture, especially when they are parametric.</p>
<p>Using parametric dimensions between vertices, edges or faces could be also a good thing.</p>
<p>I think more complex tools like paneling tools but for more specific projects&#8230;</p>
<p>Good luck !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Free ebook with code snippets for Python and Blender 2.5 &#124; Blender 3D Architect</title>
		<link>http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/comment-page-1/#comment-57852</link>
		<dc:creator>Free ebook with code snippets for Python and Blender 2.5 &#124; Blender 3D Architect</dc:creator>
		<pubDate>Tue, 05 Oct 2010 20:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.blender3darchitect.com/?p=1354#comment-57852</guid>
		<description>[...] a previous post I did mention an old project that I will try to accomplish in the next weeks, which is the creation of better tools to create [...]</description>
		<content:encoded><![CDATA[<p>[...] a previous post I did mention an old project that I will try to accomplish in the next weeks, which is the creation of better tools to create [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: indianfriend</title>
		<link>http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/comment-page-1/#comment-46891</link>
		<dc:creator>indianfriend</dc:creator>
		<pubDate>Thu, 19 Aug 2010 06:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.blender3darchitect.com/?p=1354#comment-46891</guid>
		<description>Allan, a tool to create slopping roof by giving angle will be a great thing for architectural visualizers</description>
		<content:encoded><![CDATA[<p>Allan, a tool to create slopping roof by giving angle will be a great thing for architectural visualizers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/comment-page-1/#comment-46627</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 18 Aug 2010 04:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.blender3darchitect.com/?p=1354#comment-46627</guid>
		<description>Since this site strips leading spaces all the indentation in my previous post is lost.  http://pastebin.com/RwnRXgZ7 has the code with indents.</description>
		<content:encoded><![CDATA[<p>Since this site strips leading spaces all the indentation in my previous post is lost.  <a href="http://pastebin.com/RwnRXgZ7" rel="nofollow">http://pastebin.com/RwnRXgZ7</a> has the code with indents.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.blender3darchitect.com/2010/05/modeling-for-architecture-with-python-scripts-collecting-ideas/comment-page-1/#comment-44737</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 09 Aug 2010 23:18:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.blender3darchitect.com/?p=1354#comment-44737</guid>
		<description>I made a script to create stairs with railings in Blender 2.49.  Here it is:

#! /usr/bin/env python

&#039;&#039;&#039;
Title: Stairs and railing creator script for blender 2.49
Author: Nick Trefiak
Date: 2010 08 09

Description:
Creates a straight-run staircase with railings and stringer
All components are optional and can be turned on and off by setting e.g. makeTreads=True or makeTreads=False
No GUI for the script, all parameters must be defined below
Current values assume 1 blender unit = 1 metre

Stringer will rest on lower landing and hang from upper landing
Railings start on the lowest step and end on the upper landing

NOTE: You must have numpy installed for this script to work!
      numpy is used to easily perform the necessary algebra
      numpy can be found at http://www.scipy.org/Download

Note: I&#039;m not sure how to use recalcNormals so not all normals points ouwards.
      Perhaps someone else can contribute this.
&#039;&#039;&#039;

#---------------------------------------------------------------------
&#039;&#039;&#039;define all parameters here&#039;&#039;&#039;

global rise, run
rise=0.20 #single tread rise, including the tread height
run=0.30 #single tread run, not including the nosing

#for treads
makeTreads=True
wT=1.2 #tread width
hT=0.04 #tread height
tT=0.03 #tread toe, a.k.a. nosing
nT=10 #number of treads

#for posts
makePosts=True
dP=0.04 #post depth
wP=0.04 #post width
nP=5 #number of posts

#for railings
makeRailings=True
wR=0.12 #rail width
tR=0.03 #rail thickness
hR=0.90 #rail height

#for retainers
makeRetainers=True
wRR=0.01 #retainer width
hRR=0.01 #retainer height
nRR=3 #number of retainers

#for stringer
makeStringer=True
wS=0.15 #stringer width, set equal to tread width for fully enclosed riser


#---------------------------------------------------------------------
&#039;&#039;&#039;import modules&#039;&#039;&#039;
from Blender import *
import bpy
import math
from numpy import *

#---------------------------------------------------------------------
&#039;&#039;&#039;classes for mesh creation&#039;&#039;&#039;

class General:
    
    &#039;&#039;&#039;common data, methods needed for other objects&#039;&#039;&#039;

    def __init__(self,rise,run,N):
        self.start=zeros((3))
        self.stop=float(N)*array([run,0,rise])
        self.slope=rise/run
        self.angle=arctan(self.slope)
        #identical quads for all objects except stringer
        self.faces=[[0,1,3,2],[0,1,5,4],[0,2,6,4],[4,5,7,6],[2,3,7,6],[1,3,7,5]]

    def Make_mesh(self,coords,faces,meshname,objname):
        &#039;&#039;&#039;make a mesh given the vertex coordinates, faces, and names for mesh and object&#039;&#039;&#039;
        me = bpy.data.meshes.new(meshname)
        me.verts.extend(coords.tolist())
        me.faces.extend(faces)
        scn = bpy.data.scenes.active
        ob = scn.objects.new(me, objname)

class Treads:

    &#039;&#039;&#039;class for creating treads&#039;&#039;&#039;

    def __init__(self,w,h,d,r,toe,N):
        self.w=w #tread width
        self.h=h #tread height
        self.d=d #tread run
        self.r=r #tread rise
        self.t=toe #tread nosing
        self.N=N #number of treads
        self.Create()

    def Create(self):
        for i in range(self.N):
            coords=zeros((8,3))
            coords[0,:]=[-self.t,0,0]
            coords[1,:]=[self.d,0,0]
            coords[2,:]=[-self.t,self.w,0]
            coords[3,:]=[self.d,self.w,0]
            coords[4:,:]=coords[0:4,:]+array([0,0,-self.h])
            coords=coords+array([i*self.d,0,i*self.r])
            G.Make_mesh(coords,G.faces,&#039;tMesh&#039;,&#039;tObj&#039;)

class Posts:

    &#039;&#039;&#039;class to create posts&#039;&#039;&#039;
    
    def __init__(self,d,w,wT,nP,hR,tR):
        self.x1=G.start+array([0,0,hR-tR]) #rail start
        self.x2=G.stop+array([0,0,hR-tR]) #rail stop
        self.d=d #post depth
        self.w=w #post width
        self.wT=wT #tread width
        self.nP=nP #number of posts 
        self.sp=array([(self.x2[0]-self.x1[0])/float(nP+1),0,0]) #spacing between posts
        self.Create()

    def Intersect(self,i,d):
        &#039;&#039;&#039;find intersection point, x, for rail and post&#039;&#039;&#039;
        x3=self.x1+i*self.sp+d
        x4=x3+array([0,0,self.x2[-1]])
        a=self.x2-self.x1
        b=x4-x3
        c=x3-self.x1
        cr_ab=cross(a,b)
        mag_cr_ab=(cr_ab**2).sum()
        return self.x1+a*(dot(cross(c,b),cr_ab)/mag_cr_ab)

    def Create(self):
        for i in range(0,self.nP+2,1):
            coords=zeros((8,3))
            #intersections with rail
            coords[0]=self.Intersect(i,0.0)
            coords[1]=self.Intersect(i,self.d)
            #intersections with tread
            coords[2]=array([self.x1[0]+i*self.sp[0],0,int(coords[0,0]/run)*rise])
            coords[3]=coords[2]+array([self.d,0,0])
            #inner face
            coords[4:,:]=coords[0:4,:]+array([0,self.w,0])
            G.Make_mesh(coords,G.faces,&#039;pMesh&#039;,&#039;pObj&#039;)
            #make post on other side of steps as well
            coords=coords+array([0,self.wT-self.w,0])
            G.Make_mesh(coords,G.faces,&#039;pMesh&#039;,&#039;pObj&#039;)
			
class Rails:

    &#039;&#039;&#039;class for creating railings&#039;&#039;&#039;

    def __init__(self,w,t,h,tT,wP,dP,wT):
        self.w=w #rail width
        self.t=t #rail thickness
        self.h=h #rail height
        self.start=G.start+array([0,0,self.h-self.t]) #rail start
        self.stop=G.stop+array([0,0,self.h-self.t]) #rail stop
        self.tT=tT #tread toe
        self.wP=wP #post width
        self.dP=dP #post depth
        self.wT=wT #tread width
        self.Create()

    def Create(self):
        #determine offset to include railing toe
        offset=array([self.tT,0,self.tT*tan(G.angle)])
        coords=zeros((8,3))
        coords[0]=self.start-offset
        coords[1]=self.stop+offset+array([self.dP,0,self.dP*tan(G.angle)])
        coords[2]=self.start-offset+array([0,self.w,0])
        coords[3]=self.stop+offset+array([self.dP,self.w,self.dP*tan(G.angle)])
        coords[4:,:]=coords[0:4,:]+array([0,0,self.t])
        #centre over posts
        coords=coords+array([0,0.5*(-self.w+self.wP),0])
        G.Make_mesh(coords,G.faces,&#039;rMesh&#039;,&#039;rObj&#039;)
        #make rail on other side
        coords=coords+array([0,self.wT-self.wP,0])
        G.Make_mesh(coords,G.faces,&#039;rMesh&#039;,&#039;rObj&#039;)
        
class Retainers:

    &#039;&#039;&#039;class for creating retainers&#039;&#039;&#039;

    def __init__(self,w,h,wP,wT,nR):
        self.w=w #retainer width
        self.h=h #retainer height
        self.wP=wP #post width
        self.wT=wT #tread width
        self.nR=nR #number of retainers
        self.sp=hR/float(nR+1) #retainer spacing
        self.Create()

    def Create(self):
        for i in range(self.nR):
            coords=zeros((8,3))
            offset=(i+1)*array([0,0,self.sp])
            coords[0]=G.start+offset
            coords[1]=G.stop+offset
            coords[2]=G.start+offset+array([0,self.w,0])
            coords[3]=G.stop+offset+array([0,self.w,0])
            coords[4:,:]=coords[0:4,:]+array([0,0,self.h])
            #centre in posts
            coords=coords+array([0,0.5*(self.wP-self.w),0])
            G.Make_mesh(coords,G.faces,&#039;rrMesh&#039;,&#039;rrObj&#039;)
            #make retainer on other side
            coords=coords+array([0,self.wT-self.wP,0])
            G.Make_mesh(coords,G.faces,&#039;rrMesh&#039;,&#039;rrObj&#039;)

class Stringer:
    
    &#039;&#039;&#039;class for creating stringer&#039;&#039;&#039;

    def  __init__(self,w,nT,hT,wT):
        self.w=w #stringer width
        self.nT=nT #number of treads
        self.hT=hT #tread height
        self.wT=wT #tread width
        self.faces=[[0,1,3,2],[1,5,3],[3,5,4],[6,7,9,8],[7,11,9],[9,11,10],[0,2,8,6],[0,1,7,6],[1,5,11,7]]
        self.Create()
        
    def Create(self):
        for i in range(self.nT):
            coords=zeros((12,3))
            coords[0]=G.start+array([0,0,-rise])
            coords[1]=G.start+array([run,0,-rise])
            coords[2]=G.start+array([run*0,0,-self.hT])
            coords[3]=G.start+array([run*1,0,-self.hT])
            coords[4]=G.start+array([run*1,0,0])
            coords[5]=G.start+array([run*2,0,0])
            coords[6:]=coords[0:6]+array([0,self.w,0])
            coords=coords+i*array([run,0,rise])
            #centre below tread
            coords=coords+array([0,0.5*(self.wT-self.w),0])
            G.Make_mesh(coords,self.faces,&#039;sMesh&#039;,&#039;sObj&#039;)
        
#-----------------------------------------------------------
&#039;&#039;&#039;create meshes&#039;&#039;&#039;

editmode = Window.EditMode()    # are we in edit mode?  If so ...
if editmode: Window.EditMode(0) # leave edit mode before getting the mesh

global G
G=General(rise,run,nT)
if makeTreads: Treads(wT,hT,run,rise,tT,nT)
if makePosts: Posts(dP,wP,wT,nP,hR,tR)
if makeRailings: Rails(wR,tR,hR,tT,wP,dP,wT)
if makeRetainers: Retainers(wRR,hRR,wP,wT,nRR)
if makeStringer: Stringer(wS,nT,hT,wT)

if editmode: Window.EditMode(1)  # optional, just being nice</description>
		<content:encoded><![CDATA[<p>I made a script to create stairs with railings in Blender 2.49.  Here it is:</p>
<p>#! /usr/bin/env python</p>
<p>&#8221;&#8217;<br />
Title: Stairs and railing creator script for blender 2.49<br />
Author: Nick Trefiak<br />
Date: 2010 08 09</p>
<p>Description:<br />
Creates a straight-run staircase with railings and stringer<br />
All components are optional and can be turned on and off by setting e.g. makeTreads=True or makeTreads=False<br />
No GUI for the script, all parameters must be defined below<br />
Current values assume 1 blender unit = 1 metre</p>
<p>Stringer will rest on lower landing and hang from upper landing<br />
Railings start on the lowest step and end on the upper landing</p>
<p>NOTE: You must have numpy installed for this script to work!<br />
      numpy is used to easily perform the necessary algebra<br />
      numpy can be found at <a href="http://www.scipy.org/Download" rel="nofollow">http://www.scipy.org/Download</a></p>
<p>Note: I&#8217;m not sure how to use recalcNormals so not all normals points ouwards.<br />
      Perhaps someone else can contribute this.<br />
&#8221;&#8217;</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221;&#8217;define all parameters here&#8221;&#8217;</p>
<p>global rise, run<br />
rise=0.20 #single tread rise, including the tread height<br />
run=0.30 #single tread run, not including the nosing</p>
<p>#for treads<br />
makeTreads=True<br />
wT=1.2 #tread width<br />
hT=0.04 #tread height<br />
tT=0.03 #tread toe, a.k.a. nosing<br />
nT=10 #number of treads</p>
<p>#for posts<br />
makePosts=True<br />
dP=0.04 #post depth<br />
wP=0.04 #post width<br />
nP=5 #number of posts</p>
<p>#for railings<br />
makeRailings=True<br />
wR=0.12 #rail width<br />
tR=0.03 #rail thickness<br />
hR=0.90 #rail height</p>
<p>#for retainers<br />
makeRetainers=True<br />
wRR=0.01 #retainer width<br />
hRR=0.01 #retainer height<br />
nRR=3 #number of retainers</p>
<p>#for stringer<br />
makeStringer=True<br />
wS=0.15 #stringer width, set equal to tread width for fully enclosed riser</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221;&#8217;import modules&#8221;&#8217;<br />
from Blender import *<br />
import bpy<br />
import math<br />
from numpy import *</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221;&#8217;classes for mesh creation&#8221;&#8217;</p>
<p>class General:</p>
<p>    &#8221;&#8217;common data, methods needed for other objects&#8221;&#8217;</p>
<p>    def __init__(self,rise,run,N):<br />
        self.start=zeros((3))<br />
        self.stop=float(N)*array([run,0,rise])<br />
        self.slope=rise/run<br />
        self.angle=arctan(self.slope)<br />
        #identical quads for all objects except stringer<br />
        self.faces=[[0,1,3,2],[0,1,5,4],[0,2,6,4],[4,5,7,6],[2,3,7,6],[1,3,7,5]]</p>
<p>    def Make_mesh(self,coords,faces,meshname,objname):<br />
        &#8221;&#8217;make a mesh given the vertex coordinates, faces, and names for mesh and object&#8221;&#8217;<br />
        me = bpy.data.meshes.new(meshname)<br />
        me.verts.extend(coords.tolist())<br />
        me.faces.extend(faces)<br />
        scn = bpy.data.scenes.active<br />
        ob = scn.objects.new(me, objname)</p>
<p>class Treads:</p>
<p>    &#8221;&#8217;class for creating treads&#8221;&#8217;</p>
<p>    def __init__(self,w,h,d,r,toe,N):<br />
        self.w=w #tread width<br />
        self.h=h #tread height<br />
        self.d=d #tread run<br />
        self.r=r #tread rise<br />
        self.t=toe #tread nosing<br />
        self.N=N #number of treads<br />
        self.Create()</p>
<p>    def Create(self):<br />
        for i in range(self.N):<br />
            coords=zeros((8,3))<br />
            coords[0,:]=[-self.t,0,0]<br />
            coords[1,:]=[self.d,0,0]<br />
            coords[2,:]=[-self.t,self.w,0]<br />
            coords[3,:]=[self.d,self.w,0]<br />
            coords[4:,:]=coords[0:4,:]+array([0,0,-self.h])<br />
            coords=coords+array([i*self.d,0,i*self.r])<br />
            G.Make_mesh(coords,G.faces,&#8217;tMesh&#8217;,'tObj&#8217;)</p>
<p>class Posts:</p>
<p>    &#8221;&#8217;class to create posts&#8221;&#8217;</p>
<p>    def __init__(self,d,w,wT,nP,hR,tR):<br />
        self.x1=G.start+array([0,0,hR-tR]) #rail start<br />
        self.x2=G.stop+array([0,0,hR-tR]) #rail stop<br />
        self.d=d #post depth<br />
        self.w=w #post width<br />
        self.wT=wT #tread width<br />
        self.nP=nP #number of posts<br />
        self.sp=array([(self.x2[0]-self.x1[0])/float(nP+1),0,0]) #spacing between posts<br />
        self.Create()</p>
<p>    def Intersect(self,i,d):<br />
        &#8221;&#8217;find intersection point, x, for rail and post&#8221;&#8217;<br />
        x3=self.x1+i*self.sp+d<br />
        x4=x3+array([0,0,self.x2[-1]])<br />
        a=self.x2-self.x1<br />
        b=x4-x3<br />
        c=x3-self.x1<br />
        cr_ab=cross(a,b)<br />
        mag_cr_ab=(cr_ab**2).sum()<br />
        return self.x1+a*(dot(cross(c,b),cr_ab)/mag_cr_ab)</p>
<p>    def Create(self):<br />
        for i in range(0,self.nP+2,1):<br />
            coords=zeros((8,3))<br />
            #intersections with rail<br />
            coords[0]=self.Intersect(i,0.0)<br />
            coords[1]=self.Intersect(i,self.d)<br />
            #intersections with tread<br />
            coords[2]=array([self.x1[0]+i*self.sp[0],0,int(coords[0,0]/run)*rise])<br />
            coords[3]=coords[2]+array([self.d,0,0])<br />
            #inner face<br />
            coords[4:,:]=coords[0:4,:]+array([0,self.w,0])<br />
            G.Make_mesh(coords,G.faces,&#8217;pMesh&#8217;,'pObj&#8217;)<br />
            #make post on other side of steps as well<br />
            coords=coords+array([0,self.wT-self.w,0])<br />
            G.Make_mesh(coords,G.faces,&#8217;pMesh&#8217;,'pObj&#8217;)</p>
<p>class Rails:</p>
<p>    &#8221;&#8217;class for creating railings&#8221;&#8217;</p>
<p>    def __init__(self,w,t,h,tT,wP,dP,wT):<br />
        self.w=w #rail width<br />
        self.t=t #rail thickness<br />
        self.h=h #rail height<br />
        self.start=G.start+array([0,0,self.h-self.t]) #rail start<br />
        self.stop=G.stop+array([0,0,self.h-self.t]) #rail stop<br />
        self.tT=tT #tread toe<br />
        self.wP=wP #post width<br />
        self.dP=dP #post depth<br />
        self.wT=wT #tread width<br />
        self.Create()</p>
<p>    def Create(self):<br />
        #determine offset to include railing toe<br />
        offset=array([self.tT,0,self.tT*tan(G.angle)])<br />
        coords=zeros((8,3))<br />
        coords[0]=self.start-offset<br />
        coords[1]=self.stop+offset+array([self.dP,0,self.dP*tan(G.angle)])<br />
        coords[2]=self.start-offset+array([0,self.w,0])<br />
        coords[3]=self.stop+offset+array([self.dP,self.w,self.dP*tan(G.angle)])<br />
        coords[4:,:]=coords[0:4,:]+array([0,0,self.t])<br />
        #centre over posts<br />
        coords=coords+array([0,0.5*(-self.w+self.wP),0])<br />
        G.Make_mesh(coords,G.faces,&#8217;rMesh&#8217;,'rObj&#8217;)<br />
        #make rail on other side<br />
        coords=coords+array([0,self.wT-self.wP,0])<br />
        G.Make_mesh(coords,G.faces,&#8217;rMesh&#8217;,'rObj&#8217;)</p>
<p>class Retainers:</p>
<p>    &#8221;&#8217;class for creating retainers&#8221;&#8217;</p>
<p>    def __init__(self,w,h,wP,wT,nR):<br />
        self.w=w #retainer width<br />
        self.h=h #retainer height<br />
        self.wP=wP #post width<br />
        self.wT=wT #tread width<br />
        self.nR=nR #number of retainers<br />
        self.sp=hR/float(nR+1) #retainer spacing<br />
        self.Create()</p>
<p>    def Create(self):<br />
        for i in range(self.nR):<br />
            coords=zeros((8,3))<br />
            offset=(i+1)*array([0,0,self.sp])<br />
            coords[0]=G.start+offset<br />
            coords[1]=G.stop+offset<br />
            coords[2]=G.start+offset+array([0,self.w,0])<br />
            coords[3]=G.stop+offset+array([0,self.w,0])<br />
            coords[4:,:]=coords[0:4,:]+array([0,0,self.h])<br />
            #centre in posts<br />
            coords=coords+array([0,0.5*(self.wP-self.w),0])<br />
            G.Make_mesh(coords,G.faces,&#8217;rrMesh&#8217;,'rrObj&#8217;)<br />
            #make retainer on other side<br />
            coords=coords+array([0,self.wT-self.wP,0])<br />
            G.Make_mesh(coords,G.faces,&#8217;rrMesh&#8217;,'rrObj&#8217;)</p>
<p>class Stringer:</p>
<p>    &#8221;&#8217;class for creating stringer&#8221;&#8217;</p>
<p>    def  __init__(self,w,nT,hT,wT):<br />
        self.w=w #stringer width<br />
        self.nT=nT #number of treads<br />
        self.hT=hT #tread height<br />
        self.wT=wT #tread width<br />
        self.faces=[[0,1,3,2],[1,5,3],[3,5,4],[6,7,9,8],[7,11,9],[9,11,10],[0,2,8,6],[0,1,7,6],[1,5,11,7]]<br />
        self.Create()</p>
<p>    def Create(self):<br />
        for i in range(self.nT):<br />
            coords=zeros((12,3))<br />
            coords[0]=G.start+array([0,0,-rise])<br />
            coords[1]=G.start+array([run,0,-rise])<br />
            coords[2]=G.start+array([run*0,0,-self.hT])<br />
            coords[3]=G.start+array([run*1,0,-self.hT])<br />
            coords[4]=G.start+array([run*1,0,0])<br />
            coords[5]=G.start+array([run*2,0,0])<br />
            coords[6:]=coords[0:6]+array([0,self.w,0])<br />
            coords=coords+i*array([run,0,rise])<br />
            #centre below tread<br />
            coords=coords+array([0,0.5*(self.wT-self.w),0])<br />
            G.Make_mesh(coords,self.faces,&#8217;sMesh&#8217;,'sObj&#8217;)</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221;&#8217;create meshes&#8221;&#8217;</p>
<p>editmode = Window.EditMode()    # are we in edit mode?  If so &#8230;<br />
if editmode: Window.EditMode(0) # leave edit mode before getting the mesh</p>
<p>global G<br />
G=General(rise,run,nT)<br />
if makeTreads: Treads(wT,hT,run,rise,tT,nT)<br />
if makePosts: Posts(dP,wP,wT,nP,hR,tR)<br />
if makeRailings: Rails(wR,tR,hR,tT,wP,dP,wT)<br />
if makeRetainers: Retainers(wRR,hRR,wP,wT,nRR)<br />
if makeStringer: Stringer(wS,nT,hT,wT)</p>
<p>if editmode: Window.EditMode(1)  # optional, just being nice</p>
]]></content:encoded>
	</item>
</channel>
</rss>

