|
|
@@ -3,42 +3,52 @@ from cadquery.occ_impl.exporters import ExportTypes
|
|
|
|
|
|
from ocp_vscode import show, show_object
|
|
|
|
|
|
-x = 2
|
|
|
-y = 1
|
|
|
-t = 0.1
|
|
|
-
|
|
|
-path = cq.Workplane("XZ").moveTo(0, 0).lineTo(6, 0)
|
|
|
-
|
|
|
-# base_shape = (
|
|
|
-# cq.Sketch()
|
|
|
-# .rect(4, 4)
|
|
|
-# .vertices()
|
|
|
-# .fillet(0.25)
|
|
|
-# )
|
|
|
+twist_dist = 150
|
|
|
+shift = 50
|
|
|
+down_shift = 10
|
|
|
+height = 25
|
|
|
+width = 70
|
|
|
+thickness = 1
|
|
|
+adapter_legth = 25
|
|
|
+stopper_cut_length=20
|
|
|
+eps=0.1
|
|
|
|
|
|
# Sweep a circle from diameter 2.0 to diameter 1.0 to diameter 2.0 along X axis length 10.0 + 10.0
|
|
|
-defaultSweep = (
|
|
|
- cq.Workplane("YZ")
|
|
|
- .rect(x,y)
|
|
|
- .workplane(offset=2.0)
|
|
|
- .center(1,0)
|
|
|
- .transformed(rotate=(0, 0, 30))
|
|
|
- .rect(x,y)
|
|
|
- .workplane(offset=2.0)
|
|
|
- .center(1,0)
|
|
|
- .transformed(rotate=(0, 0, 30))
|
|
|
- .rect(x,y)
|
|
|
- .workplane(offset=2.0)
|
|
|
- .center(1,0)
|
|
|
- .transformed(rotate=(0, 0, 30))
|
|
|
- .rect(x,y)
|
|
|
- .sweep(path, multisection=True, isFrenet=False)
|
|
|
-).edges("not <X or >X").fillet(0.2)
|
|
|
+sweep = (
|
|
|
+ cq.Workplane("ZX")
|
|
|
+ .rect(height,width)
|
|
|
+ .workplane(offset=twist_dist/3)
|
|
|
+ .center(-down_shift/3, shift/3)
|
|
|
+ .transformed(rotate=(-30, 0, 0))
|
|
|
+ .rect(height,width)
|
|
|
+ .workplane(offset=twist_dist/3)
|
|
|
+ .center(-down_shift/3, shift/3)
|
|
|
+ .transformed(rotate=(-30, 0, 0))
|
|
|
+ .rect(height,width)
|
|
|
+ .workplane(offset=twist_dist/3)
|
|
|
+ .center(-down_shift/3, shift/3)
|
|
|
+ .transformed(rotate=(-30, 0, 0))
|
|
|
+ .rect(height,width)
|
|
|
+ .loft()
|
|
|
+).faces("<Y or >X").shell(thickness)
|
|
|
|
|
|
extended = (
|
|
|
- defaultSweep.faces(">X")
|
|
|
- .extrude(10)
|
|
|
+ sweep.faces(">X")
|
|
|
+ .extrude(adapter_legth,combine=False)
|
|
|
+
|
|
|
)
|
|
|
+cutextendedtop = extended.faces(">Z").workplane(centerOption="CenterOfBoundBox").rect(adapter_legth,width).cutBlind(until=-thickness-eps)
|
|
|
+stopper_wall=cutextendedtop.faces(">X").workplane(centerOption="CenterOfBoundBox").box(width+2*thickness,adapter_legth+2*thickness,thickness,combine=False).edges("|X").fillet(thickness)
|
|
|
+stopper_wall=cutextendedtop.union(stopper_wall)
|
|
|
+cutout=stopper_wall.faces(">X").workplane(centerOption="CenterOfBoundBox").rect(width-stopper_cut_length,adapter_legth+2*thickness).cutBlind(-thickness-eps)
|
|
|
|
|
|
+extended_cut=cutout.faces(">Y").workplane(centerOption="CenterOfBoundBox").circle(10).cutBlind(until=-80)
|
|
|
# Translate the resulting solids so that they do not overlap and display them left to right
|
|
|
-show_object(extended)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+show_object(extended_cut)
|
|
|
+
|
|
|
+
|
|
|
+with open(r"cadquery_files/cell_measure_robot/feeder.step", "w") as fp:
|
|
|
+ cq.exporters.exportShape(extended, ExportTypes.STEP, fp)
|