edouard@2873: // geometry.ysl2 edouard@2872: // edouard@2873: // Geometry (bounding box intersection) definitions edouard@2873: edouard@2873: // This retrieves geometry obtained through "inkscape -S" edouard@2873: // already parsed by python and presented as a list of edouard@2873: // edouard@2873: const "geometry", "ns:GetSVGGeometry()"; edouard@2873: edouard@2873: // Debug data edouard@2873: function "debug_geometry" { edouard@2875: | ID, x, y, w, h edouard@2873: foreach "$geometry[@Id = $hmi_elements/@id]" edouard@2873: | «@Id» «@x» «@y» «@w» «@h» edouard@2873: } edouard@2873: !debug_output_calls.append("debug_geometry") Edouard@2779: edouard@2872: // Rates 1D intersection of 2 segments A and B edouard@2872: // described respectively with a0,a1 and b0,b1 edouard@2872: def "func:intersect_1d" { edouard@2872: // it is assumed that a1 > a0 and b1 > b0 edouard@2872: param "a0"; edouard@2872: param "a1"; edouard@2872: param "b0"; edouard@2872: param "b1"; Edouard@2792: edouard@2872: const "d0", "$a0 >= $b0"; edouard@2872: const "d1", "$a1 >= $b1"; edouard@2872: choose { edouard@2872: when "not($d0) and $d1" edouard@2872: // b contained in a edouard@2872: // a0 0 ))]"""; edouard@2873: }