Skip to content

Instantly share code, notes, and snippets.

@yschimke
Created August 27, 2024 20:57
Show Gist options
  • Save yschimke/56c34bc749f07578ce64fc655b43ba7a to your computer and use it in GitHub Desktop.
Save yschimke/56c34bc749f07578ce64fc655b43ba7a to your computer and use it in GitHub Desktop.
from cqgridfinity import *
import cadquery as cq
from ocp_vscode import show_object
FRONT_SURFACE_TAG = "front_surface"
# make a simple box
box = GridfinityBox(4, 4, 10.2, solid=True, solid_ratio=1.0, holes=True, unsupported_holes=True)
posca_box: cq.Workplane = box.cq_obj
posca_box.faces("<X[1]").workplane().tag(FRONT_SURFACE_TAG)
dh = 15
dw = 15
l = 167
for y in range(0, 4):
for x in range(-4, 6):
posca_box = (
posca_box.workplaneFromTagged(FRONT_SURFACE_TAG)
.transformed(offset=cq.Vector(x * (dw + 1) - 8, 19 + (y * (dh + 1)), -5))
.rect(dw, dh)
.cutBlind(l)
)
show_object(posca_box)
cq.exporters.export(posca_box, 'faber_castell_box.stl')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment