Editing Ali Haydar Dev log

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
  
  
# Setting up the environment installing ubuntu in dual boot and rebuilding the project in windows and ubuntu
+
# setting up the environment installing ubuntu in dual boot and rebuilding the project in windows and ubuntu
# Working on bugs:- the annotation is pointing to the origin fixed and patch submitted the drawing of numerical annotation results in no annotation working on it and notice that after constructing the numerical annotation you can't draw anything in the graphical screen until writing the Z command in MGED or reopening the database.  
+
# working on bugs:- the annotation is pointing to the origin fixed and patch submitted the drawing of numerical annotation results in no annotation working on it and notice that after constructing the numerical annotation you can't draw anything in the graphical screen until writing the Z command in MGED or reopening the database.  
# Using the code to modify the Vlist to draw a box around the label it is like a hack, not a real function just an experiment, it makes me realize that the label drawing should not start from the reference point but a little bit further so the box doesn't touch the label.
+
# using the code to modify the Vlist to draw a box around the label it is like a hack, not a real function just an experiment, it makes me realize that the label drawing should not start from the reference point but a little bit further so the box doesn't touch the label.
Contacting with the mentors and asking about there opinions.   
+
contacting with the mentors and asking about there opinions.   
 
   
 
   
  
Line 59: Line 59:
 
*July 2 the same link error we linked librt to the test file the function works but when you use RT_ADD_VLIST inside it you get the BU_ASSERT error and when using RT_ADD_VLIST inside the test program you get the unresolved external error when building the code.
 
*July 2 the same link error we linked librt to the test file the function works but when you use RT_ADD_VLIST inside it you get the BU_ASSERT error and when using RT_ADD_VLIST inside the test program you get the unresolved external error when building the code.
 
*July 3 found the solution by adding two lines to the test program which is 1- rt_g RTG; 2- BU_LIST_INIT(&RTG.rtg_vlfree); this solution is you need a free list to use the vlist which I learned in a hard way wasting 3 days searching online how to link a library to your code in cmake system.
 
*July 3 found the solution by adding two lines to the test program which is 1- rt_g RTG; 2- BU_LIST_INIT(&RTG.rtg_vlfree); this solution is you need a free list to use the vlist which I learned in a hard way wasting 3 days searching online how to link a library to your code in cmake system.
*July 4 rewrite the test file and adding all the expected cases of the function like Null pointer to no list and very long list. I have sent the file to the society to get opinions about the whole operation I think I finished it. Now looking to the bugs in the annotation we can notice that the annotation label is presented in the top-right position no matter what the position flag is I am working on this now and asked for the mentors to revise the goals of the project because the annotation editor is written in tcl/tk which will not be used in the new GUI this will make me do a lot of things that will not be useful. also, I have an exam on the 9th of June.
+
*July 4 rewrite the test file and adding all the expected cases of the function like Null pointer to no list and very long list. I have sent the file to the society to get opinions about the whole operation I think I finished it. Now looking to the bugs in the annotation we can notice that the annotation label is presented in the top right position no matter what the position flag is I am working on this now and asked for the mentors to revise the goals of the project because the annotation editor is written in tcl/tk which will not be used in the new GUI this will make me do a lot of things that will not be useful. also, I have an exam on the 9th of June.
*July 5 I couldn't do anything due to some problems in my sleeping schedule.
 
*July 6 I found a bug in the annotation behavior which is the position of the label doesn't change whatever the user chose from the position flags I am working on this and I have sent a suggestion for a partial solution.
 
*July 7 managed to make the case of the bottom right
 
{|align="right"
 
|[[File:Pasted image (3).png|thumb|256px|July 7 the bottom right position  ]]
 
|}
 
*July 8 I am preparing for structural dynamics exam tomorrow didn't do much I know I have to calculate the length of the label in the annotation.
 
*July 9 I had an exam. didn't do much
 
*July 10 I made some changes on the test program bn_test.c.
 
*July 11 I found a way to calculate the dimensions of the label in the annotation by calling the function which converts the string to a vlist bn_vlist_2string() considering that the reference point is the text placement point.
 
*July 12 working on the positions, the mentor's opinion is that the position flag should be related to a point of the text not related to the leader line but I think in this case it happens to be the endpoint of the leader line is the same point of the text placement
 
*July 13 still working on the positions flage the function rt_pos_flag() always returns the value top-right I fixed it and now I think it is manageable to construct all cases
 
*July 14 I managed to construct all the cases of the positions flage
 
{|align="right"
 
|[[File:Pasted image4.png|thumb|256px|July 14 ]]
 
|}
 
*July 15 still the discussion of position flag and I am working on making a new annotation type which is dimension line I am thinking of using the same primitive and prompt the user for the tow points of which the dimension line will exist. I fell very sick and I am planning to go to the hospital
 
*July 16 I made the dimension line and send it to the mentors to see what they think 
 
{|align="right"
 
|[[File:DL.png|thumb|256px|July 16 ]]
 
|}
 
July 16 the mentor's said this approach will not work because the line had to be in model space and its label in display space I don't know how to solve this issue, I think the line should have its own vlist and the label also and each one should have different projection matrix
 
*July 17 I was in the hospital and had minor surgery. the doctor told me you can set on the chair after tow days ): .
 
*July 18-19 I didn't do any thing.
 
*July 20 I am back to work I will fix the patches and try another approach for the dimenison line .
 
*July 21 I managed to keep the label of the dimension line in the display space and the lines in model space but the result is not good yet
 
*July 22 the solution for the dimension line is not accepted, now I will try to modify the annotation primitive and add more refrance points to the text segment and see what will result, before that I will try another approach
 
July 22 now it works the label of the dimension line is in display space and the lines are in the model space, waiting for the society opinion.
 
*July 23 now I will work on the text of dimension line, size, rotation angle, and placement flags.
 
*July 24 still working on the dimension line I have modified the txt_seg but the new attributes (txt size, rotation angle) are not passed to the database I think I have to modify the export and import functions and the function which describe the annotation.
 
*July 25 still struggling with exporting the txt_seg after adding the text size and rotation angle.
 
July 25 I fixed the error in importing and exporting the annotation but still, there is an error in the label
 
{|align="right"
 
|[[File:DL1.png|thumb|256px|July 25 ]]
 
|}
 
*July 26 working on the dimension line
 
July 26 as the current dimension line is not bad it could be used to make a dimension line for a 3d object by changing the verts to 3d points (fastf_t *pointp_t) and this is not a problem for the vlist because it is already can hold a 4d point I will see what the mentors say about that
 
*July 27 the dimension line in its current state is not accepted I will fix the position flag patch and the test program and get back to the dimension line.
 
*July 28 took one day off.
 
*July 29 I am working on the position flage patch and extending the text segment structure .
 
*July 30 submitted a patch for fixing the position of the annotation based on the position flags and a patch to extend the text segment structure in the annotation to have a text size and text rotation angle parameters
 
{|align="right"
 
|[[File:PF.png|thumb|256px|July 30 current state of position flags ]]
 
|}
 
*July 31 trying a new approach for the dimension line by adding a 3d verts to the annotation primitive which will be existed along with the 2d verts and will be used if the point index is negative. and trying to reproduce a bug in the l command when used with the annotation.
 
*August 1 after extending the text segment the old annotations doesn't work anymore I am trying to make it compatible
 
*August 2 there was some mistakes in the annotation's position flag patch I fixed them and I am working on a bug in the extended text segment structure and another one in the L command
 
*August 3 fixed some previous errors in my code and still trying to find the problem in L command the problem is it works some times and some times don't even with short and long labels.
 
*August 4 still unable to find a solution for importing the old annotation that doesn't contain a text_size and text_rotation angle in its structure because I didn't find a way to distinguish between the old one and the new one. also no result for the l command bug
 
*August 5 I found a way to import the old annotation properly by reorganizing the order of pointers but as we know the old annotation doesn't contain the new parameter so they will be random values from the database, as I am playing by the import function the l command bug some times appear when I change somthing related to the label so the solution for both problems will be probably in the import function
 
*August 6 there is some progress in the l command bug it is due to the exporting of label.vls_str structure the vls_len and vls_max has incorrect values but still doesn't know how to fix it
 
*August 7 still stuck in the same problems, my findings are we are exporting the bu_vls structure which is the annotation label as a structure I don't know why the importing function assumes that it will import the string separated from vls_offset,vls_len,vls_max
 
*August 8 I think this will be a solution for both problems the compatibility issue and the l command bug because the text segment is exported correctly but the import operation is not correct in my opinion I am still searching for a solution.
 
*August 9 I found a solution which is importing the bu_vls as a whole by using bu_vls_strcpy() function and counting for the null terminator in the increment of the external buffer pointer this solves the l command bug.
 
*August 10 I am working on extending the annotation structure to include 3d verts and waiting to see the society opinion of the l command fix.
 
*August 11 by extending the text segment and using the solution of exporting the bu_vls as a whole it is compatible with the old version of the annotation.
 
*August 12 the L command fix is correct and it needs more work on the size allocated in the exporting function and adjusting the import4 and export4 functions working on that. also, the position adjustment of the annotation is good.
 
*August 13 I am back to the dimension line and 3d verts I will see what I will get today.
 
*August 14 I fixed some errors in previous patches and working on adding the 3d verts I have a problem with importing them the Z coordinate is always zero.
 
*August 15 I fixed importing the 3d points and send a patch to see if we can use it in dimension lines.
 
*August 16 now I am trying to use the 3d verts in the dimension line. I have a problem with the functions that use verts like seg_to_vlist it uses the verts array if I want to use verts3d array that I have added to the annotation primitive I may have to write a new function. 
 
*August 17 studying about 2d paper space used in cad programs.
 
*August 18 fixing previous patches L command bug and annotation position adjustment.
 
*August 19 working on the new dimension line approach with 3d verts the problem is if we want to use a negative index for the dimension line verts it is not logical because this index will be used in an array and negative indexing is a miss and undefined behavior in c so it needs a lot of work.
 
*August 20 working on the open tickets and documentations.
 
*August 21 I am making a new function seg_to_vlist to call in case of the dimension line to deal with 3d verts array that I have added to the annotation primitive.
 
*August 22 still finalizing the open problems and working on the final report.
 
*August 23 I reviewed the committed code and found a bug in drawing the annotation I have reported the bug and submitted a solution
 
*August 24 working on the report.
 
*August 25 made a new approach for drawing a box around the label. and some documentations.
 
*August 26 Submitted the final evaluation.
 
 
 
GSOC 2019 is over it was a magnificent experience I have learned a lot of new things and developed my coding experience. I am planning to continue my contribution to open source and BRL-CAD. thanks to google and my mentors for this opportunity.
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)