Inferring if a set of lines form a rectangle #1705
-
Using the Posting snippet of the output of the {
"coordinates": {
"x0": 110.0,
"y0": 426.3626708984375,
"x1": 490.0,
"y1": 474.3626708984375
},
"closePath": false,
"even_odd": false,
"fill_opacity": 1.0,
"fill": [
0.44999998807907104,
0.08100000023841858,
0.3109999895095825
],
"seqno": 113,
"color": null,
"width": 0,
"type": "f",
"lineCap": [
0
],
"lineJoin": 0,
"dashes": "[] 0",
"stroke_opacity": 1,
"items": [
{
"x0": 110.0,
"y0": 426.3626708984375,
"x1": 110.0,
"y1": 426.3626708984375
},
{
"x0": 110.0,
"y0": 426.3626708984375,
"x1": 110.0,
"y1": 474.3626708984375
},
{
"x0": 110.0,
"y0": 474.3626708984375,
"x1": 490.0,
"y1": 474.3626708984375
},
{
"x0": 490.0,
"y0": 474.3626708984375,
"x1": 490.0,
"y1": 426.3626708984375
}
],
"itemsByShape": {
"l": [
0,
1,
2,
3
]
}
} RectangleDrawnUsingLinesOriginal.pdf Interestingly, the group of lines is recognized as a rectangle in the Foxit PDF editor. Assuming that there should be something pointing towards the fact that it is a rectangle. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@JorjMcKie |
Beta Was this translation helpful? Give feedback.
-
The underlying data basis of the method only consists of either lines or curves. |
Beta Was this translation helpful? Give feedback.
The underlying data basis of the method only consists of either lines or curves.
Inside the method
get_drawings()
, some logic already identifies rectangles and quads in many, but not all cases.Detection of other shapes, such as circles, ellipses, triangles, etc. are your burden I am afraid.
I have no insight that goes beyond the trivial / obvious unfortunately.