diff options
author | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-09-20 00:49:59 +0300 |
---|---|---|
committer | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-09-20 00:49:59 +0300 |
commit | 4fc5558f68a3d514c40f1e2d36524e9f51f85fc3 (patch) | |
tree | ae326625635e552f9689d07b55e6daa51b2c2a6e | |
parent | c06154e38ac8c754f118b74befc8380b9a00e7ae (diff) |
Addon: Mesh Extra Objects: Removed limiters in Gear and WormGear
-rw-r--r-- | add_mesh_extra_objects/add_mesh_gears.py | 84 |
1 files changed, 45 insertions, 39 deletions
diff --git a/add_mesh_extra_objects/add_mesh_gears.py b/add_mesh_extra_objects/add_mesh_gears.py index 0ccc265d..e92857b8 100644 --- a/add_mesh_extra_objects/add_mesh_gears.py +++ b/add_mesh_extra_objects/add_mesh_gears.py @@ -123,7 +123,10 @@ def add_tooth(a, t, d, radius, Ad, De, base, p_angle, rack=0, crown=0.0): # Pressure angle calc O = Ad * tan(p_angle) - p_angle = atan(O / Ra) + if Ra != 0: + p_angle = atan(O / Ra) + else: + p_angle = atan(O) if radius < 0: p_angle = -p_angle @@ -250,7 +253,10 @@ def add_gear(teethNum, radius, Ad, De, base, p_angle, teethNum = 1 #print(radius, width, conangle) - scale = (radius - 2 * width * tan(conangle)) / radius + if radius != 0: + scale = (radius - 2 * width * tan(conangle)) / radius + else: + scale = radius - 2 * width * tan(conangle) verts = [] faces = [] @@ -580,69 +586,69 @@ class AddGear(Operator): number_of_teeth: IntProperty(name="Number of Teeth", description="Number of teeth on the gear", min=2, - max=265, + #max=265, default=12 ) radius: FloatProperty(name="Radius", description="Radius of the gear, negative for crown gear", - min=-100.0, - max=100.0, + #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, + #min=0.0, + #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, + #min=0.0, + #max=100.0, unit='LENGTH', default=0.1 ) angle: FloatProperty(name="Pressure Angle", description="Pressure angle, skewness of tooth tip", - min=0.0, - max=radians(45.0), + #min=0.0, + #max=radians(45.0), unit='ROTATION', default=radians(20.0) ) base: FloatProperty(name="Base", description="Base, extent of gear below radius", - min=0.0, - max=100.0, + #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, + #min=0.0, + #max=100.0, unit='LENGTH', default=0.2 ) skew: FloatProperty(name="Skewness", description="Skew of teeth", - min=radians(-90.0), - max=radians(90.0), + #min=radians(-90.0), + #max=radians(90.0), unit='ROTATION', default=radians(0.0) ) conangle: FloatProperty(name="Conical angle", description="Conical angle of gear", - min=0.0, - max=radians(90.0), + #min=0.0, + #max=radians(90.0), unit='ROTATION', default=radians(0.0) ) crown: FloatProperty(name="Crown", description="Inward pointing extend of crown teeth", - min=0.0, - max=100.0, + #min=0.0, + #max=100.0, unit='LENGTH', default=0.0 ) @@ -780,70 +786,70 @@ class AddWormGear(Operator): number_of_teeth: IntProperty( name="Number of Teeth", description="Number of teeth on the gear", - min=2, - max=265, + min=1, + #max=265, default=12 ) number_of_rows: IntProperty( name="Number of Rows", description="Number of rows on the worm gear", - min=2, - max=265, + min=0, + #max=265, default=32 ) radius: FloatProperty( name="Radius", description="Radius of the gear, negative for crown gear", - min=-100.0, - max=100.0, + #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, + #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, + #min=0.0, + #max=100.0, unit='LENGTH', default=0.1 ) angle: FloatProperty( name="Pressure Angle", description="Pressure angle, skewness of tooth tip", - min=0.0, - max=radians(45.0), + #min=0.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, + #min=0.05, + #max=100.0, unit='LENGTH', default=0.2 ) skew: FloatProperty( name="Skewness per Row", description="Skew of each row", - min=radians(-90.0), - max=radians(90.0), + #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, + #min=0.0, + #max=100.0, unit='LENGTH', default=0.0 ) |