|
@@ -1,7 +1,7 @@
|
|
# EzCAD Patcher
|
|
# EzCAD Patcher
|
|
|
|
|
|
This tool parses and patches EZCAD files with values specified in a YAML config file.
|
|
This tool parses and patches EZCAD files with values specified in a YAML config file.
|
|
-The EZCAD format as implemented in this crate was reverse engineered from sample files, so use at your own risk.
|
|
|
|
|
|
+The EZCAD format as implemented in this crate was reverse engineered from sample files, so not all formats or options are supported.
|
|
|
|
|
|
## Usage
|
|
## Usage
|
|
|
|
|
|
@@ -22,7 +22,7 @@ Options:
|
|
|
|
|
|
Operations defined in the configuration file are applied in order of definition.
|
|
Operations defined in the configuration file are applied in order of definition.
|
|
|
|
|
|
-### Patching Pen
|
|
|
|
|
|
+### Pen Operations
|
|
|
|
|
|
Setting values of specific fields for a given pen:
|
|
Setting values of specific fields for a given pen:
|
|
|
|
|
|
@@ -30,13 +30,14 @@ Setting values of specific fields for a given pen:
|
|
Ops:
|
|
Ops:
|
|
- !PatchPen
|
|
- !PatchPen
|
|
Pen: 0 # Target pen
|
|
Pen: 0 # Target pen
|
|
|
|
+
|
|
# Specify one or more of the following:
|
|
# Specify one or more of the following:
|
|
- # Color: [127, 127, 127]
|
|
|
|
- # Enabled: true
|
|
|
|
- # LoopCount: 3
|
|
|
|
- # Speed: 1.234
|
|
|
|
- # Power: 10.5
|
|
|
|
- # Frequency: 10000
|
|
|
|
|
|
+ Color: [127, 127, 127]
|
|
|
|
+ Enabled: true
|
|
|
|
+ LoopCount: 3
|
|
|
|
+ Speed: 1.234
|
|
|
|
+ Power: 10.5
|
|
|
|
+ Frequency: 10000
|
|
```
|
|
```
|
|
|
|
|
|
Cloning pen(s) (and optionally override settings):
|
|
Cloning pen(s) (and optionally override settings):
|
|
@@ -46,14 +47,15 @@ Ops:
|
|
- !ClonePen
|
|
- !ClonePen
|
|
From: 0
|
|
From: 0
|
|
To: 1
|
|
To: 1
|
|
|
|
+
|
|
# Specify one or more of the following:
|
|
# Specify one or more of the following:
|
|
- # Inclusive: true
|
|
|
|
- # Color: [64, 64, 64]
|
|
|
|
- # Enabled: true
|
|
|
|
- # LoopCount: 3
|
|
|
|
- # Speed: 1.234
|
|
|
|
- # Power: 10.5
|
|
|
|
- # Frequency: 10000
|
|
|
|
|
|
+ Inclusive: true
|
|
|
|
+ Color: [64, 64, 64]
|
|
|
|
+ Enabled: true
|
|
|
|
+ LoopCount: 3
|
|
|
|
+ Speed: 1.234
|
|
|
|
+ Power: 10.5
|
|
|
|
+ Frequency: 10000
|
|
```
|
|
```
|
|
|
|
|
|
Incrementing a specific field by some value across a sequence of pens:
|
|
Incrementing a specific field by some value across a sequence of pens:
|
|
@@ -63,15 +65,14 @@ Ops:
|
|
- !PatternPen
|
|
- !PatternPen
|
|
From: 1
|
|
From: 1
|
|
To: 5
|
|
To: 5
|
|
|
|
+
|
|
# Specify one of the following:
|
|
# Specify one of the following:
|
|
- # Field: !Loops 1
|
|
|
|
- # Field: !Speed 100.0
|
|
|
|
- # Field: !Power 10.0
|
|
|
|
- # Field: !Frequency 1000
|
|
|
|
|
|
+ Field: !Loops 1
|
|
|
|
+ Field: !Speed 100.0
|
|
|
|
+ Field: !Power 10.0
|
|
|
|
+ Field: !Frequency 1000
|
|
```
|
|
```
|
|
|
|
|
|
-### Importing and Exporting Pens and Objects
|
|
|
|
-
|
|
|
|
Exporting a pen to a file:
|
|
Exporting a pen to a file:
|
|
|
|
|
|
``` yaml
|
|
``` yaml
|
|
@@ -90,74 +91,86 @@ Ops:
|
|
Path: "exported_pen.bin"
|
|
Path: "exported_pen.bin"
|
|
```
|
|
```
|
|
|
|
|
|
-Exporting an object to a file:
|
|
|
|
|
|
+### Object Operations
|
|
|
|
+
|
|
|
|
+Deleting all objects from a layer:
|
|
|
|
|
|
``` yaml
|
|
``` yaml
|
|
Ops:
|
|
Ops:
|
|
- - !ExportObject
|
|
|
|
|
|
+ - !DeleteObjects
|
|
Layer: 0
|
|
Layer: 0
|
|
- Object: 0
|
|
|
|
- Path: "exported_object.bin"
|
|
|
|
|
|
+ Object: 3 # Optional, will delete specific object instead
|
|
```
|
|
```
|
|
|
|
|
|
-Importing an object from a file:
|
|
|
|
|
|
+All other operations:
|
|
|
|
|
|
``` yaml
|
|
``` yaml
|
|
Ops:
|
|
Ops:
|
|
- - !ImportObject
|
|
|
|
- Layer: 0
|
|
|
|
- Object: 3 # Optional, will replace specified object instead
|
|
|
|
- Path: "exported_object.bin"
|
|
|
|
|
|
+ - !Object
|
|
|
|
+ Input: <InputObject>
|
|
|
|
+
|
|
|
|
+ # Specify one or more of the following
|
|
|
|
+ Z: 0.0
|
|
|
|
+ Origin: { X: 10.0, Y: 10.0 }
|
|
|
|
+ Pen: 3
|
|
|
|
+ Layer: 2
|
|
|
|
+ Array: <ArrayOptions>
|
|
|
|
+ Hatch: <HatchOptions>
|
|
|
|
+ Export: "exported_object.bin"
|
|
|
|
+ ReplaceObject: 0
|
|
```
|
|
```
|
|
|
|
|
|
-### Deleting and Generating Objects
|
|
|
|
|
|
+`<InputObject>` can be one of the following:
|
|
|
|
|
|
-Deleting all objects from a layer:
|
|
|
|
|
|
+``` yaml
|
|
|
|
+Input: !Rectangle { Width: 3.0, Height: 2.0 }
|
|
|
|
+Input: !Circle { Radius: 3.0 }
|
|
|
|
+Input: !Import { Path: "exported_object.bin" }
|
|
|
|
+Input: !Existing { Layer: 0, Object: 1 }
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+`<ArrayOptions>` options:
|
|
|
|
|
|
``` yaml
|
|
``` yaml
|
|
-Ops:
|
|
|
|
- - !DeleteObjects
|
|
|
|
- Layer: 0
|
|
|
|
- Object: 3 # Optional, will delete specific object instead
|
|
|
|
|
|
+Array:
|
|
|
|
+ Columns: 3
|
|
|
|
+ Rows: 2
|
|
|
|
+ Spacing: 1.0
|
|
|
|
+ RandomizeOrder: True
|
|
|
|
+ StartingPen: 1
|
|
```
|
|
```
|
|
|
|
|
|
-Generating a grid of hatched rectangles with incrementing pens:
|
|
|
|
|
|
+`<HatchOptions>` options:
|
|
|
|
|
|
``` yaml
|
|
``` yaml
|
|
-Ops:
|
|
|
|
- - !HatchArray
|
|
|
|
- Layer: 0
|
|
|
|
- Width: 10.0
|
|
|
|
- Height: 10.0
|
|
|
|
- Columns: 3
|
|
|
|
- Rows: 5
|
|
|
|
- Spacing: 0.5
|
|
|
|
- Z: 0.0
|
|
|
|
- StartingPen: 0
|
|
|
|
- Hatch:
|
|
|
|
- LineSpacing: 0.01
|
|
|
|
- # The following are optional parameters:
|
|
|
|
- # Count: 2
|
|
|
|
- # EdgeOffset: 0.0
|
|
|
|
- # StartOffset: 0.0
|
|
|
|
- # EndOffset: 0.0
|
|
|
|
- # Angle: 0.0
|
|
|
|
- # RotateAngle: 0.0
|
|
|
|
- # LineRedution: 0.0
|
|
|
|
- # LoopDistance: 0.0
|
|
|
|
- # LoopCount: 0
|
|
|
|
- # Pattern: !Bidirectional
|
|
|
|
- # FollowEdgeOnce: true
|
|
|
|
- # CrossHatch: true
|
|
|
|
|
|
+Hatch:
|
|
|
|
+ LineSpacing: 0.1
|
|
|
|
+
|
|
|
|
+ # Specify one or more of the following
|
|
|
|
+ Pen: 1
|
|
|
|
+ Count: 3
|
|
|
|
+ EdgeOffset: 0.0
|
|
|
|
+ StartOffset: 0.0
|
|
|
|
+ EndOffset: 0.0
|
|
|
|
+ Angle: 3.0
|
|
|
|
+ RotateAngle: 0.0
|
|
|
|
+ LineReduction: 0.0
|
|
|
|
+ LoopDistance: 0.0
|
|
|
|
+ LoopCount: 0.0
|
|
|
|
+ Pattern: <Pattern>
|
|
|
|
+ FollowEdgeOnce: True
|
|
|
|
+ Crosshatch: True
|
|
```
|
|
```
|
|
|
|
|
|
-Available patterns are:
|
|
|
|
|
|
+`<Pattern>` options:
|
|
|
|
|
|
-1. Directional
|
|
|
|
-2. Bidirectional
|
|
|
|
-3. Ring
|
|
|
|
-4. Continuous
|
|
|
|
-5. Gong
|
|
|
|
-6. Background (not supported)
|
|
|
|
-7. Fill
|
|
|
|
-8. Zigzag
|
|
|
|
|
|
+``` yaml
|
|
|
|
+Pattern: !Directional
|
|
|
|
+Pattern: !Bidirectional
|
|
|
|
+Pattern: !Ring
|
|
|
|
+Pattern: !Continuous
|
|
|
|
+Pattern: !Gong
|
|
|
|
+Pattern: !Background # (not supported)
|
|
|
|
+Pattern: !Fill
|
|
|
|
+Pattern: !Zigzag
|
|
|
|
+```
|