Kevin Lee 1 year ago
parent
commit
5e1f8cd4b8
4 changed files with 50 additions and 46 deletions
  1. 41 41
      config.yml
  2. BIN
      samples/Rectangle2.mlp
  3. 3 3
      src/ezcad/objects/mod.rs
  4. 6 2
      src/ezcad/objects/rectangle.rs

+ 41 - 41
config.yml

@@ -1,50 +1,50 @@
 Ops: 
-  - !PatchPen
-    Pen: 0
-    Color: [127, 127, 127]
-    Enabled: true
-    LoopCount: 3
-    Speed: 20.0
-    Power: 55.0
-    Frequency: 10000
-
-  - !ClonePen
-    From: 0
-    To: 5
-    Inclusive: True
-
-  - !PatternPen
-    From: 0
-    To: 5
-    Field: !Speed 10
-
-  - !ExportPen
-    Index: 0
-    Path: export_pen.bin
-
-  - !ImportPen
-    Index: 1
-    Path: export_pen.bin
-
-  - !ExportObject
-    Layer: 0
-    Object: 0
-    Path: export_object.bin
-
-  - !ImportObject
-    Layer: 0
-    Object: 0
-    Path: export_object.bin
+  # - !PatchPen
+  #   Pen: 0
+  #   Color: [127, 127, 127]
+  #   Enabled: true
+  #   LoopCount: 3
+  #   Speed: 20.0
+  #   Power: 55.0
+  #   Frequency: 10000
+
+  # - !ClonePen
+  #   From: 0
+  #   To: 5
+  #   Inclusive: True
+
+  # - !PatternPen
+  #   From: 0
+  #   To: 5
+  #   Field: !Speed 10
+
+  # - !ExportPen
+  #   Index: 0
+  #   Path: export_pen.bin
+
+  # - !ImportPen
+  #   Index: 1
+  #   Path: export_pen.bin
+
+  # - !ExportObject
+  #   Layer: 0
+  #   Object: 0
+  #   Path: export_object.bin
+
+  # - !ImportObject
+  #   Layer: 0
+  #   Object: 0
+  #   Path: export_object.bin
 
   - !DeleteObjects
     Layer: 0
 
   - !RectangleArray
     Layer: 0
-    Width: 10.0
-    Height: 10.0
-    Columns: 2
-    Rows: 3
-    Spacing: 4.0
+    Width: 5.0
+    Height: 4.0
+    Columns: 8
+    Rows: 5
+    Spacing: 0.5
     Z: 0.0
     StartingPen: 1

BIN
samples/Rectangle2.mlp


+ 3 - 3
src/ezcad/objects/mod.rs

@@ -87,10 +87,10 @@ impl Default for ObjectCore {
             obj_type: ObjectType::Unknown.into(),
             flags: ObjectFlags::new()
                 .with_disabled(0)
-                .with_aspect_ratio_unlocked(1)
+                .with_aspect_ratio_unlocked(0)
                 .into(),
-            name: String::new().into(),
-            count: 0.into(),
+            name: "\0".to_string().into(),
+            count: 1.into(),
             _unknown_1: vec![0, 0].into(), // 0_u16
             io_control_enable_mask: Default::default(),
             io_control_disable_mask: Default::default(),

+ 6 - 2
src/ezcad/objects/rectangle.rs

@@ -5,7 +5,7 @@ use diff::Diff;
 
 use crate::{
     field_of::FieldOf,
-    types::{Field, Point, F64},
+    types::{Field, Point, F64, ObjectType},
 };
 
 use super::ObjectCore;
@@ -46,7 +46,11 @@ impl Debug for Rectangle {
 impl Default for Rectangle {
     fn default() -> Self {
         Self {
-            core: Default::default(),
+            core: ObjectCore {
+                obj_type: ObjectType::Rectangle.into(),
+                ..Default::default()
+                
+            },
             corner_a: Point { x: 0.0, y: 0.0 }.into(),
             corner_b: Point { x: 0.0, y: 0.0 }.into(),
             round_bottom_left: 0.0.into(),