def makeWheg( externRadius = 70): radiusCenterHole = 3 radiusCenterBody = 9 heightCenterBody = 6 widthSpoke = externRadius-radiusCenterBody lengthSpoke = widthSpoke/9 heightSpoke = 4 radiusScrew = 1 heightScrew = heightCenterBody #build the structure Wheg = Part.makeCylinder(radiusCenterBody,heightCenterBody) Wheg.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) #needed for fillet below, otherwise the edge29 of one spoke was too close to the edge of the cylinder... #cut the axis hole WhegAxis = Part.makeCylinder(radiusCenterHole,heightCenterBody) Wheg = Wheg.cut(WhegAxis) # add one spoke Spoke = Part.makeBox(lengthSpoke,widthSpoke,heightSpoke) Spoke.translate(Base.Vector(-lengthSpoke/2,radiusCenterBody-heightSpoke/2,0)) # duplicate each 120 degrees radius = 0 angle = 120 Spoke = rcopy.makeCopy(Spoke,radius,angle) Wheg = Wheg.fuse(Spoke) # For chamfer you need to know edges edge1=Wheg.Edges[1] edge4=Wheg.Edges[4] edge6=Wheg.Edges[6] edge8=Wheg.Edges[8] edge10=Wheg.Edges[10] edge14=Wheg.Edges[14] edge16=Wheg.Edges[16] edge28=Wheg.Edges[28] edge32=Wheg.Edges[32] edge35=Wheg.Edges[35] edge39=Wheg.Edges[39] edge42=Wheg.Edges[42] edge46=Wheg.Edges[46] Wheg=Wheg.makeFillet(1,[edge1]) Wheg=Wheg.makeFillet(7,[edge4,edge6,edge8,edge10,edge14,edge16]) Wheg=Wheg.makeFillet(lengthSpoke/2-0.1,[edge28,edge32,edge35,edge39,edge42,edge46]) # add one hole for the screw screw = Part.makeCylinder(radiusScrew,heightScrew) screw.translate(Base.Vector(0,3*radiusCenterBody/4,0)) # duplicate each 30 degrees radius = 0 angle = 360/12 screw = rcopy.makeCopy(screw,radius,angle) Wheg = Wheg.cut(screw) return Wheg
def makeWheel( externRadius = 70, test = 0): radiusCenterHole = 1.5 radiusCenterBody = 9 heightCenterBody = 4 radiusMountingPart = 4 lengthMountingPart = radiusCenterBody heightMountingPart = 5 thicknessTire = 5 widthTire = 4 widthSpoke = externRadius-radiusCenterBody lengthSpoke = widthSpoke/9 heightSpoke = widthTire radiusScrew = 1.5 heightScrew = radiusCenterBody lengthTeeth = 4 widthTeeth = lengthTeeth heightTeeth = widthTire #build the structure Wheel = Part.makeCylinder(radiusCenterBody,heightCenterBody) Wheel.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) #needed for fillet below, otherwise the edge29 of one spoke was too close to the edge of the cylinder... MountingPart = Part.makeCylinder(radiusMountingPart,heightMountingPart) MountingPart.translate(Base.Vector(0,0,heightCenterBody)) MountingPart2 = Part.makeBox(radiusCenterBody,radiusMountingPart*2,heightMountingPart) MountingPart2.translate(Base.Vector(0,-radiusMountingPart,heightCenterBody)) MountingPart2.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) MountingPart = MountingPart.fuse(MountingPart2) Wheel = Wheel.fuse(MountingPart) #cut the axis hole WheelAxis = Part.makeCylinder(radiusCenterHole,heightCenterBody+heightMountingPart) Wheel = Wheel.cut(WheelAxis) # add one hole for the screw screw = Part.makeCylinder(radiusScrew,heightScrew) screw.rotate(Base.Vector(0,0,0),Base.Vector(0,1,0),90) screw.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) screw.translate(Base.Vector(0,0,heightCenterBody+heightMountingPart/2)) Wheel = Wheel.cut(screw) # For chamfer you need to know edges edge1 = Wheel.Edges[1] edge5 = Wheel.Edges[5] edge25 = Wheel.Edges[25] edge27 = Wheel.Edges[27] edge8 = Wheel.Edges[test] Wheel=Wheel.makeFillet(1,[edge1,edge5,edge8,edge25,edge27]) # add one spoke Spoke = Part.makeBox(lengthSpoke,widthSpoke,heightSpoke) Spoke.translate(Base.Vector(-lengthSpoke/2,radiusCenterBody-heightSpoke/2,0)) # duplicate each 120 degrees radius = 0 angle = 120 Spoke = rcopy.makeCopy(Spoke,radius,angle) Wheel = Wheel.fuse(Spoke) #add the Tire of the wheel Tire = Part.makeCylinder(externRadius,widthTire) # cut the center part WheelCenter = Part.makeCylinder(externRadius-thicknessTire,widthTire) Tire = Tire.cut(WheelCenter) Wheel = Wheel.fuse(Tire) # For chamfer you need to know edges # edgeTest=Wheel.Edges[test] # edge19=Wheel.Edges[19] # edge21=Wheel.Edges[21] # edge25=Wheel.Edges[25] # edge30=Wheel.Edges[30] # edge33=Wheel.Edges[33] # edge50=Wheel.Edges[50] # edge57=Wheel.Edges[57] # edge75=Wheel.Edges[75] # edge80=Wheel.Edges[80] # edge81=Wheel.Edges[81] # edge85=Wheel.Edges[85] # edge86=Wheel.Edges[86] # edge89=Wheel.Edges[89] # edge90=Wheel.Edges[90] # # Wheel=Wheel.makeFillet(1,[edge19,edge21,edge25,edge30,edge50]) # Wheel=Wheel.makeFillet(5,[edge57,edge75,edge80,edge81,edge85,edge86,edge89,edge90]) #Wheel=Wheel.makeFillet(7,[edge80,edge84,edge87,edge91,edge93,edge96]) # add teeth Teeth = Part.makeBox(lengthTeeth,widthTeeth,heightTeeth) Teeth.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),45) Teeth.translate(Base.Vector(externRadius,widthTeeth/2,0)) # duplicate each 120 degrees radius = 0 angle = 10 Teeth = rcopy.makeCopy(Teeth,radius,angle) Wheel = Wheel.cut(Teeth) #add new joints return Wheel
def makeWheel( externRadius = 70): radiusCenterHole = 3 radiusCenterBody = 9 heightCenterBody = 6 thicknessTire = 5 widthTire = 4 widthSpoke = externRadius-radiusCenterBody lengthSpoke = widthSpoke/9 heightSpoke = widthTire radiusScrew = 1 heightScrew = heightCenterBody lengthTeeth = 4 widthTeeth = lengthTeeth heightTeeth = widthTire #build the structure Wheel = Part.makeCylinder(radiusCenterBody,heightCenterBody) Wheel.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) #needed for fillet below, otherwise the edge29 of one spoke was too close to the edge of the cylinder... #cut the axis hole WheelAxis = Part.makeCylinder(radiusCenterHole,heightCenterBody) Wheel = Wheel.cut(WheelAxis) # add one spoke Spoke = Part.makeBox(lengthSpoke,widthSpoke,heightSpoke) Spoke.translate(Base.Vector(-lengthSpoke/2,radiusCenterBody-heightSpoke/2,0)) # duplicate each 120 degrees radius = 0 angle = 120 Spoke = rcopy.makeCopy(Spoke,radius,angle) Wheel = Wheel.fuse(Spoke) # add one hole for the screw screw = Part.makeCylinder(radiusScrew,heightScrew) screw.translate(Base.Vector(0,3*radiusCenterBody/4,0)) # duplicate each 30 degrees radius = 0 angle = 30 screw = rcopy.makeCopy(screw,radius,angle) Wheel = Wheel.cut(screw) #add the Tire of the wheel Tire = Part.makeCylinder(externRadius,widthTire) # cut the center part WheelCenter = Part.makeCylinder(externRadius-thicknessTire,widthTire) Tire = Tire.cut(WheelCenter) Wheel = Wheel.fuse(Tire) # For chamfer you need to know edges edge56=Wheel.Edges[56] edge58=Wheel.Edges[58] edge59=Wheel.Edges[59] edge61=Wheel.Edges[61] edge63=Wheel.Edges[63] edge64=Wheel.Edges[64] edge66=Wheel.Edges[66] edge80=Wheel.Edges[80] edge84=Wheel.Edges[84] edge87=Wheel.Edges[87] edge91=Wheel.Edges[91] edge93=Wheel.Edges[93] edge96=Wheel.Edges[96] Wheel=Wheel.makeFillet(1,[edge63]) Wheel=Wheel.makeFillet(7,[edge56,edge58,edge59,edge61,edge64,edge66]) Wheel=Wheel.makeFillet(7,[edge80,edge84,edge87,edge91,edge93,edge96]) # add teeth Teeth = Part.makeBox(lengthTeeth,widthTeeth,heightTeeth) Teeth.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),45) Teeth.translate(Base.Vector(externRadius,widthTeeth/2,0)) # duplicate each 120 degrees radius = 0 angle = 10 Teeth = rcopy.makeCopy(Teeth,radius,angle) Wheel = Wheel.cut(Teeth) return Wheel
def makeWheg( externRadius = 70): radiusCenterHole = 1.5 radiusCenterBody = 9 heightCenterBody = 6 radiusMountingPart = 4 lengthMountingPart = radiusCenterBody heightMountingPart = 5 widthSpoke = externRadius-radiusCenterBody lengthSpoke = widthSpoke/9 heightSpoke = 4 radiusScrew = 1.5 #build the structure Wheg = Part.makeCylinder(radiusCenterBody,heightCenterBody) Wheg.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) #needed for fillet below, otherwise the edge29 of one spoke was too close to the edge of the cylinder... #cut the axis hole WhegAxis = Part.makeCylinder(radiusCenterHole,heightCenterBody) Wheg = Wheg.cut(WhegAxis) # add one spoke Spoke = Part.makeBox(lengthSpoke,widthSpoke,heightSpoke) Spoke.translate(Base.Vector(-lengthSpoke/2,radiusCenterBody-heightSpoke/2,0)) # duplicate each 120 degrees radius = 0 angle = 120 Spoke = rcopy.makeCopy(Spoke,radius,angle) Wheg = Wheg.fuse(Spoke) # For chamfer you need to know edges edge1=Wheg.Edges[1] edge4=Wheg.Edges[4] edge6=Wheg.Edges[6] edge8=Wheg.Edges[8] edge10=Wheg.Edges[10] edge14=Wheg.Edges[14] edge16=Wheg.Edges[16] edge28=Wheg.Edges[28] edge32=Wheg.Edges[32] edge35=Wheg.Edges[35] edge39=Wheg.Edges[39] edge42=Wheg.Edges[42] edge46=Wheg.Edges[46] Wheg=Wheg.makeFillet(1,[edge1]) Wheg=Wheg.makeFillet(7,[edge4,edge6,edge8,edge10,edge14,edge16]) Wheg=Wheg.makeFillet(lengthSpoke/2-0.1,[edge28,edge32,edge35,edge39,edge42,edge46]) #build the structure MountingPart = Part.makeCylinder(radiusMountingPart,heightMountingPart) MountingPart.translate(Base.Vector(0,0,heightCenterBody)) MountingPart2 = Part.makeBox(radiusCenterBody,radiusMountingPart*2,heightMountingPart) MountingPart2.translate(Base.Vector(0,-radiusMountingPart,heightCenterBody)) MountingPart2.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) MountingPart = MountingPart.fuse(MountingPart2) Wheg = Wheg.fuse(MountingPart) # add one hole for the screw screw = Part.makeCylinder(radiusScrew,radiusCenterBody) screw.rotate(Base.Vector(0,0,0),Base.Vector(0,1,0),90) screw.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),30) screw.translate(Base.Vector(0,0,heightCenterBody+heightMountingPart/2)) Wheg = Wheg.cut(screw) #cut the axis hole WhegAxisTop = Part.makeCylinder(radiusCenterHole,heightCenterBody) WhegAxisTop.translate(Base.Vector(0,0,heightCenterBody)) Wheg = Wheg.cut(WhegAxisTop) #fillet edge127=Wheg.Edges[127] edge128=Wheg.Edges[128] edge129=Wheg.Edges[129] edge130=Wheg.Edges[130] Wheg=Wheg.makeFillet(1,[edge127,edge128,edge129,edge130]) return Wheg
def makeWheel(externRadius=70, test=0): radiusCenterHole = 1.5 radiusCenterBody = 9 heightCenterBody = 4 radiusMountingPart = 4 lengthMountingPart = radiusCenterBody heightMountingPart = 5 thicknessTire = 5 widthTire = 4 widthSpoke = externRadius - radiusCenterBody lengthSpoke = widthSpoke / 9 heightSpoke = widthTire radiusScrew = 1.5 heightScrew = radiusCenterBody lengthTeeth = 4 widthTeeth = lengthTeeth heightTeeth = widthTire #build the structure Wheel = Part.makeCylinder(radiusCenterBody, heightCenterBody) Wheel.rotate( Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 30 ) #needed for fillet below, otherwise the edge29 of one spoke was too close to the edge of the cylinder... MountingPart = Part.makeCylinder(radiusMountingPart, heightMountingPart) MountingPart.translate(Base.Vector(0, 0, heightCenterBody)) MountingPart2 = Part.makeBox(radiusCenterBody, radiusMountingPart * 2, heightMountingPart) MountingPart2.translate( Base.Vector(0, -radiusMountingPart, heightCenterBody)) MountingPart2.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 30) MountingPart = MountingPart.fuse(MountingPart2) Wheel = Wheel.fuse(MountingPart) #cut the axis hole WheelAxis = Part.makeCylinder(radiusCenterHole, heightCenterBody + heightMountingPart) Wheel = Wheel.cut(WheelAxis) # add one hole for the screw screw = Part.makeCylinder(radiusScrew, heightScrew) screw.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 1, 0), 90) screw.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 30) screw.translate( Base.Vector(0, 0, heightCenterBody + heightMountingPart / 2)) Wheel = Wheel.cut(screw) # For chamfer you need to know edges edge1 = Wheel.Edges[1] edge5 = Wheel.Edges[5] edge25 = Wheel.Edges[25] edge27 = Wheel.Edges[27] edge8 = Wheel.Edges[test] Wheel = Wheel.makeFillet(1, [edge1, edge5, edge8, edge25, edge27]) # add one spoke Spoke = Part.makeBox(lengthSpoke, widthSpoke, heightSpoke) Spoke.translate( Base.Vector(-lengthSpoke / 2, radiusCenterBody - heightSpoke / 2, 0)) # duplicate each 120 degrees radius = 0 angle = 120 Spoke = rcopy.makeCopy(Spoke, radius, angle) Wheel = Wheel.fuse(Spoke) #add the Tire of the wheel Tire = Part.makeCylinder(externRadius, widthTire) # cut the center part WheelCenter = Part.makeCylinder(externRadius - thicknessTire, widthTire) Tire = Tire.cut(WheelCenter) Wheel = Wheel.fuse(Tire) # For chamfer you need to know edges # edgeTest=Wheel.Edges[test] # edge19=Wheel.Edges[19] # edge21=Wheel.Edges[21] # edge25=Wheel.Edges[25] # edge30=Wheel.Edges[30] # edge33=Wheel.Edges[33] # edge50=Wheel.Edges[50] # edge57=Wheel.Edges[57] # edge75=Wheel.Edges[75] # edge80=Wheel.Edges[80] # edge81=Wheel.Edges[81] # edge85=Wheel.Edges[85] # edge86=Wheel.Edges[86] # edge89=Wheel.Edges[89] # edge90=Wheel.Edges[90] # # Wheel=Wheel.makeFillet(1,[edge19,edge21,edge25,edge30,edge50]) # Wheel=Wheel.makeFillet(5,[edge57,edge75,edge80,edge81,edge85,edge86,edge89,edge90]) #Wheel=Wheel.makeFillet(7,[edge80,edge84,edge87,edge91,edge93,edge96]) # add teeth Teeth = Part.makeBox(lengthTeeth, widthTeeth, heightTeeth) Teeth.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 45) Teeth.translate(Base.Vector(externRadius, widthTeeth / 2, 0)) # duplicate each 120 degrees radius = 0 angle = 10 Teeth = rcopy.makeCopy(Teeth, radius, angle) Wheel = Wheel.cut(Teeth) #add new joints return Wheel
def makeWheg(externRadius=70): radiusCenterHole = 1.5 radiusCenterBody = 9 heightCenterBody = 6 radiusMountingPart = 4 lengthMountingPart = radiusCenterBody heightMountingPart = 5 widthSpoke = externRadius - radiusCenterBody lengthSpoke = widthSpoke / 9 heightSpoke = 4 radiusScrew = 1.5 #build the structure Wheg = Part.makeCylinder(radiusCenterBody, heightCenterBody) Wheg.rotate( Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 30 ) #needed for fillet below, otherwise the edge29 of one spoke was too close to the edge of the cylinder... #cut the axis hole WhegAxis = Part.makeCylinder(radiusCenterHole, heightCenterBody) Wheg = Wheg.cut(WhegAxis) # add one spoke Spoke = Part.makeBox(lengthSpoke, widthSpoke, heightSpoke) Spoke.translate( Base.Vector(-lengthSpoke / 2, radiusCenterBody - heightSpoke / 2, 0)) # duplicate each 120 degrees radius = 0 angle = 120 Spoke = rcopy.makeCopy(Spoke, radius, angle) Wheg = Wheg.fuse(Spoke) # For chamfer you need to know edges edge1 = Wheg.Edges[1] edge4 = Wheg.Edges[4] edge6 = Wheg.Edges[6] edge8 = Wheg.Edges[8] edge10 = Wheg.Edges[10] edge14 = Wheg.Edges[14] edge16 = Wheg.Edges[16] edge28 = Wheg.Edges[28] edge32 = Wheg.Edges[32] edge35 = Wheg.Edges[35] edge39 = Wheg.Edges[39] edge42 = Wheg.Edges[42] edge46 = Wheg.Edges[46] Wheg = Wheg.makeFillet(1, [edge1]) Wheg = Wheg.makeFillet(7, [edge4, edge6, edge8, edge10, edge14, edge16]) Wheg = Wheg.makeFillet(lengthSpoke / 2 - 0.1, [edge28, edge32, edge35, edge39, edge42, edge46]) #build the structure MountingPart = Part.makeCylinder(radiusMountingPart, heightMountingPart) MountingPart.translate(Base.Vector(0, 0, heightCenterBody)) MountingPart2 = Part.makeBox(radiusCenterBody, radiusMountingPart * 2, heightMountingPart) MountingPart2.translate( Base.Vector(0, -radiusMountingPart, heightCenterBody)) MountingPart2.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 30) MountingPart = MountingPart.fuse(MountingPart2) Wheg = Wheg.fuse(MountingPart) # add one hole for the screw screw = Part.makeCylinder(radiusScrew, radiusCenterBody) screw.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 1, 0), 90) screw.rotate(Base.Vector(0, 0, 0), Base.Vector(0, 0, 1), 30) screw.translate( Base.Vector(0, 0, heightCenterBody + heightMountingPart / 2)) Wheg = Wheg.cut(screw) #cut the axis hole WhegAxisTop = Part.makeCylinder(radiusCenterHole, heightCenterBody) WhegAxisTop.translate(Base.Vector(0, 0, heightCenterBody)) Wheg = Wheg.cut(WhegAxisTop) #fillet edge127 = Wheg.Edges[127] edge128 = Wheg.Edges[128] edge129 = Wheg.Edges[129] edge130 = Wheg.Edges[130] Wheg = Wheg.makeFillet(1, [edge127, edge128, edge129, edge130]) return Wheg