You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

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)
cut_logo = Workplane("XZ").workplane(offset=32.200001 - 0.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)
)
cut_logo = (
cut_logo.move(0, -18)
.box(barbie_dim[1] + 1, barbie_dim[0] + 1, 0.195)
.rotate((1, 0, 0), (0, 0, 0), 170)
)
barbie_logo = (
Workplane("XZ")
.workplane(offset=-32.200001)
.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)
result = result.cut(cut_logo)
cq.exporters.export(result, "/home/deck/model_files/barbie_ps5_stand.stl")
try:
show_object(result)
except NameError:
pass