[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2035] contrib/py/scripts/addons/ add_mesh_column.py: Added width parameter for base and capital.

Jim Bates jsbates at pacbell.net
Wed Jun 15 07:22:28 CEST 2011


Revision: 2035
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2035
Author:   jambay
Date:     2011-06-15 05:22:27 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
Added width parameter for base and capital.

Modified Paths:
--------------
    contrib/py/scripts/addons/add_mesh_column.py

Modified: contrib/py/scripts/addons/add_mesh_column.py
===================================================================
--- contrib/py/scripts/addons/add_mesh_column.py	2011-06-15 01:55:53 UTC (rev 2034)
+++ contrib/py/scripts/addons/add_mesh_column.py	2011-06-15 05:22:27 UTC (rev 2035)
@@ -26,7 +26,7 @@
 bl_info = {
     "name": "Columns",
     "author": "Jim Bates, jambay",
-    "version": (0, 10),
+    "version": (0, 11),
     "blender": (2, 5, 7),
     "api": 36339,
     "location": "View3D > Add > Mesh > Columns",
@@ -67,6 +67,7 @@
 
 
 # Version History
+# v0.11 2011/06/14	Added width parameter for base and capital.
 # v0.10 2011/06/13	Consolidated base and capital "add" functions. More styles. Fixed taper with negative radius.
 # v0.09 2011/06/06	Column fluting - 90%. Added "sides" parameter for flutes, not sure I want to fix "odd" behavior.
 # v0.08 2011/05/24	Common function to generate base and capitals, more types added.
@@ -402,15 +403,14 @@
 #    May need to separate in future but handy for now for "simple" styles. Simply use "menu select" to set type for
 #    base or capital if they shouldn't be same.
 #
-# @todo: Use something besides height to determine width.
-#
-def add_extent(radius, height, zPos, type=1):
+def add_extent(radius, height, width, zPos, type=1):
     '''
 Create geometry for base/capital (shared function).
 
     Params:
 	radius    area of the column (inner vertice for base/capital).
 	height    height of base/capital.
+	width     width (radius) of base/capital.
         zPos      vertical origin (base height+column height for capital, zero for base).
         type      type of base/capital to generate.
 
@@ -418,8 +418,6 @@
 	list of vertices and edges
 
     '''
-    width = height # translator varible until parameter added... so function calls are correct.
-
     verts = []
     edges = []
 
@@ -884,6 +882,11 @@
         min=0.05,
         max=10.0,
         default=0.5)
+    base_width = FloatProperty(name="Width",
+        description="Width of base (radius)",
+        min=0.05,
+        max=10.0,
+        default=0.5)
 
     col_cap = BoolProperty(name="Capital",
          description="Column capital",
@@ -903,6 +906,11 @@
         min=0.05,
         max=10.0,
         default=0.5)
+    cap_width = FloatProperty(name="Width",
+        description="Width of capital (radius)",
+        min=0.05,
+        max=10.0,
+        default=0.5)
 
     def draw(self, context):
         layout = self.layout
@@ -927,6 +935,7 @@
             box.prop(self, 'base_type')
             box.prop(self, 'base_faces')
             box.prop(self, 'base_height')
+            box.prop(self, 'base_width')
 
         box = layout.box()
         box.prop(self, 'col_cap')
@@ -934,6 +943,7 @@
             box.prop(self, 'cap_type')
             box.prop(self, 'cap_faces')
             box.prop(self, 'cap_height')
+            box.prop(self, 'cap_width')
 
     def execute(self, context):
 
@@ -960,6 +970,7 @@
             vertsBase, edgesBase = add_extent(
                 self.radius,
                 baseH,
+                self.base_width,
                 0,
                 self.base_type
                 )
@@ -971,7 +982,8 @@
             vertsCap, edgesCap = add_extent(
                 self.radius - self.properties.taper, # fit to top of column
                 self.cap_height,
-                baseH + self.row_height * self.col_blocks,
+                self.cap_width,
+                baseH + (self.row_height * self.col_blocks),
                 self.cap_type
                 )
 



More information about the Bf-extensions-cvs mailing list