1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// SPDX-License-Identifier: GPL-3.0-only
// SPDX-FileCopyrightText: 2026 Alexander Kiselev <alex@akiselev.com>
//
//! Altium file format library for Rust.
//!
//! This library provides read/write support for Altium Designer files including:
//! - SchLib (Schematic symbol library)
//! - PcbLib (PCB footprint library)
//! - SchDoc (Schematic document)
//! - PcbDoc (PCB document)
//!
//! # Architecture
//!
//! The library is organized into several modules:
//!
//! - [`types`] - Core data types (coordinates, units, layers, parameters)
//! - [`traits`] - Serialization traits for derive macros
//! - [`records`] - Record types for schematic and PCB primitives
//! - [`io`] - File I/O utilities for CFB format
//! - [`error`] - Error types
//!
//! # Derive Macros
//!
//! Record types can be defined using derive macros for automatic serialization:
//!
//! ```ignore
//! use altium_format_derive::AltiumRecord;
//!
//! #[derive(AltiumRecord)]
//! #[altium(record_id = 2, format = "params")]
//! pub struct SchPin {
//! #[altium(flatten)]
//! pub base: SchGraphicalBase,
//!
//! #[altium(param = "ELECTRICAL", default)]
//! pub electrical: PinElectricalType,
//!
//! #[altium(unknown)]
//! pub unknown_params: UnknownFields,
//! }
//! ```
//!
//! # Quick Start
//!
//! ## Reading a Schematic Library
//!
//! ```no_run
//! use altium_format::io::SchLib;
//! use std::fs::File;
//! use std::io::BufReader;
//!
//! let file = File::open("components.SchLib")?;
//! let lib = SchLib::open(BufReader::new(file))?;
//!
//! for component in &lib.components {
//! println!("Component: {}", component.name());
//! println!(" Pins: {}", component.pin_count());
//! }
//! # Ok::<(), altium_format::error::AltiumError>(())
//! ```
//!
//! ## Creating a Footprint
//!
//! ```no_run
//! use altium_format::footprint::FootprintBuilder;
//! use altium_format::records::pcb::PcbPadShape;
//!
//! let mut builder = FootprintBuilder::new("SOIC-8");
//! builder.add_dual_row_smd(
//! 4, // pads per side
//! 1.27, // pitch (mm)
//! 5.3, // row spacing (mm)
//! 1.5, // pad width (mm)
//! 0.6, // pad height (mm)
//! PcbPadShape::Rectangular,
//! );
//! let component = builder.build_deterministic(&mut ());
//! ```
//!
//! # Example
//!
//! ```ignore
//! use altium_format::types::{Coord, CoordPoint, ParameterCollection};
//!
//! // Parse parameters from Altium format
//! let params = ParameterCollection::from_string("|RECORD=1|NAME=Test|X=100mil|");
//! let name = params.get("NAME").unwrap().as_str();
//! let x = params.get("X").unwrap().as_coord_or(Coord::ZERO);
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export derive macros
pub use ;