Addon: Mesh Extra Objects: Removed limiters in Gear and WormGear

This commit is contained in:
Vladimir Spivak 2019-09-20 00:49:59 +03:00
parent c06154e38a
commit 4fc5558f68
1 changed files with 45 additions and 39 deletions

View File

@ -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
)