Difference between revisions of "User:Phoenix/GSoc2013/Proposal"

From BRL-CAD
(The current status of NURBS intersection & evaluations)
(Calculating surface-surface intersection curves)
Line 16: Line 16:
 
And I also tried to calculate boolean operations on NURBS. I just focus on the union of two spheres, which is a well-conditioning problem, and tried to get a evaluated model which can pass the IsValid check offered by openNURBS, but failed. So this part only have many lines of code written, but doesn't have enough functionality, and lots of work ahead should be done.
 
And I also tried to calculate boolean operations on NURBS. I just focus on the union of two spheres, which is a well-conditioning problem, and tried to get a evaluated model which can pass the IsValid check offered by openNURBS, but failed. So this part only have many lines of code written, but doesn't have enough functionality, and lots of work ahead should be done.
 
== Calculating surface-surface intersection curves ==
 
== Calculating surface-surface intersection curves ==
 +
The function calculating NURBS surface-surface intersection curves is in /src/libbrep/opennurbs_ext.cpp:
 +
int
 +
surface_surface_intersection(const ON_Surface* surfA,
 +
    const ON_Surface* surfB,
 +
    ON_SimpleArray<ON_NurbsCurve*> &intersect3d,
 +
    ON_SimpleArray<ON_NurbsCurve*> &intersect_uv2d,
 +
    ON_SimpleArray<ON_NurbsCurve*> &intersect_st2d,
 +
    double max_dis,
 +
    double)

Revision as of 09:58, 16 April 2013

Project title

NURBS Intersection & Evaluation

Brief summary

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 some improvement are still needed. And the remaining part was done in a rush, with lots of features still missing. So in this summer, 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 but is not limited to: (1) improve the current SSI routine to deal with special cases; (2) split the surfaces with the intersection curves we get in (1); (3) combine the new trimmed faces to get a new evaluated model. If there's still some time remaining, I will tried some other interesting topics, like NURBS editing in mged/archer, or anything that have great priority in BRL-CAD.

Detailed description

Introduction

NURBS surface-surface intersection is still a high-priority project in BRL-CAD. NURBS is a dominant geometric representation format in CADs, so we need to have enough support for it in BRL-CAD. Currently most objects in BRL-CAD are modeled in CSG, when converted to NURBS representations, the primitives are first converted to NURBS primitives, which BRL-CAD supports, but the next step is missing - evaluate the boolean operations on NURBS primitives, and then get a evaluated NURBS combination as the original CSG combination object. Currently BRL-CAD only gives ``CSG tree + unevaluated NURBS primitives", so we need NURBS intersections and evaluations.

Below is my detailed proposal for this summer's project. In the first part, I'd like to mention the current status of this part left out last summer. Then I list my plan on how to implement the remaining parts, dividing into three parts. In addition, something I want to do if I have additional time will be listed. At last, I'd like to show you the schedule and what I have already done this year about this project.

The current status of NURBS intersections & evaluations

Last year I spent about a month on NURBS intersections after I almost finished the Implicit to NURBS conversion project. I implemented a surface-surface intersection routine, using the sub-division method referred in a paper [1]. Now it can give us the intersection curves of two NURBS surfaces in both 3D spaces and 2D uv spaces. If the two inputs are in good condition, the result is quite reasonable (For detailed information, please see my last year's development log, there will be some convincing figures). But when the two surfaces have some coincides, the routine may have problems, because it first calculates the intersection of surfaces' bounding boxes, and then use polylines to approximate the curves, however, in this case, we should get a surface, not some curves. And for some strange shaped surfaces, the accuracy of the output may be not ideal. (max_dis can be inputted manually to get a better result, but it's a burden for users)

And I also tried to calculate boolean operations on NURBS. I just focus on the union of two spheres, which is a well-conditioning problem, and tried to get a evaluated model which can pass the IsValid check offered by openNURBS, but failed. So this part only have many lines of code written, but doesn't have enough functionality, and lots of work ahead should be done.

Calculating surface-surface intersection curves

The function calculating NURBS surface-surface intersection curves is in /src/libbrep/opennurbs_ext.cpp: int surface_surface_intersection(const ON_Surface* surfA, const ON_Surface* surfB, ON_SimpleArray<ON_NurbsCurve*> &intersect3d, ON_SimpleArray<ON_NurbsCurve*> &intersect_uv2d, ON_SimpleArray<ON_NurbsCurve*> &intersect_st2d, double max_dis, double)