Editing User:Phoenix/GSoc2013/Proposal

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 3: Line 3:
  
 
= Brief summary =
 
= Brief summary =
BRL-CAD currently has a routine to compute the intersection curves of two NURBS surfaces, and in general cases it works well, but to get a more robust one, I still need lots of work on it this summer. Lots of tests and verification are needed, and maybe a TDD (Test Driven Development) can be used in this step. To get the SSI working in all cases, no matter what the input is like is very important, otherwise it would be useless.
+
Last summer I tried to do something on NURBS surface-surface intersection for BRL-CAD, but due to the limitation of time I cannot completely finish this project. I have implemented a routine to compute the intersection curves of two NURBS surfaces, and in general cases it works well, but to get a more robust one, I still need lots of work on it this summer. Lots of tests and verification are needed, and maybe a TDD (Test Driven Development) can be used in this step. To get the SSI working in all cases, no matter what the input is like is very important, otherwise it would be useless.
  
In this summer, if there is enough time, I would like to finish the remaining parts of evaluating NURBS, and finally offer a routine to convert CSG combination objects to evaluated NURBS objects. The work includes partitioning a surface, and building the new NURBS geometry. If there's still some time remaining, I will tried to do more tests and verification to make the implementation better.
+
The remaining part of evaluating NURBS was done in a rush last summer, with lots of features still missing (definitely cannot work now). So in this summer, if there is enough time, I would like to continue to work on this project, finishing the remaining parts, and finally offer a routine to convert CSG combination objects to evaluated NURBS objects. The work includes partitioning a surface, and building the new NURBS geometry. If there's still some time remaining, I will tried to do more tests and verification to make the implementation better.
  
 
= Detailed description =
 
= Detailed description =
Line 23: Line 23:
 
This are basis of SSI, and can be used in dealing with some degenerated issues in SSI. So I'd like to implement this in the very beginning of my schedule. Like the surface-surface intersection, the subdivision algorithm can be a good candidate in these intersection problems, as BRL-CAD already has the functionality of generating curve trees and surface trees (see src/libbrep/opennurbs_ext.cpp). So for example, in the C/C cases, we can generate the curve trees of the two curves, calculating the intersections of the bounding boxes, and get the intersection point with triangular approximations. In C/S cases, the intersections should be between curve trees and surface trees.
 
This are basis of SSI, and can be used in dealing with some degenerated issues in SSI. So I'd like to implement this in the very beginning of my schedule. Like the surface-surface intersection, the subdivision algorithm can be a good candidate in these intersection problems, as BRL-CAD already has the functionality of generating curve trees and surface trees (see src/libbrep/opennurbs_ext.cpp). So for example, in the C/C cases, we can generate the curve trees of the two curves, calculating the intersections of the bounding boxes, and get the intersection point with triangular approximations. In C/S cases, the intersections should be between curve trees and surface trees.
  
The paper [3] is good reference on defining intersection problems, but its calculations are based on numerical analysis, which I think can be easily suffered from floating point precision and accuracy (for high dimension problems like C/C, C/S and S/S), so I would like to use the subdivision method instead, which already proves good functionality in the SSI implemented. As for P/C and P/S, the get_closest_point() functions in libbrep which are used for brep raytracing, can be used to first get the closest point on a surface (curve) from a given point, and then we can compute the distance and compare it with a given tolerance to decide whether there is an intersection or not. And P/P is the most direct one - we can compute their distance, and compare it with the tolerance, but a point can have an area with uncertainty, so is the result intersection point, which is discussed in the later part "Keeping track of the uncertainty intransitivity".
+
The paper [3] is good reference on defining intersection problems, but its calculations are based on numerical analysis, which I think can be easily suffered from floating point precision and accuracy (for high dimension problems like C/C, C/S and S/S), so I would like to use the subdivision method instead, which already proves good functionality in the SSI implemented. In the other hand, the openNURBS library has strong evaluation support which can be very helpful in P/P, P/C and P/S.
  
 
Just like SSI, lots of tests and verification are needed in all these intersection problems. Some corner cases need to be considered as well. For example, two curves can touch at the endpoints, and a curve can have some part residing on the surface (that is, the intersection is a curve instead of a point, which is the general case). I should try to make the implementation as robust as possible, and it SHOULD work in all cases regardless of the input. Otherwise, the robustness of SSI can be affected, if it has some part based on lower dimensional intersection routines.
 
Just like SSI, lots of tests and verification are needed in all these intersection problems. Some corner cases need to be considered as well. For example, two curves can touch at the endpoints, and a curve can have some part residing on the surface (that is, the intersection is a curve instead of a point, which is the general case). I should try to make the implementation as robust as possible, and it SHOULD work in all cases regardless of the input. Otherwise, the robustness of SSI can be affected, if it has some part based on lower dimensional intersection routines.
Line 71: Line 71:
  
 
== Keeping track of the uncertainty intransitivity ==
 
== Keeping track of the uncertainty intransitivity ==
Uncertainty intransitivity can be introduced by the limited precision of floating point representations, and the tolerance used during intersections. Paper [5] and [6] suggests an interval arithmetic based approach for tracking the uncertainty intransitivity and improve robustness. A 3D point is not just the coordinates, but three intervals one for each axis, or the coordinates together with a diameter resulting in a sphere volume. A curve and a surface is represented by interval based CVs and interval weights. Although the interval arithmetic approach is hard to applied directly to BRL-CAD, we can get some ideas on how to keep track of the the area of uncertainty around points (curves, surfaces) during the computation of intersections, and maybe report it to the users (e.g in ON_PX_EVENTs, we not only gives an intersection point if there is an intersection, but also the uncertainty area around that point, for example, a diameter or something like that).
+
Uncertainty intransitivity can be introduced by the limited precision of floating point representations, and the tolerance used during intersections. Paper [5] and [6] suggests an interval arithmetic based approach for tracking the uncertainty intransitivity and improve robustness. Although the interval arithmetic approach is hard to applied directly to BRL-CAD, we can get some ideas on how to keep track of the the area of uncertainty around points (curves, surfaces) during the computation of intersections, and maybe report it to the users (e.g in ON_PX_EVENTs).
  
 
Again, verification is needed for this issue. Actually, as Sean says, the uncertainty intransitivity is coincidentally also the MAIN failing of most boolean evaluation implementations, so we need to give it a high priority.
 
Again, verification is needed for this issue. Actually, as Sean says, the uncertainty intransitivity is coincidentally also the MAIN failing of most boolean evaluation implementations, so we need to give it a high priority.
Line 128: Line 128:
  
 
[4] http://www.math.uiuc.edu/~nmd/temp/hass3.pdf
 
[4] http://www.math.uiuc.edu/~nmd/temp/hass3.pdf
 
[5] http://www.sciencedirect.com/science/article/pii/0010448596000139
 
 
[6] http://www.sciencedirect.com/science/article/pii/0010448596000140
 
  
 
= Deliverables =
 
= Deliverables =
Line 220: Line 216:
 
* Use openNURBS APIs for SSI, and move some code from openNURBS to libbrep (Commit  revision 55322)
 
* Use openNURBS APIs for SSI, and move some code from openNURBS to libbrep (Commit  revision 55322)
 
** Extend the ON_SSX_EVENT::Dump() functionality.
 
** Extend the ON_SSX_EVENT::Dump() functionality.
** Use max_dis_2dA and max_dis_2dB for merging polyline segments. (Commit revision 55433)
 
** Use and ON_Intersect() overload for SSI, and change the return value for consistency with other ON_Intersect()s, and some modifications to the ON_SSX_EVENT so that it can be consistent to both the current version of openNURBS in BRL-CAD and the newest version of openNURBS. (Commit revision 55439)
 
** Fix return value of ON_Intersect (SSI) - returns the number of intersection events (consistent with openNURBS), and add comment to brep.h. Remove the uncessary check of OPENNURBS_PLUS_INC_, and reduce debugging messages. (Commit revision 55550)
 
* A test geometry for SSI - using arb8. (Commit revision 55552)
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)