...you work here on the assumption that the boundary is a simple rectangle. My boundary is a user-define boundary, so an irregular shape...
Every shape can be broken down into a series of smaller rectangles. If you want to determine whether an element is part of an irregular shape, you'd need to check if an element's "bounding box" is contained fully or partially by one or more of rectangles that make up the irregular shape.
Referring to your earlier post...
...The small Element is not contained within the Boundary, yet according to the simple Top, Bottom, Left and Right values it would appear to be....
_______________
| |
| | ______
| | | |
| | --------
| -----------
| |
-------------------------------
Could you please validate inside the
t_diagramobjects table that this is indeed the case? Each element on a diagram canvas has the required bounding box dimensions, so if, according to the post above, the small element is *outside* the irregular shape, then the bounding boxes for the irregular shape and the small element contained in
t_diagramobjects table will indeed reflect that.
Now, how to go about to determine if the small element is inside an irregular shape with straigh edges?
I see a two-step approach could be helpful:
Step one: break into smaller rectangles
_______________
| |
| | ______
| #1 | | |
| | --------
_______________
|------------------------------
| #2 |
-------------------------------
Step two: use the script code provided to test if the small element is contained within [#1] or [#2].