Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions: DXF Import #291

Closed
z3dev opened this issue Aug 11, 2017 · 7 comments
Closed

Questions: DXF Import #291

z3dev opened this issue Aug 11, 2017 · 7 comments

Comments

@z3dev
Copy link

z3dev commented Aug 11, 2017

HI @danmarshall

I'm working on the DXF import into OpenJSCAD.org, as we want to be able to import/export all supported formats.

It seems that you have browsed around Autocad far more than I have, and I have a few questions.

  • Are there default color mappings? It seems that DXF just has a number, but it would be nice to map this to something useful.
  • Is there a variable that contains the 'unit' for a drawing? I will default to milimeter but it certainly would be nice to know how the units are passed between applications.

Any other tips?

@danmarshall
Copy link
Contributor

Hi @z3dev :-)
I've used this color mapping which casts to hex and rgb. I've mapped 17 of these to the primitive named web colors here.

There is a header named $INSUNITS that sets the unit type, which I've enumerated a few here.

I've seen some DXF parsers on NPM . This one and this one seem pretty good though I haven't used them personally.

@z3dev
Copy link
Author

z3dev commented Aug 11, 2017

@danmarshall Thanks

I'll use the same color mapping, so we stay in sync. ;)

I didn't like any of the DXF parsers as most focused on 2D spaces and full documents. I'm really interested in 3D models, and once satisfied will add support for 2D as well.

I'm trying to write the parser in a very simple way, allowing others to use the parser to obtain the information required, nothing more. DXF files are packed full of useless information, and really only useful in Autocad applications.

I'll let you know when finished. You may be able to add support for DXF fairly easy.

@danmarshall
Copy link
Contributor

@z3dev great, keep me updated!

@rkrishnasanka
Copy link

@danmarshall I've been using https://www.npmjs.com/package/dxf-parser in my project, I think its good because it generates an object representation that you can use however you want at the end of the day.

@danmarshall
Copy link
Contributor

Thanks for the tip @rkrishnasanka !

@rkrishnasanka
Copy link

@danmarshall no issues. Here's the project I'm working on http://3duf.org/. I came across your project when I was looking for ways to export DXF.

@danmarshall
Copy link
Contributor

I'm going to close this issue since DXF import will probably be a separate lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants