Many fast intersections

Hi all,

Currently I'm doing some research for a simulation project I am in.
It is devided into a GUI part, that mainly reads STEP geometries and does some preprocessing and a computation part that does the simulation itself. The GUI is using OpenCascade for reading the STEP files, drawing it and so on.

Now I'm trying to find out whether we could use OpenCascade for the computation core as well.

The requirements are that we have an exact 2D geometry (like the b-rep we get from OpenCascade when reading STEP files) and this geometry will be intersected with many (tousands and millions or even more!) paraxial rectangles (lets call them patches).
Most of them (~ more then 90%) lie within geometry so the intersection is trival. The others intersect with the boundary so it will get more complicated.
After the intersection has been done I do not need the exact representation of the resulting types shapes anymore. An approximation is better now so I want to generate one.
The following image trys to explain all this:

http://img9.imageshack.us/img9/1940/methoda.png

I tried to do this with BRepAlgoAPI_Section but it seams to be a little to slow for my purposes.
I think it could be a way faster if there was a algorithm that takes account on the facts that I only need 2D data, that one of the intersection operands is allways a paraxial rectangular and that first checks whether the patch compleatly lies withing the other geometry.

So my question is whether there is some kind of that intersection algorithm in OpenCascade or a way to construct one from the many that are provided?

The second question is whether there is a way to do the approximation of the exact geometry after that intersection (that may has splines, circles, ...) to a simple polygon.

Would be nice if someone could give me some hints!

Thanks,

Albert

JuryS's picture

Hi, Albert.
Witch type of output format you are need? I can recommend for you SVG output. Also if you are really need only 2D than you can build BSP tree, without any calculation, It's method very fast, because use Z-coordinates of OpenGL pixels. See the gl2ps library for the sample.
Also if you try to use SVG, there is no problem to render this data on any screen, any size, without deterioration quality.

Best regards,
Yuriy

Albert Woo's picture

First thanks for the answers Yuriy!

But I do not need any output or drawing with OpenGL here. What I need to do with the resulting little domains after the intersection is to evaluate some integrals on them (Thats why I want polygons in the end. That makes the integration easier).

JuryS's picture

Without BSP tree you can't fast calculating Intersections.
If you are only need mathematic result there is cool classes in OCC for calculating:
IntAna package in toolkit GeomBase or use some Top algorithms BRepExtrema_DistShapeShape or another.

Also I'm really don't understand how you can takes polygons without OpenGL or DirectX context. Maybe some another answers on this thread

Forum supervisor's picture

Dear Albert,
This kind of algorithms doesn't exist in OCCT at the moment, though it could be developed in efficient way using current OCCT functionality and existing data structures.
If you need our support you may contact us via Contact Form - http://www.opencascade.org/about/contacts/. We will try to find a solution acceptable for you.
As well as training and e-learning courses are at your disposal - http://www.opencascade.org/support/training/.
Regards