Editing User:Clouddrift/GSoC2014

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 8: Line 8:
  
 
== Synopsis ==
 
== 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 perfect, for it is far from, as is 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, and then add the missing Euler Operation to it.
+
: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, and then add the missing Euler Operation for it.
  
 
== Concepts ==
 
== Concepts ==
  
:Some important concepts should be clarified before starting this project.
+
:Some important concepts should be clear before starting this project.
  
 
=== Manifold ===
 
=== Manifold ===
  
:Manifold representation is commonly used in many commercial boundary based solid modeling systems. Kinds of data structures are useful to describe manifold solid. In early years, wing-edge data structure is widely accepted by researchers and companies. With the development of related theories, the half-edge data structure appeared. Splitting an edge into two half-edge makes it more flexible than wing-edge, especially when iterating elements.
+
:Manifold representation is commonly used in many commercial boundary based solid modeling systems. Kinds of data structures are useful to describe manifold solid. In early years, wing-edge data structure is widely accepted by researchers and companies. With development of the theory, half-edge data structure exists. Splitting an edge into two half-edge makes it more flexible than wing-edge, especially when iterating elements.
  
 
: As a general solid representation, half-edge data structure is enough. The lower operations named Euler Operation can make sure the completeness and validity of the solid, and the higher operations such as sweeping, fillet and others enhance the usability. But in a CAD system, we will give a proper representation for other situation which can appear as the result of the standard and the regularized Bool Operation. For instance, several volumes or faces are only connected by a single vertex.
 
: As a general solid representation, half-edge data structure is enough. The lower operations named Euler Operation can make sure the completeness and validity of the solid, and the higher operations such as sweeping, fillet and others enhance the usability. But in a CAD system, we will give a proper representation for other situation which can appear as the result of the standard and the regularized Bool Operation. For instance, several volumes or faces are only connected by a single vertex.
  
 
=== Non-manifold ===
 
=== Non-manifold ===
:To support the structure mentioned above, the core concept of this project, non-manifold is put forward. Unlike manifold, Non-manifold is a geometric modeling term referring to topological situations which are not restricted to be two-manifold. It can define not only volume but also surface, curve and point in a single uniform representation.
+
:To support the structure mentioned above, the core concept of this project, non-manifold is putted forward. Unlike manifold, Non-manifold is a geometric modeling term referring to topological situations which are not restricted to be two-manifold. It can define not only volume but also surface, curve and point in a single uniform representation.
  
:Compared with half-edge data structure, Weiler (the author of the paper[1]) proposes a new representation method, Radial Edge data structure, which extends half element from only edge to vertex, loop and face. Such change is worthy, though it makes the data structure more complex. The boundary elements may range from a surface(2D), an edge(1D), and a vertex(0D).
+
:Compared with half-edge data structure, Weiler (the author of the paper[1]) propose a new representation method, Radial Edge data structure, which extends half element from only edge to vertex, loop and face. Such change is worthy, though, it makes the data structure more complex. The boundary elements may range from a surface(2D), an edge(1D), and a vertex(0D).
  
 
== Detailed description ==
 
== Detailed description ==
Line 31: Line 31:
 
==== Codes in nmg.h ====
 
==== Codes in nmg.h ====
  
:Core NMG structure and relevant macros are defined in this file. Including:
+
:Core NMG structure as well as relevant macros are defined in this file. Including:
 
:*'''NMG elements (7):''' The basic parts of Radial Edge Data Structure, containing model, region, shell, face, loop, edge and vertex.
 
:*'''NMG elements (7):''' The basic parts of Radial Edge Data Structure, containing model, region, shell, face, loop, edge and vertex.
 
:*'''NMG using elements (4):''' The using parts of Radial Edge Data Structure, containing faceuse, loopuse, edgeuse and vertexuse.
 
:*'''NMG using elements (4):''' The using parts of Radial Edge Data Structure, containing faceuse, loopuse, edgeuse and vertexuse.
Line 39: Line 39:
  
 
==== Codes in raytrace.h ====
 
==== Codes in raytrace.h ====
:The routines about NMG here are mainly operations or functions acting on basic NMG structure. Including:
+
:The routines about NMG here are mainly operation or functions acting on basic NMG structure. Including:
 
:* '''Creation:''' Create a new NMG element without geometry information.
 
:* '''Creation:''' Create a new NMG element without geometry information.
:* '''Removal:''' Remove specific element from an existing NMG element.
+
:* '''Removal:''' Remove specific element from a exist NMG element .
 
:* '''Assignment:''' Assign geometry information to the specific topology.
 
:* '''Assignment:''' Assign geometry information to the specific topology.
 
:* '''Modification:''' Modify the specific topology.
 
:* '''Modification:''' Modify the specific topology.
 
:* '''Print:''' Give some information about the specific NMG element in form of string.
 
:* '''Print:''' Give some information about the specific NMG element in form of string.
:* '''Classification:''' Compute the relationship between two NMG elements, such as point and face, point and solid, and so on.
+
:* '''Classification:''' Compute the relationship between two NMG element, such as point and face, point to solid and so on.
:* '''Intersection:''' Compute the intersection result between two NMG elements, such as getting a point from two edges or a line from two faces.
+
:* '''Intersection:''' Compute the intersection result between two NMG element, such as getting a point from two edge or a line from two face.
 
:* '''Count:''' Count the specific element in a NMG element.
 
:* '''Count:''' Count the specific element in a NMG element.
 
:* '''Other Functions'''.
 
:* '''Other Functions'''.
  
 
=== Remove redundant code ===
 
=== 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 levels of current NMG become redundant, since they are able to be replaced by some parts in database structure now. Including:
+
:For some reason, the NMG primitive is originally designed and implemented for a stand-alone NMG CAD. But the situation changed. Some levels of current NMG become redundant, since it is possible to replace them with some parts in database structure now. Including:
  
 
:* '''model''': represents the whole geometry, which is similar to the content of BRL-CAD *.g file.
 
:* '''model''': represents the whole geometry, which is similar to the content of BRL-CAD *.g file.
Line 59: Line 59:
 
:* '''Maybe others'''.
 
:* '''Maybe others'''.
  
:I will remove them as well as relevant macros and functions to simplify the problem. In the process, I should make sure there is no side-effect or new trouble introduced.
+
: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 ===
 
=== Extract NMG to be a stand-alone library ===
Line 67: Line 67:
  
 
=== Add comments ===
 
=== Add comments ===
:Complement some proper comments for each header file in the new-built LIBNMG library. I will obey following rules when writing comments.
+
:Complement some proper comments for each header file in the new-built LIBNMG library. I will obey to following rules when writing comments.
 
:*'''Header file:''' Entirely functional description.
 
:*'''Header file:''' Entirely functional description.
 
:*'''Struct:''' Complete description for whole struct and each member.
 
:*'''Struct:''' Complete description for whole struct and each member.
Line 76: Line 76:
 
:According to the experience from other developers in community, it is absolute that lots of bugs are hidden in LIBNMG. So it is necessary to write a systematic set of test case. With more bugs discovered and fixed, the new-built library will be more readable and stable.
 
:According to the experience from other developers in community, it is absolute that lots of bugs are hidden in LIBNMG. So it is necessary to write a systematic set of test case. With more bugs discovered and fixed, the new-built library will be more readable and stable.
  
:There is some similar work done in src/libbu/tests. Finishing the test cases by consulting these samples will help me avoid many unnecessary mistakes. And what's more important, it must be assured that they can operate normally in CMake which BRL-CAD use to build system.
+
:There are some similar work done in src/libbu/tests. Finishing the test cases by consulting these samples will help me to avoid many unnecessary mistakes. And what's most important, it must be assured that they can operate normally in CMake which BRL-CAD use to build system.
  
 
=== Add Euler Operation ===
 
=== Add Euler Operation ===
  
:Euler operators are useful to manipulate manifold boundary graph based topology representations. It provides a flexible base for higher level operators while insulating them from the details and complexities of the data structures utilized. Euler operation is useful but is missed in current BRL-CAD. After the successful migration and reorganization of LIBNMG, adding Euler operation for BRL-CAD is necessary.
+
:Euler operators are useful to manipulate manifold boundary graph based topology representations. It provides a flexible base for higher level operators while insulating them from the details and complexities of the data structures utilized. Euler operation is useful but is missed in current BRL-CAD. After the successful migration and reorganization of LIBNMG, Adding Euler operation for BRL-CAD is necessary.
  
:I will reliably add Euler Operation to the system and test them. I have experience in writing Euler Operation for an implement of manifold data structure before, so it will not baffle me. All types of Euler Operation will be included.
+
:I will reliably add Euler Operation to the system and test them. I have experience in writing Euler Operation for an implement of manifold data structure before, so it will not baffle me. All types of Euler Operation mentioned in paper[1] will be included.
  
 
==== Construction Operators ====
 
==== Construction Operators ====
Line 100: Line 100:
  
 
==== Auxiliary Operators ====
 
==== Auxiliary Operators ====
:*'''SEMV( e1, v, e2 ):''' Split edge '''e1''' into two segments to create a new vertex '''v1''' and a new edge '''e2'''.
+
:*'''SEMV( e1, v, e2 ):''' Split edge '''e1''' into two segment to create a new vertex '''v1''' and a new edge '''e2'''.
 
:*'''JEKV( e1, e2 ):''' merge two adjacent edges, '''e1''' and '''e2''', then remove the common vertex.
 
:*'''JEKV( e1, e2 ):''' merge two adjacent edges, '''e1''' and '''e2''', then remove the common vertex.
  
Line 107: Line 107:
  
 
== Schedule ==
 
== Schedule ==
:*Preparation Step 1 (1 April - 18 April): Deeply understanding current logic relationship and program architecture concerning NMG.
 
 
:*Preparation Step 2 (19 April - 18 May): Discuss with mentors/developers about the solution for removing redundant structs, moving into a stand-alone library, and so on. Try as much as possible to test and verify all possibilities.
 
 
 
:*Week 1 (19 May - 25 May): Estimate completely the influence of removing abundant structs. Make sure nothing misses attention.
 
:*Week 1 (19 May - 25 May): Estimate completely the influence of removing abundant structs. Make sure nothing misses attention.
  
Line 130: Line 126:
  
 
== Brief background ==
 
== Brief background ==
:I am a graduate student in State Key Lab of CAD & CG, School of Computer Science, Zhejiang University, China. I have 3 years' 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.
+
:I am a 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 ==
 
== Why BRL-CAD ==
:There is no doubt that an amount of 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 free more. I like this open source CAD system and community. I believe it is worthy to contribute efforts for BRL-CAD. At the meantime, I can learn rich and irreplaceable experience in connection with CAD from this project and other developers.
+
:It's no doubt that much 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 free more. I like this open source CAD system and community. I believe it is worthy to contribute 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 ==
 
== 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 good background in CAD theories and programming skills. Moreover, this project is mainly about NMG mesh which is to a large extent related to my research and work experience. I have written a CAD module for an optical measurement system, whose user-friendly interface promoted the company's sales. I am sure it is no problem for me to finish it with high quality in time.
+
:I'm a graduate student of Zhejiang University, which is famous for its reputation in the field of CAD&CG research. I have 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, whose user-friendly interface promoted 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. I understand clearly the importance of adequate communication with other experienced developers and theory experts, whose valuable suggestions can enormously save twists and turns.
 
:And, I make sure I can dedicate at least 40 hours per week in this summer holiday. I understand clearly the importance of adequate communication with other experienced developers and theory experts, whose valuable suggestions can enormously save twists and turns.

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)