import cadquery as cq, math # Izometrik (-1,-1,1): uzun eksen Y=96 (sola-yukari), X=50 (saga-yukari), Z=40. On uc y=0. W, L, H = 50.0, 96.0, 40.0 # X genislik, Y boy, Z yukseklik TOP_L = 68.0 # ust yuzey boyu RUN = (L - TOP_L) / 2 # 14: her uctaki egim yatay payi (simetrik kabul, TAHMIN) Z_END = 10.0 # uclardaki dikey kisim (10 olcusu; on ucta 5 olabilir, TAHMIN) # Govde profili (y,z) -> X boyunca ekstrude prof = [(0,0),(L,0),(L,Z_END),(L-RUN,H),(RUN,H),(0,Z_END)] body = cq.Workplane("YZ").polyline(prof).close().extrude(W) # Alt kanallar (yukseklik 5): A: x=0 yuzunden 20 derin (TAHMIN), y=28..68 (40); B: Y boyunca, x=15..50 (35) body = body.cut(cq.Workplane("XY").box(21, 40, 5, centered=False).translate((-1, 28, -1))) body = body.cut(cq.Workplane("XY").box(35+1, L+2, 5, centered=False).translate((15, -1, -1))) # On egik yuzde cep: 30 genis, 20 boy (egim boyunca), 5 derin; ortada D12 delik (TAHMIN konumlar) a, b = Z_END, H tx, ty = 0.0, (RUN) / math.hypot(RUN, H - Z_END) tz = (H - Z_END) / math.hypot(RUN, H - Z_END) n = (0, -tz, ty) # dis normal (-y, +z) org = (W/2, 0, Z_END) # egik yuzun alt kenari ortasi pl = cq.Plane(origin=org, xDir=(1,0,0), normal=n) S0, SL, DEP = 4.0, 20.0, 5.0 # TAHMIN: cep basi, boyu, derinlik pocket = cq.Workplane(pl).center(0, S0 + SL/2).rect(30, SL).extrude(-DEP) body = body.cut(pocket) hole = cq.Workplane(pl).workplane(offset=-DEP).center(0, S0 + SL/2).circle(6).extrude(-10) body = body.cut(hole) # Ustte silindir D30, boy 20; ust 12 mm'si 20 genis (X) iki duz yuzle kesilmis CX, CY = W/2, 55.0 # CY=55 olcusu (on uctan) cyl = cq.Workplane("XY", origin=(CX, CY, H)).circle(15).extrude(20) keep = cq.Workplane("XY").box(40, 20, 12, centered=False).translate((CX-20, CY-10, H+8)) low = cq.Workplane("XY", origin=(CX, CY, H)).circle(15).extrude(8) tab = cyl.intersect(keep) result = body.union(low).union(tab) # BEKLENEN SINIR KUTUSU: 50 x 96 x 60 mm