diff --git a/planter.py b/planter.py index 87e4f76..2b1c8d0 100644 --- a/planter.py +++ b/planter.py @@ -1,5 +1,4 @@ from cadquery import exporters -from cq_warehouse.bearing import SingleRowDeepGrooveBallBearing from cq_warehouse.extensions import Workplane from cq_warehouse.fastener import * from cq_warehouse.thread import * diff --git a/threaded_tool_holder.py b/threaded_tool_holder.py index 8c2e874..d7bdc31 100644 --- a/threaded_tool_holder.py +++ b/threaded_tool_holder.py @@ -1,29 +1,51 @@ -import cadquery as cq -from cq_warehouse.fastener import SocketHeadCapScrew -from cq_warehouse.bearing import SingleRowDeepGrooveBallBearing -from cq_warehouse.thread import * -from cq_warehouse.fastener import * +from cadquery import exporters from cq_warehouse.extensions import Workplane -from random import randint, choice -import functools as fnc -import itertools as it +from cq_warehouse.fastener import * +from cq_warehouse.thread import * +from cqmore.polygon import regularPolygon, star +import cadquery as cq +import cqmore + +bottom_radius = 70 + +Workplane = cqmore.extend(Workplane) -# must be 17 mm wide -# gap must be at least 4 mm +simple = False -pole_length = 50*MM +screw = ButtonHeadScrew( + size="M8-1.25", fastener_type="iso7380_1", length=32 * MM, simple=simple +) -plate = ( - cq.Workplane() - .circle(8) - .extrude(pole_length) +nut_result = ( + Workplane() + .makePolygon(star(outerRadius=bottom_radius / 4.5, innerRadius=13, n=8)) + .extrude(10) ) -simple = False -screw = HexHeadScrew("M8-1.25", length=pole_length/2, fastener_type="din931", simple=simple) -threaded_hole = plate.faces(">Z[1]").threadedHole(screw, pole_length/2, simple=simple, fit="Loose") -show_object(threaded_hole) +scaled_screw = screw.scale(0.84) + +screw_result = ( + Workplane() + .makePolygon(star(outerRadius=bottom_radius / 4.5, innerRadius=13, n=8)) + .extrude(8) + .union(scaled_screw) +) + +nut_result = nut_result.workplane(offset=9.4).threadedHole( + screw, 13, simple=simple +) + +box = Workplane().box(190, 100, 100) +box = box.workplane(offset=0).move(10, 0).box(190, 90, 90, combine="cut") +box = box.workplane(offset=0).move(50, 0).hole(7) -cq.exporters.export(threaded_hole, "/home/deck/cad_files/threaded_tool_holder.step") -cq.exporters.export(screw, "/home/deck/cad_files/threaded_tool_holder_screw.step") +try: + #show_object(screw_result) + #show_object(box) + show_object(nut_result) +except NameError: + pass +cq.exporters.export(screw_result, "/home/deck/model_files/threaded_tool_holder_screw.step") +cq.exporters.export(nut_result, "/home/deck/model_files/threaded_tool_holder_nut.step") +cq.exporters.export(box, "/home/deck/model_files/threaded_tool_holder_box.step") diff --git a/xmas_coaster.py b/xmas_coaster.py index 01e0964..65815d1 100755 --- a/xmas_coaster.py +++ b/xmas_coaster.py @@ -65,7 +65,7 @@ result = (polygon.workplane() 10, 40, clean=True, combine="cut", - fontPath="/home/wes/TiltNeon-Regular-VariableFont_XROT,YROT.ttf") + fontPath="/home/wes/fonts/TiltNeon-Regular-VariableFont_XROT,YROT.ttf") )