Zrozumiałem poruszanie obiektami
This commit is contained in:
parent
1383b89eac
commit
9aaca519af
38
orange.py
38
orange.py
|
|
@ -1,7 +1,7 @@
|
||||||
from build123d import *
|
from build123d import *
|
||||||
|
|
||||||
orange = import_step("./OrangePi-Box.step")
|
# orange = import_step("./OrangePi-Box.step")
|
||||||
orange = orange.rotate(Axis.X, -90).move(Location((0, 0, 11)))
|
# orange = orange.rotate(Axis.X, -90).move(Location((0, 0, 11)))
|
||||||
|
|
||||||
dlugosc = 112.80
|
dlugosc = 112.80
|
||||||
szerokosc = 87.80
|
szerokosc = 87.80
|
||||||
|
|
@ -9,14 +9,32 @@ wysokosc = 54
|
||||||
scianka = 3
|
scianka = 3
|
||||||
|
|
||||||
|
|
||||||
with BuildPart() as box:
|
# with BuildPart() as box:
|
||||||
Box(dlugosc, szerokosc, wysokosc)
|
# Box(dlugosc, szerokosc, wysokosc)
|
||||||
front = box.faces().sort_by(Axis.Y)[0]
|
# front = box.faces().sort_by(Axis.Y)[0]
|
||||||
with BuildSketch(front) as s1:
|
# front_left_edge_vertex = box.faces().sort_by(Axis.Y)[0].edges().filter_by(Axis.Z).sort_by(Axis.X)[0].vertices()[0]
|
||||||
Rectangle(11.68, 17.84)
|
# with BuildSketch(front) as s1:
|
||||||
|
# with Locations((5, 0, 0)):
|
||||||
|
# test = Rectangle(11.68, 17.84, align=(Align.MIN, Align.MAX, Align.CENTER))
|
||||||
# extrude(amount=-scianka, mode=Mode.SUBTRACT)
|
# extrude(amount=-scianka, mode=Mode.SUBTRACT)
|
||||||
|
|
||||||
|
# show_object(box, name="box")
|
||||||
|
# # debug(orange)
|
||||||
|
# debug(front_left_edge_vertex, name="vertex")
|
||||||
|
# debug(s1.sketch)
|
||||||
|
# debug(test, name="test")
|
||||||
|
|
||||||
|
|
||||||
|
with BuildPart() as box:
|
||||||
|
with BuildSketch() as s1:
|
||||||
|
Rectangle(dlugosc, szerokosc)
|
||||||
|
extrude(amount=wysokosc)
|
||||||
|
offset(amount=-scianka, openings=box.faces().sort_by(Axis.Z)[-1])
|
||||||
|
front = box.faces().sort_by(Axis.Y)[0]
|
||||||
|
front_left_edge_vertex = box.faces().sort_by(Axis.Y)[0].edges().filter_by(Axis.Z).sort_by(Axis.X)[0].vertices()[0]
|
||||||
|
with BuildSketch(front) as s2:
|
||||||
|
with Locations((front_left_edge_vertex.X, 0, 0)):
|
||||||
|
Rectangle(30, 20, align=(Align.MIN, Align.MIN, Align.CENTER))
|
||||||
|
|
||||||
show_object(box)
|
show_object(box)
|
||||||
# debug(orange)
|
debug(s2.sketch)
|
||||||
# debug(front)
|
|
||||||
debug(s1.sketch)
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue