intersection_closed_polygons_xld(Polygons1, Polygons2 : PolygonsIntersection : : )
和函数difference_closed_polygons_xld类似,
此函数用于计算两多边形Polygons1, Polygons2组成的闭合区域的交集。
计算交集的轮廓,保存于PolygonsIntersection 。
同样也可执行下面例程,查看生成的效果
gen_ellipse_contour_xld (Contour1, 200, 200, 0, 100, 100, 0, 6.28318, 'positive', 1.5)
gen_polygons_xld (Contour1, Polygon1, 'ramer', 10)
gen_ellipse_contour_xld (Contour2, 200, 300, 0, 100, 100, 0, 6.28318, 'positive', 1.5)
gen_polygons_xld (Contour2, Polygon2, 'ramer', 10)
*
* Now, the intersection of the two regions is determined.
intersection_closed_polygons_xld (Polygon1, Polygon2, PolygonsIntersection)
*
* Visualization of the result
dev_clear_window ()
dev_set_line_width (5)
dev_set_color ('green')
dev_display (Polygon1)
dev_set_color ('red')
dev_display (Polygon2)
dev_set_line_width (3)
dev_set_color ('blue')
dev_display (PolygonsIntersection)
stop ()
dev_clear_window ()
dev_set_line_width (1)
dev_set_color ('white')
*
* Now, boundary sets that define regions with holes are created.
gen_ellipse_contour_xld (Boundary1, 200, 200, 0, 100, 100, 0, 6.28318, 'positive', 1.5)
gen_polygons_xld (Boundary1, Boundary1Poly, 'ramer', 10)
gen_ellipse_contour_xld (Hole1, 200, 200, 0, 75, 75, 0, 6.28318, 'positive', 1.5)
gen_polygons_xld (Hole1, Hole1Poly, 'ramer', 10)
concat_obj (Boundary1Poly, Hole1Poly, BoundarySet1)
gen_ellipse_contour_xld (Boundary2, 200, 300, 0, 100, 100, 0, 6.28318, 'positive', 1.5)
gen_polygons_xld (Boundary2, Boundary2Poly, 'ramer', 10)
gen_ellipse_contour_xld (Hole2, 200, 300, 0, 75, 75, 0, 6.28318, 'positive', 1.5)
gen_polygons_xld (Hole2, Hole2Poly, 'ramer', 10)
concat_obj (Boundary2Poly, Hole2Poly, BoundarySet2)
*
* Now, the intersection of the two regions is determined.
intersection_closed_polygons_xld (BoundarySet1, BoundarySet2, PolygonsIntersection)
*
* Visualization of the result
dev_clear_window ()
dev_set_line_width (5)
dev_set_color ('green')
dev_display (BoundarySet1)
dev_set_color ('red')
dev_display (BoundarySet2)
dev_set_line_width (3)
dev_set_color ('blue')
dev_display (PolygonsIntersection)
|