two_rects.scad 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Two 10x10 mm panels meeting at one edge, 45-degree dihedral angle,
  2. // with a rounded fillet on the outer face of the junction.
  3. t = 2; // panel thickness
  4. s = 10; // panel size (10x10 mm face)
  5. r = 2; // fillet radius
  6. $fn = 64;
  7. // Cross-section is built in the YZ plane, extruded in X.
  8. //
  9. // Panel 1 outer face: y=0
  10. // Panel 2 outer face: z = y+10 (i.e. the plane after 45-deg pivot)
  11. //
  12. // Fillet circle tangent to both faces at distance r:
  13. // centre_y = r
  14. // centre_z = 10 + r*(1 - sqrt(2))
  15. //
  16. // Tangent point on Panel 1 face (y=0) is at angle 180° from centre.
  17. // Tangent point on Panel 2 face is at angle 135° from centre.
  18. // Arc sweeps 180° → 135°.
  19. fc = [r, 10 + r*(1 - sqrt(2))];
  20. rotate([90, 0, 90])
  21. linear_extrude(s)
  22. polygon(concat(
  23. // Panel 1 outer face: bottom to fillet start
  24. [[0, 0]],
  25. // Fillet arc (180° → 135°)
  26. [for (a = [180:-1:135]) [fc[0]+r*cos(a), fc[1]+r*sin(a)]],
  27. // Panel 2 outer face: fillet end to far tip
  28. [[s*sin(45), 10+s*cos(45)]],
  29. // Across Panel 2 far end, down Panel 2 inner face, down Panel 1 inner face
  30. [[s*sin(45)+t*cos(45), 10+s*cos(45)-t*sin(45)],
  31. [t, fc[1]],
  32. [t, 0]]
  33. ));