Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Dealing with Precision and Speed

Subject: CGAL users discussion list

List archive

[cgal-discuss] Dealing with Precision and Speed


Chronological Thread 
  • From: Vicomt <>
  • To:
  • Subject: [cgal-discuss] Dealing with Precision and Speed
  • Date: Fri, 19 Mar 2010 02:54:19 -0800 (PST)


OK, so I have a problem, a couple of problems in fact.

The current project I'm working on works as a plugin DLL within another
application, this other application is a double based CAD engine, it has
it's won problems with precision which it gets round by using tolerances.

I wanted to go away from toleranced or inherently inaccurate geometry, so I
started off using the exact_predicates_exact_construction kernel based on
the internal MP_Float type. thisngs seems to go well until I started
noticing some serious problems with speed, not 25% or even 50% slower, these
algorithms seemed to run considerably slower, somwhere in the region of
10-20 times the amount of time taken. so I gave up for a while. I dropped
back to using a cartesian<double> kernel and started building my own methods
with would allow me to use tolerances when I needed them.

I got everything working - success, or so I thought, until I realised I
wasn't correctly handling certain geometrical cases, to fix this I had to
introduce a couple of transformations (rotation around an axis) to get my
geometry in a known format before I processed the algorithm. That's when it
all fell apart.

with a double precision kernel, rotating a facet a couple of times, then
modifying that facet, and rotating back to my original coordinate space
introduced errors. errors big enough for various CGAL functions to stop
working - like plane_3::has_on() which returns false when my point is
literally 1exp-15 units away from the plane.

so I went back to an exact kernel again, and I'm still sat here over an hour
after I started the run. when the double kernel runs in approximately 2
tenths of a second.

I'm confused. Is there something I could be doing which results in MP_Float
based calculations being thousands of times slower? is there any way I can
make CGAL tolerant of tiny distances in case there's nothing I can do with
the complex numbers?

I hope someone can send some enlightenment my way.

Karl
--
View this message in context:
http://n4.nabble.com/Dealing-with-Precision-and-Speed-tp1599212p1599212.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page