[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4243] trunk/py/scripts/addons/ add_mesh_extra_objects/add_mesh_gears.py: length and rotation units for the add_gears.py by batfinger

Brendon Murphy meta.androcto1 at gmail.com
Wed Feb 6 11:58:49 CET 2013


Revision: 4243
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4243
Author:   meta-androcto
Date:     2013-02-06 10:58:48 +0000 (Wed, 06 Feb 2013)
Log Message:
-----------
length and rotation units for the add_gears.py by batfinger

Modified Paths:
--------------
    trunk/py/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py

Modified: trunk/py/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py	2013-02-05 00:06:00 UTC (rev 4242)
+++ trunk/py/scripts/addons/add_mesh_extra_objects/add_mesh_gears.py	2013-02-06 10:58:48 UTC (rev 4243)
@@ -282,6 +282,7 @@
     if rack:
         teethNum = 1
 
+    print(radius, width, conangle)
     scale = (radius - 2 * width * tan(conangle)) / radius
 
     verts = []
@@ -584,46 +585,55 @@
         description="Radius of the gear, negative for crown gear",
         min=-100.0,
         max=100.0,
+        unit='LENGTH',
         default=1.0)
     addendum = FloatProperty(name="Addendum",
         description="Addendum, extent of tooth above radius",
         min=0.01,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     dedendum = FloatProperty(name="Dedendum",
         description="Dedendum, extent of tooth below radius",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     angle = FloatProperty(name="Pressure Angle",
-        description="Pressure angle, skewness of tooth tip (degrees)",
+        description="Pressure angle, skewness of tooth tip",
         min=0.0,
-        max=45.0,
+        max=radians(45.0),
+        unit='ROTATION',
         default=20.0)
     base = FloatProperty(name="Base",
         description="Base, extent of gear below radius",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.2)
     width = FloatProperty(name="Width",
         description="Width, thickness of gear",
         min=0.05,
         max=100.0,
+        unit='LENGTH',
         default=0.2)
     skew = FloatProperty(name="Skewness",
-        description="Skew of teeth (degrees)",
-        min=-90.0,
-        max=90.0,
+        description="Skew of teeth",
+        min=radians(-90.0),
+        max=radians(90.0),
+        unit='ROTATION',
         default=0.0)
     conangle = FloatProperty(name="Conical angle",
-        description="Conical angle of gear (degrees)",
+        description="Conical angle of gear",
         min=0.0,
-        max=90.0,
+        max=radians(90.0),
+        unit='ROTATION',
         default=0.0)
     crown = FloatProperty(name="Crown",
         description="Inward pointing extend of crown teeth",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.0)
 
     def draw(self, context):
@@ -655,10 +665,10 @@
             self.addendum,
             self.dedendum,
             self.base,
-            radians(self.angle),
+            self.angle,
             width=self.width,
-            skew=radians(self.skew),
-            conangle=radians(self.conangle),
+            skew=self.skew,
+            conangle=self.conangle,
             crown=self.crown)
 
         # Actually create the mesh object from this geometry data.
@@ -695,36 +705,43 @@
         description="Radius of the gear, negative for crown gear",
         min=-100.0,
         max=100.0,
+        unit='LENGTH',
         default=1.0)
     addendum = FloatProperty(name="Addendum",
         description="Addendum, extent of tooth above radius",
         min=0.01,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     dedendum = FloatProperty(name="Dedendum",
         description="Dedendum, extent of tooth below radius",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.1)
     angle = FloatProperty(name="Pressure Angle",
-        description="Pressure angle, skewness of tooth tip (degrees)",
+        description="Pressure angle, skewness of tooth tip",
         min=0.0,
-        max=45.0,
-        default=20.0)
+        max=radians(45.0),
+        default=radians(20.0),
+        unit='ROTATION')
     row_height = FloatProperty(name="Row Height",
         description="Height of each Row",
         min=0.05,
         max=100.0,
+        unit='LENGTH',
         default=0.2)
     skew = FloatProperty(name="Skewness per Row",
-        description="Skew of each row (degrees)",
-        min=-90.0,
-        max=90.0,
-        default=11.25)
+        description="Skew of each row",
+        min=radians(-90.0),
+        max=radians(90.0),
+        default=radians(11.25),
+        unit='ROTATION')
     crown = FloatProperty(name="Crown",
         description="Inward pointing extend of crown teeth",
         min=0.0,
         max=100.0,
+        unit='LENGTH',
         default=0.0)
 
     def draw(self, context):
@@ -750,9 +767,9 @@
             self.radius,
             self.addendum,
             self.dedendum,
-            radians(self.angle),
+            self.angle,
             width=self.row_height,
-            skew=radians(self.skew),
+            skew=self.skew,
             crown=self.crown)
 
         # Actually create the mesh object from this geometry data.



More information about the Bf-extensions-cvs mailing list