Hi, I was doing some tests with the clipper2 Java port and I have the following doubt, what is the best approach to join polygons that share the same edge?, I mean adjacent forms.
I get some different behaviours:
Using Long(64)
Paths64 one = new Paths64();
Paths64 two = new Paths64();
one.add(Clipper.MakePath(new int[]{
0, 0, 0, 1, 1, 1, 1, 0}));
two.add(Clipper.MakePath(new int[]{
1, 0, 2, 0, 2, 1, 1, 1}));
Paths64 union = Clipper.Union(one, two, FillRule.NonZero);
System.out.println("Union: " + union);
//Result:
A = (1,0) (1,1) (0,1) (0,0)
B = (2,1) (1,1) (1,0) (2,0)
//It consider they do not intersect, so they cannot be joined as one?
- Using Doubles
PathsD oneDouble = new PathsD();
PathsD twoDouble = new PathsD();
oneDouble.add(Clipper.MakePath(new double[]{
0d, 1d, 1d, 1d, 1d, 0d, 0d, 0d}));
twoDouble.add(Clipper.MakePath(new double[]{
1d, 0d, 2d, 0d, 2d, 1d, 1d, 1d}));
PathsD unionDouble = Clipper.Union(oneDouble, twoDouble, FillRule.NonZero, 3);
System.out.println("Union with doubles: " + unionDouble);
//Result:
A = 1,000000,0,000000) (2,000000,0,000000) (2,000000,1,000000) (1,000000,1,000000) (0,000000,1,000000) (0,000000,0,000000)
//That would do, but my values are long too...
Hi, I was doing some tests with the clipper2 Java port and I have the following doubt, what is the best approach to join polygons that share the same edge?, I mean adjacent forms.
I get some different behaviours:
Using Long(64)