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 POINT entity — a single point in space.
#[derive(Debug, Clone, Copy, Default)]
pub struct DxfPoint {
    /// Location.
    pub location: Point3,
    /// Extrusion thickness.
    pub thickness: f64,
    /// Angle of the X axis for the UCS in effect when the point was drawn.
    pub x_axis_angle: f64,
}

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