Split in cadquery

This commit is contained in:
Roberto Alsina 2022-11-15 16:01:20 -03:00
parent c4bae182c6
commit 4114adb49a
8 changed files with 76782 additions and 5825 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

14394
notebook_nueva/left_side.stl Normal file

File diff suppressed because it is too large Load Diff

42170
notebook_nueva/model.stl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ from cadquery2 import exporters
# Size of the whole object # Size of the whole object
width = 295 width = 295
height = 165 height = 160
thickness = 25 thickness = 25
kbd_height = 100 kbd_height = 100
@ -64,39 +64,38 @@ def model():
.split(keepBottom=True) .split(keepBottom=True)
) )
top_right = (
model()
.faces(">Y")
.workplane(offset = -120).split(keepTop=True)
.faces(">X")
.workplane(offset=-135).split(keepTop=True)
)
exporters.export(top_right, "top_right.stl")
top_left = ( left_cutout = cq.Sketch().polygon(
model() [(0, 0), (160, 0), (160, -100), (120, -100), (120, -200), (0, -200), (0, 0)],
.faces(">Y") mode="a",
.workplane(offset = -120).split(keepTop=True)
.faces(">X")
.workplane(offset=-135).split(keepBottom=True)
) )
exporters.export(top_left, "top_left.stl")
bottom_right = ( right_side = (
model() model()
.faces(">Y") .faces("<Z")
.workplane(offset = -120).split(keepBottom=True) .workplaneFromTagged("mid_height")
.faces(">X") .transformed(offset=cq.Vector(0, 0, -thickness / 2))
.workplane(offset=-165).split(keepTop=True) .center(-width / 2, height / 2)
.placeSketch(left_cutout)
.cutBlind(100)
) )
exporters.export(bottom_right, "bottom_right.stl")
bottom_left = ( exporters.export(right_side, "right_side.stl")
right_cutout = cq.Sketch().polygon(
[(160, 0), (width, 0), (width, -height), (120, -height), (120, -100), (160, -100), (160, 0)],
mode="a",
)
left_side = (
model() model()
.faces(">Y") .faces("<Z")
.workplane(offset = -120).split(keepBottom=True) .workplaneFromTagged("mid_height")
.faces(">X") .transformed(offset=cq.Vector(0, 0, -thickness / 2))
.workplane(offset=-165).split(keepBottom=True) .center(-width / 2, height / 2)
.placeSketch(right_cutout)
.cutBlind(100)
) )
exporters.export(bottom_left, "bottom_left.stl") exporters.export(right_side, "left_side.stl")
exporters.export(model(), "model.stl")

14394
notebook_nueva/right_side.stl Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff