From 67770333839b50ed3d6ea6616712f74e9785d70e Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 30 May 2025 01:54:19 -0700 Subject: [PATCH] Remove conflict with base geometry --- nhf/touhou/yasaka_kanako/onbashira.py | 33 +++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/nhf/touhou/yasaka_kanako/onbashira.py b/nhf/touhou/yasaka_kanako/onbashira.py index 7936fb2..cc711ee 100644 --- a/nhf/touhou/yasaka_kanako/onbashira.py +++ b/nhf/touhou/yasaka_kanako/onbashira.py @@ -1071,24 +1071,17 @@ class Onbashira(Model): profile_base = ( profile_arc .reset() - .polygon([ - (bx - base_w/2, by), - (bx + base_w/2, by), - (bx + base_w/2, -by), - (bx - base_w/2, -by), - ]) - .reset() .polygon([ (r1 * math.cos(theta1), r1 * math.sin(theta1)), (r1 * math.cos(theta2), r1 * math.sin(theta2)), - (r0 * math.cos(theta2), r0 * math.sin(theta2)), - (r0 * math.cos(theta), r0 * math.sin(theta)), + (bx, by - base_w/2), + (bx, by + base_w/2), ]) .polygon([ (r1 * math.cos(theta1), -r1 * math.sin(theta1)), (r1 * math.cos(theta2), -r1 * math.sin(theta2)), - (r0 * math.cos(theta2), -r0 * math.sin(theta2)), - (r0 * math.cos(theta), -r0 * math.sin(theta)), + (bx, -by + base_w/2), + (bx, -by - base_w/2), ]) .reset() .push([ @@ -1155,13 +1148,23 @@ class Onbashira(Model): # Construct the connection between the front and back + x11 = r1 * math.cos(theta1) + y11 = r1 * math.sin(theta1) + x21 = r1 * math.cos(theta2) + y21 = r1 * math.sin(theta2) + x12 = bx + base_w/2 * math.sin(-math.pi * 0.3) + y12 = by + base_w/2 * math.cos(-math.pi * 0.3) + x22 = bx + y22 = by - base_w/2 + a1 = .8 + a2 = .95 profile_bridge_outer_base = ( Cq.Sketch() .polygon([ - (bx - base_w/2, by - base_w/2), - (bx + base_w/2, by - base_w/2), - (bx + base_w/2, by - base_w*1.5), - (bx - base_w/2, by - base_w*1.5), + ((1 - a1) * x11 + a1 * x12, (1 - a1) * y11 + a1 * y12), + ((1 - a1) * x21 + a1 * x22, (1 - a1) * y21 + a1 * y22), + ((1 - a2) * x21 + a2 * x22, (1 - a2) * y21 + a2 * y22), + ((1 - a2) * x11 + a2 * x12, (1 - a2) * y11 + a2 * y12), ]) .wires() .val()