Alex McLean
10/06/2023, 10:29 AMKartik Agaram
szymon_k
10/06/2023, 3:51 PMguitarvydas
10/06/2023, 4:22 PMChristopher Shank
10/07/2023, 5:31 AMThinking about syntax based on proximity and containment rather than adjacency.Could you expand on the difference and/or tension here?
Alex McLean
10/07/2023, 10:26 AMNaveen Michaud-Agrawal
11/03/2023, 8:50 PMAlex McLean
11/03/2023, 11:01 PMNaveen Michaud-Agrawal
11/04/2023, 2:45 AMAlex McLean
11/04/2023, 12:56 PMWhen /tool/ is a "embedded shape recognizer", /tool/ points "up" at /p/ within (2) inches, /p/ recognized contours /cs/ with origin /origin/:
local boxes = {}
for i,c in ipairs(cs) do
local tl = c.region[1]
local br = c.region[3]
local w,h = br.x - tl.x, br.y-tl.y
local box = create_id(p, i)
-- Assumes parent contours are always earlier in the table
local parent_box = c.parent_index > 0 and boxes[c.parent_index] or nil
Claim (origin) has box2 (box) with position (tl) width (w) height (h).
Claim box (box) is in a stack with children count (c.children_count) parent (parent_box) centroid (c.centroid).
Claim box (box) has contour (c).
table.insert(boxes, box)
end
End
and separately does a hack to discard inner contours of drawn containers
-- Find outer shapes
When /origin/ has box2 /box/, box /box/ is in a stack with parent (nil):
Claim (box) is a shape with level (0).
End
-- Find inner shapes
When /parent/ is a shape with options /o/, box /child/ is in a stack with parent /parent/,
box /inner_child/ is in a stack with parent /child/:
Claim (inner_child) is a shape with level (o.level+1) container (parent).
End
a bit hacky but does the jobNaveen Michaud-Agrawal
11/04/2023, 1:35 PMNaveen Michaud-Agrawal
11/04/2023, 5:30 PMAlex McLean
11/04/2023, 5:34 PMNaveen Michaud-Agrawal
11/04/2023, 6:42 PMVijay Chakravarthy
11/15/2023, 3:53 AMNaveen Michaud-Agrawal
11/15/2023, 8:33 PMAlex McLean
11/16/2023, 4:02 PM