|
@@ -0,0 +1,44 @@
|
|
|
|
|
+import cadquery as cq
|
|
|
|
|
+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)
|
|
|
|
|
+# )
|
|
|
|
|
+
|
|
|
|
|
+# 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)
|
|
|
|
|
+
|
|
|
|
|
+extended = (
|
|
|
|
|
+ defaultSweep.faces(">X")
|
|
|
|
|
+ .extrude(10)
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
|
|
+# Translate the resulting solids so that they do not overlap and display them left to right
|
|
|
|
|
+show_object(extended)
|