项目作者: arnholm

项目描述 :
XML based Constructive Solid Geometry based on carve
高级语言: C++
项目地址: git://github.com/arnholm/xcsg.git
创建时间: 2017-05-01T16:53:13Z
项目社区:https://github.com/arnholm/xcsg

开源协议:Other

下载


xcsg - xml based constructive solid geometry

xcsg is both a file format and an application. For the file format definition, please see the xcsg wiki for detailed information.

The xcsg application

The xcsg application takes an input .xcsg file, compiles its data into a solid model, and exports it to common surface mesh file formats, including STL. The application uses the Carve library for boolean operations.

  1. $ xcsg --help
  2. xcsg command line options & arguments (v1.5-00):
  3. -h [ --help ] Show this help message.
  4. -v [ --version ] Show program version (numeric part).
  5. --amf AMF output format (Additive Manufacturing Format)
  6. --csg CSG output format (OpenSCAD)
  7. --dxf DXF output format (AutoCAD DXF - 2D only)
  8. --svg SVG output format (Scalar Vector Graphics - 2D only)
  9. --stl STL output format (STereoLitography)
  10. --astl STL output format (STereoLitography) - ASCII
  11. --obj OBJ output format (Wavefront format)
  12. --off OFF output format (Geomview Object File Format)
  13. --export_dir arg Export output files to directory
  14. --max_bool arg Max number of booleans allowed
  15. --sec_tol arg Secant tolerance when importing OpenSCAD csg (0.05)
  16. --fullpath Show full file paths.
  17. <xcsg-file> path to input .xcsg file (required)

example

To compute the difference between a cube and a sphere and store the result as STL

  1. $ xcsg --stl difference3d.xcsg

The file difference3d.xcsg:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xcsg version="1.0">
  3. <difference3d>
  4. <cube size="50" center="true"></cube>
  5. <sphere r="33"></sphere>
  6. </difference3d>
  7. </xcsg>

The resulting STL becomes: