Compare commits
10 Commits
4848be0288
...
4e971c8ebf
Author | SHA1 | Date |
---|---|---|
|
4e971c8ebf | 10 months ago |
|
3017f10d28 | 10 months ago |
|
05c23ab3a4 | 10 months ago |
|
b0bba2bd9d | 10 months ago |
|
6ace2b0828 | 10 months ago |
|
44bd3087ed | 10 months ago |
|
e28f128e86 | 10 months ago |
|
fd7f45b8a8 | 10 months ago |
|
5fe1ae9995 | 10 months ago |
|
1ec3a1cf33 | 10 months ago |
23 changed files with 871 additions and 273 deletions
@ -1,4 +1,7 @@ |
|||||
*swp |
*swp |
||||
*step |
*step |
||||
*3mf |
*3mf |
||||
|
*otf |
||||
|
*ttf |
||||
|
*TTF |
||||
|
__pycache__ |
||||
|
@ -0,0 +1,177 @@ |
|||||
|
from cadquery import exporters |
||||
|
from cq_warehouse.extensions import Workplane |
||||
|
from cq_warehouse.fastener import * |
||||
|
from cq_warehouse.thread import * |
||||
|
from cqmore.curve import archimedeanSpiral, circle |
||||
|
from cqmore.polygon import regularPolygon, star |
||||
|
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid |
||||
|
from svg_path import addSvgPath |
||||
|
from svgpathtools import svg2paths |
||||
|
import cadquery as cq |
||||
|
import cqmore |
||||
|
|
||||
|
Workplane = cqmore.extend(Workplane) |
||||
|
Workplane.addSvgPath = addSvgPath |
||||
|
|
||||
|
# wk_paths, wk_attributes = svg2paths( |
||||
|
# "/home/deck/cad_files/svgs/wk_edited.svg" |
||||
|
# ) |
||||
|
|
||||
|
inner_radius = 5 |
||||
|
outer_radius = 7 |
||||
|
thickness = 3.5 |
||||
|
|
||||
|
rivet_inner_radius = 2 |
||||
|
rivet_outer_radius = 3.5 |
||||
|
rivet_thickness = 3 |
||||
|
|
||||
|
belt_width = 39 |
||||
|
loop_thickness = 1.83 |
||||
|
loop_side_thickness = 5 |
||||
|
loop_height = 11.5 + loop_thickness |
||||
|
loop_width = 25 |
||||
|
loop_length = belt_width + loop_side_thickness |
||||
|
|
||||
|
slide_width_bottom = loop_side_thickness - 3 |
||||
|
slide_width_top = loop_side_thickness - 4 |
||||
|
|
||||
|
logo = Workplane().circle(outer_radius).extrude(thickness) |
||||
|
logo = logo.faces(">Z[0]").circle(inner_radius + 0.9).extrude(thickness, combine="cut") |
||||
|
logo = logo.faces(">Z[0]").circle(inner_radius).extrude(thickness) |
||||
|
logo = ( |
||||
|
logo.faces(">Z[1]") |
||||
|
.center(0, 0) |
||||
|
.cylinder(thickness + 2, inner_radius - 1, combine="cut") |
||||
|
) |
||||
|
logo = ( |
||||
|
logo.workplane(offset=1.0) |
||||
|
.circle(outer_radius + 4) |
||||
|
.extrude(1) |
||||
|
.workplane(offset=0.5) |
||||
|
.text("WK", 10, 0.8, combine="cut") |
||||
|
) |
||||
|
|
||||
|
# wk = Workplane("XY").center(0, 0).addSvgPath(wk_paths[0]).extrude(-2.0) |
||||
|
|
||||
|
# logo = logo.union(wk, clean=False) |
||||
|
|
||||
|
logo_outer = Workplane().circle(inner_radius + 1).extrude(thickness) |
||||
|
logo_outer = ( |
||||
|
logo_outer.faces(">Z[0]").circle(inner_radius).extrude(thickness, combine="cut") |
||||
|
) |
||||
|
logo_outer = logo_outer.workplane(offset=1.0).circle(outer_radius + 4).extrude(1) |
||||
|
cq.exporters.export(logo, "/home/deck/model_files/belt_hole_inner.step") |
||||
|
cq.exporters.export(logo_outer, "/home/deck/model_files/belt_hole_outer.step") |
||||
|
|
||||
|
rivet = Workplane().circle(rivet_outer_radius).extrude(rivet_thickness) |
||||
|
rivet = ( |
||||
|
rivet.faces(">Z[0]") |
||||
|
.circle(rivet_inner_radius + 1.10) |
||||
|
.extrude(rivet_thickness, combine="cut") |
||||
|
) |
||||
|
rivet = rivet.faces(">Z[0]").circle(rivet_inner_radius - 0.15).extrude(rivet_thickness) |
||||
|
rivet = ( |
||||
|
rivet.faces(">Z[1]") |
||||
|
.center(0, 0) |
||||
|
.cylinder(rivet_thickness + 2, rivet_inner_radius - 1, combine="cut") |
||||
|
) |
||||
|
rivet = rivet.workplane(offset=1.0).circle(rivet_outer_radius + 1).extrude(1) |
||||
|
|
||||
|
rivet_outer = Workplane().circle(rivet_inner_radius + 0.4).extrude(rivet_thickness) |
||||
|
rivet_outer = ( |
||||
|
rivet_outer.faces(">Z[0]") |
||||
|
.circle(rivet_inner_radius) |
||||
|
.extrude(rivet_thickness, combine="cut") |
||||
|
) |
||||
|
rivet_outer = ( |
||||
|
rivet_outer.workplane(offset=1.0).circle(rivet_outer_radius + 1).extrude(1) |
||||
|
) |
||||
|
|
||||
|
loop = Workplane().box(loop_length, loop_width, loop_height) |
||||
|
loop_cut = Workplane().box( |
||||
|
loop_length - loop_thickness - loop_side_thickness, |
||||
|
loop_width, |
||||
|
loop_height - loop_thickness, |
||||
|
) |
||||
|
loop = loop.cut(loop_cut) |
||||
|
|
||||
|
loop_top = loop.faces(">Z[0]").workplane(offset=-1.8).split(keepTop=True) |
||||
|
loop_bottom = loop.faces(">Z[0]").workplane(offset=-1).split(keepBottom=True) |
||||
|
|
||||
|
slide_bottom_cut_left = ( |
||||
|
Workplane() |
||||
|
.move(-((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_bottom, loop_width, 2) |
||||
|
) |
||||
|
slide_bottom_cut_right = ( |
||||
|
Workplane() |
||||
|
.move(((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_bottom, loop_width, 2) |
||||
|
) |
||||
|
slide_top_cut_left = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=-2.8) |
||||
|
.move(-((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_top, loop_width, loop_height / 2) |
||||
|
) |
||||
|
slide_top_cut_right = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=-2.8) |
||||
|
.move(((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_top, loop_width, loop_height / 2) |
||||
|
) |
||||
|
|
||||
|
slide_bottom_union_left = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=1) |
||||
|
.move(-((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_bottom - 0.3, loop_width, 1.8) |
||||
|
) |
||||
|
slide_bottom_union_right = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=1) |
||||
|
.move(((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_bottom - 0.3, loop_width, 1.8) |
||||
|
) |
||||
|
slide_top_union_left = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=-1.8) |
||||
|
.move(-((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_top, loop_width, loop_height / 2) |
||||
|
) |
||||
|
slide_top_union_right = ( |
||||
|
Workplane() |
||||
|
.workplane(offset=-1.8) |
||||
|
.move(((loop_length / 2) - loop_thickness), 0) |
||||
|
.box(slide_width_top, loop_width, loop_height / 2) |
||||
|
) |
||||
|
|
||||
|
loop_bottom = loop_bottom.cut(slide_bottom_cut_left) |
||||
|
loop_bottom = loop_bottom.cut(slide_bottom_cut_right) |
||||
|
loop_bottom = loop_bottom.cut(slide_top_cut_left) |
||||
|
loop_bottom = loop_bottom.cut(slide_top_cut_right) |
||||
|
|
||||
|
loop_top = loop_top.union(slide_bottom_union_left) |
||||
|
loop_top = loop_top.union(slide_bottom_union_right) |
||||
|
loop_top = loop_top.union(slide_top_union_left) |
||||
|
loop_top = loop_top.union(slide_top_union_right) |
||||
|
|
||||
|
loop_top = ( |
||||
|
loop_top.faces(">Z[0]") |
||||
|
.rect(loop_width, loop_height, forConstruction=True) |
||||
|
.vertices() |
||||
|
.hole((rivet_outer_radius * 2) + 1) |
||||
|
) |
||||
|
|
||||
|
cq.exporters.export(rivet, "/home/deck/model_files/rivet_inner.step") |
||||
|
cq.exporters.export(rivet_outer, "/home/deck/model_files/rivet_outer.step") |
||||
|
cq.exporters.export(loop_bottom, "/home/deck/model_files/loop_bottom.step") |
||||
|
cq.exporters.export(loop_top, "/home/deck/model_files/loop_top.step") |
||||
|
|
||||
|
try: |
||||
|
show_object(rivet_outer) |
||||
|
# show_object(rivet) |
||||
|
# show_object(loop_bottom) |
||||
|
# show_object(loop_top) |
||||
|
except NameError: |
||||
|
pass |
@ -0,0 +1,17 @@ |
|||||
|
from cadquery import exporters |
||||
|
from cq_warehouse.extensions import Workplane |
||||
|
from cq_warehouse.fastener import * |
||||
|
from cq_warehouse.thread import * |
||||
|
from cqmore.curve import archimedeanSpiral, circle |
||||
|
from cqmore.polygon import regularPolygon, star |
||||
|
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid |
||||
|
from svg_path import addSvgPath |
||||
|
from svgpathtools import svg2paths |
||||
|
import cadquery as cq |
||||
|
import cqmore |
||||
|
|
||||
|
xps_height = 200 |
||||
|
xps_width = 300 |
||||
|
xps_thickness = 10 |
||||
|
|
||||
|
pb_width = 330 |
@ -0,0 +1,88 @@ |
|||||
|
from cadquery import exporters |
||||
|
from cq_warehouse.extensions import Workplane |
||||
|
from cq_warehouse.fastener import * |
||||
|
from cq_warehouse.thread import * |
||||
|
from cqmore.curve import archimedeanSpiral, circle |
||||
|
from cqmore.polygon import regularPolygon, star |
||||
|
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid |
||||
|
from svg_path import addSvgPath |
||||
|
from svgpathtools import svg2paths |
||||
|
import cadquery as cq |
||||
|
import cqmore |
||||
|
from cq_gears import ( |
||||
|
SpurGear, |
||||
|
Worm, |
||||
|
HerringboneGear, |
||||
|
RackGear, |
||||
|
HerringboneRackGear, |
||||
|
BevelGear, |
||||
|
BevelGearPair, |
||||
|
) |
||||
|
|
||||
|
turn_width = 5 |
||||
|
turn_length = 150 |
||||
|
turn_height = 45 |
||||
|
|
||||
|
servo_diameter = 4.6 |
||||
|
servo_height = 12 |
||||
|
|
||||
|
screw_diameter = 3.2 |
||||
|
screw_head_diameter = 5.6 |
||||
|
|
||||
|
spur_gear = SpurGear(module=1.0, teeth_number=19, width=5.0, bore_d=5.0) |
||||
|
|
||||
|
drive_result = cq.Workplane("XY").gear(spur_gear) |
||||
|
|
||||
|
drive_result = drive_result.cylinder(turn_length, turn_width) |
||||
|
|
||||
|
turn_shaft_height = 10 |
||||
|
turn_shaft_width = 8 |
||||
|
|
||||
|
turn_result = cq.Workplane("XY").box(turn_length, turn_height, turn_width) |
||||
|
|
||||
|
turn_result = ( |
||||
|
turn_result.faces(">Z[0]") |
||||
|
.workplane() |
||||
|
.move(-(turn_length / 3.5), 0) |
||||
|
.rect( |
||||
|
32.2 - (screw_head_diameter * 2) + 4, |
||||
|
37.9 - (screw_head_diameter * 2) + 4, |
||||
|
forConstruction=True, |
||||
|
) |
||||
|
.vertices() |
||||
|
.cskHole(screw_diameter, screw_head_diameter, 83, depth=None) |
||||
|
) |
||||
|
|
||||
|
turn_result = ( |
||||
|
turn_result.faces(">Z[0]") |
||||
|
.workplane() |
||||
|
.move((turn_length / 3.5), 0) |
||||
|
.rect( |
||||
|
32.2 - (screw_head_diameter * 2) + 4, |
||||
|
37.9 - (screw_head_diameter * 2) + 4, |
||||
|
forConstruction=True, |
||||
|
) |
||||
|
.vertices() |
||||
|
.cskHole(screw_diameter, screw_head_diameter, 83, depth=None) |
||||
|
) |
||||
|
|
||||
|
turn_result = ( |
||||
|
turn_result.faces(">Z[0]") |
||||
|
.workplane(offset=5) |
||||
|
.center(0, 0) |
||||
|
.cylinder(turn_shaft_height, turn_shaft_width / 2) |
||||
|
) |
||||
|
|
||||
|
turn_result = ( |
||||
|
turn_result.faces(">Z[1]") |
||||
|
.workplane(offset=(turn_shaft_height - (servo_height / 2))) |
||||
|
.center(0, 0) |
||||
|
.cylinder(servo_height, servo_diameter / 2, combine="cut") |
||||
|
) |
||||
|
|
||||
|
try: |
||||
|
show_object(turn_result) |
||||
|
except NameError: |
||||
|
pass |
||||
|
|
||||
|
cq.exporters.export(turn_result, "/home/deck/model_files/robot_turn_part.step") |
@ -0,0 +1,49 @@ |
|||||
|
from cadquery import exporters |
||||
|
from cq_warehouse.extensions import Workplane |
||||
|
from cq_warehouse.fastener import * |
||||
|
from cq_warehouse.thread import * |
||||
|
from cqmore.polygon import regularPolygon, star |
||||
|
import cadquery as cq |
||||
|
import cqmore |
||||
|
|
||||
|
bottom_radius = 5 |
||||
|
|
||||
|
inner_screw_nsides = 6 |
||||
|
|
||||
|
Workplane = cqmore.extend(Workplane) |
||||
|
|
||||
|
simple = False |
||||
|
|
||||
|
screw = ButtonHeadScrew( |
||||
|
size="M4-0.7", fastener_type="iso7380_1", length=10 * MM, simple=simple |
||||
|
) |
||||
|
|
||||
|
nut_result = ( |
||||
|
Workplane() |
||||
|
.makePolygon(star(outerRadius=bottom_radius, innerRadius=bottom_radius, n=8)) |
||||
|
.extrude(5) |
||||
|
) |
||||
|
|
||||
|
scaled_screw = screw.scale(1.01) |
||||
|
|
||||
|
screw_result = ( |
||||
|
Workplane() |
||||
|
# .makePolygon(star(outerRadius=bottom_radius, innerRadius=13, n=8)) |
||||
|
# .extrude(8) |
||||
|
.union(scaled_screw) |
||||
|
) |
||||
|
|
||||
|
nut_result = nut_result.workplane(offset=3).threadedHole(screw, 5.5, 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) |
||||
|
|
||||
|
try: |
||||
|
show_object(scaled_screw) |
||||
|
# show_object(box) |
||||
|
# show_object(nut_result) |
||||
|
except NameError: |
||||
|
pass |
||||
|
|
||||
|
cq.exporters.export(screw_result, "/home/deck/model_files/robot_turn_part.step") |
After Width: | Height: | Size: 407 B |
@ -0,0 +1,120 @@ |
|||||
|
from cadquery import exporters |
||||
|
from cq_warehouse.extensions import Workplane |
||||
|
from cq_warehouse.fastener import * |
||||
|
from cq_warehouse.thread import * |
||||
|
from cqmore.curve import archimedeanSpiral, circle |
||||
|
from cqmore.polygon import regularPolygon, star |
||||
|
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid |
||||
|
from svg_path import addSvgPath |
||||
|
from svgpathtools import svg2paths |
||||
|
import cadquery as cq |
||||
|
import cqmore |
||||
|
|
||||
|
base_diameter = 100 |
||||
|
base_radius = base_diameter / 2 |
||||
|
|
||||
|
stand_diameter = 38 |
||||
|
stand_radius = stand_diameter / 1.5 |
||||
|
|
||||
|
clock_diameter = 35 |
||||
|
clock_radius = clock_diameter / 2 |
||||
|
|
||||
|
winding_knob_dist = clock_radius |
||||
|
band_width = 21 |
||||
|
|
||||
|
band_diameter = 55 |
||||
|
band_radius = band_diameter / 2 |
||||
|
|
||||
|
first_circle_height = 175 # how tall the horizontal circle part will be |
||||
|
|
||||
|
Workplane = cqmore.extend(Workplane) |
||||
|
Workplane.addSvgPath = addSvgPath |
||||
|
|
||||
|
stand_base = Workplane("ZY") |
||||
|
holder_part = Workplane("XY") |
||||
|
|
||||
|
simple = False |
||||
|
|
||||
|
screw = ButtonHeadScrew( |
||||
|
size="M16-2", fastener_type="iso7380_1", length=20 * MM, simple=simple |
||||
|
) |
||||
|
|
||||
|
thread_scaled_screw = screw.scale(0.5) |
||||
|
scaled_screw = screw.scale(1.00) |
||||
|
small_scaled_screw = scaled_screw.scale(0.5) |
||||
|
|
||||
|
stand_base = stand_base.cylinder(first_circle_height, stand_radius) |
||||
|
|
||||
|
stand_base = ( |
||||
|
stand_base.workplane(offset=-70) |
||||
|
.move(0, 21) |
||||
|
.box(20, 25, 20) |
||||
|
.workplane(offset=-69) |
||||
|
.transformed((90, 0, 0), (0, 0, 0)) |
||||
|
.threadedHole(screw, 34, simple=simple, fit="Loose") |
||||
|
) |
||||
|
|
||||
|
stand_base = stand_base.faces(">X[0]").sphere(base_radius*1.5) |
||||
|
stand_base = stand_base.workplane(offset=base_radius*2).box( |
||||
|
base_diameter * 2, base_radius * 3, base_radius * 3, combine="cut" |
||||
|
) |
||||
|
|
||||
|
stand_base = ( |
||||
|
stand_base.workplane(offset=base_radius - 5) |
||||
|
.rect(base_radius*1.5, base_radius*1.5, forConstruction=True) |
||||
|
.vertices() |
||||
|
.cylinder(9, 6, combine="cut") |
||||
|
) |
||||
|
|
||||
|
holder_angle_offset = 67 |
||||
|
|
||||
|
clock_paths, clock_attributes = svg2paths("/home/deck/cad_files/svgs/clock.svg") |
||||
|
|
||||
|
svgs_to_render = [(clock_paths, (-50, -125, 46), "cut", "XY")] |
||||
|
|
||||
|
holder_part = ( |
||||
|
holder_part.workplane(offset=2) |
||||
|
.makePolygon( |
||||
|
regularPolygon( |
||||
|
nSides=12, |
||||
|
radius=band_radius, |
||||
|
thetaStart=holder_angle_offset, |
||||
|
thetaEnd=360 + holder_angle_offset, |
||||
|
) |
||||
|
) |
||||
|
.extrude(band_width) |
||||
|
) |
||||
|
|
||||
|
holder_part = holder_part.faces(">Z[0]").cylinder(5, 8).union(small_scaled_screw) |
||||
|
|
||||
|
if True: |
||||
|
image_objects = [] |
||||
|
for svg_paths, translate_offsets, combine, planes in svgs_to_render: |
||||
|
image_objects.append( |
||||
|
Workplane(planes) |
||||
|
.center(0, 75) |
||||
|
.addSvgPath(svg_paths[0]) |
||||
|
.extrude(-2.0) |
||||
|
.translate(translate_offsets) |
||||
|
) |
||||
|
|
||||
|
for image_object in image_objects: |
||||
|
image_object = image_object.val().scale(0.5) |
||||
|
if combine == "cut": |
||||
|
holder_part = holder_part.cut(image_object, clean=False) |
||||
|
if combine == "union": |
||||
|
holder_part = holder_part.union(image_object, clean=False) |
||||
|
|
||||
|
cq.exporters.export(stand_base, "/home/deck/model_files/watch_stand_base.step") |
||||
|
cq.exporters.export(scaled_screw, "/home/deck/model_files/watch_stand_screw.step") |
||||
|
cq.exporters.export( |
||||
|
small_scaled_screw, "/home/deck/model_files/watch_stand_screw_small.step" |
||||
|
) |
||||
|
cq.exporters.export(holder_part, "/home/deck/model_files/watch_stand_holder.step") |
||||
|
|
||||
|
try: |
||||
|
show_object(stand_base) |
||||
|
# show_object(cut_polygon) |
||||
|
#show_object(holder_part) |
||||
|
except NameError: |
||||
|
pass |
@ -0,0 +1,26 @@ |
|||||
|
from cadquery import exporters |
||||
|
from cq_warehouse.extensions import Workplane |
||||
|
from cq_warehouse.fastener import * |
||||
|
from cq_warehouse.thread import * |
||||
|
from cqmore.curve import archimedeanSpiral, circle |
||||
|
from cqmore.polygon import regularPolygon, star |
||||
|
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid |
||||
|
from svg_path import addSvgPath |
||||
|
from svgpathtools import svg2paths |
||||
|
import cadquery as cq |
||||
|
import cqmore |
||||
|
|
||||
|
Workplane = cqmore.extend(Workplane) |
||||
|
|
||||
|
result = ( |
||||
|
Workplane() |
||||
|
.makePolygon(regularPolygon(nSides=3, radius=35, thetaStart=0, thetaEnd=360)) |
||||
|
.extrude(50) |
||||
|
) |
||||
|
|
||||
|
try: |
||||
|
show_object(result) |
||||
|
except NameError: |
||||
|
pass |
||||
|
|
||||
|
cq.exporters.export(result, "/home/deck/model_files/webcam_stand.step") |
Loading…
Reference in new issue