html5预览dxf,GitHub - skvamme/HTML-vector-graphics: Convert a DXF vector graphics file to HTML 5 <canv...

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 (Y=0)

2. Move the drawing up to its 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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值