| 12345678910111213141516171819202122232425262728 |
- import cadquery as cq
- from cadquery.occ_impl.exporters import *
- from ocp_vscode import show
- width = 60
- depth = 159
- thick = 2
- angle_deg = 1
- hole_length = 79
- hole_width = 43.5
- hole_diam = 6
- result = (
- cq.Workplane("XY")
- .workplane(centerOption="CenterOfBoundBox")
- .rect(depth,width)
- .workplane(offset=thick)
- .transformed(rotate=(0, angle_deg, 0))
- .rect(depth,width)
- .loft()
- )
- result = result.faces("<Z").workplane().rect(hole_length, hole_width,forConstruction=True).vertices().circle(hole_diam/2).cutThruAll()
- show(result)
- # export the box as a STEP file
- with open("/home/sgruen/Dokumente/cadquery/vise_angle.step", "w") as fp:
- cq.exporters.exportShape(result, ExportTypes.STEP, fp)
|