svghmi/geometry.ysl2
branchsvghmi
changeset 2904 92d115d8828d
parent 2879 58e6a91dc37f
child 2939 4296ab974d4d
equal deleted inserted replaced
2903:881d0248b3ce 2904:92d115d8828d
     5 // This retrieves geometry obtained through "inkscape -S"
     5 // This retrieves geometry obtained through "inkscape -S"
     6 // already parsed by python and presented as a list of
     6 // already parsed by python and presented as a list of
     7 // <bbox x="0" y="0" w="42" h="42">
     7 // <bbox x="0" y="0" w="42" h="42">
     8 const "geometry", "ns:GetSVGGeometry()";
     8 const "geometry", "ns:GetSVGGeometry()";
     9 
     9 
       
    10 reflect:geometry;
       
    11 
    10 // Debug data
    12 // Debug data
    11 function "debug_geometry" {
    13 template "reflect:geometry", mode="debug" {
    12     | ID, x, y, w, h
    14     | ID, x, y, w, h
    13     foreach "$geometry"
    15     foreach "$geometry"
    14         |  «@Id» «@x» «@y» «@w» «@h»
    16         |  «@Id» «@x» «@y» «@w» «@h»
    15 }
    17 }
    16 !debug_output_calls.append("debug_geometry")
       
    17 
    18 
    18 // Rates 1D intersection of 2 segments A and B
    19 // Rates 1D intersection of 2 segments A and B
    19 // described respectively with a0,a1 and b0,b1
    20 // described respectively with a0,a1 and b0,b1
    20 def "func:intersect_1d" {
    21 def "func:intersect_1d" {
    21     // it is assumed that a1 > a0 and b1 > b0
    22     // it is assumed that a1 > a0 and b1 > b0