Editing User:Andrei.ilinca24/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 6: Line 6:
 
*'''IRC Handle:'''    andrei_il
 
*'''IRC Handle:'''    andrei_il
 
*'''Studies:'''      Second year student at the Faculty of Automatic Control and  Computers, Polytechnic University of Bucharest, Romania
 
*'''Studies:'''      Second year student at the Faculty of Automatic Control and  Computers, Polytechnic University of Bucharest, Romania
*'''Github:'''        [https://github.com/ailinca ailinca]
+
*'''Github:'''        [https://github.com/ailinca]
  
 
== Background ==
 
== Background ==
Line 19: Line 19:
  
 
== Implementation Details ==
 
== Implementation Details ==
After a series of discussions on the mailinglist, this is my perception the flow of execution:
 
 
http://i.imgur.com/Y13sDjg.png
 
 
 
Scad-g binary is responsible for taking a .scad as an input, parsing it, generating the respective BRL-CAD logic (internally) then saving it as a BRL-CAD database. (.g file) . Since .scad is a programming language, parsing it will be the greatest challenge.  I expect this part to be more difficult, or at least, as difficult as generating the BRL-CAD logic/structure associated with the .scad file.
 
Scad-g binary is responsible for taking a .scad as an input, parsing it, generating the respective BRL-CAD logic (internally) then saving it as a BRL-CAD database. (.g file) . Since .scad is a programming language, parsing it will be the greatest challenge.  I expect this part to be more difficult, or at least, as difficult as generating the BRL-CAD logic/structure associated with the .scad file.
  
 
The whole project idea can be broken down in two parts.
 
The whole project idea can be broken down in two parts.
  
*1) Parsing the file and generating the BRL-CAD structure internally (my understanding is that the structure has to be generated “on-the-fly”, in the same time as parsing and since they can’t really be split)
+
1) Parsing the file and generating the BRL-CAD structure internally (my understanding is that the structure has to be generated “on-the-fly”, in the same time as parsing and since they can’t really be split)
*2) Changing the internal storing structure to  .g format and saving it accordingly. Since parsing is already a difficult task, I will most likely just print/check that the information is correct, rather than storing it properly. This part involves changing what I already know that’s correct to the appropriate format. In example, use a tree instead of a generic list.
+
2) Changing the internal storing structure to  .g format and saving it accordingly. Since parsing is already a difficult task, I will most likely just print/check that the information is correct, rather than storing it properly. This part involves changing what I already know that’s correct to the appropriate format. In example, use a tree instead of a generic list.
  
 
'''Why I decided to stick to unknown technology rather than implement my own mechanisms for parsing code?'''
 
'''Why I decided to stick to unknown technology rather than implement my own mechanisms for parsing code?'''
Line 37: Line 33:
  
 
The tools suggested by Clifford Yapp are lemon/re2c, initially, I couldn’t tell the difference between two parsers, I wouldn’t know if any was a good fit or not. My research so far hasn’t been, unfortunately due to school assignments, exhaustive, but what I did find so far is that BRL-CAD already uses lemon/re2c parser in a few given places. Thus, I decided to use the above mentioned pair because I have a guarantee that it can integrate seamlessly into BRL-CAD. I will be performing a much more in-depth research, focused on lemon/re2c, during the community bonding period. As a (rather far-fetched) observation, I plan to have the csg parser built in a manner which facilitates adding .scad rules.
 
The tools suggested by Clifford Yapp are lemon/re2c, initially, I couldn’t tell the difference between two parsers, I wouldn’t know if any was a good fit or not. My research so far hasn’t been, unfortunately due to school assignments, exhaustive, but what I did find so far is that BRL-CAD already uses lemon/re2c parser in a few given places. Thus, I decided to use the above mentioned pair because I have a guarantee that it can integrate seamlessly into BRL-CAD. I will be performing a much more in-depth research, focused on lemon/re2c, during the community bonding period. As a (rather far-fetched) observation, I plan to have the csg parser built in a manner which facilitates adding .scad rules.
 
'''scad-g structure'''
 
 
http://i.imgur.com/HHDlbAn.png
 
  
 
Looking at 3dm-g file, I believe that my application structure would involve a  main class (ScadModel) having a set of methods to interact with the parser, or actually parse.  From what I’ve read, there are methods using nextToken() and other helper methods, so I’ve added them as well.
 
Looking at 3dm-g file, I believe that my application structure would involve a  main class (ScadModel) having a set of methods to interact with the parser, or actually parse.  From what I’ve read, there are methods using nextToken() and other helper methods, so I’ve added them as well.
Line 54: Line 46:
  
 
The most important differences between the 2 formats are the facts that the CSG files do not contain expressions (so if ,in a .scad file we would use a for loop with 3 incrementations, in the .csg we would have to write each incrementation ) and modules (roughly comparable to macros or functions in other languages).
 
The most important differences between the 2 formats are the facts that the CSG files do not contain expressions (so if ,in a .scad file we would use a for loop with 3 incrementations, in the .csg we would have to write each incrementation ) and modules (roughly comparable to macros or functions in other languages).
 
Here we have a .scad file that generates a door stopper and uses the OpenSCAD specific language.
 
 
http://i.imgur.com/BX0II3U.png
 
 
After exporting the .scad file to CSG, we can see that the 3D graph generated is the same but the code format altered , resembling a clearer geometry hierarchy.
 
 
http://i.imgur.com/86jvLIM.png
 
  
 
== BRL-CAD format ==
 
== BRL-CAD format ==
Line 83: Line 67:
  
 
== Timeline ==
 
== Timeline ==
* During the whole program, I expect to work an average of 45-50 hours per week, with less during mentioned circumstances and more when needed to catch up.
+
During the whole program, I expect to work an average of 45-50 hours per week, with less during mentioned circumstances and more when needed to catch up.
  
* This is an important aspect, which I can’t really avoid. In the first 2 weeks and a half (May 30 - June 19) I will have my summer exam session,  so I believe I will be able to work an estimated amount of 5 - 10 hours per week (depending on how difficult the exams seem to me, it can fluctuate, but it won’t be below that).
+
This is an important aspect, which I can’t really avoid. In the first 2 weeks and a half (May 30 - June 19) I will have my summer exam session,  so I believe I will be able to work an estimated amount of 5 - 10 hours per week (depending on how difficult the exams seem to me, it can fluctuate, but it won’t be below that).
  
* I intend to use my personal [[User:Andrei.ilinca24/logs | wiki page]] as a host for my work this summer.
+
I intend to use my personal [[User:Andrei.ilinca24/logs||wiki page]] as a host for my work this summer.
  
* I will also log my progress (as much as I can) daily,  so we can keep track of the evolution of the project and make adjustments to the timeline (if needed). I think I will be away for about a week somewhere in the middle of the summer (probably August, not sure yet) so I won’t be able to do any kind of work for the project in that period.
+
I will also log my progress (as much as I can) daily,  so we can keep track of the evolution of the project and make adjustments to the timeline (if needed). I think I will be away for about a week somewhere in the middle of the summer (probably August, not sure yet) so I won’t be able to do any kind of work for the project in that period.
  
 
== Community bonding period ==
 
== Community bonding period ==
Line 96: Line 80:
 
As a simple TO-DO list:
 
As a simple TO-DO list:
  
*1) figure out if there is any major difference between .csg and .scad, except of expressions and modules
+
1) figure out if there is any major difference between .csg and .scad, except of expressions and modules
*2) figure out what parser to use (if it’s yacc/bison or re2c or any other, I’ll get involved and research what benefits does each offer)
+
2) figure out what parser to use (if it’s yacc/bison or re2c or any other, I’ll get involved and research what benefits does each offer)
*3) figure out how to use it,  have a very simple demo set up within BRL-CAD build hooks.
+
3) figure out how to use it,  have a very simple demo set up within BRL-CAD build hooks.
  
 
== Actual coding ==
 
== Actual coding ==
Line 138: Line 122:
 
Because I’m very excited to take part in such an extensive project and my motivation towards making a good impression and learning some real world skills is genuine. On that note, I believe you can be certain of my dedication and strive to achieve the necessary abilities to complete the project tasks.
 
Because I’m very excited to take part in such an extensive project and my motivation towards making a good impression and learning some real world skills is genuine. On that note, I believe you can be certain of my dedication and strive to achieve the necessary abilities to complete the project tasks.
  
So far, I hope I fulfilled the [http://brlcad.org/wiki/Summer_of_Code/Acceptance Acceptance guidelines]  and also followed the [http://brlcad.org/wiki/Summer_of_Code/Application_Guidelines Application guidelines]. Here is a [https://sourceforge.net/p/brlcad/patches/329/ link] to my first ever open source patch and, hopefully, not the last for BRL-CAD , regarding the importer logic and also following the HACKING guide.
+
So far, I hope I fulfilled the [[http://brlcad.org/wiki/Summer_of_Code/Acceptance|Acceptance guidelines]]  and also followed the [[http://brlcad.org/wiki/Summer_of_Code/Application_Guidelines |Application guidelines]. Here is a [https://sourceforge.net/p/brlcad/patches/329/|link]] to my first ever open source patch and, hopefully, not the last for BRL-CAD , regarding the importer logic and also following the HACKING guide.
  
 
As a last note, to be honest, I don’t have any really amazing reason to showcase (like previous industry experience on CAD, previous GSoCs etc) but … that’s a reason in itself.
 
As a last note, to be honest, I don’t have any really amazing reason to showcase (like previous industry experience on CAD, previous GSoCs etc) but … that’s a reason in itself.

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)