printbare bestanden gemaakt
This commit is contained in:
31
example.py
31
example.py
@@ -2,10 +2,33 @@ from ocp_vscode import *
|
||||
from build123d import *
|
||||
set_port(3939)
|
||||
|
||||
length = 9.0
|
||||
width = 4.0
|
||||
height = 2.0
|
||||
arc_l = 3.0
|
||||
arc_h = 1.0
|
||||
arc_m = 2.5
|
||||
|
||||
with BuildPart() as box:
|
||||
with BuildSketch() as sk_box:
|
||||
Rectangle(10.0, 15.0)
|
||||
extrude(amount=4.0)
|
||||
fillet(box.edges().filter_by(Axis.Z), radius=2)
|
||||
Box(5, 7.5, 2, align=Align.MIN)
|
||||
far_vertex = (
|
||||
box.vertices().group_by(Axis.Z)[0].group_by(Axis.X)[-1].sort_by(Axis.Y)[-1]
|
||||
)
|
||||
w = Vector(far_vertex).length
|
||||
|
||||
# Intersect with a rounded corner
|
||||
with BuildPart(mode=Mode.INTERSECT) as with_corners:
|
||||
with BuildSketch(Plane.XZ.rotated((0, 0, 45))) as profile:
|
||||
with BuildLine() as corner:
|
||||
l1 = EllipticalCenterArc(
|
||||
(w - 3, 2 - 1), 3, 1, start_angle=0, end_angle=90
|
||||
)
|
||||
Polyline(l1 @ 1, (0, 2), (0, 0), (w, 0), l1 @ 0)
|
||||
make_face()
|
||||
extrude(amount=w, both=True)
|
||||
|
||||
mirror(about=Plane.YZ)
|
||||
mirror(about=Plane.XZ)
|
||||
mirror(about=Plane.XY)
|
||||
|
||||
show(box)
|
||||
|
||||
Reference in New Issue
Block a user