• Stars
    star
    23
  • Rank 1,016,462 (Top 21 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DXF Library for Golang

Build Status

DXF-go

A DXF implementation for Golang.

It was born from my personal need of a DXF parser for Go and the fact that none exists at the moment.

It was heavily influenced by the great work done at dxfgrabber.

It currently parses a great part of a DXF file - 2014 compatible.

It currently doesn't import the Object Section and doesn't generate the files. But it wil :)

There is a lot to be done and help is appreciated.

Getting Started

A sample usage:

        file, err := os.Open(dxfPath) 
	if err != nil {
		log.Fatal(err)
	}

	doc, err := document.DxfDocumentFromStream(file)
	if err != nil {
		log.Fatal(err)
	}

	for _, block := range doc.Blocks {
		for _, entity := range block.Entities {
			if polyline, ok := entity.(*entities.Polyline); ok {
				// process polyline here...
			} else if lwpolyline, ok := entity.(*entities.LWPolyline); ok {
				// process lwpolyline here...
			}
      //...
		}
	}

Prerequisites

  • Go (1.8+)

Installing

$ go get github.com/rpaloschi/dxf-go

Authors

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

TODO