https://brlcad.org/w/api.php?action=feedcontributions&user=195.24.220.16&feedformat=atomBRL-CAD - User contributions [en]2020-07-10T14:10:51ZUser contributionsMediaWiki 1.32.2https://brlcad.org/w/index.php?title=User:NyahCh3ck20/GSoc2013/Coding_Report&diff=6110User:NyahCh3ck20/GSoc2013/Coding Report2013-09-09T19:26:08Z<p>195.24.220.16: /* Sept 02 - Sept 08 */</p>
<hr />
<div>==== Coding Log Report for GSoc 2013 ====<br />
Daily log:<br />
<br />
=== Test Results ===<br />
<br />
* Pulling unpushed object pulls matrix transformations up the tree.<br />
[http://brlcad.org/wiki/File:Pushed_pulled_object.png pull_unpushed_obj]<br />
<br />
*Pushing object after pull restores original matrix conditions.<br />
[http://brlcad.org/wiki/File:Pushed_pulled_object.png push_pulled_obj]<br />
<br />
==17 June - 23 June==<br />
Coding Begins for GsoC<br />
working on codepatch to be uploaded to brlcad<br />
uploaded the sourcefile for new push routine which supports the -x option for xpush but still needs further testing and<br />
modifications.<br />
<br />
18 june 2013<br />
Added a new functionality to new push routine<br />
where the push would recognise the the xpush case even in a case<br />
where the -x option is ommitted or ignored.<br />
<br />
Tested the new routine and extracted patch to be uploaded to sourceforge<br />
replacing the previous push file I uploaded. <br />
<br />
To discuss with mentors whether there is an implementation of the Inverse of a 4x4 matrix in the brlcad source code.<br />
<br />
Looking at the implementations of the Inverse of the matrix in BRL-CAD<br />
<br />
==24 June - 30 June==<br />
*Monday June 24<br />
Looked at the definitions for the inverse of a 4x4 matrix as defined in /src/libbn/mat.c. However, i realised orthogonal matrices were not taken into consideration. So added functionality to determine inverse faster for othogonal matrices and to upload patch to sourceforge shortly.<br />
<br />
Started creating structures for the pull routine that is ( pull_obj and p_solid) structures to hold objects to be pushed and solids currently being pushed on a CSG tree. Code to be added to sourceforge Shortly.<br />
<br />
re-read the HACKING file to make sure i conformed with the coding standards for BRL-CAD.<br />
<br />
*Tuesday June 25<br />
<br />
Further tested the bn_mat_inverse routine(src/libbn/mat.c) and modified patch that was to be uploaded yesterday but failed due to poor network connection.<br />
<br />
Looked at the libbn library especially mat.c which would be useful for implementing the pull.<br />
<br />
Studied the vmath.h header and discovered the transform.c file which could be applied in creating the pull routine.<br />
<br />
Uploaded the pull.c first patch and bn_mat_inverse patches due to failure in network for them to be uploaded yesterday.<br />
[https://sourceforge.net/p/brlcad/patches/202/ Inverse Matrix support for orthogonal matrices]<br />
<br />
Will need some clarification from mentors concerning my design strategy for the pull routine.( The necessary functions i would need to create or call from the source)<br />
in order to implement a complete pull routine.(Asked on mailing list.)<br />
still to continue work on push and xpush merger.<br />
<br />
Saw the importance of magic numbers in taking note of visited nodes along the CSG tree. Also, thought of checking the matrix transformations for each node to determine<br />
if node has been visited but since magic IDs were used in the push then i could use both in pull when performing the inorder walk from the leaf(solid) nodes.<br />
<br />
Moreover, for objects in database, dp->d_uses was used but not safe as defined push.<br />
<br />
<br />
*Wednesday July 26<br />
Earlier part of the day used for preparation for and wrote an Information System test before working.<br />
<br />
Added the new pull routine to the setup.c(/src/mged/setup.c) interface and<br />
included the new command into the CMakeLists.txt file(/src/libged/CMakeLists.txt) in the brlcad source<br />
<br />
These patches also included the removal of the xpush command to support the new push and xpush. Patches to be uploaded to sf.<br />
<br />
Added new pull routine declaration(ged_pull(struct ged *,int, char *[])) to the ged.h header so it can be accessed by other files.<br />
patches to be uploaded to sf.<br />
<br />
Added new pull to tclcad_obj.c file(/src/libtclcad/) although with support of more than one arguments i'll first of all try to <br />
test with only one argument then see how far it goes;this is so that it's available in the internal database interface.<br />
<br />
Added tentative ged_pull() function definition to the pull.c file to enable it to be accessed by files calling function.<br />
<br />
However since ged_pull() routine does not compile code can't compile due to unused variables so will create some dummy operations just to see how blank routine works and get it started.<br />
<br />
Well just realised that the orthogonal matrix consideration in the bn_mat_inverse routine in mat.c is causing the benchmark tests to fail. Gotta sit on it and fix the bug.<br />
[https://sourceforge.net/p/brlcad/patches/206/ Pull Patch]<br />
<br />
*Thursday 27 June<br />
Travelled to Douala and spent the whole day trying to cash the prepaid GSoC deposit.<br />
However, tried working on a bug in the mat.c file(/src/libbn) where the inserted code patch for orthogonal matrix support is giving wrong answers during the benchmark test. Discovered a little error calling the bn_mat_mul2() routine and now code passes 3 benchmark tests and fails 3.Will perfect code and upload codepatch tomorrow on sf.<br />
<br />
*Friday 28 June<br />
<br />
Looking at the bn_mat_inv() routine and performing some tests to ensure all benchmark tests succeed.<br />
<br />
Checked the orthogonal matrix support and code still fails 3 regression tests after testing and checking need some assistance for this.<br />
Started a detail analysis and study of the push command from the ged_push() routine. This is to enable me understand perfectly <br />
the implementation hacks of the push in order to implement a push correctly especially when it comes to dealing with the points and matrix<br />
transformations at the node and leaf levels on the CSG tree. <br />
<br />
To check all reviews from code patches so as to start working on them tomorrow.<br />
[https://sourceforge.net/p/brlcad/patches/190/ Modified push]<br />
[https://sourceforge.net/p/brlcad/patches/202/ Modified bn_mat_inv]This patches passes some regression tests; but i don't understand why it still doesn't work perfect. Don't really see the problem here<br />
<br />
==1 July - 7 July==<br />
*Monday 1 July<br />
Well did not code because of Preparations to attend the Google Student's Ambassador's Summit in Nairobi, Kenya for Africa. This summit goes on for the whole week. But will try to fix problems with my code patches while at the summit.<br />
<br />
*Tuesday 2 July 2013<br />
Boarded Kenyan Airways flight from Douala Int'l to the Jomo Kenyatta Int'l in Nairobi which took about 5 hours; then registered with the GSA team.<br />
<br />
<br />
*Wednesday 3 July 2013<br />
Attended the First day of Summit where we had talks with Google Engineers about being a good ambassador. Presentations were given by Mr. Obum Ekeke , Tayib Fall<br />
and others about opportunities at Google.<br />
<br />
*Thursday 4 July 2013<br />
Second Day of Summit focused on Google products like Adwords, Adsense and other products; also, Engr. Giacomo(Googler) gave a presentation on Webmaster tools and Google Search in general.<br />
<br />
<br />
*Friday 5 July 2013<br />
Third day of Summit where we focused on making greater impacts on our communities in Africa; with awards given to Star GSAs of the previous years.<br />
Shared ideas and experiences for the Moonshot idea competition organised as per country we emerged 3rd after South Africa and Kenya.<br />
Developed plans to execute our moonshot idea as we returned home after the summit<br />
<br />
<br />
*Saturday 6 July <br />
Preparing for return trip to Douala Int'l and went round Nairobi for shopping and other stuffs.<br />
<br />
*Sunday 7 July<br />
Returned from Nairobi to Douala and after meeting family travelled to Buea to prepare for coming week.<br />
<br />
== 8 July - 14 July ==<br />
<br />
*8 July 2013<br />
Wrote a report to be submitted to the Vice Chancellor concerning my experiences on Google Student Ambassador's summit and preparing for a Numerical Analysis Exam<br />
Took further look at source code(/src/push.c) to see how the matrix transformations are applied to the coordinate points of the node so as to determine a way of <br />
extracting the original matrix transformation or almost exact matrix transformation for source code.<br />
<br />
Glad the Dean of the faculty of Science authorized the installation of Internet in the CS so we can have 24/7 Internet access<br />
<br />
<br />
*Tuesday 9 July<br />
Wrote my Numerical Analysis exams and to finish with exams tomorrow so i can focus on GSoC full time.<br />
<br />
*Wednesday 10 July <br />
Finished writing exams today and <br />
started preparing previous code patches(mat.c,push.c,pull.c) so that when the Internet access is available<br />
all files will be uploaded so as to get commit access.<br />
<br />
<br />
*11 July 2013<br />
studied the brlcad primtive internals like(torus, spheroids, toruses (torii), spheres, ellipsoids, pyramids) so as to be able generate the original transformation matrix. Torus, struct rt_tor_internal Centerpoint, point_t v, is obviously the translation. The orientation and scale is defined by vect_t h, and radiuses by fast_t r_h and fast_t r_a. Because of symmetries, the original transformation matrix must have contained a translation of v, and a rotation that brings vect_t h to an axis <br />
<br />
Spheres and ellipsoids, struct rt_ell_internal Centerpoint is at point_t v, which again is obviously the translation done.There are three vectors, point_t a, point_t b, and point_t c, that describe the spheroid axes. This means that I can construct the transformation matrix that transforms the unit sphere to this sphere directly.<br />
<br />
for Truncated general cones, struct rt_tgc_internal Centerpoint is at vect_t v, with vect_t h describing the axis. The base of the cone is, I think, described by the vectors vect_t a and vect_t b, and the top of the cone by vectors vect_t c and vect_t d. This implies that aÂ·b=0 and cÂ·d=0, but they may not be perpendicular to h, since the base and top of a general cone may be cut along any direction. v is the translation, and h should be along an axis (probably z axis). This yields three vectors (h, f, g), that along with the translation vector v define the transformation matrix just like in the ellipsoid case.<br />
<br />
Also, looked at data type for Pyramids: struct rt_arb8_internal This data type contains between four (tetrahedron) to eight vertices as point_t variables. Pyramids and tetrahedra have the apex vertex perpendicular and center to a face. This can be taken as the face vector. The second vector is one that bisects an edge (the longest edge?) of the face perpendicular to the apex. The third vector is their cross product, and is either towards a vertex (a tetrahedron) or halves another edge of the face perpendicular to the apex (a pyramid). These three vectors can be used to regenerate the initial transformation matrix, with e.g. the base on the XY plane, and the apex along the Z axis.<br />
<br />
To look at wedges, Boxes, and convex polyhedra tomorrow.<br />
<br />
* 12 July 2013<br />
Prepared complete patches and uploaded to sf to replace the existing patches for new push routine(push.c), pull routines(pull.c) and bn_mat_inverse routine(mat.c) with orthogonal matrix support. Since there is no internet connection, I could not create these patches with the current svn checkout.<br />
<br />
Continued study of implementation of push.c so as to see what happens to coordinate points of the node, to determine how some form of the original matrix transformation is stored so as to ease restore during the pull routine.<br />
<br />
*13 July 2013<br />
Did no work because of a long meeting( in my capacity as Auditor of Computer Engineering students Association) of over 5 hours with the Dean of Faculty to draft modalities for new student union body and draft constitution and mission to govern association.<br />
<br />
Will start implementing the pull leaf function as from Monday which will extract the matrix transformations from the primitives(solid) or leaf nodes.<br />
<br />
== 15 July - 21 July ==<br />
<br />
Monday 15 July<br />
*Implemented the pull_leaf routine which build a linked list for object's tree which would be used in extracting matrix transformations in leaf_mat() routine I am to start working on tomorrow.<br />
*continued with the implementation of the ged_pull by adding -d option to command to enable a debug of command as in push -d<br />
<br />
Todo: To ask on mailing list how to generate a Magic ID since its needed for the pull.<br />
<br />
Tuesday July 16 2013<br />
*Further worked on the pull_leaf routine to make sure list is properly built and created loop to free up list if errors occured during the list build like pulling unpushed nodes.<br />
<br />
* Started working on a loop to move through the nodes of the linked list making the necessary mat_t changes while moving upwards modifying the current matrix transformation as it encounters a new leaf when necessary calculating and storing the inverse matrices up the tree till it reaches the root. This will then be followed by writing these changes to the database.<br />
<br />
TODO: Ask on mailing list how my current working model solves the method so as to make the necesary changes in approach and continue.<br />
<br />
Wednesday July 17, 2013<br />
<br />
*Finished writing loop that moves backwards on the newly built list of nodes on the tree, performing inverses as necesary,storing the changes on the node, writing to database and setting the matrix transformations for primitives(leaves) to identity as necessary.<br />
<br />
*Wrote loop that frees up built list and returns result of object pull.<br />
<br />
*started testing of pull command and to continue fixing bugs. Till command is ok before adding support to pull more than one object.<br />
<br />
*Performed another benchmark test for the orthogonal matrix support for bn_mat_inverse() in mat.c<br />
<br />
*Uploaded code patches for mat.c and combined push and xpush to sourceforge.<br />
<br />
Todo: fix all problems with with currrent and past patches and upload to sf for mentor review.<br />
<br />
<br />
Thursday July 18, 2013<br />
<br />
*Started working on compile time errors of the pull.c by fixing some pointer casts and others.<br />
<br />
Friday July 19, 2013<br />
<br />
*Finished debugging compile errors and started testing routine.<br />
<br />
*Tested for improper use of command(pull 'no object'), returned correct errors<br />
<br />
*Tested for pulling a primitive.(returned correct error message).<br />
<br />
*Tested for pulling an object which has not been previously pulled.(mged crashed due to segmentation fault) to start working on bug next week.<br />
<br />
Will be taking tomorrow off since its my birthday and start working on bugs and patches next week.<br />
<br />
== 22 July - 28 July ==<br />
<br />
Monday July 22, 2013<br />
<br />
*Added -x option to push.c to support new xpush command(recreated and tested new push command). Spent whole day debugging and still have not succeeded in removing bug causing the<br />
loss of options to push command.<br />
<br />
*Created new patch for pull command and patch applies cleanly but command still further development and debugging.<br />
<br />
Tuesday July 23, 2013<br />
*Installed Internet in the CS Lab so as to increase efficiency for BRL-CAD.<br />
<br />
*Started downloading latest svn checkout for BRL-CAD source <br />
<br />
*Set up account on bz.bzflag.bz server and Started downloading tutorials on how to use ssh and GNU Screen<br />
<br />
*Upgrading my SL 6.2 distro so as to start further work on patches tomorrow.<br />
<br />
Wednesday July 24, 2013<br />
<br />
*Enabling pull routine to be able to pull a non leaf node; that is routine is able to pull geometric transformations from any node up to the root.(as @Sean adviced me on mailing list.)<br />
<br />
*Found bug in code which returns error when pulling non-leaf node. Started fixing<br />
<br />
*Prepared patch to stub pull routine unto brlcad using svn diff(Uploaded to sf [https://sourceforge.net/p/brlcad/patches/215/ Here] <br />
<br />
*Tests of pull routine shown[http://brlcad.org/wiki/File:Pulling_non_leaf_objects.png here]<br />
<br />
<br />
Thursday July 25, 2013<br />
<br />
*Tested new algorithm for bn_mat_inverse() which used only Uses 100 multiplications and 61 additions or substractions.<br />
<br />
*Tested new algorithm for bn_mat_determinant which requires only 34 multiplications and 20 additions or substractions, saving 6 multiplications<br />
and 3 additions or substractions compared to the previous one. Integrated code into brlcad and tested. new passed all benchmark tests. <br />
Created patch and uploaded to [https://sourceforge.net/p/brlcad/patches/216/ sf]<br />
<br />
*Wrote Tests to compare runtime of old_determinant against new determinant routine which returned the following results below: <br />
<br />
*Wrote Tests to compare Inverse of Old matrix inverse routine and new_matrix Inverse routine which returned the following results:<br />
<br />
CPU: Pentium(R) Dual-Core CPU E5500 @ 2.80GHz<br />
Compiler used: gcc 4.4.6-3)<br />
Compiler command: gcc -W -Wall -O3 -fomit-frame-pointer<br />
Kernel: Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Sat Dec 10 17:47:51 EST 2011 i686 i686 i386 GNU/Linux<br />
<br />
./determinant<br />
My implementation:<br />
98 cycles minimum<br />
112 cycles median<br />
libbn implementation:<br />
84 cycles minimum<br />
84 cycles median<br />
Results (relative differences of calculated determinants):<br />
-3.836070396965505e-14 minimum<br />
0 median<br />
2.152181998793086e-13 maximum<br />
<br />
./inverse<br />
Example:<br />
My implementation:<br />
[ 0.803558 0.065957 -0.31977 0.174422 ]-1 [ 1.105838 -0.352959 0.306948 -0.191398 ]<br />
[ 0.178270 0.764400 -0.477912 0.560214 ] [ -0.546125 0.959763 0.471464 -0.743848 ]<br />
[ 0.567903 0.641359 0.602482 0.639353 ] = [ -0.461005 -0.688994 0.868583 -0.088937 ]<br />
[ 0.000000 0.000000 0 1.000000 ] [ 0.000000 0.000000 0 1.000000 ]<br />
libbn implementation:<br />
[ 0.803558 0.065957 -0.31977 0.174422 ]-1 [ 1.105838 -0.352959 0.306948 -0.191398 ]<br />
[ 0.178270 0.764400 -0.477912 0.560214 ] [ -0.546125 0.959763 0.471464 -0.743848 ]<br />
[ 0.567903 0.641359 0.602482 0.639353 ] = [ -0.461005 -0.688994 0.868583 -0.088937 ]<br />
[ 0.000000 0.000000 0 1.000000 ] [ 0.000000 0.000000 -0 1.000000 ]<br />
My implementation:<br />
462 cycles minimum<br />
490 cycles median<br />
libbn implementation:<br />
434 cycles minimum<br />
546 cycles median<br />
<br />
<br />
<br />
Friday July 26, 2013<br />
<br />
*Added -x option to push command. But command fails to read options in mged. Tried (Pd:x) and Pdx as arguments to bu_getopt() but command fails to read options. Continued testing and debugging. <br />
<br />
*Changed the call of pushx(formerly ged_xpush to take as args gedp,dp so as to proceed to xpushing of object. Still testing routine.<br />
<br />
*Debugged push command to support -x option, made [https://sourceforge.net/p/brlcad/patches/217/ patch] and submitted on sourceforge. However command can push only an object at a time so further work needs to be done to added support for multiple objects. <br />
<br />
* Some tests on command [http://brlcad.org/wiki/File:Testing_new_push_routine.png Here]<br />
<br />
<br />
TOD0: Add support for multiple objects then clean up xpush in BRL-CAD.<br />
<br />
<br />
Saturday 27 July, 2013<br />
<br />
*Added support to Push routine to push multiple objects. Created patch and modified patch uploaded to sourceforge.<br />
<br />
*To clean up xpush routine from source code and make all new references to new push.<br />
<br />
<br />
<br />
== 29 July - 4 August ==<br />
Monday July 29, 2013<br />
<br />
*Started studies on ssh, irssi, and GNU Screen, succeeded in uploading some of my code patches to bz.bzflag.bz.<br />
<br />
*Downloaded code to bzflag and compiled code although there is a small in bug in current code repository.<br />
<br />
* Started working on tests for some of the /src/libbn/mat.c routines using the modified test Sean gave me on bn_mat_inverse and bn_mat_determinant.<br />
<br />
<br />
Tuesday July 30, 2013<br />
<br />
*Started looking at the BRL-CAD Numerics library for tests and started wrote a unit test for the bn_poly_multiply() routine.<br />
<br />
* Tested for very large and small values and answer was correct.<br />
<br />
*Integrated test into BRL-CAD, created patch and submited code on [https://sourceforge.net/p/brlcad/patches/221/ sf].<br />
<br />
<br />
*Filled the Mid-Term Evaluation form for participants.<br />
<br />
To continue work on poly.c routines tomorrow.<br />
<br />
Wednesday July 31, 2013<br />
<br />
*Wrote the unit test for bn_poly_scale(), bn_poly_add(), bn_poly_sub(), bn_poly_synthetic_division() routines and uploaded code patches to source forge.<br />
<br />
Will continue writing tests for the other poly.c tomorrow and finish by the end of the week.<br />
<br />
Thursday Aug 1, 2013<br />
<br />
*Wrote the unit test for bn_poly_quadratic_roots() routine and uploaded patch on [https://sourceforge.net/p/brlcad/patches/226/ sourceforge]<br />
<br />
*Spent day debugging test and doing some further extreme test.<br />
<br />
Friday Aug 2, 2013<br />
<br />
*Wrote and tested the unit tests for the bn_poly_cubic_roots and bn_poly_quartic_roots() routines. Created patches and uploaded to sourceforge.<br />
<br />
* To modify patches include source of known test values( Use Octave or maxima) since mathportal.org doesn't give clear math solver.<br />
<br />
* Modifying patches to match reference values from Octave.<br />
<br />
Saturday Aug 3, 2013<br />
<br />
*Spent whole day debugging all unit test patches making sure tests failed when expected and produced the right results and outputs.<br />
<br />
*uploaded codes to sourceforge.<br />
<br />
== 5 August - 11 August ==<br />
<br />
Monday Aug 5, 2013<br />
<br />
*Started working on the pull routine making sure non-leaf objects could be pulled.<br />
started by building a linked list. and there is a bug lurking in there somewhere in. Spent whole day here; will continue work on it tomorrow after i finish moving the comments. starseeker talked about.<br />
<br />
* will upload latest patch to sf which should apply cleanly<br />
<br />
Tuesday Aug 6, 2013<br />
<br />
*had to continue debugging pull.c but persistent problems with patches forced me to continue working on the libbn unit test patches I submitted on sourceforge.<br />
<br />
*Currently fixing patches with Erik so they can apply cleanly.<br />
Will be travelling home tomorrow and resume on Monday next week; So i'm to finish with these patches and get commit access so I could work freely on my project.<br />
<br />
== 12 August - 18 August ==<br />
<br />
Monday Aug 12 2013<br />
<br />
*Finished correcting indentation errors on libbn unit tests for polynomial routines.<br />
<br />
*Continued test of pull routine; since tree fails to build linked list and discoved that the problem actually lied in the fact that I was testing on invalid input so linked list was not built. Trying appropriate objects.<br />
<br />
<br />
Tuesday Aug 13 2013<br />
<br />
*Continued testing of pull routine on non leaf nodes like regions and combinations and this kept reporting a segmentation fault. To continue debugging<br />
<br />
Wednesday Aug 14, 2013<br />
<br />
* continued working on the pull or matrix transformations up one level but work halted due to lights out for the rest of day.<br />
<br />
Thursday Aug 15, 2013<br />
<br />
*Fixed patch on bn_poly_add() test and uploaded code to sourceforge, continued debugging bn_poly_synthetic_division() routine but error kept coming from bn_poly_synthetic routine itself as traced by gdb. Continue working on it.<br />
<br />
* Resolved an issue with test but seg fault still lurks somewhere in code; been starting for over an hour and still getting nowhere. Will look at that tomorrow.<br />
<br />
Friday Aug 16, 2013<br />
<br />
*Fixed the bn_poly_synthetic_division() unit test and uploaded code to sourceforge.<br />
<br />
* Started looking at the db_preorder_traverse() routine ( although its not clear what struct db_traverse is since i don't see definition in source code) and how I could use it in implementing pull routine.<br />
<br />
* To ask about definition of db_traverse since i don't see in source code.<br />
<br />
Saturday Aug 17, 2013<br />
<br />
*Reworked the accepted patches and submitted patch on sourceforge.<br />
<br />
*Fixed the bn_poly_quadratic_roots() routine and submitted code on sourceforge.<br />
<br />
*Started working on plan to implement pull using the db_preorder_traverse() which will need some routines to work with combinations and extract matrix transoformations from primitives<br />
<br />
ToDo: To start working on the leaf_mat() routine which extracts matrix transformation from primitive.<br />
<br />
== 19 August - 25 August ==<br />
<br />
Monday August 19, 2013<br />
<br />
* Started reworking the pull_leaf routine to use db_functree instead of db_preorder_walk but may still use later to extract matrix transformation from primitives and continue walking up the tree. Still to ask on mailing which primitives to support first.<br />
<br />
* Wrote the comb_enter_func() which restores the matrix transformations of a combination but is still dependent on pull_leaf() which is to deal with various primitives. To ask sean how to store changes on a combination matrix.<br />
<br />
ToDo: Continue implementing pull_leaf() adding support to pull matrix transformation from torus then, spheres, ellipsoids and in that order.<br />
Still wondering why commit access is not coming!<br />
<br />
Tuesday August 20, 2013<br />
<br />
*Finished Writing the pull_comb() routine together with the pull_comb_mat() routines. Discussed with Sean about test driven development. Will start writing unit test for routines tomorrow<br />
<br />
*Looked into BRL-CAD source on how to write pull_leaf() routines which will support various primitives in the pull process since they don't have matrix transformation as such. Still to look at pull_leaf to actually see how they dealt with primitives<br />
<br />
<br />
Wednesday August 21, 2013<br />
<br />
*Started looking at test provided by Sean to use of db_walk_tree so as to be able to create a similar for pull_comb using db_functree() but faced problems calling functions in BRL-CAD's libraries. So i'll continue working on test tomorrow<br />
<br />
*Continued adding some functionalities to pull_leaf() routine.(still crude) will continue work on pull_leaf after testing pull_comb() perfectly<br />
<br />
Thursday August 22, 2013<br />
<br />
*Started and finished writing pull_comb() unit test. But there is actually a seg fault which prevents the cur_mat() pointer from being inverted. Probably NULL. <br />
<br />
*Will continue debugging and finish testing pull_comb() tomorrow then move on to pull_leaf()<br />
<br />
<br />
Friday August 23, 2013<br />
<br />
*Finished debugging pull_comb() and tested routine. Works perfectly. <br />
Any way to note changes made on combination. pulled matrix is stored on <br />
comb_leaf->tr_l.tl_mat.<br />
<br />
*Created patch to stub empty pull routine into brlcad. then continue working on pull_leaf() routine tomorrow.<br />
<br />
* Waiting for mentors to apply patch so i could create patch which adds pull_comb() routine into BRL-CAD.<br />
<br />
<br />
<br />
== Aug 26 - Sept 01 ==<br />
<br />
Monday 26 August 2013<br />
<br />
* Started implementing the pull_leaf routine which extracts the 4x4 matrix transformations for a primitive. Succeeeded in implementing the pull_leaf for an ellipse, sphere, EPH, elliptical parabola, elliptical torus, extrude, hyperbola, and a particle.<br />
<br />
* started testing function and will continue debugging tomorrow before continuing with the addition of the superellipse, metaball, arbitrary complex polyhedra, arb8, rhc, rpc, and pipe.<br />
<br />
Tuesday 27 August 2013<br />
<br />
*Finished debugging pull_leaf() but routine is incomplete since I don't currently support all primitives. Will follow Sean's instructions and start developing pull interface from tomorrow by adding synopsis, docs, full integration and test cases.<br />
<br />
*Added support for truncated cones in pull_leaf() but a bug hangs in there. Will take a peek tomorrow or finish this night before going to sleep.<br />
<br />
Wednesday August 28, 2013<br />
<br />
*Started developing the interface by adding the stubbing the pull to archer interface.<br />
<br />
*Added the pull routine to the tclscripts, libtclcad, and wrote the pull documentation in brlcad/doc/ directories.<br />
<br />
Still to finish writing the regresssion tests before moving on to adding support for pulling primitives on BRL-CAD.<br />
<br />
Thursday August 29, 2013<br />
<br />
*Started and finished writing the regression tests for the pull command.<br />
<br />
*Tested and compiled code but pull does not appear on the command line when regression tests are ran. Will ask on IRC for assistance here. <br />
<br />
Todo: When done with developing the pull interface, I'll dive into writing the pull_leaf routine for all primitives.<br />
<br />
Friday August 30, 2013<br />
<br />
*Tested regression tests for pull and added manual pages and documentation for pull successfully such as in man pages, appropos library for pull<br />
<br />
*To create patch and submit on sourceforge, also tried adding pull to archer but found a little problem. To discuss with mentor on how to proceed.<br />
<br />
TodO: After approval of man pages, to continue adding support for all primitives into pull command. and fix bn_poly_sub() test patch.<br />
<br />
Saturday August 31, 2013<br />
<br />
*Finished testing regression tests and uploaded code to sourceforge<br />
<br />
* Continued looking at the primitives such as arb8, arbn so as to continue working on primitives for pull.<br />
<br />
== Sept 02 - Sept 08 ==<br />
<br />
Monday Sept 02<br />
<br />
*Started looking at the other primitives; left to complete the pull_leaf() routine. Saw many complications with many primitives. Will need the Assistance of Sean in extracting the matrix transformations from them.<br />
<br />
<br />
Tuesday Sept 03<br />
<br />
*Fixed bug in bn_poly_sub() unit test; uploaded code to [https://sourceforge.net/p/brlcad/patches/224/ sourceforge].<br />
<br />
*Succeeded in pulling the following primitives(TGC, REC, PARTICLE, EPA, EHY, HYP, ETO, EXTRUDE). Still left with about 26 primitives to be pulled in order to complete the pull_leaf() routine. <br />
<br />
Will need some directions on how to implement pull_leaf() since using switch case statements is not a good design choice.<br />
<br />
Thursday05 - Sunday 08<br />
*Took a break so as to recover from malaria.<br />
<br />
== Sept 09 - Sept 15 ==<br />
<br />
<br />
== Sept 16 - Sept 22 ==<br />
<br />
<br />
== Sept 23 - Sept 28 ==</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak&diff=5946User:Izak2013-08-07T07:02:22Z<p>195.24.220.16: /* Project Proposal */</p>
<hr />
<div>==PROJECT PROPOSAL==<br />
<br />
==PERSONAL INFORMATION==<br />
<br />
Name: Isaac Kamga.<br />
<br />
E-mail: u2isaac@gmail.com.<br />
<br />
Internet Relay Chat Username: Izak.<br />
<br />
Brief Background information.<br />
<br />
I am a final year Master of Science in Computer Science student at the University of Buea , Cameroon , Africa holding a Bachelor of Science degree in Mathematics.I have worked on various data structuring, algorithmic and compiler-related individual and team projects in the University community which I really enjoyed.By June , I expect to be done with the writing of my thesis and will be available for 40+ hours weekly to implement a heart surface primitive for BRLCAD software.If I am not done with the thesis or I am given more work,I will work on the thesis writing during the day and allocate time to work on the BRL-CAD software during the night hours making sure I dedicate atleast 40 hours each week.<br />
<br />
=PROJECT INFORMATION=<br />
<br />
PROJECT TITLE: Implementation of a heart primitive.<br />
<br />
==PROJECT SUMMARY==<br />
In our world today , we observe that all solid objects are simply combinations of basic ones like cubes,spheres,cones,etc and we frequently have to manipulate objects which have surfaces such as gadgets and devices . With the explosion in ubiquitous technology, Computer-aided design (CAD) software help us create digital content in adverts and movies as well as visualize some solid objects like perfume bottles and shampoo before they are actually manufactured. In this project, we propose that BRL-CAD, which aspires to be the best CAD software, should incorporate a heart, a symbol of love, into its core functionality as one of its basic solid objects in order to increase its customer base and differentiate itself amongst its competitors. Indeed, this heart structure ( also called a heart primitive ) shall be used by those producing cartoons and designing electronic cards, gifts and presents during celebrations such as birthdays, weddings,family reunions, anniversaries and Valentine's day which deeply appeals to many individuals,families and communities.So during the summer, this heart primitive will be included into the raytrace library as a set of routines with corresponding support added to other parts of the source code.<br />
<br />
==PROJECT DESCRIPTION==<br />
<br />
In this section of this proposal, I give a detailed description of how I am going to implement the heart primitive.<br />
In order to implement a heart primitive for the BRL-CAD software, we have to write a set of routines.These routines will be stored in the hrt.c file that help for ray intersection, geometric representation and analysis of the a heart as well as the combination of regions using boolean operations which assist BRLCAD users in constructive solid geometry (C.S.G.) modeling.<br />
<br />
--hrt.c<br />
Here, we implement ray intersection , geometric analysis , geometric representation and combine several elliptical paraboloids to form a heart.<br />
This hrt.c file is the heart of the heart primitive.<br />
We include common.h for portability , system headers like stdio.h, math.h and stddef.h, db.h for database interactions, raytrace.h and rtgeeom.h .<br />
<br />
The sextic equation given below by the formula<br />
<br />
F(x,y,z)=0 ------- (1)<br />
<br />
where F(x,y,z) = (x^2 + 9/4*y^2 + z^2 - 1 )^3 - x^2*y^3 - 9/80 * y^3 * z^3<br />
<br />
defines the surface of the heart and it happens to be symmetric along the x-axis. We need to Solve this equation for x^2 inorder to enable us plot the heart curve in three dimensions.<br />
To do this, we rewrite the equation into a function of two variables P(y,z) which yields Q(x,y).<br />
We get x = Q(y,z) = sqrt(P(y,z)).<br />
The sextic equation above gets sinplified to the formula<br />
<br />
(a + 9/4*y^2 + z^2 - 1)^3 - a*y^3 - 9/80*y^3*z^3 = 0 ---------- (2)<br />
<br />
by a = P(y,z) = x^2.<br />
<br />
This gets reduced to a cubic (of power 3) polynomial given below<br />
<br />
a^3 + b*a^2 + c*a + d = 0-------------(3)<br />
<br />
where<br />
<br />
b = P1(y,z) = 27/4 * y^2 + 3 * z^2 - 3.<br />
c = P2(y,z) = 405/16 * y^4 - 27/4 * y^2 + z^4 + 9/2 * z^2 * ( y^2 + 1) + 1.<br />
d = P3(y,z) = 729/64*y^6+243/16*z^2*y^4+27/4*y^2*z^4-27/4*y^2*z^2-81/4*y^4+9/2*y^2+z^6-z^4 + z^2-1. <br />
<br />
The cubic equation in (3) can be solved algebraically using a division method or a decomposition as referenced in the research articles below (See "Links to code and algorithms you intend to use" section in this proposal).<br />
The roots of the equation will be Q(x,y) = {a1,a2,a3,a4,a5,a6} where ai = Q(x,y) for i in {1,2,3,4,5,6}.<br />
We are now able to plot the heart curve in 3D.<br />
<br />
Ray tracing<br />
<br />
Now we go over to how I intend to evaluate a ray against the sextic equation in (1).<br />
<br />
First of all , I will parametrize the sextic surface equation in (1) by converting it into the form<br />
<br />
x = F1(u,v) ----------- (4)<br />
<br />
y = F2(u,v) ----------- (5)<br />
<br />
z = F3(u,v) ----------- (6)<br />
<br />
I intend to compute the normal vector (ray) using the cross product of the partial derivatives of the coordinate functions. That is,<br />
<br />
F1u(u,v) = partial(F1(u, v)) / partial(u) ------------- (i)<br />
<br />
F1v(u, v) = partial(F1(u, v)) / partial(v) -------------(ii)<br />
<br />
F2u(u, v) = partial(F2(u, v)) / partial(u) -------------(iii)<br />
<br />
F2v(u, v) = partial(F2(u, v)) / partial(v) -------------(iv)<br />
<br />
F3u(u, v) = partial(F3(u, v)) / partial(u) --------------(v)<br />
<br />
F3v(u, v) = partial(F3(u, v)) / partial(v) --------------(vi)<br />
<br />
where the vectors<br />
<br />
tu(u, v) = <F1u(u,v), F2u(u,v) , F3u(u,v)> and tv(u, v) = <F1v(u,v) , F2v(u,v) F3v(u,v)> are tangents to the surface. Thus, we obtain the vector perpendicular to the tangent ( the normal to the surface) which is N(u, v) = p(u, v) / || p(u, v) || where p(u, v) = tu(u,v) X tv(u,v).<br />
The normal to the surface N(u,v) is the ray touching the heart from a particular point in 3D.<br />
<br />
Rendering<br />
<br />
Here, I discuss how I intend to do visualization (geometric representation and analysis). I intend to do this by finding the intersection points between the line (light ray ) and the heart. We simply will write a line-heart test which tells us if a point on the heart surface intersects with the heart. The points of intersection are those that satisfy the line equation and the equation for the surface of the heart at the same coordinates x, y, z.<br />
Here , we equate (1) and the equation of the line given below by<br />
<br />
X = o + dL --------------- (7)<br />
<br />
where d > 0 , X = (x,y,z) is in R^3 and L is the direction of the line.<br />
<br />
To search for points that are on the line and on the heart means combining the equations and solving for d. When equations are combined , expanded and rearranged , we get a quadratic equation<br />
<br />
a*d^2 + b*d + c = 0 ---------------(8)<br />
<br />
which can be solved using the quadratic formula.<br />
<br />
d = -b + sqrt(b^2 - 4 * a * c) / 2*a and d = -b - sqrt(b^2 - 4*a*c) / 2*a.<br />
<br />
If the value of b^2 - 4*a*c is less than zero, then it is clear that no solutions exist, that is, the line does not intersect the heart.If it is zero, then exactly one solution exists, that is, the line just touches the heart in one point.If it is greater than zero, two solutions exist, and thus the line touches the heart in two points (the entry and exit point).<br />
<br />
Boolean operations<br />
<br />
Intersection<br />
In order to write the intersection of different primitives with the heart primitive , I will solve for the 3D surface R(x,y,z) using the method given above (Equating (1) and the equation of the given primitive).<br />
<br />
We create bounding box for the heart.<br />
<br />
We transform the points on the heart to points on a heart centered at the origin, with a height along the the positive Z axis and a vertex V.<br />
<br />
We find the point of intersection W of a line with the surface of a heart and the vector normal to the tangent plane at the point of intersection.<br />
<br />
We write routines to interact with the values of the heart in the database.For example, routine to free the database storage of he heart, change database formats and export the heart from the database.<br />
<br />
We then write routines to compute the volume, surface area and centroid of the heart.<br />
Routines to print the heart , get curve points, plot the heart and tesselate will be written.<br />
<br />
We write routines to return the normal, entry and exit points of a ray .<br />
<br />
===LINKS TO CODE OR ALGORITHMS WHICH YOU INTEND TO USE===<br />
<br />
Research papers<br />
<br />
1.Taubin, G. "An Accurate Algorithm for Rasterizing Algebraic Curves." In Second ACM/IEEE Symposium on Solid Modeling and Applications Proceedings. 221-230, May 1993. <br />
<br />
2.Nordstrand, T. "Heart." http://jalape.no/math/hearttxt. <br />
<br />
3."A Generalization of Algebraic Surface drawing" by James F. Blinn.<br />
<br />
4.Wolfram mathworld's sextic equation:http://mathworld.wolfram.com/HeartSurface.html<br />
<br />
5.Solving sextic equations by division , Raghavendra G. Kulkarni.<br />
<br />
6.Solving sextic equations by decomposition , Raghavendra G. Kulkarni.<br />
<br />
<br />
<br />
<br />
Pictures<br />
<br />
1.Three dimensional heart with sextic equation:<br />
<br />
http://www.google.cm/imgres?imgurl=http://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/Heart3D.png/400px-Heart3D.png&imgrefurl=http://en.wikipedia.org/wiki/Heart_%28symbol%29&usg=__XN7WVIXRvY-U2iWfJEUScKLec3w=&h=431&w=400&sz=46&hl=en&start=7&zoom=1&tbnid=kE8CeD2yTcfjQM:&tbnh=126&tbnw=117&ei=wv5_UY7cFqbk4QTGwIHIDQ&itbs=1&sa=X&ved=0CDcQrQMwBg<br />
<br />
<br />
2.Two dimensional heart with sextic equation:<br />
<br />
http://www.google.cm/imgres?imgurl=http://image.spreadshirt.com/image-server/v1/compositions/3874833/views/1,width%3D280,height%3D280,appearanceId%3D1.png/yellowibis-com-mathematics-toddler-t-heart-surface-white_design.png&imgrefurl=http://yellowibis.spreadshirt.com/yellowibis-com-mathematics-toddler-t-heart-surface-white-A3491939&usg=__RGCh-_OLatg54LA5YvW6RlD4Hr8=&h=280&w=280&sz=40&hl=en&start=11&zoom=1&tbnid=EAbPmsQpWM9CeM:&tbnh=114&tbnw=114&ei=wv5_UY7cFqbk4QTGwIHIDQ&itbs=1&sa=X&ved=0CD8QrQMwCg<br />
<br />
<br />
3.Three dimensional heart centered at origin according to Taubin,G:<br />
<br />
http://www.google.cm/imgres?imgurl=http://www.maa.org/mathland/pic03563.jpg&imgrefurl=http://www.maa.org/mathland/mathtrek_02_11_02.html&usg=__DBx2PqQ_2PQIprMydn8zBX5VS60=&h=200&w=200&sz=6&hl=en&start=4&zoom=1&tbnid=qBdMD9--k5-pOM:&tbnh=104&tbnw=104&ei=DQGAUdCmO4HX4ASa9YGoDQ&itbs=1&sa=X&ved=0CDEQrQMwAw<br />
<br />
<br />
Code patch<br />
<br />
http://sourceforge.net/p/brlcad/patches/174/<br />
<br />
==DELIVERABLES==<br />
<br />
Pre mid term evaluation period<br />
<br />
* Ray intersection with heart.<br />
* Geometric analysis and representation<br />
* Compute heart metrics like surface area and volume of heart.<br />
* Testing of hrt.c.<br />
<br />
Post mid term evaluation period<br />
<br />
* Combinations and regions using booolean operations.<br />
* Database interactions.<br />
* Intersections with other primitives.<br />
* Integrating and documenting heart primitive into BRLCAD<br />
<br />
==DEVELOPMENT SCHEDULE AND TIMELINE==<br />
<br />
May 27th : Community bonding period<br />
<br />
(3 weeks)<br />
<br />
*Study BRL-CAD manuals,tutorials series and documentation concerning hacking.<br />
<br />
*Compile BRL-CAD source code ,Study code base and remove bugs.<br />
<br />
*Discuss with other developers and BRL-CAD mentors to refine mailing-list etiquette.<br />
<br />
*Study the src/librt/primitives/*/* and /include libraries.<br />
<br />
*Acquaint myself with necessary software like svn<br />
<br />
June 17th to July 26th : Work period (Pre-mid term evaluation)<br />
<br />
(1 week) <br />
<br />
*Ray intersection with heart.<br />
<br />
*Testing and debugging routines.<br />
<br />
(2 weeks)<br />
<br />
*Geometric analysis and representation.<br />
<br />
*Testing and debugging routines.<br />
<br />
(1 week)<br />
<br />
*Compute heart metrics like surface area and volume of heart.<br />
<br />
*Testing and debugging routines. <br />
<br />
(2 weeks)<br />
<br />
*Testing routines in hrt.c code.<br />
<br />
*Submission of hrt.c to mentors for corrections.<br />
<br />
<br />
June 29th to August 2nd : Mid-term evaluation<br />
<br />
(1 week)<br />
<br />
*Submission of preliminary hrt.c to Google.<br />
<br />
Aug 5th to Sept 13th : Work period (Post mid-term evaluation)<br />
<br />
(2 weeks)<br />
<br />
*Combinations and regions using <br />
<br />
*-intersection operation.<br />
<br />
*-union operation .<br />
<br />
*-exclusion operation.<br />
<br />
(2 weeks)<br />
<br />
*Database interactions.<br />
<br />
*Intersections with other primitives.<br />
<br />
(2 weeks)<br />
<br />
*Testing and debugging of hrt.c.<br />
<br />
<br />
Sep 16th to Sep 27th: Testing and Documentation period<br />
<br />
(1 week)<br />
<br />
*Integrating heart primitive into BRL-CAD.<br />
<br />
*Final testing and debugging of src/librt/primitives/hrt/hrt.c code.<br />
<br />
*Documenting heart primitive in BRL-CAD.<br />
<br />
*Submit hrt.c code to Google.<br />
<br />
(1 week) <br />
<br />
*Final submission of hrt.c code to Google.<br />
<br />
==TIME AVAILABILITY.== <br />
<br />
I am at the last phase of my M.Sc. research and will be done with the thesis before June. I will have ample time to code full time for 40+ hours weekly till the end of the summer holidays.My thesis defense will take place after the summer holidays in November . If I am done with my thesis in June, while awaiting defense and graduation in December 2013 after the summer , I will be available for some months to do any polishing and maintenance work given to me by BRL-CAD mentors.If I am not done with the thesis or I am given more work, I will work on the thesis writing during the day and allocate time to work on the BRL-CAD software during the night hours making sure I dedicate atleast 40 hours each week.<br />
<br />
==WHY BRL-CAD?==<br />
<br />
First of all, I really believe that software can change the world by providing new technologies and that software should be free. I choose BRL-CAD because it is a not-for-profit technology organization which offers me the opportunity to assist the United States Army Research Laboratory with tools which help them simulate and visualize their combat vehicle systems and war events. Working with BRL-CAD also helps me contribute over the long-term and gain status within the hacker community based on my mathematical/Computing background and academic interests.<br />
Although I have not contributed before to opensource ,I see implementing a heart surface primitive as a long-awaited opportunity to provide more primitive options (adding a heart to the raytrace library which is the heart of BRL-CAD) for the BRL-CAD software and a jumpstart to my continued contribution to open source software through BRL-CAD.This project will also help BRL-CAD users to build three-dimensional models related to the heart and love - a virtue we really need in our world today.<br />
<br />
==WHY YOU?==<br />
<br />
<br />
I am a final year M.Sc. student in Computer Science at the University of Buea (www.ubuea.net) , Cameroon , Africa and a holder of a B.Sc. in Mathematics & Computer Science. I am currently rounding up with my research thesis on business process compliance.<br />
I have a good background and intuition in Mathematics and algorithms as well as C/C++ programming. In the past , I worked on various data structuring and algorithmic individual and team projects in the University community which I really enjoyed. For example , I built mini-compilers flex/bison to reason about and infer the regulatory compliance in associated business process graphs . Also , I worked within a team to implement red black trees and variants like order statistics trees , interval trees and persistence trees (over 6000 lines of C code). I was enthused collaborating in teams with other bright thinkers . I was the best on some projects and mediocre on some others - but I really learned the importance of communicating and working in teams with other smart individuals. <br />
I was born into an extended family of researchers in Research institutions and Universities under the Cameroonian government.This gave me the passion to become a researcher for not-for-profit organizations and contribute to the open source community. With this upbringing ,background and experience, I think I have the necessary skills to implement a heart surface primitive for the BRL-CAD software. I am familiar with various open source software engineering tools like svn, gcc, gdb ,emacs ,etc and switched to Linux distributions ( using Red Hat and Ubuntu ) since 2010.<br />
Also, I am at the last phase of my research and will be done with the thesis before June. I will have ample time to code away the summer holidays .If I am not done with the thesis or I am given more work,I will work on the thesis writing during the day and allocate time to work on the BRL-CAD software during the night hours making sure I dedicate atleast 40 hours each week. Lastly , I will make sure I communicate my progress , problems encountered and further work to my mentors in Weekly reports to facilitate the supervision and management of the project. I will discuss with mentors real time for short clarifications on IRC chat and demand long clarifications on the mailing list.<br />
<br />
==ANYTHING ELSE?== <br />
<br />
I think it would be great for BRL-CAD to select me for various reasons. Firstly , it will greatly encourage the programmers around my community and country to come up to hackerdom standard and contribute to open source projects. <br />
It will also attract and encourage a lot of young ones in my country and continent towards the computing field as a whole. <br />
Also, BRL-CAD will gain the reputation of encouraging equal opportunity and ethnic diversity by helping to groom more hackers from underrepresented minority backgrounds in computing like Africa.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:NyahCh3ck20/GSoc2013/Coding_Report&diff=5906User:NyahCh3ck20/GSoc2013/Coding Report2013-08-02T17:27:08Z<p>195.24.220.16: /* 29 July - 4 August */</p>
<hr />
<div>==== Coding Log Report for GSoc 2013 ====<br />
Daily log:<br />
<br />
<br />
==17 June - 23 June==<br />
Coding Begins for GsoC<br />
working on codepatch to be uploaded to brlcad<br />
uploaded the sourcefile for new push routine which supports the -x option for xpush but still needs further testing and<br />
modifications.<br />
<br />
18 june 2013<br />
Added a new functionality to new push routine<br />
where the push would recognise the the xpush case even in a case<br />
where the -x option is ommitted or ignored.<br />
<br />
Tested the new routine and extracted patch to be uploaded to sourceforge<br />
replacing the previous push file I uploaded. <br />
<br />
To discuss with mentors whether there is an implementation of the Inverse of a 4x4 matrix in the brlcad source code.<br />
<br />
Looking at the implementations of the Inverse of the matrix in BRL-CAD<br />
<br />
==24 June - 30 June==<br />
*Monday June 24<br />
Looked at the definitions for the inverse of a 4x4 matrix as defined in /src/libbn/mat.c. However, i realised orthogonal matrices were not taken into consideration. So added functionality to determine inverse faster for othogonal matrices and to upload patch to sourceforge shortly.<br />
<br />
Started creating structures for the pull routine that is ( pull_obj and p_solid) structures to hold objects to be pushed and solids currently being pushed on a CSG tree. Code to be added to sourceforge Shortly.<br />
<br />
re-read the HACKING file to make sure i conformed with the coding standards for BRL-CAD.<br />
<br />
*Tuesday June 25<br />
<br />
Further tested the bn_mat_inverse routine(src/libbn/mat.c) and modified patch that was to be uploaded yesterday but failed due to poor network connection.<br />
<br />
Looked at the libbn library especially mat.c which would be useful for implementing the pull.<br />
<br />
Studied the vmath.h header and discovered the transform.c file which could be applied in creating the pull routine.<br />
<br />
Uploaded the pull.c first patch and bn_mat_inverse patches due to failure in network for them to be uploaded yesterday.<br />
[https://sourceforge.net/p/brlcad/patches/202/ Inverse Matrix support for orthogonal matrices]<br />
<br />
Will need some clarification from mentors concerning my design strategy for the pull routine.( The necessary functions i would need to create or call from the source)<br />
in order to implement a complete pull routine.(Asked on mailing list.)<br />
still to continue work on push and xpush merger.<br />
<br />
Saw the importance of magic numbers in taking note of visited nodes along the CSG tree. Also, thought of checking the matrix transformations for each node to determine<br />
if node has been visited but since magic IDs were used in the push then i could use both in pull when performing the inorder walk from the leaf(solid) nodes.<br />
<br />
Moreover, for objects in database, dp->d_uses was used but not safe as defined push.<br />
<br />
<br />
*Wednesday July 26<br />
Earlier part of the day used for preparation for and wrote an Information System test before working.<br />
<br />
Added the new pull routine to the setup.c(/src/mged/setup.c) interface and<br />
included the new command into the CMakeLists.txt file(/src/libged/CMakeLists.txt) in the brlcad source<br />
<br />
These patches also included the removal of the xpush command to support the new push and xpush. Patches to be uploaded to sf.<br />
<br />
Added new pull routine declaration(ged_pull(struct ged *,int, char *[])) to the ged.h header so it can be accessed by other files.<br />
patches to be uploaded to sf.<br />
<br />
Added new pull to tclcad_obj.c file(/src/libtclcad/) although with support of more than one arguments i'll first of all try to <br />
test with only one argument then see how far it goes;this is so that it's available in the internal database interface.<br />
<br />
Added tentative ged_pull() function definition to the pull.c file to enable it to be accessed by files calling function.<br />
<br />
However since ged_pull() routine does not compile code can't compile due to unused variables so will create some dummy operations just to see how blank routine works and get it started.<br />
<br />
Well just realised that the orthogonal matrix consideration in the bn_mat_inverse routine in mat.c is causing the benchmark tests to fail. Gotta sit on it and fix the bug.<br />
[https://sourceforge.net/p/brlcad/patches/206/ Pull Patch]<br />
<br />
*Thursday 27 June<br />
Travelled to Douala and spent the whole day trying to cash the prepaid GSoC deposit.<br />
However, tried working on a bug in the mat.c file(/src/libbn) where the inserted code patch for orthogonal matrix support is giving wrong answers during the benchmark test. Discovered a little error calling the bn_mat_mul2() routine and now code passes 3 benchmark tests and fails 3.Will perfect code and upload codepatch tomorrow on sf.<br />
<br />
*Friday 28 June<br />
<br />
Looking at the bn_mat_inv() routine and performing some tests to ensure all benchmark tests succeed.<br />
<br />
Checked the orthogonal matrix support and code still fails 3 regression tests after testing and checking need some assistance for this.<br />
Started a detail analysis and study of the push command from the ged_push() routine. This is to enable me understand perfectly <br />
the implementation hacks of the push in order to implement a push correctly especially when it comes to dealing with the points and matrix<br />
transformations at the node and leaf levels on the CSG tree. <br />
<br />
To check all reviews from code patches so as to start working on them tomorrow.<br />
[https://sourceforge.net/p/brlcad/patches/190/ Modified push]<br />
[https://sourceforge.net/p/brlcad/patches/202/ Modified bn_mat_inv]This patches passes some regression tests; but i don't understand why it still doesn't work perfect. Don't really see the problem here<br />
<br />
==1 July - 7 July==<br />
*Monday 1 July<br />
Well did not code because of Preparations to attend the Google Student's Ambassador's Summit in Nairobi, Kenya for Africa. This summit goes on for the whole week. But will try to fix problems with my code patches while at the summit.<br />
<br />
*Tuesday 2 July 2013<br />
Boarded Kenyan Airways flight from Douala Int'l to the Jomo Kenyatta Int'l in Nairobi which took about 5 hours; then registered with the GSA team.<br />
<br />
<br />
*Wednesday 3 July 2013<br />
Attended the First day of Summit where we had talks with Google Engineers about being a good ambassador. Presentations were given by Mr. Obum Ekeke , Tayib Fall<br />
and others about opportunities at Google.<br />
<br />
*Thursday 4 July 2013<br />
Second Day of Summit focused on Google products like Adwords, Adsense and other products; also, Engr. Giacomo(Googler) gave a presentation on Webmaster tools and Google Search in general.<br />
<br />
<br />
*Friday 5 July 2013<br />
Third day of Summit where we focused on making greater impacts on our communities in Africa; with awards given to Star GSAs of the previous years.<br />
Shared ideas and experiences for the Moonshot idea competition organised as per country we emerged 3rd after South Africa and Kenya.<br />
Developed plans to execute our moonshot idea as we returned home after the summit<br />
<br />
<br />
*Saturday 6 July <br />
Preparing for return trip to Douala Int'l and went round Nairobi for shopping and other stuffs.<br />
<br />
*Sunday 7 July<br />
Returned from Nairobi to Douala and after meeting family travelled to Buea to prepare for coming week.<br />
<br />
== 8 July - 14 July ==<br />
<br />
*8 July 2013<br />
Wrote a report to be submitted to the Vice Chancellor concerning my experiences on Google Student Ambassador's summit and preparing for a Numerical Analysis Exam<br />
Took further look at source code(/src/push.c) to see how the matrix transformations are applied to the coordinate points of the node so as to determine a way of <br />
extracting the original matrix transformation or almost exact matrix transformation for source code.<br />
<br />
Glad the Dean of the faculty of Science authorized the installation of Internet in the CS so we can have 24/7 Internet access<br />
<br />
<br />
*Tuesday 9 July<br />
Wrote my Numerical Analysis exams and to finish with exams tomorrow so i can focus on GSoC full time.<br />
<br />
*Wednesday 10 July <br />
Finished writing exams today and <br />
started preparing previous code patches(mat.c,push.c,pull.c) so that when the Internet access is available<br />
all files will be uploaded so as to get commit access.<br />
<br />
<br />
*11 July 2013<br />
studied the brlcad primtive internals like(torus, spheroids, toruses (torii), spheres, ellipsoids, pyramids) so as to be able generate the original transformation matrix. Torus, struct rt_tor_internal Centerpoint, point_t v, is obviously the translation. The orientation and scale is defined by vect_t h, and radiuses by fast_t r_h and fast_t r_a. Because of symmetries, the original transformation matrix must have contained a translation of v, and a rotation that brings vect_t h to an axis <br />
<br />
Spheres and ellipsoids, struct rt_ell_internal Centerpoint is at point_t v, which again is obviously the translation done.There are three vectors, point_t a, point_t b, and point_t c, that describe the spheroid axes. This means that I can construct the transformation matrix that transforms the unit sphere to this sphere directly.<br />
<br />
for Truncated general cones, struct rt_tgc_internal Centerpoint is at vect_t v, with vect_t h describing the axis. The base of the cone is, I think, described by the vectors vect_t a and vect_t b, and the top of the cone by vectors vect_t c and vect_t d. This implies that aÂ·b=0 and cÂ·d=0, but they may not be perpendicular to h, since the base and top of a general cone may be cut along any direction. v is the translation, and h should be along an axis (probably z axis). This yields three vectors (h, f, g), that along with the translation vector v define the transformation matrix just like in the ellipsoid case.<br />
<br />
Also, looked at data type for Pyramids: struct rt_arb8_internal This data type contains between four (tetrahedron) to eight vertices as point_t variables. Pyramids and tetrahedra have the apex vertex perpendicular and center to a face. This can be taken as the face vector. The second vector is one that bisects an edge (the longest edge?) of the face perpendicular to the apex. The third vector is their cross product, and is either towards a vertex (a tetrahedron) or halves another edge of the face perpendicular to the apex (a pyramid). These three vectors can be used to regenerate the initial transformation matrix, with e.g. the base on the XY plane, and the apex along the Z axis.<br />
<br />
To look at wedges, Boxes, and convex polyhedra tomorrow.<br />
<br />
* 12 July 2013<br />
Prepared complete patches and uploaded to sf to replace the existing patches for new push routine(push.c), pull routines(pull.c) and bn_mat_inverse routine(mat.c) with orthogonal matrix support. Since there is no internet connection, I could not create these patches with the current svn checkout.<br />
<br />
Continued study of implementation of push.c so as to see what happens to coordinate points of the node, to determine how some form of the original matrix transformation is stored so as to ease restore during the pull routine.<br />
<br />
*13 July 2013<br />
Did no work because of a long meeting( in my capacity as Auditor of Computer Engineering students Association) of over 5 hours with the Dean of Faculty to draft modalities for new student union body and draft constitution and mission to govern association.<br />
<br />
Will start implementing the pull leaf function as from Monday which will extract the matrix transformations from the primitives(solid) or leaf nodes.<br />
<br />
== 15 July - 21 July ==<br />
<br />
Monday 15 July<br />
*Implemented the pull_leaf routine which build a linked list for object's tree which would be used in extracting matrix transformations in leaf_mat() routine I am to start working on tomorrow.<br />
*continued with the implementation of the ged_pull by adding -d option to command to enable a debug of command as in push -d<br />
<br />
Todo: To ask on mailing list how to generate a Magic ID since its needed for the pull.<br />
<br />
Tuesday July 16 2013<br />
*Further worked on the pull_leaf routine to make sure list is properly built and created loop to free up list if errors occured during the list build like pulling unpushed nodes.<br />
<br />
* Started working on a loop to move through the nodes of the linked list making the necessary mat_t changes while moving upwards modifying the current matrix transformation as it encounters a new leaf when necessary calculating and storing the inverse matrices up the tree till it reaches the root. This will then be followed by writing these changes to the database.<br />
<br />
TODO: Ask on mailing list how my current working model solves the method so as to make the necesary changes in approach and continue.<br />
<br />
Wednesday July 17, 2013<br />
<br />
*Finished writing loop that moves backwards on the newly built list of nodes on the tree, performing inverses as necesary,storing the changes on the node, writing to database and setting the matrix transformations for primitives(leaves) to identity as necessary.<br />
<br />
*Wrote loop that frees up built list and returns result of object pull.<br />
<br />
*started testing of pull command and to continue fixing bugs. Till command is ok before adding support to pull more than one object.<br />
<br />
*Performed another benchmark test for the orthogonal matrix support for bn_mat_inverse() in mat.c<br />
<br />
*Uploaded code patches for mat.c and combined push and xpush to sourceforge.<br />
<br />
Todo: fix all problems with with currrent and past patches and upload to sf for mentor review.<br />
<br />
<br />
Thursday July 18, 2013<br />
<br />
*Started working on compile time errors of the pull.c by fixing some pointer casts and others.<br />
<br />
Friday July 19, 2013<br />
<br />
*Finished debugging compile errors and started testing routine.<br />
<br />
*Tested for improper use of command(pull 'no object'), returned correct errors<br />
<br />
*Tested for pulling a primitive.(returned correct error message).<br />
<br />
*Tested for pulling an object which has not been previously pulled.(mged crashed due to segmentation fault) to start working on bug next week.<br />
<br />
Will be taking tomorrow off since its my birthday and start working on bugs and patches next week.<br />
<br />
== 22 July - 28 July ==<br />
<br />
Monday July 22, 2013<br />
<br />
*Added -x option to push.c to support new xpush command(recreated and tested new push command). Spent whole day debugging and still have not succeeded in removing bug causing the<br />
loss of options to push command.<br />
<br />
*Created new patch for pull command and patch applies cleanly but command still further development and debugging.<br />
<br />
Tuesday July 23, 2013<br />
*Installed Internet in the CS Lab so as to increase efficiency for BRL-CAD.<br />
<br />
*Started downloading latest svn checkout for BRL-CAD source <br />
<br />
*Set up account on bz.bzflag.bz server and Started downloading tutorials on how to use ssh and GNU Screen<br />
<br />
*Upgrading my SL 6.2 distro so as to start further work on patches tomorrow.<br />
<br />
Wednesday July 24, 2013<br />
<br />
*Enabling pull routine to be able to pull a non leaf node; that is routine is able to pull geometric transformations from any node up to the root.(as @Sean adviced me on mailing list.)<br />
<br />
*Found bug in code which returns error when pulling non-leaf node. Started fixing<br />
<br />
*Prepared patch to stub pull routine unto brlcad using svn diff(Uploaded to sf [https://sourceforge.net/p/brlcad/patches/215/ Here] <br />
<br />
*Tests of pull routine shown[http://brlcad.org/wiki/File:Pulling_non_leaf_objects.png here]<br />
<br />
<br />
Thursday July 25, 2013<br />
<br />
*Tested new algorithm for bn_mat_inverse() which used only Uses 100 multiplications and 61 additions or substractions.<br />
<br />
*Tested new algorithm for bn_mat_determinant which requires only 34 multiplications and 20 additions or substractions, saving 6 multiplications<br />
and 3 additions or substractions compared to the previous one. Integrated code into brlcad and tested. new passed all benchmark tests. <br />
Created patch and uploaded to [https://sourceforge.net/p/brlcad/patches/216/ sf]<br />
<br />
*Wrote Tests to compare runtime of old_determinant against new determinant routine which returned the following results below: <br />
<br />
*Wrote Tests to compare Inverse of Old matrix inverse routine and new_matrix Inverse routine which returned the following results:<br />
<br />
CPU: Pentium(R) Dual-Core CPU E5500 @ 2.80GHz<br />
Compiler used: gcc 4.4.6-3)<br />
Compiler command: gcc -W -Wall -O3 -fomit-frame-pointer<br />
Kernel: Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Sat Dec 10 17:47:51 EST 2011 i686 i686 i386 GNU/Linux<br />
<br />
./determinant<br />
My implementation:<br />
98 cycles minimum<br />
112 cycles median<br />
libbn implementation:<br />
84 cycles minimum<br />
84 cycles median<br />
Results (relative differences of calculated determinants):<br />
-3.836070396965505e-14 minimum<br />
0 median<br />
2.152181998793086e-13 maximum<br />
<br />
./inverse<br />
Example:<br />
My implementation:<br />
[ 0.803558 0.065957 -0.31977 0.174422 ]-1 [ 1.105838 -0.352959 0.306948 -0.191398 ]<br />
[ 0.178270 0.764400 -0.477912 0.560214 ] [ -0.546125 0.959763 0.471464 -0.743848 ]<br />
[ 0.567903 0.641359 0.602482 0.639353 ] = [ -0.461005 -0.688994 0.868583 -0.088937 ]<br />
[ 0.000000 0.000000 0 1.000000 ] [ 0.000000 0.000000 0 1.000000 ]<br />
libbn implementation:<br />
[ 0.803558 0.065957 -0.31977 0.174422 ]-1 [ 1.105838 -0.352959 0.306948 -0.191398 ]<br />
[ 0.178270 0.764400 -0.477912 0.560214 ] [ -0.546125 0.959763 0.471464 -0.743848 ]<br />
[ 0.567903 0.641359 0.602482 0.639353 ] = [ -0.461005 -0.688994 0.868583 -0.088937 ]<br />
[ 0.000000 0.000000 0 1.000000 ] [ 0.000000 0.000000 -0 1.000000 ]<br />
My implementation:<br />
462 cycles minimum<br />
490 cycles median<br />
libbn implementation:<br />
434 cycles minimum<br />
546 cycles median<br />
<br />
<br />
<br />
Friday July 26, 2013<br />
<br />
*Added -x option to push command. But command fails to read options in mged. Tried (Pd:x) and Pdx as arguments to bu_getopt() but command fails to read options. Continued testing and debugging. <br />
<br />
*Changed the call of pushx(formerly ged_xpush to take as args gedp,dp so as to proceed to xpushing of object. Still testing routine.<br />
<br />
*Debugged push command to support -x option, made [https://sourceforge.net/p/brlcad/patches/217/ patch] and submitted on sourceforge. However command can push only an object at a time so further work needs to be done to added support for multiple objects. <br />
<br />
* Some tests on command [http://brlcad.org/wiki/File:Testing_new_push_routine.png Here]<br />
<br />
<br />
TOD0: Add support for multiple objects then clean up xpush in BRL-CAD.<br />
<br />
<br />
Saturday 27 July, 2013<br />
<br />
*Added support to Push routine to push multiple objects. Created patch and modified patch uploaded to sourceforge.<br />
<br />
*To clean up xpush routine from source code and make all new references to new push.<br />
<br />
<br />
<br />
== 29 July - 4 August ==<br />
Monday July 29, 2013<br />
<br />
*Started studies on ssh, irssi, and GNU Screen, succeeded in uploading some of my code patches to bz.bzflag.bz.<br />
<br />
*Downloaded code to bzflag and compiled code although there is a small in bug in current code repository.<br />
<br />
* Started working on tests for some of the /src/libbn/mat.c routines using the modified test Sean gave me on bn_mat_inverse and bn_mat_determinant.<br />
<br />
<br />
Tuesday July 30, 2013<br />
<br />
*Started looking at the BRL-CAD Numerics library for tests and started wrote a unit test for the bn_poly_multiply() routine.<br />
<br />
* Tested for very large and small values and answer was correct.<br />
<br />
*Integrated test into BRL-CAD, created patch and submited code on [https://sourceforge.net/p/brlcad/patches/221/ sf].<br />
<br />
<br />
*Filled the Mid-Term Evaluation form for participants.<br />
<br />
To continue work on poly.c routines tomorrow.<br />
<br />
Wednesday July 31, 2013<br />
<br />
*Wrote the unit test for bn_poly_scale(), bn_poly_add(), bn_poly_sub(), bn_poly_synthetic_division() routines and uploaded code patches to source forge.<br />
<br />
Will continue writing tests for the other poly.c tomorrow and finish by the end of the week.<br />
<br />
Thursday Aug 1, 2013<br />
<br />
*Wrote the unit test for bn_poly_quadratic_roots() routine and uploaded patch on [https://sourceforge.net/p/brlcad/patches/226/ sourceforge]<br />
<br />
*Spent day debugging test and doing some further extreme test.<br />
<br />
Friday Aug 2, 2013<br />
<br />
*Wrote and tested the unit tests for the bn_poly_cubic_roots and bn_poly_quartic_roots() routines. Created patches and uploaded to sourceforge.<br />
<br />
* To modify patches include source of known test values( Use Octave or maxima) since mathportal.org doesn't give clear math solver.<br />
<br />
* Modifying patches to match reference values from Octave.<br />
<br />
== 5 August - 11 August ==<br />
<br />
== 12 August - 18 August ==<br />
<br />
== 19 August - 25 August ==<br />
<br />
= Original Timeline =<br />
<br />
Since i'll have to attend the Google Student Ambassador's summit in the first days of July and exams begin on the early part of July i'll move some of the work overhead to june when coding begins.<br />
<br />
<br />
<br />
<br />
===Community Bonding Period ===<br />
May 30<br />
<br />
<br />
June 13<br />
TODO: combination of push and xpush routine.<br />
changed xpush to push -x <br />
<br />
June 14:<br />
Integration into MGED and tests of new command.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5850User:Izak/GSOC 2013 logs2013-07-27T15:06:05Z<p>195.24.220.16: /* From July 22th to July 27th */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
June 17<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
June 18<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here .<br />
<br />
June 19<br />
<br />
*Hoped to do this today : Need to look at the "Metaball" paper on using the blobby method , read volume rendering by Drebin et al and edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
June 20<br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
June 21<br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
June 22<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
June 24<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper titled "Volumetric shape description using the blobby model" which was used to implement the metaball primitive ( by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres ( for the heart lobes ) and an elliptical parabola - epa (for the lower portion of the heart ). Need to verify the correctness of this design approach on the mailing list.<br />
<br />
June 25<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
June 26<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
June 27<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
June 28<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
June 29<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
July 1<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
July 2<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
July 3<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
July 4<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
June 5<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
July 6<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
July 8<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
July 9<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
July 10<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
July 11<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
July 12<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
July 13<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart in src/librt/primitives/table.c .This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
July 15<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
July 16<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
July 17<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
July 18<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
July 19<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
July 20<br />
<br />
* Had a headache today. Did no coding work. Just did some planning and light observation of toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
July 22<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
July 23<br />
<br />
* Fixed my S.L. 6.2 system today after a crash. Lost the 0rt_hrt_prep() function which I already wrote :(. Not a big deal though. <br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.<br />
<br />
July 24<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/207/ hrt_stub.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
July 25<br />
<br />
* My mentor [http://sourceforge.net/p/brlcad/patches/203/?limit=10&page=1#836c accepted] the hrt_magic.patch and [http://sourceforge.net/p/brlcad/patches/203/?limit=10&page=1#a682 applied] it to r56212. :)<br />
<br />
* Doing changes to generate hrt_typein.patch.<br />
<br />
July 26<br />
<br />
* Removing errors from the hrt_typein.patch <br />
<br />
* My hrt_stub.patch file got [http://sourceforge.net/p/brlcad/patches/207/?limit=10&page=1#99a9 closed-accepted] status and [http://sourceforge.net/p/brlcad/patches/207/?limit=10&page=1#f22c applied] to r56235.<br />
<br />
July 27<br />
<br />
* Working on a test for the [sourceforge.net/p/brlcad/patches/191/ rb_delete.c] function.<br />
* ....<br />
==Pre-midterm evaluation summary==<br />
<br />
In order to prepare the BRL-CAD source code for the heart primitive , I hooked the heart primitive into the BRL-CAD source by adding a magic number for the heart in include/magic.h and src/libbu/magic.c, stubbing an empty heart in include/db5.h, include/rtgeom.h, include/raytrace.h, src/librt/db5_types.c and /src/librt/primitives/table.c and adding typing support for the heart in the mged interface in include/wdb.h, src/libwdb/wdb.c and src/libged/typein.c as can be seen [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here]. As regards the ray tracing callback functions in src/librt/primitives/hrt/hrt.c , I have built the hrt_specific structure, written the rt_hrt_shot() and rt_hrt_prep() functions and I am currently testing these.I intend to continue working on other callback functions like rt_hrt_import(), rt_hrt_print(), etc and finally hook the heart primitive to the mged and archer interfaces with associated clean up and documentation.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5835User:Izak/GSOC 2013 logs2013-07-26T17:06:09Z<p>195.24.220.16: /* From July 22th to July 27th */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
June 17<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
June 18<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here .<br />
<br />
June 19<br />
<br />
*Hoped to do this today : Need to look at the "Metaball" paper on using the blobby method , read volume rendering by Drebin et al and edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
June 20<br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
June 21<br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
June 22<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
June 24<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper titled "Volumetric shape description using the blobby model" which was used to implement the metaball primitive ( by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres ( for the heart lobes ) and an elliptical parabola - epa (for the lower portion of the heart ). Need to verify the correctness of this design approach on the mailing list.<br />
<br />
June 25<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
June 26<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
June 27<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
June 28<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
June 29<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
July 1<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
July 2<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
July 3<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
July 4<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
June 5<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
July 6<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
July 8<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
July 9<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
July 10<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
July 11<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
July 12<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
July 13<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart in src/librt/primitives/table.c .This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
July 15<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
July 16<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
July 17<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
July 18<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
July 19<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
July 20<br />
<br />
* Had a headache today. Did no coding work. Just did some planning and light observation of toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
July 22<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
July 23<br />
<br />
* Fixed my S.L. 6.2 system today after a crash. Lost the 0rt_hrt_prep() function which I already wrote :(. Not a big deal though. <br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.<br />
<br />
July 24<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/207/ hrt_stub.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
July 25<br />
<br />
* My mentor [http://sourceforge.net/p/brlcad/patches/203/?limit=10&page=1#836c accepted] the hrt_magic.patch and [http://sourceforge.net/p/brlcad/patches/203/?limit=10&page=1#a682 applied] it to r56212. :)<br />
<br />
* Doing changes to generate hrt_typein.patch.<br />
<br />
July 26<br />
<br />
* Removing errors from the hrt_typein.patch <br />
<br />
* My hrt_stu.patch file got [http://sourceforge.net/p/brlcad/patches/207/?limit=10&page=1#99a9 closed-accepted] status and [http://sourceforge.net/p/brlcad/patches/207/?limit=10&page=1#f22c applied] to r56235.<br />
<br />
July 27<br />
<br />
==Pre-midterm evaluation summary==<br />
<br />
In order to prepare the BRL-CAD source code for the heart primitive , I hooked the heart primitive into the BRL-CAD source by adding a magic number for the heart in include/magic.h and src/libbu/magic.c, stubbing an empty heart in include/db5.h, include/rtgeom.h, include/raytrace.h, src/librt/db5_types.c and /src/librt/primitives/table.c and adding typing support for the heart in the mged interface in include/wdb.h, src/libwdb/wdb.c and src/libged/typein.c as can be seen [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here]. As regards the ray tracing callback functions in src/librt/primitives/hrt/hrt.c , I have built the hrt_specific structure, written the rt_hrt_shot() and rt_hrt_prep() functions and I am currently testing these.I intend to continue working on other callback functions like rt_hrt_import(), rt_hrt_print(), etc and finally hook the heart primitive to the mged and archer interfaces with associated clean up and documentation.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5833User:Izak/GSOC 2013 logs2013-07-26T13:13:14Z<p>195.24.220.16: /* From July 22th to July 27th */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
June 17<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
June 18<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here .<br />
<br />
June 19<br />
<br />
*Hoped to do this today : Need to look at the "Metaball" paper on using the blobby method , read volume rendering by Drebin et al and edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
June 20<br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
June 21<br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
June 22<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
June 24<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper titled "Volumetric shape description using the blobby model" which was used to implement the metaball primitive ( by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres ( for the heart lobes ) and an elliptical parabola - epa (for the lower portion of the heart ). Need to verify the correctness of this design approach on the mailing list.<br />
<br />
June 25<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
June 26<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
June 27<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
June 28<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
June 29<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
July 1<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
July 2<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
July 3<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
July 4<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
June 5<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
July 6<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
July 8<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
July 9<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
July 10<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
July 11<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
July 12<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
July 13<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart in src/librt/primitives/table.c .This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
July 15<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
July 16<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
July 17<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
July 18<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
July 19<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
July 20<br />
<br />
* Had a headache today. Did no coding work. Just did some planning and light observation of toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
July 22<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
July 23<br />
<br />
* Fixed my S.L. 6.2 system today after a crash. Lost the 0rt_hrt_prep() function which I already wrote :(. Not a big deal though. <br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.<br />
<br />
July 24<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/207/ hrt_stub.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
July 25<br />
<br />
* My mentor [http://sourceforge.net/p/brlcad/patches/203/?limit=10&page=1#836c accepted] the hrt_magic.patch and [http://sourceforge.net/p/brlcad/patches/203/?limit=10&page=1#a682 applied] it to r56212. :)<br />
<br />
* Doing changes to generate hrt_typein.patch.<br />
<br />
July 26<br />
<br />
* removing errors from the hrt_typein.patch <br />
<br />
July 27<br />
<br />
==Pre-midterm evaluation summary==<br />
<br />
In order to prepare the BRL-CAD source code for the heart primitive , I hooked the heart primitive into the BRL-CAD source by adding a magic number for the heart in include/magic.h and src/libbu/magic.c, stubbing an empty heart in include/db5.h, include/rtgeom.h, include/raytrace.h, src/librt/db5_types.c and /src/librt/primitives/table.c and adding typing support for the heart in the mged interface in include/wdb.h, src/libwdb/wdb.c and src/libged/typein.c as can be seen [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here]. As regards the ray tracing callback functions in src/librt/primitives/hrt/hrt.c , I have built the hrt_specific structure, written the rt_hrt_shot() and rt_hrt_prep() functions and I am currently testing these.I intend to continue working on other callback functions like rt_hrt_import(), rt_hrt_print(), etc and finally hook the heart primitive to the mged and archer interfaces with associated clean up and documentation.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5779User:Izak/GSOC 2013 logs2013-07-24T21:03:01Z<p>195.24.220.16: /* June 17 */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
June 17<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
==June 18==<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here . <br />
<br />
==June 19==<br />
<br />
*Hoped to do this today : Need to look at the "Metaball" paper on using the blobby method , read volume rendering by Drebin et al and edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
==June 20== <br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
==June 21== <br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
==June 22==<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
==June 24==<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper titled "Volumetric shape description using the blobby model" which was used to implement the metaball primitive ( by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres ( for the heart lobes ) and an elliptical parabola - epa (for the lower portion of the heart ). Need to verify the correctness of this design approach on the mailing list.<br />
<br />
==June 25==<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
<br />
==June 26==<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
==June 27==<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
==June 28==<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
==June 29==<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
==July 1==<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
==July 2==<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
==July 3==<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
==July 4==<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
==June 5==<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
==July 6==<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
==July 8==<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
==July 9==<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
==June 10==<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
==June 11==<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
==June 12==<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
==June 13==<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart in src/librt/primitives/table.c .This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
==July 15==<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
==July 16==<br />
<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
==July 17==<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
==July 18==<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
==July 19==<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
==July 20==<br />
<br />
* Had a headache today. Did no coding work. Just did some planning and light observation of toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
==July 22==<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
==July 23==<br />
<br />
* Fixed my S.L. 6.2 system today after a crash.<br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.<br />
<br />
==July 24==<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/207/ hrt_stub.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
==July 25==<br />
<br />
<br />
==July 26==<br />
<br />
<br />
==July 27==<br />
<br />
==Pre-midterm evaluation summary==<br />
<br />
In order to prepare the BRL-CAD source code for the heart primitive , I hooked the heart primitive into the BRL-CAD source by adding a magic number for the heart in include/magic.h and src/libbu/magic.c, stubbing an empty heart in include/db5.h, include/rtgeom.h, include/raytrace.h, src/librt/db5_types.c and /src/librt/primitives/table.c and adding typing support for the heart in the mged interface in include/wdb.h, src/libwdb/wdb.c and src/libged/typein.c as can be seen [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here]. As regards the ray tracing callback functions in src/librt/primitives/hrt/hrt.c , I have built the hrt_specific structure, written the rt_hrt_shot() and rt_hrt_prep() functions and I am currently testing these.I intend to continue working on other callback functions like rt_hrt_import(), rt_hrt_print(), etc and finally hook the heart primitive to the mged and archer interfaces with associated clean up and documentation.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5778User:Izak/GSOC 2013 logs2013-07-24T20:58:38Z<p>195.24.220.16: /* July 24 */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
== June 17 ==<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
==June 18==<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here . <br />
<br />
==June 19==<br />
<br />
*Hoped to do this today : Need to look at the "Metaball" paper on using the blobby method , read volume rendering by Drebin et al and edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
==June 20== <br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
==June 21== <br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
==June 22==<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
==June 24==<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper titled "Volumetric shape description using the blobby model" which was used to implement the metaball primitive ( by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres ( for the heart lobes ) and an elliptical parabola - epa (for the lower portion of the heart ). Need to verify the correctness of this design approach on the mailing list.<br />
<br />
==June 25==<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
<br />
==June 26==<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
==June 27==<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
==June 28==<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
==June 29==<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
==July 1==<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
==July 2==<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
==July 3==<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
==July 4==<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
==June 5==<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
==July 6==<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
==July 8==<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
==July 9==<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
==June 10==<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
==June 11==<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
==June 12==<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
==June 13==<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart in src/librt/primitives/table.c .This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
==July 15==<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
==July 16==<br />
<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
==July 17==<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
==July 18==<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
==July 19==<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
==July 20==<br />
<br />
* Had a headache today. Did no coding work. Just did some planning and light observation of toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
==July 22==<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
==July 23==<br />
<br />
* Fixed my S.L. 6.2 system today after a crash.<br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.<br />
<br />
==July 24==<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
* Generated and tested the [https://sourceforge.net/p/brlcad/patches/207/ hrt_stub.patch] that it applies cleanly, independently and without any side effects.<br />
<br />
==July 25==<br />
<br />
<br />
==July 26==<br />
<br />
<br />
==July 27==<br />
<br />
==Pre-midterm evaluation summary==<br />
<br />
In order to prepare the BRL-CAD source code for the heart primitive , I hooked the heart primitive into the BRL-CAD source by adding a magic number for the heart in include/magic.h and src/libbu/magic.c, stubbing an empty heart in include/db5.h, include/rtgeom.h, include/raytrace.h, src/librt/db5_types.c and /src/librt/primitives/table.c and adding typing support for the heart in the mged interface in include/wdb.h, src/libwdb/wdb.c and src/libged/typein.c as can be seen [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here]. As regards the ray tracing callback functions in src/librt/primitives/hrt/hrt.c , I have built the hrt_specific structure, written the rt_hrt_shot() and rt_hrt_prep() functions and I am currently testing these.I intend to continue working on other callback functions like rt_hrt_import(), rt_hrt_print(), etc and finally hook the heart primitive to the mged and archer interfaces with associated clean up and documentation.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5749User:Izak/GSOC 2013 logs2013-07-23T19:53:45Z<p>195.24.220.16: /* From June 17th to June 21 */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
June 17<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
June 18<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here . <br />
<br />
June 19<br />
<br />
*Hoped to do this today <br />
<br />
Need to look at the "Metaball" paper on using the blobby method .<br />
Read volume rendering by Drebin et al .<br />
Edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
June 20 <br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
June 21 <br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
June 22<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
June 24<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper, Volumetric shape description using the blobby model, which was used to implement the meta ball primitive (by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres (for the heart lobes ) and an elliptical parabola (for the lower portion of the heart ).<br />
<br />
June 25<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
<br />
June 26<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
June 27<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
June 28<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
June 29<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
July 1<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
July 2<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
July 3<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
July 4<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
June 5<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
July 6<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
July 8<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
July 9<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
June 10<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
June 11<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
June 12<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
June 12<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart.This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
July 15<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
July 16<br />
<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
July 17<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
July 18<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
July 19<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
July 20<br />
<br />
* Had a headache today. Did not work. Just did some planning and light obsetrvation of Toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
July 22<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
July 23<br />
<br />
* Fixed my S.L. 6.2 system today after a crash.<br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.</div>195.24.220.16https://brlcad.org/w/index.php?title=User:Izak/GSOC_2013_logs&diff=5746User:Izak/GSOC 2013 logs2013-07-23T19:32:33Z<p>195.24.220.16: /* From July 22th to July 27th */</p>
<hr />
<div>==PROJECT DETAILS==<br />
Project Title : Implementation of a heart primitive.<br />
<br />
Name: Isaac Kamga.<br />
<br />
IRC Name (Handle): Izak<br />
<br />
e-mail: u2isaac@gmail.com<br />
<br />
Phone : +237 74 10 62 97<br />
<br />
==Introduction==<br />
This page will contain logs of the work I will be doing during and after the summer of code period.<br />
<br />
==From June 3rd to June 7th==<br />
<br />
*Compiled and ran BRL-CAD from source (in 26 minutes) as well as used mged command interface.<br />
<br />
* Studying /src/librt/primitives/*/*.<br />
<br />
* Revising red-black trees in "Introduction to algorithms",third edition book by Cormen.<br />
<br />
==From June 10th to June 14th==<br />
*Fixing rb_delete.c to effectively delete nodes.<br />
<br />
==My Development Pictures==<br />
<br />
<br />
<br />
==From June 17th to June 21==<br />
<br />
June 17<br />
<br />
*Finished working on rb_delete.c .<br />
<br />
June 18<br />
<br />
*Edited raytrace.h by defining ID_HRT 43 ,incrementing ID_MAXIMUM and ID_MAX_SOLID to 44 as shown in this patch .<br />
<br />
*Added the DB5_MINORTYPE_BRLCAD_HRT 42 define to db5.h as shown here . <br />
<br />
June 19<br />
<br />
*Hoped to do this today <br />
Need to look at the "Metaball" paper on using the blobby method .<br />
Read volume rendering by Drebin et al .<br />
Edit magic.h and rtgeom.h to include the heart primitive .<br />
<br />
*However, took ill ( of malaria ) so undergoing treatment .<br />
<br />
June 20 <br />
<br />
*Ill of malaria so undergoing treatment .<br />
<br />
June 21 <br />
<br />
*Ill of malaria so undergoing treatment .<br />
*Uploaded some patches [http://sourceforge.net/p/brlcad/patches/191/ here].<br />
<br />
June 22<br />
<br />
* Recovering from brief illness.... <br />
<br />
* Updated GSoC 2013 Accepted projects page on the wiki .<br />
<br />
==From June 24th to June 29th==<br />
<br />
June 24<br />
<br />
* Re-read the Patch submission guidelines in the HACKING file .<br />
<br />
* Read the research paper, Volumetric shape description using the blobby model, which was used to implement the meta ball primitive (by the second method). Since the above method is used with two sphere primitives to create a metaball , I am considering using this same method alongside two spheres (for the heart lobes ) and an elliptical parabola (for the lower portion of the heart ).<br />
<br />
June 25<br />
<br />
* Studying the ray tracing geometry header ( rtgeom.h ) to write the heart primitive's internal representation (struct rt_hrt_internal) .<br />
<br />
* Searching for more information on the key properties of the heart .<br />
<br />
* Editing the magic numbers header ( magic.h ) which I have patched [https://sourceforge.net/p/brlcad/patches/203/ here] .<br />
<br />
* Currently writing the struct rt_hrt_internal structure which I have kept [https://sourceforge.net/p/brlcad/patches/204/ here] .Also wrote the RT_HRT_CK_MAGIC(_p) macro in rtgeom.h for the heart .<br />
<br />
<br />
June 26<br />
<br />
* Finished Modifying the magic header file [https://sourceforge.net/p/brlcad/patches/203/ here] which I earlier on submitted .<br />
<br />
* Looking into the internal representations of the tor and the superell .<br />
<br />
* Reading the rt_???_shot() functions in src/librt/primitives/tor/tor.c and src/librt/primitives/superell/superell.c to understand how they build up and evaluate formulae.<br />
<br />
* Included the internal representation of the heart in the include/rtgeom.h file used by the ray trace geometry library .That is, added the ID_HRT section ( struct rt_hrt_internal ). Please, take a [https://sourceforge.net/p/brlcad/patches/204/ look] :)<br />
<br />
* Editing the table.c file in src/librt/primitives .Declared a raytrace interface for the heart by RT_DECLARE_INTERFACE(hrt) . Edited the rt_functab[] array by providing an entry ID_HRT for the heart primitive. That is, add RT_FUNCTAB_MAGIC, "ID_HRT", "hrt",rt_hrt_*, just to name a few. You are welcome to look at my [https://sourceforge.net/p/brlcad/patches/205/ progress].<br />
<br />
June 27<br />
<br />
* Early in the morning I Left Buea, my home town to collect Google's welcome package in Douala. Collected some cash from the available ATM . Negotiating for Internet access and cool coding environment.Really tired.<br />
<br />
June 28<br />
<br />
* Corrected and submitted the db5 header [https://sourceforge.net/p/brlcad/patches/191/ ( See db5.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the raytrace header [https://sourceforge.net/p/brlcad/patches/191/ ( See raytrace.patch )] based on guidelines given by mentors.<br />
<br />
* Corrected and submitted the magic header [https://sourceforge.net/p/brlcad/patches/203/ ( See newest_magic.patch )] based on guidelines given by mentors. Still to correct the magic.c file to make these changes complete.<br />
<br />
June 29<br />
<br />
* Editing the magic.c file to accommodate the heart primitive. Uploaded the [https://sourceforge.net/p/brlcad/patches/203/?page=1 patch here].<br />
<br />
* Reworking the ray trace geometry header file (rtgeom.h) so that the internal representation of the heart will be accurate.<br />
<br />
==From July 1st to July 6th==<br />
<br />
July 1<br />
<br />
* Working on struct rt_hrt_internal inorder to include the heart primitive into the include/rtgeom.h header. Reading wikipedia and Wolfram pages on heart symbol,Level set,cusps and epicycloids.<br />
<br />
* Combined magic_h.patch and magic_c.patch into single [https://sourceforge.net/p/brlcad/patches/203/?page=1 magic.tar.gz] compressed file .<br />
<br />
* Combined db5_h.patch and db5_types_c.patch into single [https://sourceforge.net/p/brlcad/patches/207/ db5.tar.gz] compressed file.<br />
<br />
July 2<br />
<br />
* Still awaiting clarifications which I requested on the mailing list to develope the internal representation of the heart primitive in include/rtgeom.h.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/203/?page=1 hrt_magic.patch] file based on recommendations given by my mentor.<br />
<br />
* Corrected the [https://sourceforge.net/p/brlcad/patches/207/ hrt_db5.patch] file based on recommendations given by my mentor.<br />
<br />
* Awaiting some answers to questions posted on the mailing list in order to proceed with the editing of rtgeom.h and raytrace.h<br />
<br />
July 3<br />
<br />
* Getting requisite authorization to connect Workspace at the Faculty of Science building to the Internet. Not easy dealing with a bureaucratic system in which every administrative decision has to be documented in letters.<br />
<br />
* Downloaded subversion packages and source code to install. Need this to submit patches that apply cleanly.<br />
<br />
* The above activities took the whole day. Could not do coding work.<br />
<br />
July 4<br />
<br />
* Doing negotiations to get Internet access. This is a prerequisite to submitting perfect patches which are generated from the svn checkout.<br />
<br />
* Pushing through with authorization for Internet access at my workspace .<br />
<br />
* Presented the "Implementation of the heart primitive" proposal and progress reports to lectures and students of the Departments of Computer Science and computer Engineering.<br />
<br />
* Did no coding work today as I was preparing a good environment for coding.<br />
<br />
June 5<br />
<br />
* Did detailed mind maps to aid visualization of necessary editing of files to aid submission of logical patches. This will help see exactly how to group file changes like magic numbers , mirror support, mged support, etc.<br />
<br />
* Got equipment ready for installations of Internet but could not install today due to rainy weather. Hoping to get a sunny window tomorrow morning for installation.<br />
<br />
July 6<br />
<br />
* Awaiting the arrival of Head of Department from Bamenda. Discussed with him the need for authorization to install Internet at the laboratory by phone. He said we need to officially discuss it during office hours on Monday,July 8.<br />
<br />
* Doing research on how to solve the sextic equation of the heart. Read some papers and observed that the sextic equation of the heart does not meet the conditions presented in the literature.<br />
<br />
==From July 8th to July 14th==<br />
<br />
July 8<br />
<br />
* Yoopee:) My Head of Department discusses the need for GSoC students to temporarily install Internet at the laboratory with the Dean of the Faculty of Science.The Dean seconds the idea and writes to the Vice-Chancellor for final authorization. Waiting for the final authorization from the Vice-Chancellor within the week.This is the [https://docs.google.com/file/d/0B4kEIUMOBbU-SlBaeEdqQ0Eta1U/edit?usp=sharing letter] I wrote to the Deputy Vice Chancellor .The Head of Department's letter through the Dean to the Vice-Chancellor can be viewed [https://docs.google.com/file/d/0B4kEIUMOBbU-b2xzMXl2Y2lyaG8/edit?usp=sharing here].<br />
<br />
* Modified the internal representation of the heart (struct rt_hrt_internal).<br />
<br />
* Including an entry into the rt_functab[] array for the heart.<br />
<br />
* Plan to generate the patches from the work done immediately Internet access is available.<br />
<br />
July 9<br />
<br />
* Correcting my M.Sc. thesis in order to submit to supervisor until 13:00 UTC. <br />
<br />
* Finished working on the internal parameters of the heart solid in include/rtgeom.h .It now includes a center point, unit vectors in x,y and z directions and distance from center point to both upper and lower cusps.<br />
<br />
* Added mk_hrt() routine and associated comments to the include/wdb.h header file and src/libwdb/wdb.c file.<br />
<br />
* Added p_hrt[] array and hrt_in() routine to src/libged/typein.c so as to read heart parameters from the keyboard. <br />
<br />
* Waiting for final authorization for temporal installation of Internet access to generate patches which I worked on using svn.My Head of Department says the Dean still awaits response from the Vice-Chancellor's office.<br />
<br />
* Intend to test these edits tomorrow. Couldn't do these today because the Faculty building was very noisy today due to a staff meeting.<br />
<br />
June 10<br />
<br />
* Had a two-hour entretien today with my supervisor and head of Department until 10:00 UTC.<br />
<br />
* Created a hrt_magic patch file ( generated from diff -u for now ),the patch applied cleanly and BRL-CAD source compiled.<br />
<br />
* Created a hrt_stub patch file ( also generated from diff -u for now ), patch applied cleanly and BRL-CAD source compiled.Realised that an empty heart primitive has NULL fields in its rt_functab[] array entry. <br />
<br />
* Still Awaiting response to letter of authorization from the Vice-Chancellor :(<br />
<br />
* For tomorrow's work, I intend to create a heart object which can be tested in the mged interface.<br />
<br />
June 11<br />
<br />
* Debugged and compiled the int mk_hrt(struct rt_wdb *wdbp, const char *name, const fastf_t *center, const fastf_t *xdir, const fastf_t *ydir, const fastf_t *zdir, const fastf_t d) routine which was previously added to src/libwdb/wdb.c file.<br />
<br />
* Debugged and compliled the p_hrt[] array and the hrt_in(struct ged *gedp, char *cmd_argv[], struct rt_db_internal *intern) function which was previously added to src/libged/typein.c . <br />
<br />
* Tested the compiled code by reading in the coordinates of a heart object using the keyboard on the mged interface as shown [https://docs.google.com/file/d/0B4kEIUMOBbU-ZUpmcXpxZlFzVXc/edit?usp=sharing here ]. Feeling great!:)<br />
<br />
* Still awaiting response from the Vice-Chancellor.<br />
<br />
* Intend to finish any hacks of the mged interface and get into the difficult functions like rt_hrt_shot, rt_hrt_prep , etc.<br />
<br />
June 12<br />
<br />
* Added case HRT to the solbld function in src/conv/asc/asc2g.c which parses the heart record and determines which libwdb routine to call in order to replicate it. Debugging asc2g.c.....<br />
<br />
June 12<br />
<br />
* Started writing rt_hrt_shot() function for src/librt/primitives/hrt/hrt.c<br />
<br />
==Monthly Summary==<br />
<br />
Work done <br />
<br />
1. Added magic numbers: <br />
*Defined RT_HRT_INTERNAL_MAGIC Ox6872743f in include/magic.h <br />
*Included a case RT_HRT_INTERNAL_MAGIC in src/libbu/magic.c<br />
*I ended up with hrt_magic.patch.<br />
<br />
2. Stubbed in an empty heart primitive<br />
*Defined DB5_MINORTYPE_BRLCAD_HRT in include/db5.h.<br />
*Incremented ID_MAX_SOLID and ID_MAXIMUM to 44 as well as defined ID_HRT as 43.<br />
*Added { DB5_MAJORTYPE_BRLCAD, DB5_MINORTYPE_BRLCAD_HRT, 1, "hrt", "Heart" } as entry for the heart primitive in src/librt/db5_types.c.<br />
*Added struct rt_hrt_internal{} to internally represent the heart and wrote the RT_HRT_CK_MAGIC(_p) macro .<br />
*Declared RT_DECLARE_INTERFACE(hrt) and edited rtfunctab[] to include an entry for the heart.This entry had many NULL fields.<br />
*With this, I generated hrt_stub.patch.<br />
<br />
3. Added type in support for the heart (so as to read heart parameters from the keyboard.)<br />
*Added mk_hrt() routine and associated comments to include/wdb.h and src/libwdb/wdb.c .<br />
*Added p_hrt[] array and hrt_in() routine to src/libged/typein.c <br />
*This gave birth to hrt_type.patch, which was compiled, debugged and tested in the mged interface (See July 11 on my Development log).<br />
<br />
Future work<br />
<br />
* Start coding and testing the Intersection of a heart with a ray by writing int rt_hrt_shot(), void rt_hrt_norm, void rt_hrt_uv, etc<br />
<br />
==From July 15th to July 20th ==<br />
<br />
July 15<br />
<br />
* Studying how the quartic equation of the torus is built until the roots of this quartic equation is found by the root finder.<br />
<br />
* Working on int rt_hrt_shot() function whereby a ray intersects with the heart.This yield a sextic polynomial in t with 7 coefficients each with an average of 70 algebraic terms. The coefficient of t^6 has been computed while the coefficient of t^5 is being computed.<br />
<br />
July 16<br />
<br />
* Working on the t^5 and t^4 coefficients of the sextic equation in the int rt_hrt_shot() function whereby a ray intersects with the heart.<br />
<br />
July 17<br />
<br />
* Finished working on the coefficients of the sextic equation... Pretty tedious.<br />
<br />
* Discussed today with my former mathematics professor who pointed me to the Rouche's theorem to locate complex roots of a polynomial . Researching on this Theorem to locate roots and solve sextic equation.<br />
<br />
July 18<br />
<br />
* Following up the letter written to the Vice-Chancellor at the Central Administration. No coding work done today.<br />
<br />
July 19<br />
<br />
* Finished writing the rt_hrt_shot() function which has to be debugged and tested.<br />
<br />
July 20<br />
<br />
* Had a headache today. Did not work. Just did some planning and light obsetrvation of Toroid and superell primitives in src/librt/primitives/.<br />
<br />
=From July 22th to July 27th=<br />
<br />
July 22<br />
<br />
* Wrote the rt_hrt_parse[] array based on the internal properties of the heart.<br />
<br />
* Corrected the hrt_specific structure.<br />
<br />
* Wrote the rt_hrt_prep() function to prepare the heart object for ray shoting.<br />
<br />
* Making sure that my patches compile, although not yet generated from svn diff -u .<br />
<br />
July 23<br />
<br />
* Fixed my S.L. 6.2 system today after a crash.<br />
<br />
* Helped install Internet at the laboratory.<br />
<br />
* Discussed on IRC with brlcad on setting up a bzflag account. Accepted the usage policy and rules. Got this account set up. <br />
<br />
* Discussed with brlcad and Erik on IRC about correcting my communication (posting) style. Read the more academic [http://en.wikipedia.org/wiki/Posting_style wikipedia] page and Erik's recommended [http://catb.org/jargon/html/T/top-post.html link] in order to correct this.<br />
<br />
* Checking my patches from A to Z.</div>195.24.220.16