From 66385e8bd757b5a965f1d8abc069b57f0e9cac88 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sat, 14 Nov 2026 22:16:06 +0100 Subject: [PATCH] Use Craft CAD codecs for QCAD-compatible DXF and DWG exchange --- .gitattributes | 2 + Cargo.lock | 117 +- README.md | 2 +- crates/midra-layout/Cargo.toml | 4 +- .../examples/check_geometry_exchange.rs | 9 +- crates/midra-layout/src/geometry_formats.rs | 137 +- crates/midra-layout/src/gui.rs | 2 +- crates/midra-layout/src/interchange.rs | 21 +- crates/midra-layout/src/vendor_formats.rs | 23 + crates/midra-layout/tests/cad.rs | 101 ++ crates/midra-layout/tests/exchange.rs | 15 +- docs/interfaces/midra-layout-exchange.md | 68 +- docs/midra-layout/README.md | 2 +- docs/midra-layout/changelog.md | 2 + docs/midra-layout/guide/canvas.md | 2 +- docs/midra-layout/guide/files.md | 6 +- docs/midra-layout/plan.md | 4 +- docs/templates/midra-layout/README.md | 20 +- .../midra-layout-1080p-2-layers.dwg | Bin 0 -> 19456 bytes .../midra-layout-1080p-2-layers.dxf | 1148 +++++++++++++++-- .../midra-layout/midra-layout-4k-2-layers.dwg | Bin 0 -> 19456 bytes .../midra-layout/midra-layout-4k-2-layers.dxf | 1148 +++++++++++++++-- .../midra-layout-ai-templates.zip | Bin 0 -> 13288 bytes scripts/manuals.py | 2 +- tests/test_midra_templates.py | 19 + 25 files changed, 2540 insertions(+), 314 deletions(-) create mode 100644 .gitattributes create mode 100644 crates/midra-layout/tests/cad.rs create mode 100644 docs/templates/midra-layout/midra-layout-1080p-2-layers.dwg create mode 100644 docs/templates/midra-layout/midra-layout-4k-2-layers.dwg create mode 100644 docs/templates/midra-layout/midra-layout-ai-templates.zip create mode 100644 tests/test_midra_templates.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5f8ff1e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# CAD text fixtures retain the format's CRLF line endings. +*.dxf -text whitespace=cr-at-eol diff --git a/Cargo.lock b/Cargo.lock index 0b0f71e..f1f6469 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,30 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" +[[package]] +name = "acadrust" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8923c99ea1f151cb7fc17ce2fc14f8b1e330fa22611e535602d985c0cc3c89a2" +dependencies = [ + "anyhow", + "bitflags 2.13.2", + "byteorder", + "encoding_rs", + "flate2", + "foldhash 0.2.0", + "indexmap", + "itoa", + "memmap2", + "nom", + "oem_cp", + "once_cell", + "rayon", + "ryu", + "thiserror 2.0.21", + "web-time", +] + [[package]] name = "adler2" version = "2.0.1" @@ -569,6 +593,12 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "byteorder-lite" version = "0.1.0" @@ -887,6 +917,12 @@ dependencies = [ "libc", ] +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "core_maths" version = "0.1.1" @@ -905,6 +941,32 @@ dependencies = [ "libc", ] +[[package]] +name = "craft-codepage" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=79e97b6febcb62de406e5bcf5a724bd3f7333065#79e97b6febcb62de406e5bcf5a724bd3f7333065" + +[[package]] +name = "craft-dwg" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=79e97b6febcb62de406e5bcf5a724bd3f7333065#79e97b6febcb62de406e5bcf5a724bd3f7333065" +dependencies = [ + "acadrust", + "log", +] + +[[package]] +name = "craft-dxf" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=79e97b6febcb62de406e5bcf5a724bd3f7333065#79e97b6febcb62de406e5bcf5a724bd3f7333065" +dependencies = [ + "craft-codepage", + "encoding_rs", + "kurbo 0.13.1", + "log", + "thiserror 2.0.21", +] + [[package]] name = "crc32fast" version = "1.5.2" @@ -1303,6 +1365,20 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" +[[package]] +name = "encoding_rs" +version = "0.8.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + [[package]] name = "endi" version = "1.1.1" @@ -1554,6 +1630,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "font-types" version = "0.11.3" @@ -1904,7 +1986,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -2713,6 +2795,8 @@ name = "midra-layout" version = "0.6.0" dependencies = [ "base64 0.22.1", + "craft-dwg", + "craft-dxf", "csv", "deckcraft-geom", "deckcraft-model", @@ -2735,6 +2819,12 @@ dependencies = [ "winresource", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -2782,6 +2872,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + [[package]] name = "mutate_once" version = "0.1.2" @@ -2855,6 +2951,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-bigint" version = "0.4.8" @@ -3207,6 +3313,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "oem_cp" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7959d3349f484aec36462f98226983578bf7d33f9b034c32967489c7000e1f" +dependencies = [ + "phf", +] + [[package]] name = "once_cell" version = "1.21.4" diff --git a/README.md b/README.md index 44b1332..d8a126d 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ See [development setup](https://proxy.dandaedre.com/gitea/Beffroi/beffroi-tools/ [Browse all starter files →](https://proxy.dandaedre.com/gitea/Beffroi/beffroi-tools/src/branch/main/docs/templates/midra-layout/README.md) Matching Full HD and UHD 4K layouts are available in SVG, draw.io, geometry JSON, -CSV, DXF, HTML, PPTX, Figma FIG and Illustrator AI. The catalog contains every +CSV, DXF/DWG, HTML, PPTX, Figma FIG and Illustrator AI. The catalog contains every base file, import guidance and format dependencies. ## Explore further diff --git a/crates/midra-layout/Cargo.toml b/crates/midra-layout/Cargo.toml index 2855ca8..8f4c085 100644 --- a/crates/midra-layout/Cargo.toml +++ b/crates/midra-layout/Cargo.toml @@ -8,11 +8,13 @@ description = "Midra layer positioning, geometry import and reviewed device cont [features] default = ["vendor_formats"] -vendor_formats = ["dep:deckcraft-pptx", "dep:deckcraft-model", "dep:deckcraft-geom", "dep:figcraft-format", "dep:figcraft-doc", "dep:figcraft-geom"] +vendor_formats = ["dep:craft-dwg", "dep:deckcraft-pptx", "dep:deckcraft-model", "dep:deckcraft-geom", "dep:figcraft-format", "dep:figcraft-doc", "dep:figcraft-geom"] # Use with --no-default-features to exclude the optional codecs and their dependencies. no_proprietary = [] [dependencies] +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "79e97b6febcb62de406e5bcf5a724bd3f7333065" } +craft-dwg = { git = "https://github.com/storytold/craft-libs", rev = "79e97b6febcb62de406e5bcf5a724bd3f7333065", optional = true } deckcraft-pptx = { version = "=0.6.1", optional = true } deckcraft-model = { version = "=0.6.1", optional = true } deckcraft-geom = { version = "=0.6.1", optional = true } diff --git a/crates/midra-layout/examples/check_geometry_exchange.rs b/crates/midra-layout/examples/check_geometry_exchange.rs index 6455986..44cdfb0 100644 --- a/crates/midra-layout/examples/check_geometry_exchange.rs +++ b/crates/midra-layout/examples/check_geometry_exchange.rs @@ -2,7 +2,6 @@ use midra_layout::{ Geometry, Layout, exchange::{self, Format, Options}, - import::parse_values, project::{Project, Resolution, write_file}, }; @@ -105,8 +104,12 @@ fn main() -> Result<(), String> { [command, paths @ ..] if command == "verify" && !paths.is_empty() => { let project = Project::from_layout(&Layout::default()); for path in paths { - let text = std::fs::read_to_string(path).map_err(|e| e.to_string())?; - let imported = parse_values(&text)?; + let bytes = std::fs::read(path).map_err(|e| e.to_string())?; + let pages = midra_layout::interchange::import(&bytes, path)?; + if pages.len() != 1 { + return Err(format!("Expected one page: {path}")); + } + let imported = &pages[0].document; let shapes: Vec<_> = imported .shapes .iter() diff --git a/crates/midra-layout/src/geometry_formats.rs b/crates/midra-layout/src/geometry_formats.rs index f22e7e9..5f12a98 100644 --- a/crates/midra-layout/src/geometry_formats.rs +++ b/crates/midra-layout/src/geometry_formats.rs @@ -255,65 +255,64 @@ fn export_html(canvas: [u32; 2], shapes: &[ExportShape]) -> String { output } -fn dxf_pair(output: &mut String, code: i32, value: impl std::fmt::Display) { - output.push_str(&format!("{code}\r\n{value}\r\n")); -} - fn export_dxf(canvas: [u32; 2], shapes: &[ExportShape]) -> String { - let mut output = String::new(); - dxf_pair(&mut output, 999, "MIDRA_LAYOUT_GEOMETRY 1"); - dxf_pair(&mut output, 0, "SECTION"); - dxf_pair(&mut output, 2, "HEADER"); - dxf_pair(&mut output, 9, "$ACADVER"); - dxf_pair(&mut output, 1, "AC1021"); - dxf_pair(&mut output, 9, "$INSUNITS"); - dxf_pair(&mut output, 70, 0); - dxf_pair(&mut output, 9, "$EXTMIN"); - dxf_pair(&mut output, 10, 0); - dxf_pair(&mut output, 20, 0); - dxf_pair(&mut output, 9, "$EXTMAX"); - dxf_pair(&mut output, 10, canvas[0]); - dxf_pair(&mut output, 20, canvas[1]); - dxf_pair(&mut output, 9, "$LIMMIN"); - dxf_pair(&mut output, 10, 0); - dxf_pair(&mut output, 20, 0); - dxf_pair(&mut output, 9, "$LIMMAX"); - dxf_pair(&mut output, 10, canvas[0]); - dxf_pair(&mut output, 20, canvas[1]); - dxf_pair(&mut output, 0, "ENDSEC"); - dxf_pair(&mut output, 0, "SECTION"); - dxf_pair(&mut output, 2, "TABLES"); - dxf_pair(&mut output, 0, "TABLE"); - dxf_pair(&mut output, 2, "LAYER"); - dxf_pair(&mut output, 70, shapes.len()); + use craft_dxf::model::{ + Color, Common, Entity, EntityKind, Layer, Lineweight, LwPolyline, LwVertex, Transparency, + write::{Drawing, Format}, + }; + let bounds = [0.0, 0.0, f64::from(canvas[0]), f64::from(canvas[1])]; + let mut drawing = Drawing { + format: Format::R2007, + extents: bounds, + limits: bounds, + insunits: 0, + ..Default::default() + }; for (index, shape) in shapes.iter().enumerate() { - dxf_pair(&mut output, 0, "LAYER"); - dxf_pair(&mut output, 2, &shape.id); - dxf_pair(&mut output, 70, 0); - dxf_pair(&mut output, 62, if index % 2 == 0 { 4 } else { 5 }); - dxf_pair(&mut output, 6, "CONTINUOUS"); - } - dxf_pair(&mut output, 0, "ENDTAB"); - dxf_pair(&mut output, 0, "ENDSEC"); - dxf_pair(&mut output, 0, "SECTION"); - dxf_pair(&mut output, 2, "ENTITIES"); - for shape in shapes { - let [x, y, width, height] = rounded(shape.geometry); - let top = i64::from(canvas[1]) - y; + drawing.layers.push(Layer { + handle: None, + name: shape.id.clone(), + color: Color::Index(if index % 2 == 0 { 4 } else { 5 }), + on: true, + frozen: false, + vp_freeze_new: false, + locked: false, + plot: true, + linetype: "Continuous".into(), + lineweight: Lineweight::Default, + plot_style: None, + transparency: Transparency::ByLayer, + description: Some(shape.name.clone()), + }); + let [x, y, width, height] = rounded(shape.geometry).map(|v| v as f64); + let top = f64::from(canvas[1]) - y; let bottom = top - height; - dxf_pair(&mut output, 999, format!("NAME {}", shape.name)); - dxf_pair(&mut output, 0, "LWPOLYLINE"); - dxf_pair(&mut output, 8, &shape.id); - dxf_pair(&mut output, 90, 4); - dxf_pair(&mut output, 70, 1); - for [px, py] in [[x, top], [x + width, top], [x + width, bottom], [x, bottom]] { - dxf_pair(&mut output, 10, px); - dxf_pair(&mut output, 20, py); - } + let mut common = Common::read(&[]); + common.layer = shape.id.clone(); + drawing.entities.push(Entity { + common, + kind: EntityKind::LwPolyline(LwPolyline { + vertices: [[x, top], [x + width, top], [x + width, bottom], [x, bottom]] + .into_iter() + .map(|[x, y]| LwVertex { + x, + y, + ..Default::default() + }) + .collect(), + closed: true, + plinegen: false, + const_width: 0.0, + elevation: 0.0, + }), + }); } - dxf_pair(&mut output, 0, "ENDSEC"); - dxf_pair(&mut output, 0, "EOF"); - output + let (tags, _) = drawing.tags(); + // QCAD seeds stock objects at low handles before importing. Reserve that range + // and remap definitions and references together with Craft's model helper. + let mut tags = craft_dxf::model::write::remap_handles(&tags, |handle| Some(handle + 0x100)); + tags.insert(0, craft_dxf::Tag::s(999, "MIDRA_LAYOUT_GEOMETRY 1")); + craft_dxf::write_ascii_as(&tags, true) } pub(crate) fn parse_json(text: &str) -> Result { @@ -421,26 +420,18 @@ pub(crate) fn parse_html(text: &str) -> Result { ) } -fn dxf_pairs(text: &str) -> Result, String> { - let lines: Vec<_> = text.lines().collect(); - let (pairs, remainder) = lines.as_chunks::<2>(); - if !remainder.is_empty() { - return Err("DXF must contain group-code/value line pairs.".into()); - } - pairs - .iter() - .map(|pair| { - pair[0] - .trim() - .parse::() - .map(|code| (code, pair[1].trim())) - .map_err(|_| "Invalid DXF group code.".into()) - }) - .collect() +pub(crate) fn parse_dxf(text: &str) -> Result { + parse_dxf_bytes(text.as_bytes()) } -pub(crate) fn parse_dxf(text: &str) -> Result { - let pairs = dxf_pairs(text)?; +pub(crate) fn parse_dxf_bytes(bytes: &[u8]) -> Result { + let tags = craft_dxf::parse_with_limit(bytes, MAX_EXCHANGE_BYTES / 4) + .map_err(|e| format!("Invalid DXF: {e}"))?; + let values: Vec<_> = tags.iter().map(|tag| (tag.code, tag.str())).collect(); + let pairs: Vec<_> = values + .iter() + .map(|(code, value)| (*code, value.trim())) + .collect(); if !pairs .iter() .any(|(code, value)| *code == 0 && *value == "LWPOLYLINE") diff --git a/crates/midra-layout/src/gui.rs b/crates/midra-layout/src/gui.rs index 3754455..20dd204 100644 --- a/crates/midra-layout/src/gui.rs +++ b/crates/midra-layout/src/gui.rs @@ -713,7 +713,7 @@ impl Editor { .is_some_and(|extension| { let extension = extension.to_ascii_lowercase(); midra_layout::interchange::extensions().contains(&extension.as_str()) - || matches!(extension.as_str(), "pptx" | "fig" | "ai") + || matches!(extension.as_str(), "pptx" | "fig" | "ai" | "dwg") }) } fn read_geometry_files(files: Vec, p: &mut Paste) { diff --git a/crates/midra-layout/src/interchange.rs b/crates/midra-layout/src/interchange.rs index b76656c..9334161 100644 --- a/crates/midra-layout/src/interchange.rs +++ b/crates/midra-layout/src/interchange.rs @@ -13,6 +13,7 @@ pub enum Codec { Json, Csv, Dxf, + Dwg, Html, Pptx, Figma, @@ -33,7 +34,7 @@ impl Codec { feature = "vendor_formats", not(feature = "no_proprietary") )) { - formats.extend([Self::Pptx, Self::Figma, Self::Illustrator]); + formats.extend([Self::Dwg, Self::Pptx, Self::Figma, Self::Illustrator]); } formats } @@ -44,6 +45,7 @@ impl Codec { Self::Json => "Geometry JSON", Self::Csv => "Geometry CSV", Self::Dxf => "DXF · CAD", + Self::Dwg => "DWG · CAD (Craft)", Self::Html => "HTML / CSS", Self::Pptx => "PowerPoint · PPTX", Self::Figma => "Figma · FIG", @@ -57,6 +59,7 @@ impl Codec { Self::Json => "json", Self::Csv => "csv", Self::Dxf => "dxf", + Self::Dwg => "dwg", Self::Html => "html", Self::Pptx => "pptx", Self::Figma => "fig", @@ -64,10 +67,13 @@ impl Codec { } } pub fn artwork(self) -> bool { - !matches!(self, Self::Csv | Self::Dxf) + !matches!(self, Self::Csv | Self::Dxf | Self::Dwg) } pub fn help(self) -> &'static str { match self { + Self::Dwg => { + "Editable CAD rectangles via Craft. Unitless drawing: one unit equals one screen pixel; no pictures." + } Self::Pptx => { "One editable slide. Coordinates use 96 pixels per inch. Import lets you choose a slide." } @@ -150,9 +156,10 @@ pub fn import(bytes: &[u8], filename: &str) -> Result, String> { .and_then(|s| s.to_str()) .unwrap_or("") .to_ascii_lowercase(); - let vendor = matches!(extension.as_str(), "pptx" | "fig" | "ai") + let vendor = matches!(extension.as_str(), "pptx" | "fig" | "ai" | "dwg") || bytes.starts_with(b"PK") - || bytes.starts_with(b"fig-"); + || bytes.starts_with(b"fig-") + || bytes.starts_with(b"AC10"); if vendor { if cfg!(feature = "no_proprietary") { return Err("Vendor format support is disabled in this no_proprietary build.".into()); @@ -166,6 +173,12 @@ pub fn import(bytes: &[u8], filename: &str) -> Result, String> { return Err("Vendor format support is not compiled in. Enable vendor_formats.".into()); } } + if extension == "dxf" || bytes.starts_with(b"AutoCAD Binary DXF") { + return Ok(vec![Page { + name: filename.into(), + document: crate::geometry_formats::parse_dxf_bytes(bytes)?, + }]); + } let text = std::str::from_utf8(bytes).map_err( |_| "Unrecognized binary format. Choose PPTX, FIG, AI or a supported geometry file.", )?; diff --git a/crates/midra-layout/src/vendor_formats.rs b/crates/midra-layout/src/vendor_formats.rs index 019b6eb..d920866 100644 --- a/crates/midra-layout/src/vendor_formats.rs +++ b/crates/midra-layout/src/vendor_formats.rs @@ -55,6 +55,14 @@ pub(crate) fn export( return Err("Rename the layer called ‘midra-background’ before native export; that name identifies the optional background.".into()); } match codec { + Codec::Dwg => { + let dxf = exchange::encode_shapes(exchange::Format::Dxf, canvas, shapes)?; + let (bytes, omitted) = craft_dwg::dxf_to_dwg_noted(dxf.as_bytes(), "AC1021")?; + if !omitted.is_empty() { + return Err(format!("DWG export omitted records: {omitted:?}")); + } + Ok(bytes) + } Codec::Pptx => export_pptx(canvas, shapes), Codec::Figma => export_fig(canvas, shapes), Codec::Illustrator => { @@ -72,6 +80,21 @@ pub(crate) fn export( } } pub(crate) fn import(bytes: &[u8], extension: &str, filename: &str) -> Result, String> { + if extension == "dwg" || craft_dwg::is_dwg(bytes) { + let (dxf, notes) = craft_dwg::dwg_to_dxf_noted( + bytes, + craft_dwg::Limits { + max_dwg_bytes: exchange::MAX_EXCHANGE_BYTES, + max_dxf_bytes: exchange::MAX_EXCHANGE_BYTES, + }, + )?; + let mut document = crate::geometry_formats::parse_dxf_bytes(&dxf)?; + document.note = format!("DWG via Craft. {} {}", document.note, notes.join("; ")); + return Ok(vec![Page { + name: filename.into(), + document, + }]); + } if extension == "ai" { return import_ai(bytes); } diff --git a/crates/midra-layout/tests/cad.rs b/crates/midra-layout/tests/cad.rs new file mode 100644 index 0000000..4d12173 --- /dev/null +++ b/crates/midra-layout/tests/cad.rs @@ -0,0 +1,101 @@ +use midra_layout::{ + Layout, + exchange::Options, + interchange::{self, Codec}, + project::Project, +}; + +#[test] +fn craft_dxf_has_owned_entities_and_roundtrips_binary_tags() { + let project = Project::from_layout(&Layout::default()); + let ids: Vec<_> = project.layers.iter().map(|l| l.id).collect(); + let bytes = interchange::export(&project, &ids, Codec::Dxf, Options::default()).unwrap(); + let tags = craft_dxf::parse(&bytes).unwrap(); + let handles: Vec<_> = tags + .iter() + .filter(|t| t.code == 5 || t.code == 105) + .map(|t| t.str()) + .collect(); + assert!( + tags.iter() + .any(|t| t.code == 100 && t.str() == "AcDbBlockTableRecord") + ); + let mut entities = 0; + for (index, tag) in tags.iter().enumerate() { + if tag.code != 0 || tag.str() != "LWPOLYLINE" { + continue; + } + entities += 1; + let entity: Vec<_> = tags[index + 1..] + .iter() + .take_while(|t| t.code != 0) + .collect(); + assert!(entity.iter().any(|t| t.code == 5)); + assert!( + entity + .iter() + .any(|t| t.code == 330 && handles.contains(&t.str())) + ); + for subclass in ["AcDbEntity", "AcDbPolyline"] { + assert!(entity.iter().any(|t| t.code == 100 && t.str() == subclass)); + } + } + assert_eq!(entities, 2); + let binary = craft_dxf::write_binary(&tags, true); + let pages = interchange::import(&binary, "layout.DXF").unwrap(); + assert_eq!( + pages[0] + .document + .shapes + .iter() + .map(|s| s.geometry) + .collect::>(), + project.layers.iter().map(|l| l.bounds).collect::>() + ); +} + +#[cfg(all(feature = "vendor_formats", not(feature = "no_proprietary")))] +#[test] +fn craft_dwg_preserves_canvas_background_and_layer_boxes() { + for resolution in [[1920, 1080], [3840, 2160]] { + let mut project = Project::from_layout(&Layout::default()); + project.output_resolution = resolution.into(); + let ids: Vec<_> = project.layers.iter().map(|l| l.id).collect(); + for background in [false, true] { + let bytes = interchange::export( + &project, + &ids, + Codec::Dwg, + Options { + background, + placeholders: false, + }, + ) + .unwrap(); + assert!(craft_dwg::is_dwg(&bytes)); + let pages = interchange::import(&bytes, "layout.DWG").unwrap(); + let shapes = &pages[0].document.shapes; + assert_eq!(shapes.len(), 2 + usize::from(background)); + let boxes: Vec<_> = shapes + .iter() + .filter(|s| !s.background_only) + .map(|s| s.geometry) + .collect(); + assert_eq!( + boxes, + project.layers.iter().map(|l| l.bounds).collect::>() + ); + } + } +} + +#[cfg(any(not(feature = "vendor_formats"), feature = "no_proprietary"))] +#[test] +fn licensing_build_rejects_dwg_explicitly() { + assert!(!Codec::available().contains(&Codec::Dwg)); + assert!( + interchange::import(b"AC1021invalid", "layout.dwg") + .unwrap_err() + .contains("support") + ); +} diff --git a/crates/midra-layout/tests/exchange.rs b/crates/midra-layout/tests/exchange.rs index 8053ba7..6dea25f 100644 --- a/crates/midra-layout/tests/exchange.rs +++ b/crates/midra-layout/tests/exchange.rs @@ -375,7 +375,18 @@ fn open_text_adapters_reject_wrong_versions_canvases_and_non_rectangles() { ); let dxf = exchange::export(&project, &ids, Format::Dxf, Options::default()).unwrap(); - assert!(parse_values(&dxf.replacen("70\r\n1\r\n", "70\r\n0\r\n", 1)).is_err()); + let mut tags = craft_dxf::parse(dxf.as_bytes()).unwrap(); + let start = tags + .iter() + .position(|t| t.code == 0 && t.str() == "LWPOLYLINE") + .unwrap(); + let closed = tags[start + 1..] + .iter_mut() + .take_while(|t| t.code != 0) + .find(|t| t.code == 70) + .unwrap(); + *closed = craft_dxf::Tag::i(70, 0); + assert!(parse_values(&craft_dxf::write_ascii_as(&tags, true)).is_err()); } #[test] @@ -488,7 +499,7 @@ fn check_native_templates(codecs: &[midra_layout::interchange::Codec]) { #[test] fn native_readme_templates_preserve_two_layer_geometry() { use midra_layout::interchange::Codec; - check_native_templates(&[Codec::Pptx, Codec::Figma]); + check_native_templates(&[Codec::Pptx, Codec::Figma, Codec::Dwg]); } #[cfg(all(feature = "vendor_formats", not(feature = "no_proprietary")))] diff --git a/docs/interfaces/midra-layout-exchange.md b/docs/interfaces/midra-layout-exchange.md index 2626ac9..2a195f6 100644 --- a/docs/interfaces/midra-layout-exchange.md +++ b/docs/interfaces/midra-layout-exchange.md @@ -1,7 +1,7 @@ # Midra Layout geometry exchange The Export menu writes **SVG v2**, **draw.io v1**, **geometry JSON v1**, -**geometry CSV v1**, **DXF**, **HTML/CSS v1**, **PPTX**, **Figma FIG** and +**geometry CSV v1**, **DXF/DWG**, **HTML/CSS v1**, **PPTX**, **Figma FIG** and **Illustrator AI** (the latter via a local VectorCraft CLI). Project JSON is version 10 and is the full-fidelity save format. These exchanges preserve layer **visible-box geometry**, not sources, crop settings, zoom, pivots, @@ -10,7 +10,7 @@ cropping; importing a picture does not reconstruct its crop or source settings. The [starter-file catalog](../templates/midra-layout/README.md) centralizes ready-to-open two-layer templates under `docs/templates/midra-layout/` for Full HD (1920 × 1080) and UHD 4K -(3840 × 2160), in all nine exchange formats (including PPTX, FIG and AI). The 4K geometry is an exact +(3840 × 2160), in all ten exchange formats (including PPTX, FIG and AI). The 4K geometry is an exact 2× scale of the Full HD layout. Regenerate them with: ```sh @@ -110,7 +110,7 @@ optional executable rather than embedding that stack. Upstream licenses still apply to separately distributed tools; Midra does not bundle VectorCraft. ```sh -# Normal build: native PPTX/FIG codecs and the optional AI converter interface. +# Normal build: native PPTX/FIG/DWG codecs and the optional AI converter interface. cargo build --locked --release -p midra-layout # Excludes vendor codecs, their optional dependency trees and the AI interface. cargo build --locked --release -p midra-layout --no-default-features --features no_proprietary @@ -260,18 +260,40 @@ meaning as JSON. Empty files, mismatched canvases, extra/missing fields and non-integer geometry are rejected. CSV carries background geometry but no image data or placeholder pictures. -## DXF profile +## CAD: DXF and DWG profiles -UTF-8 ASCII DXF declares `AC1021` (AutoCAD 2007), unitless `$INSUNITS=0`, and -whole-pixel `$LIMMIN`/`$LIMMAX` canvas bounds (with matching initial extents). -Every stable ID has a layer-table entry and every shape is one closed, -four-vertex `LWPOLYLINE`; its DXF layer name is the stable Midra layer ID. -Because CAD Y increases upward, export writes `cad_y = canvas_height - screen_y` -and import reverses that conversion. The `midra-background` entity is ignored as -background. DXF cannot embed the supported self-contained placeholder artwork; -human names are comments and may be discarded by CAD re-saving. Import requires -explicit extents and axis-aligned closed rectangles rather than guessing scale, -units or page origin. +DXF uses the official shared `craft-dxf` document model and serializer, pinned to +Craft libraries revision `79e97b6febcb62de406e5bcf5a724bd3f7333065` (MIT OR Apache-2.0). +It writes UTF-8 ASCII DXF `AC1021` (AutoCAD 2007), with complete symbol tables, +model/paper-space block records, dictionaries, layouts, unique handles, owner +references and subclass markers. Handles reserve the low `0x100` range to avoid +QCAD stock-object collisions; Craft remaps definitions and pointers together. This replaces the incomplete hand-written DXF +skeleton rejected by QCAD. The rectangle/coordinate contract remains unchanged; +older Midra DXF files are still readable. + +Drawings are unitless (`$INSUNITS=0`): one CAD unit equals one screen pixel. +Whole-pixel `$LIMMIN`/`$LIMMAX` describe the canvas, with matching initial extents. +Every stable ID has a layer-table entry; every box is one closed four-vertex +`LWPOLYLINE`. CAD Y increases upward, so `cad_y = canvas_height - screen_y`. +Import reverses this conversion and requires explicit canvas limits (falling +back to extents), rather than guessing scale or page origin. The special +`midra-background` layer is excluded from destination mapping. Human names are +layer descriptions; imported IDs remain CAD layer names. Pictures are omitted. +DXF import uses Craft's bounded ASCII/binary tag reader and retains the existing +axis-aligned rectangle restrictions. + +DWG uses the optional `craft-dwg` byte bridge from the same pinned revision, +backed by unmodified `acadrust` 0.6.6 (MPL-2.0). It converts the same DXF model to +AutoCAD 2007 DWG and back; canvas limits, IDs, pixel rounding and background rules +are identical. A writer report of omitted records rejects export. Reader notes +appear in the import review. Both DWG input and expanded DXF are limited to +16 MiB. DWG is available with `vendor_formats`, excluded by `no_proprietary`; +DXF remains available in all builds. The bridge reports unsupported platforms +explicitly (WebAssembly and FreeBSD ARM64 at this pin). + +Geometry exchange is not a general CAD editor: arbitrary drawing entities, +blocks and drafting annotations are not a supported round-trip profile. Keep +original CAD drawings; import/export the rectangular layer layout separately. ## HTML/CSS v1 @@ -325,7 +347,7 @@ the only positions present in that SVG. Include Midra Layout's background layer before exporting through draw.io when the full output-screen origin must survive the round trip. -Tests cover each format/artwork combination, the twelve text templates and four native PPTX/FIG templates (plus two AI templates in the opt-in CLI check), +Tests cover each format/artwork combination, the twelve text templates and six native PPTX/FIG/DWG templates (plus two AI templates in the opt-in CLI check), full-screen layers vs backgrounds, negative/fractional coordinates, repeat round trips, compressed clipboard/files, embedded references, invalid IDs/versions and no-overwrite file handling. @@ -356,3 +378,19 @@ Multiple references are flattened into the same single background image in artwork-capable exports; no format version changes. Reimport reconstructs that background as a geometry/artwork item, not the editable reference collection. Use project JSON v10 to preserve independent images and visibility. + +### QCAD interoperability check + +Validated with QCAD Professional 3.28.2: both 1080p and 4K DXF/DWG templates +render two correctly placed rectangles without import/handle warnings. Saving +both Full HD samples through QCAD as R21 (2007) and reimporting preserves both +layer boxes. Example manual check (temporary output only): + +```sh +QT_QPA_PLATFORM=offscreen /path/to/qcad/dwg2dwg -r R21 -o /tmp/layout.dwg docs/templates/midra-layout/midra-layout-1080p-2-layers.dwg +cargo run --locked -p midra-layout --example check_geometry_exchange -- verify /tmp/layout.dwg +``` + +The verifier now uses the unified byte importer for text and binary formats. +The `.ai` starter ZIP is only a download wrapper, not a new import format; its +two entries must remain byte-identical to the `.ai` fixtures (Python regression). diff --git a/docs/midra-layout/README.md b/docs/midra-layout/README.md index c0c4f21..f062eda 100644 --- a/docs/midra-layout/README.md +++ b/docs/midra-layout/README.md @@ -67,7 +67,7 @@ See [formats and crop](guide/formats-and-crop.md) and that retains the full editor project. - **Work with another application:** drop a supported geometry file into the window, use **Import → Geometry file…**, or **Project → Export → Export layers…**. The [starter-file catalog](../templates/midra-layout/README.md) - has matching Full HD and 4K files in SVG, draw.io, geometry JSON, CSV, DXF, + has matching Full HD and 4K files in SVG, draw.io, geometry JSON, CSV, DXF/DWG, HTML, PPTX, Figma FIG and Illustrator AI. It also lists format dependencies. - **Use an Eikos 4K:** connect, review layer mappings, then explicitly load or send the chosen layers. Ordinary editing does not send commands to the device. diff --git a/docs/midra-layout/changelog.md b/docs/midra-layout/changelog.md index 74ca3fa..182279c 100644 --- a/docs/midra-layout/changelog.md +++ b/docs/midra-layout/changelog.md @@ -4,6 +4,8 @@ ## Unreleased +- Replace the incomplete DXF skeleton with the official shared Craft DXF document writer/reader; add optional Craft DWG exchange with the same pixel geometry and canvas limits. Refresh CAD starter files and cover document structure, binary DXF and DWG round trips. Add a byte-preserving ZIP of the AI templates to bypass Gitea/browser PDF preview downloads. + - Place insufficient import-destination warnings directly below the destination scope selector instead of repeating them near the Import button. - Simplify geometry/clipboard import into a shared review without repeated acquisition controls. Collapse clipboard and before/after details, emphasize destination mapping, and add independent All / Selected / Folder scopes plus per-item exclusion. Preserve compatible mappings and canvas selection; regression tests cover scope filtering, atomic import and review visibility. diff --git a/docs/midra-layout/guide/canvas.md b/docs/midra-layout/guide/canvas.md index 20ffe67..3767c50 100644 --- a/docs/midra-layout/guide/canvas.md +++ b/docs/midra-layout/guide/canvas.md @@ -17,7 +17,7 @@ The title is clipped to the banner and appears only without an imported referenc image, at any output resolution. It is not exported to SVG or sent to Midra. The initial backdrop is illustrative and adapts to every output resolution/aspect ratio; importing a reference picture replaces it. -Project save/load, nine-format geometry exchange, arbitrary layer collections, +Project save/load, ten-format geometry exchange, arbitrary layer collections, single-level folders and persistent Midra screen/layer links are implemented. File export offers current/specific/selected/all/visible scopes; device transfers use All/Selected/Folder. Organization never sends commands by itself. diff --git a/docs/midra-layout/guide/files.md b/docs/midra-layout/guide/files.md index acc3901..098d472 100644 --- a/docs/midra-layout/guide/files.md +++ b/docs/midra-layout/guide/files.md @@ -4,7 +4,7 @@ ## Paste layer values and import geometry -Drop SVG, draw.io/XML, geometry JSON/CSV, DXF, HTML, PPTX, FIG or AI files into +Drop SVG, draw.io/XML, geometry JSON/CSV, DXF/DWG, HTML, PPTX, FIG or AI files into the window to open the same geometry review as **Import → Geometry file…**. Native codecs still require their normal build options/dependencies. Filename extensions are case-insensitive; PNG/JPEG/BMP drops remain reference images. @@ -120,11 +120,11 @@ viewport preferences, and all embedded reference images. Apply pending edits before saving. Opening asks before replacing current work and starts a fresh undo history. Existing files require confirmation before replacement. -The [starter-file catalog](../../templates/midra-layout/README.md) contains all nine +The [starter-file catalog](../../templates/midra-layout/README.md) contains all ten exchange formats, with two layers for 1920 × 1080 and 3840 × 2160 canvases. **Project → Export → Export layers…** opens one shared window. Choose SVG, -draw.io, JSON, CSV, DXF, HTML, PPTX, Figma FIG or Illustrator AI, then +draw.io, JSON, CSV, DXF/DWG, HTML, PPTX, Figma FIG or Illustrator AI, then **Current layer…**, **Selected layers…**, **Specific layer…**, **All layers…** and **Visible layers only…**. A current-layer export keeps its original screen position and full-screen diff --git a/docs/midra-layout/plan.md b/docs/midra-layout/plan.md index ddb3212..797b37c 100644 --- a/docs/midra-layout/plan.md +++ b/docs/midra-layout/plan.md @@ -40,10 +40,10 @@ device readback and physical-screen acceptance. - [x] Clipboard/import mapping review with per-row target/ignore, independent size/position/available-zoom toggles, draw.io stroke handling and own-copy round trips. Real draw.io clipboard sample and draw.io-exported SVG supported. -- [x] Nine-format file exchange: SVG, draw.io, geometry JSON, CSV, DXF, HTML, +- [x] Ten-format file exchange: SVG, draw.io, geometry JSON, CSV, DXF/DWG, HTML, PPTX, FIG and AI through VectorCraft. Shared geometry, scope and review, optional artwork where supported, page/frame selection and licensing build flag. - Two-layer Full HD and UHD templates exist for all nine formats. + Two-layer Full HD and UHD templates exist for all ten formats. - [x] Project JSON v10, tested legacy/recovery migration, saved layer links, central application preferences, full Settings, themes and recent-theme list. - [x] Separate Midra connection and mapping/transfer controls, saved address, diff --git a/docs/templates/midra-layout/README.md b/docs/templates/midra-layout/README.md index c4aafc4..620bc9e 100644 --- a/docs/templates/midra-layout/README.md +++ b/docs/templates/midra-layout/README.md @@ -18,11 +18,25 @@ Review the detected rectangles and their destination layers before applying. | Geometry JSON | [Download .json](midra-layout-1080p-2-layers.json) | [Download .json](midra-layout-4k-2-layers.json) | Scripts and geometry exchange | | Geometry CSV | [Download .csv](midra-layout-1080p-2-layers.csv) | [Download .csv](midra-layout-4k-2-layers.csv) | Spreadsheets and data tools | | DXF | [Download .dxf](midra-layout-1080p-2-layers.dxf) | [Download .dxf](midra-layout-4k-2-layers.dxf) | CAD tools | +| DWG | [Download .dwg](midra-layout-1080p-2-layers.dwg) | [Download .dwg](midra-layout-4k-2-layers.dwg) | CAD tools; Craft bridge | | HTML | [Download .html](midra-layout-1080p-2-layers.html) | [Download .html](midra-layout-4k-2-layers.html) | Browsers and web layouts | | PowerPoint | [Download .pptx](midra-layout-1080p-2-layers.pptx) | [Download .pptx](midra-layout-4k-2-layers.pptx) | PowerPoint, LibreOffice Impress or DeckCraft | | Figma FIG | [Download .fig](midra-layout-1080p-2-layers.fig) | [Download .fig](midra-layout-4k-2-layers.fig) | Figma or FigCraft | | Illustrator AI | [Download .ai](midra-layout-1080p-2-layers.ai) | [Download .ai](midra-layout-4k-2-layers.ai) | Illustrator or VectorCraft | +## Illustrator downloads in Gitea + +[Download both Illustrator templates as ZIP](midra-layout-ai-templates.zip), then +extract the `.ai` files. This avoids the browser's PDF viewer changing the download +extension. These AI files contain PDF-compatible artwork: Gitea detects the `%PDF` +header and serves them as `application/pdf` with an inline disposition. It does +not convert them. If you already downloaded the original bytes under a `.pdf` +name, rename the extension to `.ai`; do not print or re-export from the PDF viewer. + +The ZIP contains exact copies of the two AI samples. After updating them, rebuild +it with `python3 -m zipfile -c midra-layout-ai-templates.zip +midra-layout-1080p-2-layers.ai midra-layout-4k-2-layers.ai` from this folder. + ## Geometry files and saved projects These files exchange visible layer boxes. They do not store the complete editor @@ -41,6 +55,10 @@ CLI. See [dependencies and licensing builds](../../interfaces/midra-layout-excha Keep all formats here and link to this catalog instead of copying files or maintaining separate download lists. The [generation and verification commands](../../interfaces/midra-layout-exchange.md) rebuild both canvas sizes with the application exporter and verify their geometry. -Text and native PPTX/FIG fixtures are covered by regression tests; the AI check +Text and native PPTX/FIG/DWG fixtures are covered by regression tests; the AI check requires VectorCraft and is opt-in. The AI samples were checked with VectorCraft 0.24.1, not Adobe Illustrator. + +The DXF and DWG samples were opened and rendered with **QCAD Professional 3.28.2**. +Both formats were also saved as R21 (2007) in QCAD and reimported with unchanged +layer coordinates. DXF and DWG carry unitless pixel geometry and no pictures. diff --git a/docs/templates/midra-layout/midra-layout-1080p-2-layers.dwg b/docs/templates/midra-layout/midra-layout-1080p-2-layers.dwg new file mode 100644 index 0000000000000000000000000000000000000000..7dcb6326a07ccd3a2402a4fa8155252eb764ba12 GIT binary patch literal 19456 zcmeI433yZG*6;uC-buQfrp?~zKw1jjX-i29O42qR=#&o777Dab5PB5C)FMNvOf7@3 zTZV?=Kt(tdR1Atxz>iT81hEWiMU+82ieteeqNso)=Q|4D3ZXII`OdxP-sidZd+u{C zsllY#d$0YzzqQtXt#|JxH{WVWw8H%e=i604=kTs~-rfC2p2Gv_J+2g+rACYz6d_xmCAISRC@-LDd$p9T+|n3#Ni& zU_lTgYpz9AiX0mK7*lnUtNdzF$=D|Q0DG-97uIFmPVLRI>+342k0s%Nn*U^1&b8Wd zKOuHJp9f8+cH4bZ*Q%M}qAF6U9TFgvVm_uuFcv6@D6Xx2L<=EhKcL?D$*#C-weS;ejOTxYrm@{Nbn4oD%|`8XKC)&)xI zQ9QZ!ktGlYagG8Geh!RW@mc@LOM2XvPsS#~KvTkg$n%>@7lvLJOQ88;r(&}{e%$~beUaXBP z5MG|jpE<3$ebsjA%Gwo|4He5HcO?yRZYy1ohpGm)vzKIvEH0n(NJ*=ZaltV`#>RI6 z_8Iyt!Fd@*1$FyzOvb)?ZeK%5$|{iO4FxW>;Z{GW%aHvM3Ql0p;hOW?E4K{8N5@&& z#!fv=ehZ5#FEnnNHp@P8b?*L|%g(OU?u@&B=;i7)XYi-n{LiOy!d8@@t%%*bD{qvu z(=!Y1n^vXfc3xa(Q7)GUyi|ho8B^;gu$~*m+o%nJmPbZ2$my%*f_(+OmRprt!fqjd z8mgRNKVtX^EZ7fj0N7fHH*2mfuM`)fv4*jko#eG*+TkT@R{#4u`Yz$Sf7EVvJpW4H z_JkX+YHR!27X9$;tgu6W{PO*XZxhS^{hN!bD&?=sj&F>E`+4KH#-aP3j(q9D!FB5=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%#*5cL literal 0 HcmV?d00001 diff --git a/docs/templates/midra-layout/midra-layout-1080p-2-layers.dxf b/docs/templates/midra-layout/midra-layout-1080p-2-layers.dxf index 6437703..3b90a3c 100644 --- a/docs/templates/midra-layout/midra-layout-1080p-2-layers.dxf +++ b/docs/templates/midra-layout/midra-layout-1080p-2-layers.dxf @@ -1,134 +1,1078 @@ 999 MIDRA_LAYOUT_GEOMETRY 1 -0 + 0 SECTION -2 + 2 HEADER -9 + 9 $ACADVER -1 + 1 AC1021 -9 -$INSUNITS -70 -0 -9 + 9 +$DWGCODEPAGE + 3 +ANSI_1252 + 9 +$INSBASE + 10 +0.0 + 20 +0.0 + 30 +0.0 + 9 $EXTMIN -10 -0 -20 -0 -9 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 9 $EXTMAX -10 -1920 -20 -1080 -9 + 10 +1920.0 + 20 +1080.0 + 30 +0.0 + 9 $LIMMIN -10 -0 -20 -0 -9 + 10 +0.0 + 20 +0.0 + 9 $LIMMAX -10 -1920 -20 -1080 + 10 +1920.0 + 20 +1080.0 + 9 +$INSUNITS + 70 0 + 9 +$MEASUREMENT + 70 +1 + 9 +$HANDSEED + 5 +134 + 0 ENDSEC -0 + 0 SECTION -2 + 2 +CLASSES + 0 +CLASS + 1 +ACDBDICTIONARYWDFLT + 2 +AcDbDictionaryWithDefault + 3 +ObjectDBX Classes + 90 +0 + 91 +0 +280 +0 +281 +0 + 0 +CLASS + 1 +ACDBPLACEHOLDER + 2 +AcDbPlaceHolder + 3 +ObjectDBX Classes + 90 +0 + 91 +0 +280 +0 +281 +0 + 0 +CLASS + 1 +LAYOUT + 2 +AcDbLayout + 3 +ObjectDBX Classes + 90 +0 + 91 +0 +280 +0 +281 +0 + 0 +ENDSEC + 0 +SECTION + 2 TABLES -0 + 0 TABLE -2 -LAYER -70 -2 + 2 +VPORT + 5 +108 +330 0 -LAYER -2 -layer-2 -70 +100 +AcDbSymbolTable + 70 +1 + 0 +VPORT + 5 +115 +330 +108 +100 +AcDbSymbolTableRecord +100 +AcDbViewportTableRecord + 2 +*Active + 70 0 -62 -4 -6 -CONTINUOUS + 10 +0.0 + 20 +0.0 + 11 +1.0 + 21 +1.0 + 12 +960.0 + 22 +540.0 + 13 +0.0 + 23 +0.0 + 14 +1.0 + 24 +1.0 + 15 +10.0 + 25 +10.0 + 16 +0.0 + 26 +0.0 + 36 +1.0 + 17 +0.0 + 27 +0.0 + 37 +0.0 + 40 +1408.0 + 41 +1.5 + 42 +50.0 + 43 +0.0 + 44 +0.0 + 50 +0.0 + 51 +0.0 + 71 0 -LAYER -2 -layer-1 -70 + 72 +1000 + 73 +1 + 74 +3 + 75 0 -62 -5 -6 -CONTINUOUS + 76 0 + 77 +0 + 78 +0 +281 +0 + 65 +0 +146 +0.0 + 0 ENDTAB + 0 +TABLE + 2 +LTYPE + 5 +102 +330 0 -ENDSEC +100 +AcDbSymbolTable + 70 +3 + 0 +LTYPE + 5 +11C +330 +102 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +ByBlock + 70 0 -SECTION -2 -ENTITIES -999 -NAME Slides + 3 + + 72 +65 + 73 0 -LWPOLYLINE -8 + 40 +0.0 + 0 +LTYPE + 5 +11D +330 +102 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +ByLayer + 70 +0 + 3 + + 72 +65 + 73 +0 + 40 +0.0 + 0 +LTYPE + 5 +11E +330 +102 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +Continuous + 70 +0 + 3 +Solid line + 72 +65 + 73 +0 + 40 +0.0 + 0 +ENDTAB + 0 +TABLE + 2 +LAYER + 5 +101 +330 +0 +100 +AcDbSymbolTable + 70 +3 + 0 +LAYER + 5 +11F +330 +101 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +0 + 70 +0 + 62 +7 + 6 +Continuous +290 +1 +370 +-3 +390 +11B + 0 +LAYER + 5 +130 +330 +101 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 layer-2 -90 -4 -70 -1 -10 -120 -20 -900 -10 -760 -20 -900 -10 -760 -20 -540 -10 -120 -20 -540 -999 -NAME Presenter + 70 0 -LWPOLYLINE -8 + 62 +4 + 6 +Continuous +290 +1 +370 +-3 +390 +11B +1001 +AcAecLayerStandard +1000 + +1000 +Slides + 0 +LAYER + 5 +131 +330 +101 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 layer-1 -90 -4 -70 + 70 +0 + 62 +5 + 6 +Continuous +290 1 -10 -1160 -20 -900 -10 -1800 -20 -900 -10 -1800 -20 -540 -10 -1160 -20 -540 +370 +-3 +390 +11B +1001 +AcAecLayerStandard +1000 + +1000 +Presenter + 0 +ENDTAB + 0 +TABLE + 2 +STYLE + 5 +105 +330 0 +100 +AcDbSymbolTable + 70 +1 + 0 +STYLE + 5 +120 +330 +105 +100 +AcDbSymbolTableRecord +100 +AcDbTextStyleTableRecord + 2 +Standard + 70 +0 + 40 +0.0 + 41 +1.0 + 50 +0.0 + 71 +0 + 42 +2.5 + 3 +txt + 4 + + 0 +ENDTAB + 0 +TABLE + 2 +VIEW + 5 +107 +330 +0 +100 +AcDbSymbolTable + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +UCS + 5 +106 +330 +0 +100 +AcDbSymbolTable + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +APPID + 5 +103 +330 +0 +100 +AcDbSymbolTable + 70 +1 + 0 +APPID + 5 +116 +330 +103 +100 +AcDbSymbolTableRecord +100 +AcDbRegAppTableRecord + 2 +ACAD + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +DIMSTYLE + 5 +104 +330 +0 +100 +AcDbSymbolTable + 70 +1 +100 +AcDbDimStyleTable + 0 +DIMSTYLE +105 +117 +330 +104 +100 +AcDbSymbolTableRecord +100 +AcDbDimStyleTableRecord + 2 +Standard + 70 +0 + 0 +ENDTAB + 0 +TABLE + 2 +BLOCK_RECORD + 5 +109 +330 +0 +100 +AcDbSymbolTable + 70 +2 + 0 +BLOCK_RECORD + 5 +10D +330 +109 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*Model_Space +340 +113 + 70 +0 +280 +1 +281 +0 + 0 +BLOCK_RECORD + 5 +10E +330 +109 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*Paper_Space +340 +114 + 70 +0 +280 +1 +281 +0 + 0 +ENDTAB + 0 ENDSEC + 0 +SECTION + 2 +BLOCKS + 0 +BLOCK + 5 +10F +330 +10D +100 +AcDbEntity + 8 0 +100 +AcDbBlockBegin + 2 +*Model_Space + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*Model_Space + 1 + + 0 +ENDBLK + 5 +110 +330 +10D +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +111 +330 +10E +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +*Paper_Space + 70 +0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*Paper_Space + 1 + + 0 +ENDBLK + 5 +112 +330 +10E +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +ENDSEC + 0 +SECTION + 2 +ENTITIES + 0 +LWPOLYLINE + 5 +132 +330 +10D +100 +AcDbEntity + 8 +layer-2 +100 +AcDbPolyline + 90 +4 + 70 +1 + 43 +0.0 + 38 +0.0 + 10 +120.0 + 20 +900.0 + 10 +760.0 + 20 +900.0 + 10 +760.0 + 20 +540.0 + 10 +120.0 + 20 +540.0 + 0 +LWPOLYLINE + 5 +133 +330 +10D +100 +AcDbEntity + 8 +layer-1 +100 +AcDbPolyline + 90 +4 + 70 +1 + 43 +0.0 + 38 +0.0 + 10 +1160.0 + 20 +900.0 + 10 +1800.0 + 20 +900.0 + 10 +1800.0 + 20 +540.0 + 10 +1160.0 + 20 +540.0 + 0 +ENDSEC + 0 +SECTION + 2 +OBJECTS + 0 +DICTIONARY + 5 +10A +330 +0 +100 +AcDbDictionary +281 +1 + 3 +ACAD_GROUP +350 +10B + 3 +ACAD_LAYOUT +350 +10C + 3 +ACAD_PLOTSTYLENAME +350 +11A + 0 +DICTIONARY + 5 +10B +330 +10A +100 +AcDbDictionary +281 +1 + 0 +DICTIONARY + 5 +10C +330 +10A +100 +AcDbDictionary +281 +1 + 3 +Layout1 +350 +114 + 3 +Model +350 +113 + 0 +ACDBDICTIONARYWDFLT + 5 +11A +330 +10A +100 +AcDbDictionary +281 +1 + 3 +Normal +350 +11B +100 +AcDbDictionaryWithDefault +340 +11B + 0 +ACDBPLACEHOLDER + 5 +11B +330 +11A + 0 +LAYOUT + 5 +113 +330 +10C +100 +AcDbPlotSettings + 1 + + 2 +none_device + 4 + + 6 + + 40 +0.0 + 41 +0.0 + 42 +0.0 + 43 +0.0 + 44 +0.0 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 + 49 +0.0 +140 +0.0 +141 +0.0 +142 +1.0 +143 +1.0 + 70 +1712 + 72 +1 + 73 +0 + 74 +5 + 7 + + 75 +16 + 76 +0 + 77 +2 + 78 +300 +147 +1.0 +148 +0.0 +149 +0.0 +100 +AcDbLayout + 1 +Model + 70 +1 + 71 +0 + 10 +0.0 + 20 +0.0 + 11 +1920.0 + 21 +1080.0 + 12 +0.0 + 22 +0.0 + 32 +0.0 + 14 +0.0 + 24 +0.0 + 34 +0.0 + 15 +1920.0 + 25 +1080.0 + 35 +0.0 +146 +0.0 + 13 +0.0 + 23 +0.0 + 33 +0.0 + 16 +1.0 + 26 +0.0 + 36 +0.0 + 17 +0.0 + 27 +1.0 + 37 +0.0 + 76 +1 +330 +10D + 0 +LAYOUT + 5 +114 +330 +10C +100 +AcDbPlotSettings + 1 + + 2 +none_device + 4 + + 6 + + 40 +0.0 + 41 +0.0 + 42 +0.0 + 43 +0.0 + 44 +0.0 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 + 49 +0.0 +140 +0.0 +141 +0.0 +142 +1.0 +143 +1.0 + 70 +688 + 72 +1 + 73 +0 + 74 +5 + 7 + + 75 +16 + 76 +0 + 77 +2 + 78 +300 +147 +1.0 +148 +0.0 +149 +0.0 +100 +AcDbLayout + 1 +Layout1 + 70 +1 + 71 +1 + 10 +0.0 + 20 +0.0 + 11 +1920.0 + 21 +1080.0 + 12 +0.0 + 22 +0.0 + 32 +0.0 + 14 +0.0 + 24 +0.0 + 34 +0.0 + 15 +1920.0 + 25 +1080.0 + 35 +0.0 +146 +0.0 + 13 +0.0 + 23 +0.0 + 33 +0.0 + 16 +1.0 + 26 +0.0 + 36 +0.0 + 17 +0.0 + 27 +1.0 + 37 +0.0 + 76 +1 +330 +10E + 0 +ENDSEC + 0 EOF diff --git a/docs/templates/midra-layout/midra-layout-4k-2-layers.dwg b/docs/templates/midra-layout/midra-layout-4k-2-layers.dwg new file mode 100644 index 0000000000000000000000000000000000000000..ba4bb3b99176856afdcc561f59526081b5a25039 GIT binary patch literal 19456 zcmeI434Bv^+V6k=bCUElO`CJlg|rlU(w35zDoOXyEnOfj7D%CG=_rI9Su0x$D4dq1 zDKJn$h60K~9VjrPEQ%nC1zeEPVG&1QP>Ty9ID(E#=Z?zzgwU9G-nsX^_w%`*_ukLE zqz1E{^PKFHS zvPrCIn|;2$Ze0=Pt>o5dJCkm1d}-#f(>QpG|KRPy8>_2=Y7!?tR}6Qzj-~g^8mDIK zFRMOM>gq#;BUmiWiaEnVw~9br9kf6$2Zh7rd0;x|HQd_V3RZ`bZJ0a-Y&S**VaY6T z3@i*{Z0(J>Ng{`)AjVYP-avtk$vl|+=+)jgzzkjuHcj^!i0X2sfE znbj#J+YU^gBD38MBZC^3%v#%ZEHO9YUKP3Tn}VKTDp8)?SO+y@x%P|4>ke$irsLeT zt(}*WHa>u3&BqU_w|+1*=|&xbgs&&^KS9&fky$-!!+vIXQWYCpH|#~hd0{aQ#juT` z(k7HouX|_(gdv=(lta)wjMja0pJqj$T=`_3^8U611ykgkyBn&58u!my`x--R7}mwc zMK5eEaH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`nhb6y(fwO;F?tdZ!Km!7KapD&^fx%a@UYwgDM z3G*i$Rd2Rt9b114urw=7`0+)oY#R9KZ|}cMFxKwhuSDQZbOP)t)bW9}pn3Fw}dx!Ob!!v0FD}qZaAKDL@I``!XSIuEFj9|`s=Pu33 zTi4DDsS7IKuRe|S0#kGMsUcZEm$^+g_o&k~NLAtrgPn13d(wnTeFKMdn2NuCd`PbN=G=;Y=OtG9F(`V!BX`Z`s zUCWWad07`5R{!dXNE^rq;*&CT@|d#M%&NLm^cZ|R!#Mg08TM`S%(Ilu-?aBHzz`eN zKIu>NYBq?{>?D1c5ABXa%Yd9==cchVCe0)1*lgbGy|^471y_3YL}drFL`J?8?I z4kKq;>h>#_OWJ%6Zw)o!a~|xw_R> z{eDI1ZE7^$IaL0_9Aq?-X^=q<=vKIws2Ra|25W812__hp&6}Mf;T=FsU_3#jUruOOOb%oS zBz8Lrj+(Da6bSj9COpB7krBec#Mm6LyqE71fT=f?o+@Mp-I1?;SMuN18^Yx z4+fA93r;z{hWW$3U*uqmY`C;a8Lg$*FHH17EUauX%agS>t0F}~+Vqbp>Z zjAI2F*k?px#D(VoB0+>iVdVJ~3^ l|4{+}0)Pts@t^\]\()(?P[^\s)]+)(?P\))" r"|(?P(?:href|src)=[\"'])(?P[^\"']+)(?P[\"'])") diff --git a/tests/test_midra_templates.py b/tests/test_midra_templates.py new file mode 100644 index 0000000..3bff743 --- /dev/null +++ b/tests/test_midra_templates.py @@ -0,0 +1,19 @@ +"""Download wrappers must preserve the native starter files byte for byte.""" +import pathlib +import unittest +import zipfile + +ROOT = pathlib.Path(__file__).resolve().parents[1] / "docs/templates/midra-layout" + + +class MidraTemplateDownloads(unittest.TestCase): + def test_ai_download_archive_preserves_names_and_original_bytes(self): + names = {"midra-layout-1080p-2-layers.ai", "midra-layout-4k-2-layers.ai"} + with zipfile.ZipFile(ROOT / "midra-layout-ai-templates.zip") as archive: + self.assertEqual(set(archive.namelist()), names) + for name in names: + self.assertEqual(archive.read(name), (ROOT / name).read_bytes()) + + +if __name__ == "__main__": + unittest.main()