![]() Improve warning or Error passing of BRL-CAD DXF code.The Export part of the original plan is not implemented.For spline and polyline, I have to learn a lot about the math and the geometry about spline such as NURBS, B-spline, Bezier Curve. For insert, I had to spend time on learning the DXF specification much more than other entities because I had to fix the insert structure that's parsing the data. Last challenge was dealing with entities like insert, spline, polyline. ![]() This really helped me understand how the parser process and store the parsed data from DXF file. I spent a lot of time to figure out how BRL-CAD bn_ style memory allocation functions and the storing structure of different data work to switch them to appropriate C++ containers and functions. Recommended memory needed for brl cad code#Changing the original C code to C++ code led to another challenge which is to switch the C style memory allocation, constructs to C++ style memory allocation and std containers.As I had discussed with my mentor, reading code is a very important skill for a programmer, however, school hardly ever guide students to read and understand long code. But I did learn a lot from completing this clean-up. First two weeks were challenging to me because I didn't know if I can clean up such a long, old C code which I have never done before.But spline and polyline with curve fit flag are still not good enough due to the current algorithm and functions that we have in OpenSCAD. Entities like insert, spline, polyline are more complex than others which took a lot of time to learn the structure and specifications of DXF format to get them done. Entities including circle, line, ellipse, arc, polyline, spline, lwpolyline, insert are implemented. The actual integration happens at this stage. Different ways to integrate were used and finally decided to pass a class structure that contains all the information from the DXF parser. This is just a try to integrate the DXF code with OpenSCAD, at this stage, we were trying to figure out what's the best way to integrate since BRL-CAD DXF code is not an actual library. Testing for all entities and fix are done to ensure the code work as before it's extracted and ready for integration.įirst try integrating importer to OpenSCAD During this process, I continue to clean up the code function by function along with testing. This prepared the code for integrating with OpenSCAD. This includes switching the C source code to C++ style, swapping all the C standard function, BRL-CAD bu_ type name with C++ standard type name and constructs with C++ class and containers, Replicate necessary functions from other BRL-CAD dependencies or manually write the modified version of those functions to avoid dependencies, change memory allocation style from C to C++. The DXF import code needed to be extracted and refactoring to make it useable for both BRL-CAD and OpenSCAD. ![]() ![]() After the discussion with mentors, we decide to use BRL-CAD DXF import code instead of an existing library.The import part is implemented in OpenSCAD which supports most of the entities except text-related entities and 3D related entities. The clean up of BRL-CAD code is finished and making it self-contained and useful for OpenSCAD or maybe any other software. This makes the project first goal shifted from integrating library to OpenSCAD to clean up BRL-CAD code. This project was originally planned for improving the DXF import and export for OpenSCAD using an existing external library, while after the discussion of library selection we decided to use BRL-CAD DXF Code instead of an existing library. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |