Skip to Content.
Sympa Menu

cgal-discuss - 2D Regularized Boolean Set-Operations

Subject: CGAL users discussion list

List archive

2D Regularized Boolean Set-Operations


Chronological Thread 
  • From: Marko Kukovec <>
  • To:
  • Subject: 2D Regularized Boolean Set-Operations
  • Date: Wed, 30 Apr 2008 11:22:02 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=EHHmMDn8d6xMlFC3hXrYpsFAxzxCkOnI08GbI4qcx3mjvX37j2vXh+IApbuchYXmTO9SxprKfDeIpCcCL2idcAZB0X+oF4TMUR0euIyybN99rxPtyeOUNPoZCRgwbFFISkyyHSNYWs5ogomdtU/CQOFvgVCXCouPa0r99h4gUO8=

Hello!

I'm new to the usage of the CGAL library. I'm especially interested in
the "2D Regularized Boolean Set-Operations" so I went trough all the
examples in the documentation. I have a question regarding example in
the "14.3.2 Operating on Polygons with Circular Arcs"
http://www.cgal.org/Manual/3.3/examples/Boolean_set_operations_2/circle_segment.cpp

when I execute the example with the values presented I get correct
result:

{ Outer boundary =
[ 8 curves:
start (0, 5) --> end (0, 1)
start (0, 1) --> end (1, 0)
circle center(1, 1), radious(1), orientation(1)
start (1, 0) --> end (5, 0)
start (5, 0) --> end (6, 1)
circle center(5, 1), radious(1), orientation(1)
start (6, 1) --> end (6, 5)
start (6, 5) --> end (5, 6)
circle center(5, 5), radious(1), orientation(1)
start (5, 6) --> end (1, 6)
start (1, 6) --> end (0, 5)
circle center(1, 5), radious(1), orientation(1)
1 holes:
Hole #1 = [ 4 curves:
start (2, 4) --> end (4, 4)
start (4, 4) --> end (4, 2)
start (4, 2) --> end (2, 2)
start (2, 2) --> end (2, 4)
}

Picture:
http://img138.imageshack.us/img138/5940/goodresultsrf7.jpg


but when I multiply input data by 100, result is wrong

circ1 = construct_polygon(Circle_2(Point_2(100, 100), 100));
S.insert(circ1);
circ2 = construct_polygon(Circle_2(Point_2(500, 100), 100));
S.insert(circ2);
circ3 = construct_polygon(Circle_2(Point_2(500, 500), 100));
S.insert(circ3);
circ4 = construct_polygon(Circle_2(Point_2(100, 500), 100));
S.insert(circ4);

// Compute the union with four rectangles incrementally.
Polygon_2 rect1, rect2, rect3, rect4;

rect1 = construct_polygon(Point_2(100, 0), Point_2(500, 0),
Point_2(500, 200), Point_2(100, 200));
S.join (rect1);

rect2 = construct_polygon(Point_2(100, 400), Point_2(500, 400),
Point_2(500, 600), Point_2(100, 600));
S.join (rect2);

rect3 = construct_polygon(Point_2(0, 100), Point_2(200, 100),
Point_2(200, 500), Point_2(0, 500));
S.join (rect3);

rect4 = construct_polygon(Point_2(400, 100), Point_2(600, 100),
Point_2(600, 500), Point_2(400, 500));

Result:

{ Outer boundary =
[ 16 curves:
start (600, 500) --> end (510, 500)
start (510, 500) --> end (500, 510)
circle center(500, 500), radious(10), orientation(1)
start (500, 510) --> end (500, 600)
start (500, 600) --> end (100, 600)
start (100, 600) --> end (100, 510)
start (100, 510) --> end (90, 500)
circle center(100, 500), radious(10), orientation(1)
start (90, 500) --> end (0, 500)
start (0, 500) --> end (0, 100)
start (0, 100) --> end (90, 100)
start (90, 100) --> end (100, 90)
circle center(100, 100), radious(10), orientation(1)
start (100, 90) --> end (100, 0)
start (100, 0) --> end (500, 0)
start (500, 0) --> end (500, 90)
start (500, 90) --> end (510, 100)
circle center(500, 100), radious(10), orientation(1)
start (510, 100) --> end (600, 100)
start (600, 100) --> end (600, 500)
1 holes:
Hole #1 = [ 4 curves:
start (200, 400) --> end (400, 400)
start (400, 400) --> end (400, 200)
start (400, 200) --> end (200, 200)
start (200, 200) --> end (200, 400)
}

Picture:
http://img138.imageshack.us/img138/7459/wrongresultslz1.jpg


I don't understand why? Shouldn't I get the same number of curves in the
result but proportionally bigger?

Thank you for all the help.

Regards,
Marko Kukovec




Archive powered by MHonArc 2.6.16.

Top of Page