Skip to content

Commit

Permalink
Shameful attempt to hack this into a solder spool holder
Browse files Browse the repository at this point in the history
The library needed a little editing in order to render just the base.

I note that doing this from the grounds up probably would have been
easier, but I'm just really lazy.

Ref michaelgale#17
  • Loading branch information
mmalecki committed Jan 23, 2025
1 parent 4655acd commit 55f4b55
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions cqgridfinity/gf_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def render_shell(self, as_solid=False):
.translate((*self.half_dim, 0.5))
)
rc = rc.intersect(r).union(rw)
return rc
if not as_solid:
return rc.cut(self.interior_solid)
return rc
Expand Down Expand Up @@ -479,3 +480,40 @@ class GridfinitySolidBox(GridfinityBox):

def __init__(self, length_u, width_u, height_u, **kwargs):
super().__init__(length_u, width_u, height_u, **kwargs, solid=True)


box = GridfinityBox(
length_u=1,
width_u=1,
height_u=0,
holes = True,
)
b = box.render()

wallT = 4
bearingT = 7
bearingOD = 22
h = 62.5

solderGuideID = 1.75
solderGuideT = box.outer_rad - GR_TOL/2
solderGuideL = GRU / 2 + solderGuideID / 2 + solderGuideID

b = b.faces(">Z").workplane().tag("top").end()
b = b.workplaneFromTagged("top").move(GRU / 2 - wallT / 2 - GR_TOL / 2,0).rect(wallT, GRU - 2 * box.outer_rad).extrude(h)
b = b.faces(">Z").edges("|X").fillet(GRU / 3)
b = b.faces("<X[2]").workplane(centerOption="CenterOfBoundBox").move(0, h / 2 - bearingOD / 2 - wallT).cylinder(bearingT, bearingOD / 2 + wallT)
b = b.faces("<X[3]").workplane(centerOption="CenterOfBoundBox").hole(bearingOD)

if solderGuideID != 0.0:
b = b.workplaneFromTagged("top").move((GRU - solderGuideL) / 2 - GR_TOL / 2, GRU / 2 - solderGuideT / 2 - GR_TOL / 2).rect(solderGuideL, solderGuideT).extrude(solderGuideID * 3)

b = (b.edges(">>Y and >>X").fillet(box.outer_rad))
b = b.faces(">Y").workplane(centerOption="CenterOfBoundBox").move(0,-(box.bin_height + GR_BASE_CLR) / 2).hole(solderGuideID)

b = (b.faces("<X[2]").edges("<<Z").fillet(wallT / 2))
b = (b.faces("<Y[2]").edges("<<Z").fillet(wallT / 2))
b = (b.faces("<Z[1]").edges("<X").fillet(solderGuideID))
b = (b.faces("<Z[1]").edges(">Y").fillet(solderGuideID))

show_object(b)

0 comments on commit 55f4b55

Please sign in to comment.