Code Monkey home page Code Monkey logo

html-vector-graphics's Introduction

This Erlang Program converts a DXF (binary or ASCII) to an HTML file. View it in an HTML5-ready browser (Safari, Chromium etc).

The DXF file can be created in QCAD (free) http://www.ribbonsoft.com/en/ , AUTOCAD and other CAD systems. Note that a closed pline will be filled in the HTML file. Entities with higher thickness will be on top in the HTML file.

1. Mirror your drawing in the CAD-app down over the X-axis (X=0)
2. Move the drawing up to it's previous position (up above the X-axis)
3. Save as DXF
4. Undo Move and Miror

Make sure you have compiled the 3 erl-files, the Erlang command is erlc *.erl

In a terminal, type ./dxf2js.sh myfile 0
to create a file myfile.html with a canvas representation of the drawing at layer 0.

In a terminal, type ./dxf2js.sh myfile svg
to create a file myfile.html with a svg representation of the drawing at layer svg.

If you are on a Windows system you have to create a bat-file or run dxf2js module from the erlang console.

If you are using QCAD, set the paper size in Drawing Preferences.
 

The parameters to dxf2js.sh is a dxffilename without extension, and a layername

If the layer name is svg the output format will be svg, all other layers will be in canvas format. This makes it easy to create a combined svg/canvas graphics.
 
You need to download and install Erlang http://www.erlang.org to run this program. After installation, run erlc *.erl in HTML-vector-graphics directory.
 
 

html-vector-graphics's People

Contributors

skvamme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.