dxfscan 0.1.0

Binary DXF parser with typed entity data and lookup indices
Documentation
// SPDX-License-Identifier: ISC
use crate::point::Point3;
use crate::value::GroupValue;

/// A CIRCLE entity.
#[derive(Debug, Clone, Copy, Default)]
pub struct Circle {
    /// Center point.
    pub center: Point3,
    /// Radius.
    pub radius: f64,
    /// Extrusion thickness.
    pub thickness: f64,
}

impl Circle {
    pub(crate) fn feed(&mut self, code: u16, val: &GroupValue) {
        if let Some(v) = val.as_f64() {
            match code {
                10 => self.center.x = v,
                20 => self.center.y = v,
                30 => self.center.z = v,
                40 => self.radius = v,
                39 => self.thickness = v,
                _ => {}
            }
        }
    }
}