Browse Source

Refactor and print f64 as {:.3}

Kevin Lee 1 month ago
parent
commit
b65076bff1

+ 222 - 166
src/config/hatch.rs

@@ -1,166 +1,222 @@
-use ezcad::objects::{hatch::HatchSetting, Object};
-use log::debug;
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, Serialize, Deserialize)]
-
-pub enum PatternHatchField {
-    Count(u32),
-    LineSpacing(f64),
-    EdgeOffset(f64),
-    StartOffset(f64),
-    EndOffset(f64),
-    Angle(f64),
-    RotateAngle(f64),
-    LineReduction(f64),
-    LoopDistance(f64),
-    LoopCount(u32),
-}
-
-impl PatternHatchField {
-    pub fn pattern(&self, objects: &mut dyn Iterator<Item = (usize, &mut Object)>) {
-        let (src_idx, src) = objects
-            .next()
-            .expect("Pattern must involve at least one pen");
-
-        // Obtain settings from first object
-        let mut setting: PatternHatchField = match src {
-            Object::Hatch(src) => {
-                let setting = src
-                    .hatch_settings
-                    .iter()
-                    .find(|h| h.enabled.into())
-                    .expect("Hatch missing enabled settings");
-
-                let setting: PatternHatchField = match self {
-                    PatternHatchField::Count(_) => {
-                        debug!("Initial hatch count from object #{} is {}", src_idx, *setting.count);
-                        PatternHatchField::Count(*setting.count)
-
-                    },
-                    PatternHatchField::LineSpacing(_) => {
-                        debug!("Initial hatch line spacing from object #{} is {}", src_idx, *setting.line_spacing);
-                        PatternHatchField::LineSpacing(*setting.line_spacing)
-                    },
-                    PatternHatchField::EdgeOffset(_) => {
-                        debug!("Initial hatch edge offset from object #{} is {}", src_idx, *setting.edge_offset);
-                        PatternHatchField::EdgeOffset(*setting.edge_offset)
-                    },
-                    PatternHatchField::StartOffset(_) => {
-                        debug!("Initial hatch start offset from object #{} is {}", src_idx, *setting.start_offset);
-                        PatternHatchField::StartOffset(*setting.start_offset)
-                    },
-                    PatternHatchField::EndOffset(_) => {
-                        debug!("Initial hatch end offset from object #{} is {}", src_idx, *setting.end_offset);
-                        PatternHatchField::EndOffset(*setting.end_offset)
-                    },
-                    PatternHatchField::Angle(_) => {
-                        debug!("Initial hatch angle from object #{} is {}", src_idx, *setting.angle);
-                        PatternHatchField::Angle(*setting.angle)
-                    },
-                    PatternHatchField::RotateAngle(_) => {
-                        debug!("Initial hatch rotate angle from object #{} is {}", src_idx, *setting.rotate_angle);
-                        PatternHatchField::RotateAngle(*setting.rotate_angle)
-                    },
-                    PatternHatchField::LineReduction(_) => {
-                        debug!("Initial hatch line reduction angle from object #{} is {}", src_idx, *setting.line_reduction);
-                        PatternHatchField::LineReduction(*setting.line_reduction)
-                    },
-                    PatternHatchField::LoopDistance(_) => {
-                        debug!("Initial hatch loop distance from object #{} is {}", src_idx, *setting.loop_distance);
-                        PatternHatchField::LoopDistance(*setting.loop_distance)
-                    },
-                    PatternHatchField::LoopCount(_) => {
-                        debug!("Initial hatch loop count from object #{} is {}", src_idx, *setting.loop_count);
-                        PatternHatchField::LoopCount(*setting.loop_count)
-                    },
-                };
-
-                setting
-            }
-            _ => panic!("Object #{} not a hatch object", src_idx)
-        };
-
-        for (idx, dst) in objects {
-            // Calculate new setting
-            setting = match (setting, self) {
-                (PatternHatchField::Count(prev), PatternHatchField::Count(incr)) => {
-                    let value: u32 = prev + incr;
-                    debug!("Patching hatch count for object #{} to {}", idx, value);
-                    PatternHatchField::Count(value)
-                }
-                (PatternHatchField::LineSpacing(prev), PatternHatchField::LineSpacing(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch line spacing for object #{} to {}", idx, value);
-                    PatternHatchField::LineSpacing(value)
-                }
-                (PatternHatchField::EdgeOffset(prev), PatternHatchField::EdgeOffset(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch edge offset for object #{} to {}", idx, value);
-                    PatternHatchField::EdgeOffset(value)
-                }
-                (PatternHatchField::StartOffset(prev), PatternHatchField::StartOffset(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch start offset for object #{} to {}", idx, value);
-                    PatternHatchField::StartOffset(value)
-                }
-                (PatternHatchField::EndOffset(prev), PatternHatchField::LineSpacing(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch end offset for object #{} to {}", idx, value);
-                    PatternHatchField::EndOffset(value)
-                }
-                (PatternHatchField::Angle(prev), PatternHatchField::Angle(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch angle for object #{} to {}", idx, value);
-                    PatternHatchField::Angle(value)
-                }
-                (PatternHatchField::RotateAngle(prev), PatternHatchField::RotateAngle(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch rotate angle for object #{} to {}", idx, value);
-                    PatternHatchField::RotateAngle(value)
-                }
-                (PatternHatchField::LineReduction(prev), PatternHatchField::LineReduction(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch line reduction for object #{} to {}", idx, value);
-                    PatternHatchField::LineReduction(value)
-                }
-                (PatternHatchField::LoopDistance(prev), PatternHatchField::LoopDistance(incr)) => {
-                    let value: f64 = prev + incr;
-                    debug!("Patching hatch loop distance for object #{} to {}", idx, value);
-                    PatternHatchField::LoopDistance(value)
-                }
-                (PatternHatchField::LoopCount(prev), PatternHatchField::LoopCount(incr)) => {
-                    let value: u32 = prev + incr;
-                    debug!("Patching hatch loop count for object #{} to {}", idx, value);
-                    PatternHatchField::LoopCount(value)
-                }
-                _ => unreachable!(),
-            };
-
-            // Apply setting
-            match dst {
-                Object::Hatch(dst) => {
-                    let dst: &mut HatchSetting = dst
-                        .hatch_settings
-                        .iter_mut()
-                        .find(|h| h.enabled.into())
-                        .expect("Hatch missing enabled settings");
-
-                    match setting {
-                        PatternHatchField::Count(x) => *dst.count = x,
-                        PatternHatchField::LineSpacing(x) => *dst.line_spacing = x,
-                        PatternHatchField::EdgeOffset(x) => *dst.edge_offset = x,
-                        PatternHatchField::StartOffset(x) => *dst.start_offset = x,
-                        PatternHatchField::EndOffset(x) => *dst.end_offset = x,
-                        PatternHatchField::Angle(x) => *dst.angle = x,
-                        PatternHatchField::RotateAngle(x) => *dst.rotate_angle = x,
-                        PatternHatchField::LineReduction(x) => *dst.line_reduction = x,
-                        PatternHatchField::LoopDistance(x) => *dst.loop_distance = x,
-                        PatternHatchField::LoopCount(x) => *dst.loop_count = x,
-                    }
-                },
-                _ => panic!("Object #{} not a hatch object", src_idx)
-            }
-        }
-    }
-}
+use ezcad::objects::{hatch::HatchSetting, Object};
+use log::debug;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Serialize, Deserialize)]
+
+pub enum PatternHatchField {
+    Count(u32),
+    LineSpacing(f64),
+    EdgeOffset(f64),
+    StartOffset(f64),
+    EndOffset(f64),
+    Angle(f64),
+    RotateAngle(f64),
+    LineReduction(f64),
+    LoopDistance(f64),
+    LoopCount(u32),
+}
+
+impl PatternHatchField {
+    pub fn pattern(&self, objects: &mut dyn Iterator<Item = (usize, &mut Object)>) {
+        let (src_idx, src) = objects
+            .next()
+            .expect("Pattern must involve at least one pen");
+
+        // Obtain settings from first object
+        let mut setting: PatternHatchField = match src {
+            Object::Hatch(src) => {
+                let setting = src
+                    .hatch_settings
+                    .iter()
+                    .find(|h| h.enabled.into())
+                    .expect("Hatch missing enabled settings");
+
+                let setting: PatternHatchField = match self {
+                    PatternHatchField::Count(_) => {
+                        debug!(
+                            "Initial hatch count from object #{} is {}",
+                            src_idx, *setting.count
+                        );
+                        PatternHatchField::Count(*setting.count)
+                    }
+                    PatternHatchField::LineSpacing(_) => {
+                        debug!(
+                            "Initial hatch line spacing from object #{} is {:.3}",
+                            src_idx, *setting.line_spacing
+                        );
+                        PatternHatchField::LineSpacing(*setting.line_spacing)
+                    }
+                    PatternHatchField::EdgeOffset(_) => {
+                        debug!(
+                            "Initial hatch edge offset from object #{} is {:.3}",
+                            src_idx, *setting.edge_offset
+                        );
+                        PatternHatchField::EdgeOffset(*setting.edge_offset)
+                    }
+                    PatternHatchField::StartOffset(_) => {
+                        debug!(
+                            "Initial hatch start offset from object #{} is {:.3}",
+                            src_idx, *setting.start_offset
+                        );
+                        PatternHatchField::StartOffset(*setting.start_offset)
+                    }
+                    PatternHatchField::EndOffset(_) => {
+                        debug!(
+                            "Initial hatch end offset from object #{} is {:.3}",
+                            src_idx, *setting.end_offset
+                        );
+                        PatternHatchField::EndOffset(*setting.end_offset)
+                    }
+                    PatternHatchField::Angle(_) => {
+                        debug!(
+                            "Initial hatch angle from object #{} is {:.3}",
+                            src_idx, *setting.angle
+                        );
+                        PatternHatchField::Angle(*setting.angle)
+                    }
+                    PatternHatchField::RotateAngle(_) => {
+                        debug!(
+                            "Initial hatch rotate angle from object #{} is {:.3}",
+                            src_idx, *setting.rotate_angle
+                        );
+                        PatternHatchField::RotateAngle(*setting.rotate_angle)
+                    }
+                    PatternHatchField::LineReduction(_) => {
+                        debug!(
+                            "Initial hatch line reduction angle from object #{} is {:.3}",
+                            src_idx, *setting.line_reduction
+                        );
+                        PatternHatchField::LineReduction(*setting.line_reduction)
+                    }
+                    PatternHatchField::LoopDistance(_) => {
+                        debug!(
+                            "Initial hatch loop distance from object #{} is {:.3}",
+                            src_idx, *setting.loop_distance
+                        );
+                        PatternHatchField::LoopDistance(*setting.loop_distance)
+                    }
+                    PatternHatchField::LoopCount(_) => {
+                        debug!(
+                            "Initial hatch loop count from object #{} is {:.3}",
+                            src_idx, *setting.loop_count
+                        );
+                        PatternHatchField::LoopCount(*setting.loop_count)
+                    }
+                };
+
+                setting
+            }
+            _ => panic!("Object #{} not a hatch object", src_idx),
+        };
+
+        for (idx, dst) in objects {
+            // Calculate new setting
+            setting = match (setting, self) {
+                (PatternHatchField::Count(prev), PatternHatchField::Count(incr)) => {
+                    let value: u32 = prev + incr;
+                    debug!("Patching hatch count for object #{} to {:.3}", idx, value);
+                    PatternHatchField::Count(value)
+                }
+                (PatternHatchField::LineSpacing(prev), PatternHatchField::LineSpacing(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch line spacing for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::LineSpacing(value)
+                }
+                (PatternHatchField::EdgeOffset(prev), PatternHatchField::EdgeOffset(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch edge offset for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::EdgeOffset(value)
+                }
+                (PatternHatchField::StartOffset(prev), PatternHatchField::StartOffset(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch start offset for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::StartOffset(value)
+                }
+                (PatternHatchField::EndOffset(prev), PatternHatchField::LineSpacing(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch end offset for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::EndOffset(value)
+                }
+                (PatternHatchField::Angle(prev), PatternHatchField::Angle(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!("Patching hatch angle for object #{} to {:.3}", idx, value);
+                    PatternHatchField::Angle(value)
+                }
+                (PatternHatchField::RotateAngle(prev), PatternHatchField::RotateAngle(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch rotate angle for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::RotateAngle(value)
+                }
+                (
+                    PatternHatchField::LineReduction(prev),
+                    PatternHatchField::LineReduction(incr),
+                ) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch line reduction for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::LineReduction(value)
+                }
+                (PatternHatchField::LoopDistance(prev), PatternHatchField::LoopDistance(incr)) => {
+                    let value: f64 = prev + incr;
+                    debug!(
+                        "Patching hatch loop distance for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::LoopDistance(value)
+                }
+                (PatternHatchField::LoopCount(prev), PatternHatchField::LoopCount(incr)) => {
+                    let value: u32 = prev + incr;
+                    debug!(
+                        "Patching hatch loop count for object #{} to {:.3}",
+                        idx, value
+                    );
+                    PatternHatchField::LoopCount(value)
+                }
+                _ => unreachable!(),
+            };
+
+            // Apply setting
+            match dst {
+                Object::Hatch(dst) => {
+                    let dst: &mut HatchSetting = dst
+                        .hatch_settings
+                        .iter_mut()
+                        .find(|h| h.enabled.into())
+                        .expect("Hatch missing enabled settings");
+
+                    match setting {
+                        PatternHatchField::Count(x) => *dst.count = x,
+                        PatternHatchField::LineSpacing(x) => *dst.line_spacing = x,
+                        PatternHatchField::EdgeOffset(x) => *dst.edge_offset = x,
+                        PatternHatchField::StartOffset(x) => *dst.start_offset = x,
+                        PatternHatchField::EndOffset(x) => *dst.end_offset = x,
+                        PatternHatchField::Angle(x) => *dst.angle = x,
+                        PatternHatchField::RotateAngle(x) => *dst.rotate_angle = x,
+                        PatternHatchField::LineReduction(x) => *dst.line_reduction = x,
+                        PatternHatchField::LoopDistance(x) => *dst.loop_distance = x,
+                        PatternHatchField::LoopCount(x) => *dst.loop_count = x,
+                    }
+                }
+                _ => panic!("Object #{} not a hatch object", src_idx),
+            }
+        }
+    }
+}

+ 44 - 108
src/config/object.rs

@@ -294,30 +294,30 @@ impl ObjectOperation {
                     }
                 }
 
-                match (&array.pattern_hatch_y, &array.pattern_hatch_x, &array.pattern_pen_y, &array.pattern_pen_x) {
-                    (None, None, None, None) => (),
-                    (Some(hatch_y), Some(hatch_x), None, None) => {
+                if (array.pattern_hatch_x.is_some() && array.pattern_pen_x.is_some())
+                    || (array.pattern_hatch_y.is_some() && array.pattern_pen_y.is_some())
+                {
+                    panic!("Conflict with X or Y axis patterning options");
+                }
+
+                let pattern_x: bool =
+                    array.pattern_hatch_x.is_some() || array.pattern_pen_x.is_some();
+                let pattern_y: bool =
+                    array.pattern_hatch_y.is_some() || array.pattern_pen_y.is_some();
+
+                if let Some(pen_y) = &array.pattern_pen_y {
+                    if pattern_x {
                         for x in 0..array.columns {
-                            hatch_y.pattern(
-                                &mut new_obj
+                            pen_y.pattern(
+                                &mut pens
                                     .iter_mut()
                                     .enumerate()
-                                    .skip(x)
+                                    .skip(x + array.starting_pen)
                                     .step_by(array.columns)
                                     .take(array.rows),
                             );
                         }
-                        for y in 0..array.rows {
-                            hatch_x.pattern(
-                                &mut new_obj
-                                    .iter_mut()
-                                    .enumerate()
-                                    .skip(y * array.columns)
-                                    .take(array.columns),
-                            )
-                        }
-                    }
-                    (None, None, Some(pen_y), Some(pen_x)) => {
+                    } else {
                         for x in 0..array.columns {
                             pen_y.pattern(
                                 &mut pens
@@ -328,6 +328,11 @@ impl ObjectOperation {
                                     .take(array.rows),
                             );
                         }
+                    }
+                }
+
+                if let Some(pen_x) = &array.pattern_pen_x {
+                    if pattern_y {
                         for y in 0..array.rows {
                             pen_x.pattern(
                                 &mut pens
@@ -338,8 +343,19 @@ impl ObjectOperation {
                                     .take(array.columns),
                             )
                         }
+                    } else {
+                        pen_x.pattern(
+                            &mut pens
+                                .iter_mut()
+                                .enumerate()
+                                .skip(array.starting_pen)
+                                .take(array.columns * array.rows),
+                        );
                     }
-                    (Some(hatch_y), None, None, Some(pen_x)) => {
+                }
+
+                if let Some(hatch_y) = &array.pattern_hatch_y {
+                    if pattern_x {
                         for x in 0..array.columns {
                             hatch_y.pattern(
                                 &mut new_obj
@@ -350,28 +366,22 @@ impl ObjectOperation {
                                     .take(array.rows),
                             );
                         }
-                        for y in 0..array.rows {
-                            pen_x.pattern(
-                                &mut pens
-                                    .iter_mut()
-                                    .enumerate()
-                                    .skip(array.starting_pen)
-                                    .skip(y * array.columns)
-                                    .take(array.columns),
-                            )
-                        }
-                    }
-                    (None, Some(hatch_x), Some(pen_y), None) => {
+                    } else {
                         for x in 0..array.columns {
-                            pen_y.pattern(
-                                &mut pens
+                            hatch_y.pattern(
+                                &mut new_obj
                                     .iter_mut()
                                     .enumerate()
-                                    .skip(x + array.starting_pen)
+                                    .skip(x)
                                     .step_by(array.columns)
                                     .take(array.rows),
                             );
                         }
+                    }
+                }
+
+                if let Some(hatch_x) = &array.pattern_hatch_x {
+                    if pattern_y {
                         for y in 0..array.rows {
                             hatch_x.pattern(
                                 &mut new_obj
@@ -381,20 +391,7 @@ impl ObjectOperation {
                                     .take(array.columns),
                             )
                         }
-                    }
-                    (Some(hatch_y), None, None, None) => {
-                        for x in 0..array.columns {
-                            hatch_y.pattern(
-                                &mut new_obj
-                                    .iter_mut()
-                                    .enumerate()
-                                    .skip(x)
-                                    .step_by(array.columns)
-                                    .take(array.rows),
-                            );
-                        }
-                    }
-                    (None, Some(hatch_x), None, None) => {
+                    } else {
                         hatch_x.pattern(
                             &mut new_obj
                                 .iter_mut()
@@ -402,69 +399,8 @@ impl ObjectOperation {
                                 .take(array.columns * array.rows),
                         );
                     }
-                    (None, None, Some(pen_y), None) => {
-                        for x in 0..array.columns {
-                            pen_y.pattern(
-                                &mut pens
-                                    .iter_mut()
-                                    .enumerate()
-                                    .skip(x + array.starting_pen)
-                                    .step_by(array.columns)
-                                    .take(array.rows),
-                            );
-                        }
-                    }
-                    (None, None, None, Some(pen_x)) => {
-                        pen_x.pattern(
-                            &mut pens
-                                .iter_mut()
-                                .enumerate()
-                                .skip(array.starting_pen)
-                                .take(array.columns * array.rows),
-                        );
-                    }
-                    _ => panic!("Unsupported combination of patterning X and Y")
                 }
 
-                // // Generate pens
-                // match &array.pattern_pen_y {
-                //     None => {
-                //         if let Some(pen_x) = &array.pattern_pen_x {
-                //             pen_x.pattern(
-                //                 &mut pens
-                //                     .iter_mut()
-                //                     .enumerate()
-                //                     .skip(array.starting_pen)
-                //                     .take(array.columns * array.rows),
-                //             );
-                //         }
-                //     }
-                //     Some(pen_y) => {
-                //         for x in 0..array.columns {
-                //             pen_y.pattern(
-                //                 &mut pens
-                //                     .iter_mut()
-                //                     .enumerate()
-                //                     .skip(x + array.starting_pen)
-                //                     .step_by(array.columns)
-                //                     .take(array.rows),
-                //             );
-                //         }
-                //         if let Some(pen_x) = &array.pattern_pen_x {
-                //             for y in 0..array.rows {
-                //                 pen_x.pattern(
-                //                     &mut pens
-                //                         .iter_mut()
-                //                         .enumerate()
-                //                         .skip(array.starting_pen)
-                //                         .skip(y * array.columns)
-                //                         .take(array.columns),
-                //                 )
-                //             }
-                //         }
-                //     }
-                // }
-
                 if array.randomize_order {
                     debug!("Randomizing draw order of array objects");
                     new_obj.shuffle(&mut thread_rng());

+ 1 - 1
src/ezcad/objects/circle.rs

@@ -41,7 +41,7 @@ impl Display for Circle {
 
         write!(
             f,
-            "{}, Origin: {}, Width : {:.2}, Height: {:.2}, Start Radian: {:.2}, Clockwise: {}",
+            "{}, Origin: {}, Width : {:.3}, Height: {:.3}, Start Radian: {:.3}, Clockwise: {}",
             self.core,
             origin,
             width,

+ 1 - 1
src/ezcad/objects/ellipse.rs

@@ -42,7 +42,7 @@ impl Display for Ellipse {
 
         write!(
             f,
-            "{}, Origin: {}, Width: {:.2}, Height: {:.2}, Start Radian: {:.2}, End Radian: {:.2}, Open Curve: {}", 
+            "{}, Origin: {}, Width: {:.3}, Height: {:.3}, Start Radian: {:.3}, End Radian: {:.3}, Open Curve: {}", 
             self.core,
             origin,
             width,

+ 2 - 2
src/ezcad/objects/hatch.rs

@@ -410,7 +410,7 @@ impl Display for Hatch {
             if setting.enabled.into() {
                 write!(
                     f,
-                    "\nHatch #{}: All Calc: {}, Follow Edge Once: {}, Cross Hatch: {}, Pattern: {}, Angle: {:.2}, Pen: {}, Count: {}, Line Space: {:.2}, Avg Distribte Line: {}",
+                    "\nHatch #{}: All Calc: {}, Follow Edge Once: {}, Cross Hatch: {}, Pattern: {}, Angle: {:.3}, Pen: {}, Count: {}, Line Space: {:.3}, Avg Distribte Line: {}",
                     index,
                     setting.flags.all_calc() != 0,
                     setting.flags.follow_edge_once() != 0,
@@ -424,7 +424,7 @@ impl Display for Hatch {
                 )?;
                 write!(
                     f,
-                    "\n          Edge Offset: {:.2}, Start Offset: {:.2}, End Offset: {:.2}, Line Reduction: {:.2}, Loop Count: {}, Loop Distance: {:.2}, Auto Rotate: {}, Auto Rotate Angle: {:.2}",
+                    "\n          Edge Offset: {:.3}, Start Offset: {:.3}, End Offset: {:.3}, Line Reduction: {:.3}, Loop Count: {}, Loop Distance: {:.3}, Auto Rotate: {}, Auto Rotate Angle: {:.3}",
                     *setting.edge_offset,
                     *setting.start_offset,
                     *setting.end_offset,

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

@@ -79,7 +79,7 @@ impl Display for ObjectCore {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         write!(
             f,
-            "Type: {}, Enabled: {}, Pen: {}, Count: {}, Z: {:.2}",
+            "Type: {}, Enabled: {}, Pen: {}, Count: {}, Z: {:.3}",
             self.obj_type,
             (self.flags.disabled() == 0),
             self.pen,

+ 1 - 1
src/ezcad/objects/polygon.rs

@@ -44,7 +44,7 @@ impl Display for Polygon {
 
         write!(
             f,
-            "{}, Origin: {}, Width: {:.2}, Height: {:.2}, Inverted: {}, Offset CX: {:.2}, Offset CY: {:.2}, Offset DX: {:.2}, Offset: DY: {:.2}, Edges: {}",
+            "{}, Origin: {}, Width: {:.3}, Height: {:.3}, Inverted: {}, Offset CX: {:.3}, Offset CY: {:.3}, Offset DX: {:.3}, Offset: DY: {:.3}, Edges: {}",
             self.core,
             origin,
             width,

+ 1 - 1
src/ezcad/objects/rectangle.rs

@@ -42,7 +42,7 @@ impl Display for Rectangle {
 
         write!(
             f,
-            "{}, Origin: {}, Width: {:.2}, Height: {:.2}",
+            "{}, Origin: {}, Width: {:.3}, Height: {:.3}",
             self.core, origin, width, height,
         )
     }

+ 1 - 1
src/ezcad/types.rs

@@ -141,7 +141,7 @@ pub struct Point {
 
 impl Display for Point {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        write!(f, "({:.2}, {:.2})", self.x, self.y)
+        write!(f, "({:.3}, {:.3})", self.x, self.y)
     }
 }