User:Harman052/GSoc2013/Logs
Proposal Link: http://brlcad.org/wiki/User:Harman052
Contents
- 1 Daily Progress
- 1.1 June 17 2013
- 1.2 June 18 2013
- 1.3 June 19 2013
- 1.4 June 20 2013
- 1.5 June 21 2013
- 1.6 June 22 2013
- 1.7 June 23 2013
- 1.8 June 24 2013
- 1.9 June 25 2013
- 1.10 June 26 2013
- 1.11 June 27 2013
- 1.12 June 28 2013
- 1.13 June 29 2013
- 1.14 June 30 2013
- 1.15 July 01 2013
- 1.16 July 02 2013
- 1.17 July 03 2013
- 1.18 July 04 2013
- 1.19 July 05 2013
- 1.20 July 06 2013
- 1.21 July 07 2013
- 1.22 July 08 2013
- 1.23 July 09 2013
- 1.24 July 10 2013
- 1.25 July 11 2013
- 1.26 July 12 2013
- 1.27 July 13 2013
- 1.28 July 14 2013
- 1.29 July 15 2013
- 1.30 July 16 2013
- 1.31 July 17 2013
- 1.32 July 18 2013
- 1.33 July 19 2013
- 1.34 July 20 2013
- 1.35 July 21 2013
- 1.36 July 22 2013
- 1.37 July 23 2013
- 1.38 July 24 2013
- 1.39 July 25 2013
Daily Progress
June 17 2013
I go through the project flow, checked milestones and time period to do specific tasks. I mentioned various JavaScript libraries in the proposal so was trying to sort out which I should start with. I compared them with each other but later on with some Internet searches, it was found that webGL is not fully supported on all devices and browsers. I already compared webGL and HTML5 during proposal submission but now it is confirmed that I will go with HTML5 canvas for this project. Also learned about its various capabilities and features.
June 18 2013
Tried tutorials of HTML5 to build base for the project implementation.
June 19 2013
I decided to submit a patch and selected a feature request of directing the mged output to journal file. Currently, only user inputs can be written in it. I tried by searching for files that I need to edit but failed. I was searching for bu_log_add_hook() that doesn't pointed me to files that I could start with. Later I got useful and detailed hints from IRC to look into src/mged. I will look into it.
Also discussed about project scope with Sean.
June 20 2013
Conclusion of discussion was that many aspects of project are still unclear to developers. Although it was very painful to know that developers have doubts about my proposal but anyway I started with visualization. Different steps can be visualized as 2D HTML5 entities. The results of intersection can be visualized as not displaying the non-overlapping part as soon as user clicks on 'Intersect' button using javascript's "onclick" event handler. But mathematical visualization will not there.
June 21 2013
Searched for solutions for unclear aspects of project. Searched about wireframes, why wireframes are used? It is just because they are fast to calculate but didn't find any anything useful specific to BRL-CAD for reply.
June 22 2013
I searched and collected lot of information that can be very useful for BRL-CAD. I am compiling it now, and as it completed, will share with developers.
June 23 2013
Found more useful information. Will share on mailing list, once summarized. Took break.
June 24 2013
Worked on patch. Studied the f_journal function, its various components. Some doubts are still not cleared. Will try to finish by tomorrow.
June 25 2013
- Prepared a detailed email and sent to mailing list about what I found for Sean's questions. Expecting new directions.
- Designed basic layout of interface.
June 26 2013
- As told by mentor, I studied WebGL and tried WebGL demos. I would use mixture of HTML5 and WebGL.
June 27 2013
- As suggested by Charlie Stirk, I reviewed http://shapesmith.net/. I tried it by downloading and installing locally. 3D objects can be easily created and edited. Moreover, it can produce josm files than can be easily parsed and used to make script of MGED commands. It will be wonderful if we use its interface.
- Got reply from Sean, suggesting to shift from making geometry editor to geometry viewer.
June 28 2013
I was suggested to focus on making online geometry viewer. I just posted on dev-mailing list whatever I did in this context.
June 29 2013
- Used facetize command to convert implicit primitives into bot format. However it failed to run on brep objects.
- Searched for web technology that could support NURBS geometry directly.
- Posted details about today's progress on mailing list.
June 30 2013
- Explored source files to fix the facetize command. I found code for facetize command in two files, one in src/libged/facetize.c and other in src/libged/wdb_obj.c. Currently facetize.c is working.
July 01 2013
Wasn't able to do much work due to some un-expected urgent work.
July 02 2013
Looking into wdb_obj.c as it controls BRL-CAD database, it may be helpful in reading file from browser.
July 03 2013
- Completed the task of summarizing the things discussed on mailing list into an wiki article.
- Working on layout.
July 04 2013
Explored src/libged/facetize.c and src/libged/wdb_obj.c files. From man page, found "t" option of facetize command and for corresponding to this option, found nmg_use_tnurbs flag in src/libged/facetize.c and src/libged/wdb_obj.c files. But I didn't found any relevant code that can be hooked to make the command working in desired way.
July 05 2013
- Trying to figure out solution. Ask for solution on IRC.
July 06 2013
- Post problem on mailing list.
- In the mean time, I worked on patch. Tried to add "-r" option (for response) under f_journal function in history file. Now just need to figure out where to add hook in this file.
July 07 2013
- Waiting for reply.
- Found function history_journalize that actually writes data in journal file and where the log hook is required to be added. With the help of grep, I found details about bu_log_add_hook() in bu.h. Need to figure out how to implement.
July 08 2013
Was looking at similar implementation of bu_log_add_hook() in src/libged/log.c and util/pl-dm.c to figure out to redirect data to file. Both these files have same bu_hook_t function. I tried to implement in similar way, but it didn't worked.
July 09 2013
- Looked at the source of http://www.ibiblio.org/e-notes/Splines/models/parrot.html since it is much similar to our requirement. They are using CanvasMatrix.js library (http://www.ibiblio.org/e-notes/webgl/CanvasMatrix.src.js) for matrix calculations as webGL does not have this support. However, CanvasMatrix.js is provided by Apple Inc. and its terms of use seems favorable to me but some expert person must check.
- Model is taking input just like an ordinary webGL application i.e. in the form of vertices and faces, so we can easily provide that with OBJ file.
July 10 2013
- I read about WebGLU. Even they didn't specify the support for visualizing trimmed NURBS.
- However they have partial .obj parser implemented to load objects. But they said, they support object hierarchies. If I got it correctly then it mean we can show sub components of regions and combinations.
- Found 'glMatrix', another Javascript Matrix and Vector library.
July 11 2013
- Found a performance benchmark for different matrix libraries: http://stepheneb.github.io/webgl-matrix-benchmarks/matrix_benchmark.html.
- Still not clear which library is suitable.
- Talked to Sean on IRC about the code that's to be hooked in facetize.c. Have to move quickly.
July 12 2013
- Did some experiments with B-rep objects. My motive was to see how B-rep objects are represented in database file. First I made an implicit object and convert .g file to .asc then from .asc back to .g and it was successful. Then in new database file, made another object and made its brep object and converted file to .asc. In asc file I got message, "a Tcl output routine for this type of object has not yet been implemented" which means brep object was not described in .asc file. When this file converted back to g, all entities (one Implicit and one brep) were lost.
- Not much work done.
July 13 2013
- Reviewed glMatrix and WebGLU matrix library to see if they can satisfy our requirements.
July 14 2013
- Asked questions on webGL IRC about various matrix libraries.
- Prepared summary as told my Sean of his last email.
- After seeing reply, many things got cleared which I took other way earlier.
July 15 2013
Understanding the basics of various geometry representation forms to know more how they are used in graphics.
July 16 2013
Learned concepts behind Bezier curve and other basic things like control points, degree, basis function.
July 17 2013
Explored about NURBS and maths part behind its working. How control points and their weights played their part in making curve, purpose of knot vector. However, it need sufficient time to grasp all that completely. But now I have basic understanding to NURBS geometry.
July 18 2013
- Tried a basic NURBS specific example in OpenGL to see what basic functions are required to be ported to JavaSctipt(WebGLU).
- Tried example in SWIG to convert C code int Python but later came to know it does not support JavaScript. :-(
- Looking into GLU's source code and looking for some other converter.
July 19 2013
- Found Emscripten: https://github.com/kripken/emscripten. From its description and demos, it looks promising and suitable for my work.
- Working on it.
July 20 2013
- Received mail from my mentor on mailing list having instructions about how to proceed further in project. So finally I will visualize polygonal OBJ files on browser, no need to use Emscripten.
- Started reading about how to read data from g file.
July 21 2013
Took break.
July 22 2013
- Successfully retrieve name of database file, title, version, units from g file using pointer to db_i struct.
- Working out to retrieve names of entities from g file.
July 23 2013
- Made wire frame of layout.
- Prepared flow and implementation summary of project.
- Nothing found. Still working on same task of retrieving names of objects.
July 24 2013
- Making a small prototype of web models. Searched the Internet and found good examples of displaying OBJ files using ThreeJS.
- Basic scene is setup but getting problem with loading OBJ file.
- Tried to get solutions from IRC and Stack OverFlow, but not succeeded.
July 25 2013
- Made prototype of how BRL-CAD models will be interactively displayed on browser.
- http://devplace.in/~harman/geometry_viewer/cylinder.html
- http://devplace.in/~harman/geometry_viewer/mug.html