touching/abutting polygons

S

sajin

Guest
Hi All
I have two polygons in layout. I wanted to know whether these two
polygons are touching each other. Is there a function in SKILL to know
this.I tried dBLayerAnd, but will be true only if the two polygons are
averlapping!!
Thanks
Sajin
 
Hi Sajin,

There should be a function to do this, I'm pretty much sure. But just
like you ... I don't know it. That does not help much, I Know ....

The 'rescue' workaround I'm able to think of right know is just to
look at the intersection of the points of your polygon.
Assuming 2 polygons :

p1~>points =
((0.0 0.0)
(0.0 1.0)
(1.0 1.0)
(1.0 0.0)
)

p2~>points=
((1.0 0.0)
(1.0 1.0)
(2.0 1.0)
(2.0 0.0)
)

And assuming a function called RKlistIntersection
;
procedure( RKlistIntersection(l1 l2)
setof(element l1 member(element l2))
)
;

Then the intersection of Polygons P1 and P2, i.e RKlistIntersection(p1
p2) would return :

((1.0 1.0)
(1.0 0.0)
)

I can't think of a better solution so far I'm afraid ...
Hope other chaps are more inspired :)

Hope this help anyway !
Riad.
 
Riad KACED wrote, on 03/30/09 00:27:
Hi Sajin,

There should be a function to do this, I'm pretty much sure. But just
like you ... I don't know it. That does not help much, I Know ....

The 'rescue' workaround I'm able to think of right know is just to
look at the intersection of the points of your polygon.
Assuming 2 polygons :

p1~>points =
((0.0 0.0)
(0.0 1.0)
(1.0 1.0)
(1.0 0.0)
)

p2~>points=
((1.0 0.0)
(1.0 1.0)
(2.0 1.0)
(2.0 0.0)
)

And assuming a function called RKlistIntersection
;
procedure( RKlistIntersection(l1 l2)
setof(element l1 member(element l2))
)
;

Then the intersection of Polygons P1 and P2, i.e RKlistIntersection(p1
p2) would return :

((1.0 1.0)
(1.0 0.0)
)

I can't think of a better solution so far I'm afraid ...
Hope other chaps are more inspired :)

Hope this help anyway !
Riad.
Unfortunately that won't work if the polygons have touching edges, but no
coincident points.

If you want to find whether two polygons are overlapping or touching, you can
use dbLayerOr() and see whether the result is a list of a single object. If you
want to rule out overlapping objects, then you could also check whether
dbLayerAnd returns anything - if it does, then they are overlapping.

Or you could use the function CCSpointOnBoundary (and other related functions)
from sourcelink solution 11024326 - in the file CCSpointInPolygon.il - to check
if any of the points on either polygon are on the boundary of the other. There's
lots of ways it could be done.

Simplest (smallest amount of coding) is probably to use the dbLayer functions I
mention above.

Regards,

Andrew.
 
Hi Sajin, sounds like this would be simple to flag with a diva/assura
DRC, though it looks like the other guys have Skill solutions for you.
If not let me know and i'll post a couple of lines of DRC.

Thanks

Stu
 
Hi Andrew,

Thanks for your advise indeed.
I'm definitely going ti check out your sourceLink solution.

Thanks,
Riad.
 

Welcome to EDABoard.com

Sponsor

Back
Top