Skip to content
Snippets Groups Projects
Commit 4fc5558f authored by Spivak Vladimir (cwolf3d)'s avatar Spivak Vladimir (cwolf3d)
Browse files

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

parent c06154e3
Branches
Tags
No related merge requests found
...@@ -123,7 +123,10 @@ def add_tooth(a, t, d, radius, Ad, De, base, p_angle, rack=0, crown=0.0): ...@@ -123,7 +123,10 @@ def add_tooth(a, t, d, radius, Ad, De, base, p_angle, rack=0, crown=0.0):
# Pressure angle calc # Pressure angle calc
O = Ad * tan(p_angle) 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: if radius < 0:
p_angle = -p_angle p_angle = -p_angle
...@@ -250,7 +253,10 @@ def add_gear(teethNum, radius, Ad, De, base, p_angle, ...@@ -250,7 +253,10 @@ def add_gear(teethNum, radius, Ad, De, base, p_angle,
teethNum = 1 teethNum = 1
#print(radius, width, conangle) #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 = [] verts = []
faces = [] faces = []
...@@ -580,69 +586,69 @@ class AddGear(Operator): ...@@ -580,69 +586,69 @@ class AddGear(Operator):
number_of_teeth: IntProperty(name="Number of Teeth", number_of_teeth: IntProperty(name="Number of Teeth",
description="Number of teeth on the gear", description="Number of teeth on the gear",
min=2, min=2,
max=265, #max=265,
default=12 default=12
) )
radius: FloatProperty(name="Radius", radius: FloatProperty(name="Radius",
description="Radius of the gear, negative for crown gear", description="Radius of the gear, negative for crown gear",
min=-100.0, #min=-100.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=1.0 default=1.0
) )
addendum: FloatProperty(name="Addendum", addendum: FloatProperty(name="Addendum",
description="Addendum, extent of tooth above radius", description="Addendum, extent of tooth above radius",
min=0.01, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.1 default=0.1
) )
dedendum: FloatProperty(name="Dedendum", dedendum: FloatProperty(name="Dedendum",
description="Dedendum, extent of tooth below radius", description="Dedendum, extent of tooth below radius",
min=0.0, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.1 default=0.1
) )
angle: FloatProperty(name="Pressure Angle", angle: FloatProperty(name="Pressure Angle",
description="Pressure angle, skewness of tooth tip", description="Pressure angle, skewness of tooth tip",
min=0.0, #min=0.0,
max=radians(45.0), #max=radians(45.0),
unit='ROTATION', unit='ROTATION',
default=radians(20.0) default=radians(20.0)
) )
base: FloatProperty(name="Base", base: FloatProperty(name="Base",
description="Base, extent of gear below radius", description="Base, extent of gear below radius",
min=0.0, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.2 default=0.2
) )
width: FloatProperty(name="Width", width: FloatProperty(name="Width",
description="Width, thickness of gear", description="Width, thickness of gear",
min=0.05, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.2 default=0.2
) )
skew: FloatProperty(name="Skewness", skew: FloatProperty(name="Skewness",
description="Skew of teeth", description="Skew of teeth",
min=radians(-90.0), #min=radians(-90.0),
max=radians(90.0), #max=radians(90.0),
unit='ROTATION', unit='ROTATION',
default=radians(0.0) default=radians(0.0)
) )
conangle: FloatProperty(name="Conical angle", conangle: FloatProperty(name="Conical angle",
description="Conical angle of gear", description="Conical angle of gear",
min=0.0, #min=0.0,
max=radians(90.0), #max=radians(90.0),
unit='ROTATION', unit='ROTATION',
default=radians(0.0) default=radians(0.0)
) )
crown: FloatProperty(name="Crown", crown: FloatProperty(name="Crown",
description="Inward pointing extend of crown teeth", description="Inward pointing extend of crown teeth",
min=0.0, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.0 default=0.0
) )
...@@ -780,70 +786,70 @@ class AddWormGear(Operator): ...@@ -780,70 +786,70 @@ class AddWormGear(Operator):
number_of_teeth: IntProperty( number_of_teeth: IntProperty(
name="Number of Teeth", name="Number of Teeth",
description="Number of teeth on the gear", description="Number of teeth on the gear",
min=2, min=1,
max=265, #max=265,
default=12 default=12
) )
number_of_rows: IntProperty( number_of_rows: IntProperty(
name="Number of Rows", name="Number of Rows",
description="Number of rows on the worm gear", description="Number of rows on the worm gear",
min=2, min=0,
max=265, #max=265,
default=32 default=32
) )
radius: FloatProperty( radius: FloatProperty(
name="Radius", name="Radius",
description="Radius of the gear, negative for crown gear", description="Radius of the gear, negative for crown gear",
min=-100.0, #min=-100.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=1.0 default=1.0
) )
addendum: FloatProperty( addendum: FloatProperty(
name="Addendum", name="Addendum",
description="Addendum, extent of tooth above radius", description="Addendum, extent of tooth above radius",
min=0.01, #min=0.01,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.1 default=0.1
) )
dedendum: FloatProperty( dedendum: FloatProperty(
name="Dedendum", name="Dedendum",
description="Dedendum, extent of tooth below radius", description="Dedendum, extent of tooth below radius",
min=0.0, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.1 default=0.1
) )
angle: FloatProperty( angle: FloatProperty(
name="Pressure Angle", name="Pressure Angle",
description="Pressure angle, skewness of tooth tip", description="Pressure angle, skewness of tooth tip",
min=0.0, #min=0.0,
max=radians(45.0), #max=radians(45.0),
default=radians(20.0), default=radians(20.0),
unit='ROTATION' unit='ROTATION'
) )
row_height: FloatProperty( row_height: FloatProperty(
name="Row Height", name="Row Height",
description="Height of each Row", description="Height of each Row",
min=0.05, #min=0.05,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.2 default=0.2
) )
skew: FloatProperty( skew: FloatProperty(
name="Skewness per Row", name="Skewness per Row",
description="Skew of each row", description="Skew of each row",
min=radians(-90.0), #min=radians(-90.0),
max=radians(90.0), #max=radians(90.0),
default=radians(11.25), default=radians(11.25),
unit='ROTATION' unit='ROTATION'
) )
crown: FloatProperty( crown: FloatProperty(
name="Crown", name="Crown",
description="Inward pointing extend of crown teeth", description="Inward pointing extend of crown teeth",
min=0.0, #min=0.0,
max=100.0, #max=100.0,
unit='LENGTH', unit='LENGTH',
default=0.0 default=0.0
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment