Menu

Main_Demo-Random_Rectangles

Timo Kähkönen

Donate Javascript Clipper Project

Clipping Random Rectangles

This page presents primary boolean operations between two sets of polygons. The subject polygon is blue and clip is red. Both sets have 23 sub polygons each consisting of four points. Which means that subject polygon as well as clip polygon has 92 points, totally 184 points.

The result of boolean operations produced about 460 - 960 points. This rather huge addition in point count is due to self intersections of source polygons. Because they are generated randomly (in Javascript) without check for self intersections, this means that intersection points are added by Clipper library during execution of boolean operations. The result of boolean operations of Clipper library has never self intersection points (at least according to my tests with thousands of examples).

These examples are screen captures of Main Demo program, which uses Javascript Clipper library.

Table of Contents


NONE

Random Rectangles - None

Below we see Subject and Clipping polygons without any modifications.


INTERSECTION

Random Rectangles - Intersection

Below we see Intersection of both polygons.


UNION

Random Rectangles - Union

Below we see Union of both polygons.


DIFFERENCE

Random Rectangles - Difference

Below we see Difference of both polygons.


XOR

Random Rectangles - Xor

Below we see Xor of both polygons.



Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.