Browse Source

barbie ps5

master
wes 2 months ago
parent
commit
84cc329fb5
  1. 54
      barbie_ps5.py
  2. 32
      brush_holder.py
  3. 33
      drain_catcher_screw.py
  4. 39
      ghibli_ticket.py
  5. 27
      modified_enclosure_back.py

54
barbie_ps5.py

@ -0,0 +1,54 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from svg_path import addSvgPath
from svgpathtools import svg2paths
import cadquery as cq
import cqmore
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
barbie_dim = (30.059, 33.773)
barbie_dim = (barbie_dim[0] - 0.5, barbie_dim[1] - 0.5)
barbie_paths, barbie_attributes = svg2paths("/home/deck/cad_files/svgs/barbie_logo.svg")
cover_logo = Workplane("XZ").workplane(offset=32.1)
cover_logo_2 = Workplane("XZ").workplane(offset=31.1)
cover_logo = (
cover_logo.move(0, -18)
.box(barbie_dim[1], barbie_dim[0], 2.2)
.rotate((1, 0, 0), (0, 0, 0), 170)
)
cover_logo_2 = (
cover_logo_2.move(0, -18)
.box(barbie_dim[1], barbie_dim[0], 1.2)
.rotate((1, 0, 0), (0, 0, 0), 170)
)
barbie_logo = (
Workplane("XZ")
.workplane(offset=-32.15)
.center(-105, -166.5)
.addSvgPath(barbie_paths[0])
.extrude(0.5)
)
barbie_logo = barbie_logo.rotate((1, 0, 0), (0, 0, 0), 190).rotate(
(0, 0, 1), (0, 0, 0), 180
)
result = cq.importers.importStep("/home/deck/Downloads/ps5_stand.step")
result = result.cut(cover_logo)
result = result.union(cover_logo_2)
result = result.union(barbie_logo)
cq.exporters.export(result, "/home/deck/model_files/barbie_ps5_stand.stl")
try:
show_object(result)
except NameError:
pass

32
brush_holder.py

@ -0,0 +1,32 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
import cadquery as cq
result = Workplane()
length = 34
width = 10
height = 80
# l, w, h
result = result.box(length, width, height)
result = (
result.workplane(offset=-10)
.center(0, 0)
.box(length / 2, width, height, combine="cut")
)
result = (
result.workplane(offset=-30)
.center(10, 0)
.box(length / 2, width, height, combine="cut")
)
result = result.workplane(offset=-height / 2).center(-40, -2.5).box(30, 5, 5)
result = result.workplane(offset=-height / 2 + 5).center(-12.5, 0).box(5, 5, 8.5)
cq.exporters.export(result, "/home/deck/model_files/brush_holder.stl")
try:
show_object(result)
except NameError:
pass

33
drain_catcher_screw.py

@ -0,0 +1,33 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
from cqmore.polygon import regularPolygon, star
import cadquery as cq
import cqmore
Workplane = cqmore.extend(Workplane)
simple = False
bottom_radius = 70
screw = ButtonHeadScrew(
size="M8-1.25", fastener_type="iso7380_1", length=15 * MM, simple=simple
)
scaled_screw = screw.scale(0.77)
screw_result = (
Workplane()
.makePolygon(star(outerRadius=bottom_radius / 4.5, innerRadius=13, n=8))
.extrude(8)
.union(scaled_screw)
)
try:
show_object(screw_result)
except NameError:
pass
cq.exporters.export(screw_result, "/home/deck/model_files/drain_catcher_screw.stl")

39
ghibli_ticket.py

@ -0,0 +1,39 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
from cqmore.curve import archimedeanSpiral, circle
from cqmore.polygon import regularPolygon, star
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid
from svg_path import addSvgPath
from svgpathtools import svg2paths
import cadquery as cq
import cqmore
from math import ceil, floor
ticket_width = 40
ticket_height = 95
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
result = Workplane()
result = result.box(ticket_width + 5, ticket_height + 5, 30)
result = (
result.workplane(offset=11)
.move(0, 0)
.box(ticket_width - 2, ticket_height, 50, combine="cut")
)
result = (
result.workplane(offset=(ticket_width / 2.0) - 5)
.move(0, 1)
.box(ticket_width, ticket_height + 5, 1.5, combine="cut")
)
cq.exporters.export(result, "/home/deck/model_files/ghibli_ticket_holder.stl")
try:
show_object(result)
except NameError:
pass

27
modified_enclosure_back.py

@ -16,6 +16,9 @@ Workplane.addSvgPath = addSvgPath
screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing
cable_diameter = 5.6
cable_radius = cable_diameter / 2.0
screw_length = 10
power_cable_screw = ButtonHeadScrew(
size="M3-0.5",
@ -29,6 +32,14 @@ height = 130
poop_chute_dist_from_side = 59
cable_gripper = (
Workplane("XY").cylinder(3, 11.2 / 2.0).cylinder(4, cable_radius, combine="cut")
)
cable_gripper_split = (
cable_gripper.workplane().move(-(11.2 / 2.0), 0).box(11.2, 11.2, 4, combine="cut")
)
holes_plane = (
Workplane("XZ")
.workplane(offset=-2)
@ -36,7 +47,7 @@ holes_plane = (
.cylinder(8, 17 / 2)
.workplane(offset=-7)
.center(0, height - 165)
.circle(11.08 / 2.0)
.circle(11.5 / 2.0)
.extrude(20)
)
@ -45,7 +56,7 @@ hole_extruded_plane = (
.workplane(offset=-2)
.center(0, height - 110)
.move(20, 0)
.circle(11.08 / 1.4)
.circle(11.5 / 1.4)
.extrude(-5)
)
@ -65,15 +76,15 @@ test_piece = (
Workplane().workplane(offset=110).center(70, 0).box(80, 4, 60).cut(holes_plane)
)
cq.exporters.export(result, "/home/deck/model_files/modified_backpanel_part_3.step")
cq.exporters.export(result, "/home/deck/model_files/modified_backpanel_part_3.stl")
cq.exporters.export(
test_piece, "/home/deck/model_files/modified_backpanel_test_piece.step"
test_piece, "/home/deck/model_files/modified_backpanel_test_piece.stl"
)
result_part1 = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part1.stp")
magnet_diameter = 6
magnet_diameter = 6.1
magnet_radius = magnet_diameter / 2.0
poop_chute_dist_from_bottom = (
14.8 # how far the poop chute is from the bottom of its piece
@ -96,10 +107,12 @@ magnet_holes_plane = (
result_part1 = result_part1.cut(magnet_holes_plane)
cq.exporters.export(
result_part1, "/home/deck/model_files/modified_backpanel_part_1.step"
result_part1, "/home/deck/model_files/modified_backpanel_part_1.stl"
)
cq.exporters.export(cable_gripper_split, "/home/deck/model_files/cable_gripper.stl")
try:
show_object(result)
show_object(cable_gripper_split)
except NameError:
pass

Loading…
Cancel
Save