# HG changeset patch # User Chris Cannam # Date 1582748114 0 # Wed Feb 26 20:15:14 2020 +0000 # Node ID db5191b3e76d9345f425b92915e9b974c2e1f082 # Parent 3309269644e927597294b9807822fb6c0154075f Find proper tangent points for top of lens mount diff --git a/cover.sml b/cover.sml --- a/cover.sml +++ b/cover.sml @@ -4,6 +4,17 @@ fun main () = let val lens_radius = 31.6 val lens_centre_height = 31.9 + val flat_top_half_width = 26.3 + + (* calculate tangent *) + val b = Math.sqrt (flat_top_half_width * flat_top_half_width + + lens_centre_height * lens_centre_height) + val beta = Math.acos (lens_centre_height / b) + val gamma = Math.acos (lens_radius / b) + val alpha = Math.pi / 2.0 - beta - gamma + val tangent_elevation = lens_radius * Math.sin alpha + val tangent_offset = lens_radius * Math.cos alpha + val document = { size = (200.0, 200.0), content = [ @@ -24,10 +35,12 @@ (RECT { origin = (0.0, 12.0), size = (57.0 + 2.0 * lens_radius + 43.0, 43.0) }, []), - (PATH [ M (57.0, lens_centre_height), - L [(57.0 + lens_radius - 26.3, 0.0), - (57.0 + lens_radius + 26.3, 0.0), - (57.0 + 2.0 * lens_radius, lens_centre_height)] ], []), + (PATH [ M (57.0 + lens_radius - tangent_offset, + lens_centre_height - tangent_elevation), + L [(57.0 + lens_radius - flat_top_half_width, 0.0), + (57.0 + lens_radius + flat_top_half_width, 0.0), + (57.0 + lens_radius + tangent_offset, + lens_centre_height - tangent_elevation)] ], []), (CIRCLE { centre = (49.0, 12.0 + 15.0), radius = 1.25 }, []), (CIRCLE { centre = (49.0, 12.0 + 43.0 - 13.0), diff --git a/cover.svg b/cover.svg --- a/cover.svg +++ b/cover.svg @@ -7,7 +7,7 @@ - +