Help needed with radial labels (trigonometry guru required)
-
I want to draw some labels on a panel radiating out from a knob. Each stop on the knob should point to a label.
This is what I have so far
HiseSnippet 1042.3ocsV0saaaCElxIJqRacXcnO.BF6BYTOOYmT2NjVLW6jLXzlTg5rhBX3VvHQaQDIRAJpl3MjWg8DsK1izdC1NTRVRd0Ks0.yWXeHO+8wC+NGZWA2ijjvEHMiyWFSPZek9jkLYvn.LkgFeDR6a0eSTnqfjPjCwdWlFmfFtLFmjP7QZZ67yJ6zL1Ek84u9og3PLyiTsEB8ZN0i7BZDUVsq6fmSCCOA6SNmFUy5CFL1iyFwC4o.l1Q2AECIEufbFVYVCcj1dG6SkbwDIVRR.aFx8WNIfeEK29WSSnWDRTK5hl.AJeazn.Znu6pyaBBosqa0oem7S+80Ok5SK2upJ7MYJrp7ndMPqwsAoteFPRqFj1MGR2SehmfFKqznvyWpOlIIh4XnTWGJ41hZ7GMzGwAKXxNQ3KImHfEkdX22wosE7UqCMMgxchzJDeAILw5oVSalI1sYaqbodkR6WJcPozCKk5WJ8nRoGWJ8ikRccZNqLsuGKrdNieQWHyqv6BhbDOJlyfE1Myz1r0Zd3hYPb9OcIWclO4hc.tqKbSJeEOURYD64oLOIkyrWzx72LMTwDCgSFPSTw5EbOb3PdJyOwVUiLLMVnhQNszN+mjNWEPkDUVLlyEV1THBNGZQsdRQ0rSHgsPF.a8fGzxz.RDDFAWQRrOEKC5H4uB6SwrD6866X8Cq6Vq1VSwS6MC1uWaK7z8yjlofCDFeA9pmERWvH9mStVZm65T5rLublo7na128lk68L0E.YtTUWLtw7lVGtpJXwYmwkjWxrypFl2XZ8uUMe9F0op+BdXHQrQ0pVaws4nMKM5BhnMbqFlRJMD39q2Ps2mVCkWNcnlgb1XFU9xXRw5S3g9pFEk7G19gJ3SpFwBDBlJyZC+5h1vIgTeh.Qgf7E5YjSTF3qOvC8KiOBKwqBCDQHKwDgjpNLZGQdOLPLu61P+HRxkRdblsETXHz4I8tq58Uz3rbdG8bJM5Zjlt1u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GgbEQpfnr0YDUbmfAauaG+BekBcShmwhMwWRtr2H713dahIWtigZTcXHxPHH6zwG+03hHosvDKaZnYfAZy1F6YuB6jP4STwa00FlwBI1iAF4e.lg+V7bFAhd7i2ncK3bCHKRRt4YIrIbZzEz2qJh2krQFX5ORCwtlu6MxB2Q5KR5Xkt91p4Yilc2Gsaae6FGTV0wB94BE8kbOS0u8ssw+cUiGuPc56aoHIgJWnZ8FF4GxQO9zzqnxMgtnjozJCgwt4mkcu6Y4lqZBsseMLTvGvYpWlQ420BHTQOqdtu.UfoJyT+mWL0OLgEQkHFLb+ItlA.jAvMW+hd0fiIJRYXfHBYIiJUL8Av4X56fcw1kIsbOllesRjYrsXLABsMoOnbUidTwjy66ZGaPuuNgr9ypY9492vhTwPcx42A1XJaRrpjSAsQkq0acu+D9ncYtL29e83Vm4e6GajYfIkEEkPCD4L8UaMldTecG3P1uLWUJkz3L7UkvtTv48KgdsjLhDvXCvVUMP+y0zvCDhnoID07uZneprPgFiMWUqWGyArOqIJ+e6oj+qP7gtALUX7hw3JK.ivE3GCLV7.7CbOY7XZnpFfq4d5a937ZKx9FvDX0pjAMGtmOMcHzrFRgrygKZ83uyJ5AUKuulWWAFR4QFFcOcgxtZdmBkcKUhRIgRwaCsi25m3uuQBfIt4e2zx8LMOtZt100uiOB5sYuMLTe72B52VrO8VBe1YI7Y2kvmmrD9r2R3y9KgOO8C5i9O58roJQpcb.DDbhY+piyIbBzYY5BQ+EPH1n.L
EDIT: The upside down writing isn't very attractive though...
-
@ustk Thanks, I'll check it out in the morning. I think changing left to right alignment will flip the text, but might cause other problems
-
@d-healey yes, but probably with two loops (or a condition in the main one)
-
@d-healey Here's a better version
HiseSnippet 1208.3ocsV80aaaCDmJIpqVacXcnOzGIL1CJqINxIoosKMntwIYvnModyYEEHHnfQh1hHzjBTzI0aH.6K59NruAaGojkjScxBLV0CB2w6e+3wi2wtJYHMMUpPN0NdbBE47Mt8FKzwsiILApydHmu28CC4cUzTpdWR34iRRQ6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ZnfdxP3Z26efOy5Sg.u+yscIB9yeoBB.lgrnHNb0KkYNhKC7iZYtgzi86zpOoXHoxd4GtN7O5yf+QsRHJ.iU.aQVA84CUgw4xnQbhd5Y7lG1jKvfwpCVMCOE.1GWEk+uM3+tBwG51koCimMFWXFXDN.+Rfw7mK8.2862mFpKA3RtG7guLuMBkMwd.zoVwfhC2iFMrGTrFRgnKfCZSa.mELWXy3CL7lLPOpHxxXpoyE1zv6jKr4DgngjPk7igYWyMOH691U.LIruEsl6gFdbw8aW2fFAHn1l8wvPy1eUnda11r9bXyFygMaNG17z4vlslCad1bXyyuUaLOK+0izxgYWGfE5tusOqiy9BBTYYqBQ+K.sJHNK
-
@ustk Oh wow that's great, thanks!
-
@ustk As I'm bringing this in to my main project I realised two parameters that weren't present in the simple snippet.
The labels are different lengths.
The panel is not square.I'm thinking that it's going to be necessary to draw the labels using the knob's area, rather than just using the panel's area. Any ideas?
HiseSnippet 1246.3ocsV0uSabDDeOfKM1sopoJO.qr5ebz.NlOZZUInXv.sHBDqXRTjPzz02s12Bq28zdqAbpPpOZ8wnOF8Mncl8N66LEnHTy8G16Ne9amY1Y11FcHOMUaHdUNbTBm38E9cForwshYBEY2sHdes+6GHaa3ob6lrvSGljR1bTBKMkGQ77l8mP47pLGw88WubSljoB4EjHj2oEg7WIFHrETa2bOgTtCKhenXPIoWs4tgZUKsTODvzr9MHIfSY84GvPwlwm38fsiDVsoikY4oDu41TGMpSr9bUl7uSjJ5J43lkHc.CkQdGsLBQLRkzJVHiZO9rmR.qztHRLaVj3I96KhDSnWDQ9JGCZgFkiGdyLM7lcJ3sTY30nD7tFH4UBRykAoG62IzHRrEbP77496prbSOFD1KCkLYIy7my42RCRnr0GvNkuiA1LQifm2nwBT3m4WqZUHzmZoRVWtLktN8nZGnU7ZKPq8FVpE+eS1HlUfq5v51k4VHNkEiK9YwIrOhK13D1.7+CXwryYpnILo6wL3l8FZhxD3bFcCaLP83wN+LlgtmR2cIv+iQcetskdPBfEkMnlias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CCZLhwC
-
@d-healey No need to get the knob’s area info (unless it won't be centred in the panel)
As for the different label lengths, I reversed the left/right alignment and used some arbitrary indentation. This way they are aligned from the centre and not from the perimeter of the panelHiseSnippet 1333.3ocsW0uaaaCDmJIpq1acncnO.DF6OjWRbsS6ZGlaPc9byHsoF0oEEHHqiVh1hMRjZTTI0cH.6QauB6MYuAa2QIaKm59wBV0eDKde96NdmtK8zJedZpRSbpbz3DNw4qb6OVZB2IjIjjt6Rb9F2WFG0SyS4lsY9mlkjR1dbBKMkGPbbV9mP4bprBw972OZaVDS5ymQhPdgR3yerHVXlQsWmCDQQ6yB3GIhKI885z0WI2QEox.LsraSRB3T1H9gLTrkbINWau.gQo6aXFdJwYksUAi6GpNWlK+KDohAQb7PKRevP4j2WEEfHFoR1ITDEzaRrmR.qzaVlX47LwscehHPLk9rLxMsLnyznb9vYo4g2xyAuVkgWyRvaAPxoDjVIGR2xsuuVjXlwAwyW51UZ35gLHsWFJ4xRV5ubc2QARHMMhYmx2WCGlpg28a1bMJ7m5sqVER8oFZDa.OJktI83ZGpj7ZqQq8LVpA+ca1XlQfu0mMX.y9h3TVH9xOKdM6s3Ka8ZVL96grP14LYvTlzCXZ7vAY5fbANmQ2xDBTOYhyOiooGHUCZA9eBpGwM6nhS.rHMd0rbqMCtnF8XRdz6Wkb1VcxesATM2CtOMOSkYDRt2vLouQnjdipW82qVAsICLG3ggJc7Qp9+VFSy8LghTz1OV4yh1VkICR8ZVGrakbcRMLsAza8mvLgM508N2qQy1ElS6CLtailzuiVvkdG5FS4mZ3If.nX2g5keGzHhKGYBWuU8Bgz7y35TdOE.cPXqcFFoT54UH2vkfkJl2M.RELLFAEa8flVliZnUXgpmE3qQOlcbySnqRYGuwInQVCd6t12NI2ZP1f5I.KzrMUPeHcN2BjVc05Uq.IPvxo3U.1G6km1BXFViynatInXc5in4LSan4Azeb5oyCEFN5KvYUDCQm8v4Bav9VG.dHPyNeqHwHIO3H9aLE4fiEmLIPV+RQNFNsNYMa3kGZvO0zhQglZVeVNgvS9n4iJUfBDn9IiiGtnLngv7xndlwKt++31u5mTXt5mTXFwGVDk+2BxKpdA13TUHifNE5jNk2o2fY6br1ZSpm0XqasTczTsQVafrPR1ZIM2jokTV6pWr.yqj1FcrgVqh77mzMuFzvGkwsNqnYdRkUNm1Soq4IXOtG.+KZW0Zt7pRqI2gEEM.Ft3MumrwZ9SIrbnxvepzy5U.tzKyZ3vExqvlQb8BYiy9zeHE8jYwC35xwLJHLPX9oLtu+oLkGB5m+0wRBpjckBySS3x22nQRwmTwIREnBD0XmG80Eyi5GIB3Zh.F67Et1jIwB3Yy0uYGxy6tKbOMwLfEAujv0FAF.N6xOC1RHeLWE2c4omZTIVYKt2ASm6zaLYHHdIa840cyuvIuYpC67qcFO6vq6btHvDNkvep6Dxwt9oT9iS6XfdqIKdT4Z+C7fLlCAU+ng8LDP9kRHfbTmXQPPD7wfTAdEOiys6fcg8EukWdMpXVIK8sWB9jCuL7AJIPOnzTBrSyJj2cQBXEFUPVDyL+dM3xbELPLVdYBbgAIf8wkQ4+aK67oBwa41SX7CWLFWZAXDt.+bfwhUDug6dCGx8My.3Jt6+xOO6CRxWUYDL6PKfhC2Cyh6CEq9bv6R3hF+LfyRXCa94l3YLCzmKCrGvZ5BlsvyNELaMgIIl4qUuxOuMGWB85VJ.lj18uq39D7LcZ+sqayFMIPss3U99X3uNTusXc13JnycuB5buqfNe+UPm6eEz4AWAc9gOnN3+JxVYFUbd6.Pn2d1uy53rmjAUV1pPx+By27z..
-
@ustk Thanks again! Looks perfect.
-
@ustk This is how it looks in my project, thanks again to you!
-
@d-healey Looks cool