opencax / GSoC

Google Summer of Code Projects
31 stars 14 forks source link

Improve DXF import #1

Closed t-paul closed 2 years ago

t-paul commented 5 years ago

Outline

Currently OpenSCAD uses it's own limited parser to read DXF files (2D-only) which does not support things like curves/splines. A previous GSoC project started with converting the BRL-CAD importer into a library. Goal of this project is to finish conversion by using more C++ features and fully integrating the code into OpenSCAD.

Details

The main focus for the change is the import of DXF files as the import currently fails to read various categories of DXF files exported by other tools. Right now a complex preparation is needed to ensure drawings created in programs like Inkscape can be imported correctly in OpenSCAD.

Importing more complex drawings will need some integration with OpenSCAD features, e.g. the handling of $fn/$fa/$fs variables that define how curves are converted into the internal polygon/mesh data structures.

In addition to import() the DXF specific modules dxf_dim() and dxf_cross() need to be considered as well.

The current state is tracked in https://github.com/openscad/openscad/pull/3006

Expected Outcome

Project Properties

Skills

Difficulty

Medium

Additional Information

Mentors: Marius Kintel (IRC: kintel), Torsten Paul (IRC: teepee)

avivijay19 commented 3 years ago

Wanted to work on this issue? Can anyone guide how to start?

brlcad commented 3 years ago

@avinash14022002 One way to get started could be to read up on the previous GSoC project that worked on this task: https://github.com/openscad/openscad/issues/3044

Of course, read the links in the description too including the current issue tracking integration: openscad/openscad#3006

You can also see the entire daily log of the 2019 project at https://brlcad.org/wiki/User:Xuwei/DevLog2019

t-paul commented 3 years ago

@avinash14022002 in addition, check Getting Started for a short summary of general steps.

Yinchu-Liu commented 3 years ago

I want to join this project, but where does the source code locate in?

avivijay19 commented 3 years ago

@brlcad sir and @t-paul sir, sir could you guide through the project and good first issue..!!!

brlcad commented 3 years ago

I want to join this project, but where does the source code locate in?

@Yinchu-Liu did you see the links provided? The openscad/openscad#3006 issue is tracking the latest code changes for integration into OpenSCAD. openscad/openscad#3044 has a great overview of the whole thing including other links to source code (e.g., pre-merge and indep library setup).

Yinchu-Liu commented 3 years ago

I want to join this project, but where does the source code locate in?

@Yinchu-Liu did you see the links provided? The openscad/openscad#3006 issue is tracking the latest code changes for integration into OpenSCAD. openscad/openscad#3044 has a great overview of the whole thing including other links to source code (e.g., pre-merge and indep library setup).

Got it. Thank you!

brlcad commented 3 years ago

@brlcad sir and @t-paul sir, sir could you guide through the project and good first issue..!!!

@avinash14022002 if you need that much help already even with the detailed links provided, then GSoC may not be a great fit. Conversion is technically challenging and typically needs someone able and willing to figure things out, not be guided on every step. I suggest compile and run openscad first, compile the dxf code, and find something you can improve (however minor) to have a discussion on that.

avivijay19 commented 3 years ago

@brlcad thank you sir..!!!

Yinchu-Liu commented 3 years ago

Just want to make the problem more clear, what we should do is improve BRL-CAD code , i.e. dxf-g.c, to OpenSCAD so that OpenSCAD can also import outside dxf documents? Or rather, what we should implement is:

Is my understanding clear? Or anything else we can add, although I think those could fit the workload for a suitable time slot?

Yinchu-Liu commented 3 years ago

Just want to make the problem more clear, what we should do is improve BRL-CAD code , i.e. dxf-g.c, to OpenSCAD so that OpenSCAD can also import outside dxf documents? Or rather, what we should implement is:

* Reading dxf-g.c in BRL-CAD.

* Add similar code with dxf-g.c in OpenSCAD but in a C++ style to use C++ allocate memory, say the name should be dxf-openscad.cpp.

* However, in 2019 project, the coversion of 2D splines and Bezier still has issues, we should fix the problem with the guidance with mathematical formulus.

Is my understanding clear? Or anything else we can add, although I think those could fit the workload for a suitable time slot?

Sorry for my misunderstanding, we should work on dxf.cc instead of creating one called dxf-openscad.cpp.

brlcad commented 3 years ago

Others can speak to it better but as I understand it, the goal of this project is not to improve or do anything with BRL-CAD code. It's to complete the DXF import support for OpenSCAD, which had origins and previous work that involved dxf-g.c from BRL-CAD. It would be awesome if the dxf parsing library worked on for this effort continued to be made reusable so that it "could" be re-integrated back into BRL-CAD for dxf support, but the focus is what's in the description -- completing the integration into OpenSCAD and cleaning up the dxf library code.

Yinchu-Liu commented 3 years ago

Others can speak to it better but as I understand it, the goal of this project is not to improve or do anything with BRL-CAD code. It's to complete the DXF import support for OpenSCAD, which had origins and previous work that involved dxf-g.c from BRL-CAD. It would be awesome if the dxf parsing library worked on for this effort continued to be made reusable so that it "could" be re-integrated back into BRL-CAD for dxf support, but the focus is what's in the description -- completing the integration into OpenSCAD and cleaning up the dxf library code. Yes, that's also what I am thinking. Let me look into the OpenSCAD dxf file and get hands dirty. Thank you!

aykalkan commented 3 years ago

Just a little correction. You wrote difficulty as medium in project description, but labeled as easy. This project is definitely not easy.