User:Clouddrift/GSoC2014

From BRL-CAD
< User:Clouddrift
Revision as of 07:29, 15 March 2014 by Clouddrift (talk | contribs) (Synopsis)

Project Title

Mesh Library Cleanup

Synopsis

BRL-CAD has an extensive n-manifold (NMG) polygonal mesh library presently embedded within LIBRT. N-manifold can provide an arbitrary boundary representation structure. This part in BRL-CAD runs good but not excellent, for it is far away from expected stable, rubost and easy-read. Sometimes it causes some awkward performance problem and some algorithm based on current NMG is inefficient. The purpose of this project is to clean, validate and verify relevant source code about NMG.

Detailed description

The current status of NMG

Now, this part of NMG is mainly located in raytrace.h and nmg.h where is mixed with other irrelevant structs, macros and functions. It's not an ideal organization for other developers to read, use and maintain.

Remove redundant code

For some reason, the NMG primitive is originally designed and implemented for a stand-alone NMG CAD. But the situation changed. Some level of current NMG structure can be replaced with some part in database structure. So they become redundant now. Including:
1) model: represents the whole geometry, which is similar to the content of BRL-CAD *.g file.
2) nmgregion: sub-level structure beneath model, which is similar to the BRL-CAD region struct.
3) Maybe others.
And I will remove them as well as relevant macros and functions to simply the problem. In the process, I should make sure there is no side-effect or new trouble introduced.

Extract NMG to be a stand-alone library

The concept of manifold is critical to many parts of geometry and mathematical physics because it allows more complicated structures to be described and understood in terms of the relatively well-understood way. So it can and should be combined into a function-independent library. I will check the every lines of code in LIBRT, then move the NMG parts into a new stand-alone library named LIBNMG.
Besides, dividing the whole content into several header and code files will be more reasonable just like what be done in LIBBU. Accurate division can make code organization more clear.

Add comments

Complement some proper comments for header files in the new-built LIBNMG library.

Unit test

According to the experience from other developers in community, it is absolutely that lots of bugs hidden in LIBNMG. So a systematic set of test case should be written. More bugs is discovered and fixed, the new-built library will be more readable and stable.
In my opinion, since test-driven development is indispensable in this project, gtest will be a good choice for the coming unit test.

Documentation

During my writing this proposal, lots of data should be read. So in the last stage, for others being interested in this part, I will describe how I approached this project and give some useful links and a change list.

Schedule

  • Week 1 (19 May - 25 May): Estimate completely the influence of removing abundant structs. Make sure nothing is missing to be paid attention to.
  • Week 2 (26 May - 1 June): Remove the abundant structs and test briefly.
  • Week 3 - 4 (2 June - 15 June): Move the NMG parts from LIBRT into a new-built library, LIBNMG.
  • Week 5 - 6 (16 June - 29 June): Prepar for the mid-evaluation and take a break for days.
  • Week 7 - 9 (30 June - 20 July): Write test case by using gtest, and make sure everything goes well just like before and to fix bugs found.
  • Week 10 (21 July - 27 July): Complement the comments for the new library.
  • Week 11 (28 July - 3 August): Writing relevant documents.
  • Week 12 - 13 (4 August - 17 August): Prepare for final-evaluation.

Brief background

I am a master graduate student in State Key Lab of CAD & CG, School of CS, Zhejiang University, China. I have 3-year work experience in programming a CAD module for an Optical Critical Dimension system in a conductor measurement company using Open Cascade. Now, my main research direction is something about hexahedral mesh.

Why BRL-CAD

It's no doubt that many commercial CAD software is outstanding and amazing, but their high price of each copy decides that not everyone could get such a CAD tool to try and improve their unconstrained idea. We need open source software to make people free, free, and more free. I like this open source CAD system and community. I believe it is worthy contributing efforts for BRL-CAD. At the meantime, I can learn rich and irreplaceable experience in connection with CAD from this project and other developers.

Why me

I'm a graduate student of Zhejiang University, which is famous for its reputation in the field of CAD&CG research. I have a good background in CAD theory and programming skills. What's more important, this project is mainly about NMG mesh that is more or less related to my research and work experience. I have written a CAD module for an optical measurement system and it's easy-use and user-friendly interface help the company's sales. I am sure it is no problem for me to finish it with high quality in time.
And, I make sure I can dedicate at least 40 hours per week in this summer holiday, if needed can be more. I understand clearly the importance of adequate communication, getting suggestions from other experienced developers and theory experts can enormously saves twists and turns.

References

[1] http://www.scorec.rpi.edu/REPORTS/1986-1.pdf
[2] http://sourceforge.net/p/brlcad/mailman/message/28536100