Subject: CGAL users discussion list
List archive
- From: Benoît Presles <>
- To:
- Cc: Michael Hoffmann <>
- Subject: Re: [cgal-discuss] Bug in min_strip_2 function
- Date: Thu, 07 Oct 2010 10:40:15 +0200
Hello Michael,
After some tests, I think there is a bug in the min_strip_2 function (cf.
"minStrip.cpp" to reproduce the bug).
I compute the min strip of the quadrilateral shown in figure "minStrip.png"
and I get the following results:
-0.5818 -0.0609 0.547501
-0.5818 -0.0609 0.257432
One of these lines is printed in red.
In my point of view this result is not correct, the min strip of this set of
points should be the green line and the line parallel to the green line
passing through the point (0.8726,0.6539).
Thank your in advance for your help,
thanks for your report. I think the patch below fixes the problem.
I have just tried to apply the patch below and I get an error:
patch --verbose < monpatch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Min_quadrilateral_traits_2.h (revision 59078)
|+++ Min_quadrilateral_traits_2.h (working copy)
--------------------------
Patching file Min_quadrilateral_traits_2.h using Plan A...
Hunk #1 FAILED at 215.
Hunk #2 FAILED at 227.
2 out of 2 hunks FAILED -- saving rejects to file Min_quadrilateral_traits_2.h.rej
done
I think it is because I do not have the same version as you of "Min_quadrilateral_traits_2.h" (// $Id: Min_quadrilateral_traits_2.h 56667 2010-06-09 07:37:13Z sloriot $)
Thank you very much for your help,
Best Regards,
Benoît
===================================================================
--- Min_quadrilateral_traits_2.h (revision 59078)
+++ Min_quadrilateral_traits_2.h (working copy)
@@ -215,9 +215,9 @@
RT
width_numerator(const Strip_2& r, Cartesian_tag) const
{
- return
+ return CGAL_NTS square(
r.second.dx() * (r.third.y() - r.first.y()) +
- r.second.dy() * (r.first.x() - r.third.x());
+ r.second.dy() * (r.first.x() - r.third.x()));
}
RT
@@ -227,16 +227,16 @@
RT
width_numerator(const Strip_2& r, Homogeneous_tag) const
{
- return
+ return CGAL_NTS square(
r.second.dx() *
(r.third.hy() * r.first.hw() - r.first.hy() * r.third.hw()) +
r.second.dy() *
- (r.first.hx() * r.third.hw() - r.third.hx() * r.first.hw());
+ (r.first.hx() * r.third.hw() - r.third.hx() * r.first.hw()));
}
RT
width_denominator(const Strip_2& r, Homogeneous_tag) const {
- return r.first.hw() * r.third.hw() *
+ return CGAL_NTS square(r.first.hw()) * CGAL_NTS square(r.third.hw()) *
(CGAL_NTS square(r.second.dx()) + CGAL_NTS square(r.second.dy()));
}
- [cgal-discuss] Bug in min_strip_2 function, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Sebastien Loriot (GeometryFactory), 10/05/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Michael Hoffmann, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Benoît Presles, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Michael Hoffmann, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Benoît Presles, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Michael Hoffmann, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Benoît Presles, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Michael Hoffmann, 10/07/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Michael Hoffmann, 10/05/2010
- Re: [cgal-discuss] Bug in min_strip_2 function, Sebastien Loriot (GeometryFactory), 10/05/2010
Archive powered by MHonArc 2.6.16.