svg2gcode 项目使用教程
1. 项目的目录结构及介绍
svg2gcode 项目的目录结构如下:
svg2gcode/
├── examples/
│ └── Vanderbilt_Commodores_logo.svg
├── lib/
│ └── (各种库文件)
├── web/
│ └── (Web 界面相关文件)
├── .gitignore
├── .gitmodules
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
└── codecov.yml
目录结构介绍
- examples/: 包含示例 SVG 文件,用于测试和演示。
- lib/: 包含项目的核心功能库文件。
- web/: 包含 Web 界面相关的文件,用于在线转换 SVG 到 G-code。
- .gitignore: Git 忽略文件列表。
- .gitmodules: Git 子模块配置文件。
- Cargo.lock: Rust 项目的依赖锁定文件。
- Cargo.toml: Rust 项目的配置文件,定义了项目的依赖和构建配置。
- LICENSE: 项目许可证文件,采用 MIT 许可证。
- README.md: 项目说明文件,包含项目的基本信息和使用方法。
- codecov.yml: Codecov 配置文件,用于代码覆盖率测试。
2. 项目的启动文件介绍
svg2gcode 项目的主要启动文件是 Cargo.toml
和 README.md
。
Cargo.toml
Cargo.toml
是 Rust 项目的配置文件,定义了项目的依赖、构建配置和元数据。以下是 Cargo.toml
的部分内容:
[package]
name = "svg2gcode"
version = "0.1.0"
edition = "2018"
[dependencies]
(依赖库列表)
README.md
README.md
是项目的说明文件,包含了项目的基本信息、使用方法和示例。以下是 README.md
的部分内容:
# svg2gcode
Convert vector graphics to g-code for pen plotters, laser engravers, and other CNC machines.
## Usage
### Web interface
Check it out at https://sameer.github.io/svg2gcode.
### Command line interface (CLI)
Input:
cargo run --release -- examples/Vanderbilt_Commodores_logo.svg --off 'M4' --on 'M5' -o out.gcode
3. 项目的配置文件介绍
svg2gcode 项目的主要配置文件是 Cargo.toml
。
Cargo.toml
Cargo.toml
是 Rust 项目的配置文件,定义了项目的依赖、构建配置和元数据。以下是 Cargo.toml
的部分内容:
[package]
name = "svg2gcode"
version = "0.1.0"
edition = "2018"
[dependencies]
(依赖库列表)
配置文件介绍
- [package]: 定义了项目的名称、版本和 Rust 版本。
- [dependencies]: 列出了项目所依赖的库和版本。
通过这些配置文件,开发者可以管理和构建项目,确保项目在不同环境中的一致性和可重复性。