deadsy / sdfx

A simple CAD package using signed distance functions
MIT License
541 stars 52 forks source link

Whether to support dxf file parsing? #78

Closed hanxuanliang closed 8 months ago

hanxuanliang commented 8 months ago

I am a newcomer and was searching for dxf topic on github and found this library. Not sure if dxf files are supported?

deadsy commented 8 months ago

You can take a 2d SDF and output it as a dxf file.

Example: https://github.com/deadsy/sdfx/blob/master/examples/text/main.go

The render.ToDXF() will run marching squares on the SDF and then write the resulting line segments out to the DXF file.

Reading a DXF file is a different proposition because in general a DXF file will not cleanly represent the boundary of a SDF.

hanxuanliang commented 8 months ago

Is there an API that can read and write dxf files directly?

deadsy commented 8 months ago

https://github.com/yofu/dxf