It looks like you're new here. If you want to get involved, click one of these buttons!
Hi Hutch,
thanks :-)
But good point: I did not have angles in mind yet.
Here is a script that measures the angle between two rulers:
mw = RBA::Application::instance.main_window lv = mw.current_view lv || raise("No layout loaded") rulers = [] lv.each_annotation { |a| rulers << a } rulers.size == 2 || raise("There must be two rulers exactly") v1 = rulers[0].p2 - rulers[0].p1 v2 = rulers[1].p2 - rulers[1].p1 v1 = v1 * (1.0 / v1.abs) v2 = v2 * (1.0 / v2.abs) cos = v1.x * v2.x + v1.y * v2.y sin = v1.x * v2.y - v1.y * v2.x angle = Math.atan2(sin, cos) * 180 / Math::PI v = RBA::MessageBox::warning("Angle", "Angle between rulers is %.2f degree" % angle, RBA::MessageBox::Ok)
Regarding Python: there is a test version already (see http://klayout.de/python_preview.html) in case you like to try it.
Regards,
Matthias
Comments
Hi Hutch,
thanks :-)
But good point: I did not have angles in mind yet.
Here is a script that measures the angle between two rulers:
Regarding Python: there is a test version already (see http://klayout.de/python_preview.html) in case you like to try it.
Regards,
Matthias