Difference between revisions of "User:Xuwei/DevLog2019"

From BRL-CAD
(Coummunity Bonding Period)
(Coding Period)
Line 44: Line 44:
  
 
=Coding Period=
 
=Coding Period=
==May 27th==
+
==May==
 +
===May 27th===
 
*Looking at both libdxfrw(libdxfrw.h, dxfreader.cpp) and OpenSCAD(dxfdata.cc, dxfdim.cc, import.cc) relative code.
 
*Looking at both libdxfrw(libdxfrw.h, dxfreader.cpp) and OpenSCAD(dxfdata.cc, dxfdim.cc, import.cc) relative code.
 
**Comparing the differences between these two on how they handle DXF data.
 
**Comparing the differences between these two on how they handle DXF data.
Line 54: Line 55:
 
**dxflib does not store any entities, only pass supported entities.
 
**dxflib does not store any entities, only pass supported entities.
 
**A useful link for understanding dxflib data structure.[https://qcad.org/doc/dxflib/2.5/classref/class_d_l___dxf.html]
 
**A useful link for understanding dxflib data structure.[https://qcad.org/doc/dxflib/2.5/classref/class_d_l___dxf.html]
==May 28th==
+
===May 28th===
 
*Move on to reading dxflib code for now
 
*Move on to reading dxflib code for now
 
**Continue reading the link about the data structure of dxflib above.
 
**Continue reading the link about the data structure of dxflib above.
 
**Trying to understand form the connection between dxflib and OpenSCAD code base.
 
**Trying to understand form the connection between dxflib and OpenSCAD code base.
 
*Continue reading dxfdata.cc
 
*Continue reading dxfdata.cc
==May 29th==
+
===May 29th===
 
*Found another one existing integration with dxflib that I can use it as reference.[https://github.com/CauldronDevelopmentLLC/CAMotics/tree/master/src CAMotics]
 
*Found another one existing integration with dxflib that I can use it as reference.[https://github.com/CauldronDevelopmentLLC/CAMotics/tree/master/src CAMotics]
 
*Continue on reading dxflib and import.cc, dxfdata.cc.
 
*Continue on reading dxflib and import.cc, dxfdata.cc.
Line 65: Line 66:
 
*Fill out the comparison [https://github.com/openscad/openscad/wiki/DXF-Library-overview wiki page]
 
*Fill out the comparison [https://github.com/openscad/openscad/wiki/DXF-Library-overview wiki page]
  
==May 30th==
+
===May 30th===
 
*Had to go the dentist this morning, will catch up the afternoon and at night.
 
*Had to go the dentist this morning, will catch up the afternoon and at night.
 
*Keep browsing for more information for those four libraries.
 
*Keep browsing for more information for those four libraries.
 
*Reading [https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf DXF standard] to learn how DXF format works
 
*Reading [https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf DXF standard] to learn how DXF format works
  
==May 31th==
+
===May 31th===
 
*Searching more information for potential libraries.
 
*Searching more information for potential libraries.
 
**Add more information that found to the comparison page.
 
**Add more information that found to the comparison page.
 
*Learning how to integrate the library from the [https://ribbonsoft.com/doc/dxflib/2.5/reference/contents.html instruction] written by QCAD.
 
*Learning how to integrate the library from the [https://ribbonsoft.com/doc/dxflib/2.5/reference/contents.html instruction] written by QCAD.
  
==June 3rd==
+
==June==
 +
 
 +
===June 3rd===
 
*We stick with using BRL-CAD's code for now.
 
*We stick with using BRL-CAD's code for now.
 
*Try to implement the circle entity.
 
*Try to implement the circle entity.
Line 82: Line 85:
 
**Having some issue with ADDLINE. Will dig into that later.
 
**Having some issue with ADDLINE. Will dig into that later.
  
==June 4th==
+
===June 4th===
 
*Push few commits on [https://github.com/leonplust/openscad/tree/dxf-import import_dxf branch].
 
*Push few commits on [https://github.com/leonplust/openscad/tree/dxf-import import_dxf branch].
 
**Basically create a new import_dxf() function that replace the old dxfdata.cc
 
**Basically create a new import_dxf() function that replace the old dxfdata.cc
 
**Implement a simple geometry to test out the function
 
**Implement a simple geometry to test out the function
  
==June 5th==
+
===June 5th===
 
*Modify the code committed yesterday to output a simple circle.
 
*Modify the code committed yesterday to output a simple circle.
 
*Trying to understand layer, block.
 
*Trying to understand layer, block.
  
==June 6th==
+
===June 6th===
 
*Created a new branch [https://github.com/leonplust/brlcadDXF/tree/prototype prototype] on brlcadDXF repo.
 
*Created a new branch [https://github.com/leonplust/brlcadDXF/tree/prototype prototype] on brlcadDXF repo.
 
**Trying to clean up the code so that it could compile independently.
 
**Trying to clean up the code so that it could compile independently.
  
==June 7th==
+
===June 7th===
 
*Switch some functions and datatype and continue on cleaning up the code.
 
*Switch some functions and datatype and continue on cleaning up the code.
 
*Spend most of my day studying the exam tonight. Will make up the time tomorrow.
 
*Spend most of my day studying the exam tonight. Will make up the time tomorrow.
  
==June 8th==
+
===June 8th===
 
*Walked through the whole file line by line and cleaned up as much as I can so far. There are still many details that I need to learn to clean up the rest.
 
*Walked through the whole file line by line and cleaned up as much as I can so far. There are still many details that I need to learn to clean up the rest.
  
==June 10th==
+
===June 10th===
 
*Made changes to dxf-g.c according to the answer from brlcad.
 
*Made changes to dxf-g.c according to the answer from brlcad.
  
==June 11th==
+
===June 11th===
 
*fix bu_list with std::list and related functions, etc.
 
*fix bu_list with std::list and related functions, etc.
  
==June 12th==
+
===June 12th===
 
*Add functions for circle eclipse from vmath.h, color.h.
 
*Add functions for circle eclipse from vmath.h, color.h.
  
==June 13th==
+
===June 13th===
 
*Added more functions from dependencies.
 
*Added more functions from dependencies.
 
*uploaded a file that records to-do list, question, notes, etc.
 
*uploaded a file that records to-do list, question, notes, etc.
Line 118: Line 121:
 
*Study for the midterm tonight for the most of the day will make up the hours tomorrow.
 
*Study for the midterm tonight for the most of the day will make up the hours tomorrow.
  
==June 15th==
+
===June 15th===
 
*Finished converting all bu_list data structure to std::list except in one function drawmtext().
 
*Finished converting all bu_list data structure to std::list except in one function drawmtext().
 
**drawmtext() may be removed later.
 
**drawmtext() may be removed later.
==June 17th==
+
===June 17th===
 
*Finished fixing all bu_vert_tree structure.
 
*Finished fixing all bu_vert_tree structure.
 
*Started on fixing vls a bit.
 
*Started on fixing vls a bit.
==June 18th==
+
===June 18th===
 
*Finished fixing all vls except those in the main().
 
*Finished fixing all vls except those in the main().
==June 19th==
+
===June 19th===
 
*Finished most of the parts of dxf-g.c.
 
*Finished most of the parts of dxf-g.c.
 
** Create a new branch [https://github.com/leonplust/brlcadDXF/tree/test test] for testing and commented out some less necessary functions to test.
 
** Create a new branch [https://github.com/leonplust/brlcadDXF/tree/test test] for testing and commented out some less necessary functions to test.
Line 132: Line 135:
 
** Need to fix the segmentation fault.
 
** Need to fix the segmentation fault.
  
==June 20th==
+
===June 20th===
 
*Fixed numbers of segmentation faults mainly caused by malloc.
 
*Fixed numbers of segmentation faults mainly caused by malloc.
  
==June 21st==
+
===June 21st===
 
*Fix strncmp function error
 
*Fix strncmp function error
 
*Tested with circle, ellipse, failed at block section.
 
*Tested with circle, ellipse, failed at block section.
 
*Tried to reconstruct block_list, block_head data structure.
 
*Tried to reconstruct block_list, block_head data structure.
  
==June 24th==
+
===June 24th===
 
* Fix block_list data structure
 
* Fix block_list data structure
 
* Now dxf-g.cc can go through the whole dxf file and spit out data to file output
 
* Now dxf-g.cc can go through the whole dxf file and spit out data to file output
Line 147: Line 150:
 
** coordinates of the vertices are correct.
 
** coordinates of the vertices are correct.
  
==June 25th==
+
===June 25th===
 
* Randomly picking files from openscad/testdata/dxf to check geometry and coordinates.
 
* Randomly picking files from openscad/testdata/dxf to check geometry and coordinates.
 
* Trying to figure out if the data structure is actually storing the correct data.
 
* Trying to figure out if the data structure is actually storing the correct data.

Revision as of 11:10, 25 June 2019

Coummunity Bonding Period

  • Set up the Development log
  • Set up the development environment such as OS.
  • Start to look at the different potential libraries code base.
  • Discuss with mentors which external library to choose.

May 16th

  • Start to check the checklist.
    • Agreement sent.
    • Dev log created.
    • My Profile created.

May 17th

  • Had four of my wisdom teeth extracted. The progress for the following week may be slow due to teeth extraction.

May 19th

  • Looking at Coin3D/Dime code base, a possible library for DXF import/export.
    • It has no external dependency.
    • It supports all past and should support the future version of DXF format.
    • It compiles on Windows, Linux, MacOS, etc.
    • But it only loads DXF files into Dime object hierarchies and saves Dime object hierarchies as files conforming to DXF format.
    • Seems only support 3D.

May 20th

  • Looking at BRL-CAD DXF import/export code. Trying to understand how it works and see if it is suitable for OpenSCAD.
    • It converts DXF format to .g and .g to DXF which is a BRL-CAD format.
    • It seems that BRL-CAD does not support the entire format, only the part that is relative to solid-model.

May 21st

  • Looking at dxflib which is used by QCAD and works fine, but it only supports 2D which is not ideal since OpenSCAD is already supporting 2D.
    • Maybe we can add the 3D part. But not sure how hard it is to add that.

May 22nd

  • Searching for a library that supports both 3D and 2D DXF import/export.
    • Libraries above are for either 2D or 3D.
    • Found some libraries support both but they are written in python instead of C++.

May 23rd

  • Continue on searching for the potential library.

May 24th

  • Looking at and Compile libdxfrw code base which is used by LibreCAD.
  • Will be out of town for the next two days.

Coding Period

May

May 27th

  • Looking at both libdxfrw(libdxfrw.h, dxfreader.cpp) and OpenSCAD(dxfdata.cc, dxfdim.cc, import.cc) relative code.
    • Comparing the differences between these two on how they handle DXF data.
    • Trying to form a connection between these two.
    • dxfdata.cc seems a bit complicated. Need some time to digest.
    • The way that libdxfrw reads DXF file is kind of mixing with DRW code.
    • libdxfrw encounters problems when dealing with elevated arcs(no response yet).[1]
  • Looking at dxflib code base as well.
    • dxflib does not store any entities, only pass supported entities.
    • A useful link for understanding dxflib data structure.[2]

May 28th

  • Move on to reading dxflib code for now
    • Continue reading the link about the data structure of dxflib above.
    • Trying to understand form the connection between dxflib and OpenSCAD code base.
  • Continue reading dxfdata.cc

May 29th

  • Found another one existing integration with dxflib that I can use it as reference.CAMotics
  • Continue on reading dxflib and import.cc, dxfdata.cc.
    • Keep trying to write some code that may help understanding how to integrate the library.
  • Fill out the comparison wiki page

May 30th

  • Had to go the dentist this morning, will catch up the afternoon and at night.
  • Keep browsing for more information for those four libraries.
  • Reading DXF standard to learn how DXF format works

May 31th

  • Searching more information for potential libraries.
    • Add more information that found to the comparison page.
  • Learning how to integrate the library from the instruction written by QCAD.

June

June 3rd

  • We stick with using BRL-CAD's code for now.
  • Try to implement the circle entity.
    • Add a callback function on dxf-g.c to pass the data back to openSCAD.
    • Add processentitiyecircle() to dxfdata.cc and some other changes to enable that function.
    • Having some issue with ADDLINE. Will dig into that later.

June 4th

  • Push few commits on import_dxf branch.
    • Basically create a new import_dxf() function that replace the old dxfdata.cc
    • Implement a simple geometry to test out the function

June 5th

  • Modify the code committed yesterday to output a simple circle.
  • Trying to understand layer, block.

June 6th

  • Created a new branch prototype on brlcadDXF repo.
    • Trying to clean up the code so that it could compile independently.

June 7th

  • Switch some functions and datatype and continue on cleaning up the code.
  • Spend most of my day studying the exam tonight. Will make up the time tomorrow.

June 8th

  • Walked through the whole file line by line and cleaned up as much as I can so far. There are still many details that I need to learn to clean up the rest.

June 10th

  • Made changes to dxf-g.c according to the answer from brlcad.

June 11th

  • fix bu_list with std::list and related functions, etc.

June 12th

  • Add functions for circle eclipse from vmath.h, color.h.

June 13th

  • Added more functions from dependencies.
  • uploaded a file that records to-do list, question, notes, etc.

June 14th

  • few fixes on dxf-g.cc.
  • Study for the midterm tonight for the most of the day will make up the hours tomorrow.

June 15th

  • Finished converting all bu_list data structure to std::list except in one function drawmtext().
    • drawmtext() may be removed later.

June 17th

  • Finished fixing all bu_vert_tree structure.
  • Started on fixing vls a bit.

June 18th

  • Finished fixing all vls except those in the main().

June 19th

  • Finished most of the parts of dxf-g.c.
    • Create a new branch test for testing and commented out some less necessary functions to test.
    • Upload test files from openSCAD testdata/dxf
    • Need to fix the segmentation fault.

June 20th

  • Fixed numbers of segmentation faults mainly caused by malloc.

June 21st

  • Fix strncmp function error
  • Tested with circle, ellipse, failed at block section.
  • Tried to reconstruct block_list, block_head data structure.

June 24th

  • Fix block_list data structure
  • Now dxf-g.cc can go through the whole dxf file and spit out data to file output
  • Done basic testing with circle, ellipse, polygons, lwpolyline. files from openscad testdata/dxf.
    • Found the correct geometry.
    • coordinates of the vertices are correct.

June 25th

  • Randomly picking files from openscad/testdata/dxf to check geometry and coordinates.
  • Trying to figure out if the data structure is actually storing the correct data.