dxf_go

package module
v0.0.0-...-07cf6cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

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

Documentation

Overview

Package dxf_go is a library to Read and Write (not yet) DXF files in Go.

dxf_go contains the following packages:

The core package provides the basic abstractions and utility functions to deal with DXF files..

The document package provides the library's entry point and the DxfDocument representation.

The entities package provides all the abstraction and code for DXF entities.

The sections package provides all the abstraction and code for DXF section.

Directories

Path Synopsis
Package core provides functions and data structures for basic DXF operations.
Package core provides functions and data structures for basic DXF operations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL