java 是否有任何库可以将 CAD 转换为 SVG?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14035557/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 14:49:44  来源:igfitidea点击:

Is there any library to Convert CAD to SVG?

javac++svgcad

提问by Joe SHI

I am looking for a library, which can convert CAD files(DWG, DXF) into SVG format. The library should be able to run on Linux platform. Can anyone tell me which library can do this?

我正在寻找一个可以将 CAD 文件(DWG、DXF)转换为 SVG 格式的库。该库应该能够在 Linux 平台上运行。谁能告诉我哪个图书馆可以做到这一点?

采纳答案by OMG

Try these tools.

试试这些工具。

1) http://etc.nkadesign.com/Download/Cad2svg

1) http://etc.nkadesign.com/Download/Cad2svg

cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG

cad2svg 是一个简单的 Linux 命令行实用程序,可自动将 AutoCAD 文件(dwg 和 dxf)转换为 SVG

2) http://davinder.in/blog/how-install-libredwg-ubuntu

2) http://davinder.in/blog/how-install-libredwg-ubuntu

GNU LibreDWG is a free C library to handle DWG files.

GNU LibreDWG 是一个免费的 C 库,用于处理 DWG 文件。

3) http://kabeja.sourceforge.net/

3) http://kabeja.sourceforge.net/

Kabeja is a Java library for parsing, processing and converting Autodesk's DXF format

Kabeja 是一个 Java 库,用于解析、处理和转换 Autodesk 的 DXF 格式

4) http://sourceforge.net/projects/dxf-svg-convert

4) http://sourceforge.net/projects/dxf-svg-convert

A dxf to svg converter.
Can be used to create pure svg files or Inkscape svg files with extra information like layers.

一个 dxf 到 svg 转换器。
可用于创建带有图层等额外信息的纯 svg 文件或 Inkscape svg 文件。

回答by Stefan Steiger

The OpenDesignAlliance currently provides the only useful implementation of such a thing.
You want Theigaand Theiga for .NET and Java .

OpenDesignAlliance目前提供了这样的事情的唯一有用的实现。
您需要用于 .NET 和 Java 的TheigaTheiga

In 2013, ODA used the Java support provided by SWIG to create "Teigha for Java".
Teigha for Java includes the following:

2013 年,ODA 使用 SWIG 提供的 Java 支持创建了“Teigha for Java”。
Java 版 Teigha 包括以下内容:

  • Java access to the full Teigha API for both .dwg and .dgn files.
  • Support for Windows, Linux and Mac platforms. API very similar to Teigha.NET, simplifying the transition between languages.
  • Java 访问 .dwg 和 .dgn 文件的完整 Teigha API。
  • 支持 Windows、Linux 和 Mac 平台。API 与 Teigha.NET 非常相似,简化了语言之间的转换。

Also, if you're using C#, WoutWareCadLibwould be a very good fully managedcommercial option for converting DWG/DXF to SVG (while preserving layers). And it also works on Linux and Mac with .NET-Core (no native binaries required).

此外,如果您使用C#WoutWareCadLib将是一个非常好的完全托管的商业选项,用于将 DWG/DXF 转换为 SVG(同时保留层)。它也适用于带有 .NET-Core 的 Linux 和 Mac(不需要本机二进制文件)。