diff --git a/Cargo.lock b/Cargo.lock index 90edec928..f5fe8e2e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,7 +88,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "acadrust" version = "0.5.5" -source = "git+https://github.com/ramox81/cadcodec.git?rev=d290dbe#d290dbe1712666d83dfd0fc63341ee3246f8de76" +source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=d290dbe#d290dbe1712666d83dfd0fc63341ee3246f8de76" dependencies = [ "ahash 0.8.12", "anyhow", @@ -924,7 +924,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cadkernel" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=6eae7c9#6eae7c97fb29a21a818164af7c009f93e3ffe5b8" +source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=4134ae3#4134ae386153a76998c2fbf03e81a5c4a23928cc" dependencies = [ "acadrust", "cavalier_contours", @@ -935,7 +935,7 @@ dependencies = [ [[package]] name = "cadkernel-constraints" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=6eae7c9#6eae7c97fb29a21a818164af7c009f93e3ffe5b8" +source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=4134ae3#4134ae386153a76998c2fbf03e81a5c4a23928cc" dependencies = [ "nalgebra", ] diff --git a/Cargo.toml b/Cargo.toml index 3a6a349ef..a58daffc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,9 +33,9 @@ rfd = "0.17" clap = { version = "4", features = ["derive", "string"] } env_logger = "0.11" log = "0.4" -acadrust = { git = "https://github.com/ramox81/cadcodec.git", rev = "d290dbe", features = ["serde"] } -cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "6eae7c9", features = ["acis", "offset"] } -cadkernel-constraints = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "6eae7c9" } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", features = ["serde"] } +cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "4134ae3", features = ["acis", "offset"] } +cadkernel-constraints = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "4134ae3" } dwg-thumbnailer = { path = "crates/dwg-thumbnailer" } flate2 = "1" image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] } @@ -81,9 +81,6 @@ objc2-app-kit = { version = "0.2", features = ["NSApplication", "NSResponder", " block2 = "0.5" objc2-foundation = { version = "0.2", features = ["NSArray", "NSURL", "NSString", "NSObject", "NSNotification", "NSThread", "NSEnumerator"] } -[patch."https://github.com/HakanSeven12/cadcodec.git"] -acadrust = { git = "https://github.com/ramox81/cadcodec.git", rev = "d290dbe" } - [patch.crates-io] iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } iced_widget = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } diff --git a/crates/ocs_plugin_api/Cargo.toml b/crates/ocs_plugin_api/Cargo.toml index 659a36381..c459fb630 100644 --- a/crates/ocs_plugin_api/Cargo.toml +++ b/crates/ocs_plugin_api/Cargo.toml @@ -15,7 +15,7 @@ serde_json = { version = "1", optional = true } # Pulled in only by the `host` feature, which adds the `acadrust`-typed # `HostApi` runtime surface. The default crate stays dependency-free so engine # crates and external tooling can depend on the manifest/ribbon contract cheaply. -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "dd1d7bf", optional = true, features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", optional = true, features = ["serde"] } # Runtime IPC and serialization (host feature only). interprocess = { version = "2", optional = true } @@ -39,7 +39,7 @@ serde_json = "1" serde = { version = "1", features = ["derive"] } cargo-lock = "11" # acadrust is scanned at build time to generate the embedded type registry. -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "dd1d7bf", features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", features = ["serde"] } [dev-dependencies] serde_json = "1" diff --git a/crates/ocs_web_worker/Cargo.toml b/crates/ocs_web_worker/Cargo.toml index 225783fd6..345f12ba3 100644 --- a/crates/ocs_web_worker/Cargo.toml +++ b/crates/ocs_web_worker/Cargo.toml @@ -8,7 +8,7 @@ publish = false crate-type = ["cdylib"] [dependencies] -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "dd1d7bf", features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", features = ["serde"] } bincode = "1.3" serde = { version = "1", features = ["derive"] } console_error_panic_hook = "0.1" diff --git a/docs/cadcodec-reader-gaps.md b/docs/cadcodec-reader-gaps.md index d726b6c45..27795f840 100644 --- a/docs/cadcodec-reader-gaps.md +++ b/docs/cadcodec-reader-gaps.md @@ -7,8 +7,8 @@ reloading it, and comparing entity fields. **Status (23 September 2026):** the fixes landed in cadcodec as [#48](https://github.com/HakanSeven12/cadcodec/pull/48) (issues 1-6) and [#51](https://github.com/HakanSeven12/cadcodec/pull/51) (the first three style findings), and -the block description with commit `dd1d7bf` (cadcodec issue #49). OCS pins `dd1d7bf`, and the -canaries below were flipped against it. What is still open: +the block description with commit `dd1d7bf` (cadcodec issue #49). OCS pins `d290dbe`, which +includes it; the canaries below were flipped against `dd1d7bf`. What is still open: - **ATTDEF `lock_position`** (issue 1): the reader is complete, but the DXF writer emits no group 280 at all, neither the version byte nor the lock flag the reader expects after it. diff --git a/locales/ar-SA/opencadstudio.ftl b/locales/ar-SA/opencadstudio.ftl index 312518f40..b5b52b214 100644 --- a/locales/ar-SA/opencadstudio.ftl +++ b/locales/ar-SA/opencadstudio.ftl @@ -3520,7 +3520,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE حدد نقطة الإدراج: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3529,8 +3529,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/bg-BG/opencadstudio.ftl b/locales/bg-BG/opencadstudio.ftl index 832aa0ce4..9e160c284 100644 --- a/locales/bg-BG/opencadstudio.ftl +++ b/locales/bg-BG/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Посочи точка на вмъкване: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/cs-CZ/opencadstudio.ftl b/locales/cs-CZ/opencadstudio.ftl index 4cfd79f75..cb2dbd5fd 100644 --- a/locales/cs-CZ/opencadstudio.ftl +++ b/locales/cs-CZ/opencadstudio.ftl @@ -3505,7 +3505,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Zadejte bod vložení: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3514,8 +3514,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/de-DE/opencadstudio.ftl b/locales/de-DE/opencadstudio.ftl index 98e83b493..0b5726b07 100644 --- a/locales/de-DE/opencadstudio.ftl +++ b/locales/de-DE/opencadstudio.ftl @@ -3508,7 +3508,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Einführstelle angeben: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3517,8 +3517,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/el-GR/opencadstudio.ftl b/locales/el-GR/opencadstudio.ftl index 8eee59b7f..93238ee8b 100644 --- a/locales/el-GR/opencadstudio.ftl +++ b/locales/el-GR/opencadstudio.ftl @@ -3508,7 +3508,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Ορίστε σημείο εισαγωγής: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3517,8 +3517,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/en-US/opencadstudio.ftl b/locales/en-US/opencadstudio.ftl index 2e6aa003e..a1da84051 100644 --- a/locales/en-US/opencadstudio.ftl +++ b/locales/en-US/opencadstudio.ftl @@ -3509,7 +3509,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Specify insertion point: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3518,8 +3518,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/es-ES/opencadstudio.ftl b/locales/es-ES/opencadstudio.ftl index b4c92c381..47df32a13 100644 --- a/locales/es-ES/opencadstudio.ftl +++ b/locales/es-ES/opencadstudio.ftl @@ -3508,7 +3508,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Especifique el punto de inserción: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3517,8 +3517,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/fi-FI/opencadstudio.ftl b/locales/fi-FI/opencadstudio.ftl index b6cc0684a..b663e3526 100644 --- a/locales/fi-FI/opencadstudio.ftl +++ b/locales/fi-FI/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Määritä lisäyskohta: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/fr-FR/opencadstudio.ftl b/locales/fr-FR/opencadstudio.ftl index fe50226f2..0fceb5ba8 100644 --- a/locales/fr-FR/opencadstudio.ftl +++ b/locales/fr-FR/opencadstudio.ftl @@ -3508,7 +3508,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Spécifier le point d'insertion: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3517,8 +3517,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/hi-IN/opencadstudio.ftl b/locales/hi-IN/opencadstudio.ftl index c00f06967..8db40abbe 100644 --- a/locales/hi-IN/opencadstudio.ftl +++ b/locales/hi-IN/opencadstudio.ftl @@ -3496,7 +3496,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE निर्दिष्ट सम्मिलन बिंदु: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3505,8 +3505,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/hu-HU/opencadstudio.ftl b/locales/hu-HU/opencadstudio.ftl index 98256df07..7bb2fd143 100644 --- a/locales/hu-HU/opencadstudio.ftl +++ b/locales/hu-HU/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Beszúrási pont megadása: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/it-IT/opencadstudio.ftl b/locales/it-IT/opencadstudio.ftl index da90ce995..41a09aa50 100644 --- a/locales/it-IT/opencadstudio.ftl +++ b/locales/it-IT/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Specificare il punto di inserimento: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/ja-JP/opencadstudio.ftl b/locales/ja-JP/opencadstudio.ftl index 2d8ec2c74..87b0c88e9 100644 --- a/locales/ja-JP/opencadstudio.ftl +++ b/locales/ja-JP/opencadstudio.ftl @@ -3498,7 +3498,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE 挿入点を指定: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3507,8 +3507,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/ko-KR/opencadstudio.ftl b/locales/ko-KR/opencadstudio.ftl index 8568b0114..f60cc8de8 100644 --- a/locales/ko-KR/opencadstudio.ftl +++ b/locales/ko-KR/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE 삽입점 지정: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/nl-NL/opencadstudio.ftl b/locales/nl-NL/opencadstudio.ftl index 6498fcc23..a9e461925 100644 --- a/locales/nl-NL/opencadstudio.ftl +++ b/locales/nl-NL/opencadstudio.ftl @@ -3506,7 +3506,7 @@ annotate = .dimradius-select-arc-circle-or-polyline-arc = DIMRADIUS Selecteer een boog, cirkel of polylijnboog: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3515,8 +3515,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/pl-PL/opencadstudio.ftl b/locales/pl-PL/opencadstudio.ftl index 95f8e9c0d..05151e318 100644 --- a/locales/pl-PL/opencadstudio.ftl +++ b/locales/pl-PL/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Określ punkt wstawienia: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/pt-BR/opencadstudio.ftl b/locales/pt-BR/opencadstudio.ftl index 91e263736..a05c43150 100644 --- a/locales/pt-BR/opencadstudio.ftl +++ b/locales/pt-BR/opencadstudio.ftl @@ -3508,7 +3508,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Especifique o ponto de inserção: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3517,8 +3517,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/ru-RU/opencadstudio.ftl b/locales/ru-RU/opencadstudio.ftl index da9efe90f..fcc5dc966 100644 --- a/locales/ru-RU/opencadstudio.ftl +++ b/locales/ru-RU/opencadstudio.ftl @@ -3509,7 +3509,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE Укажите точку вставки: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3518,8 +3518,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/zh-CN/opencadstudio.ftl b/locales/zh-CN/opencadstudio.ftl index 0c53bba49..0af91b489 100644 --- a/locales/zh-CN/opencadstudio.ftl +++ b/locales/zh-CN/opencadstudio.ftl @@ -3495,7 +3495,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE 指定插入点: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3504,8 +3504,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/locales/zh-TW/opencadstudio.ftl b/locales/zh-TW/opencadstudio.ftl index b7d9309a9..ecb6dca35 100644 --- a/locales/zh-TW/opencadstudio.ftl +++ b/locales/zh-TW/opencadstudio.ftl @@ -3507,7 +3507,7 @@ annotate = .tolerance-specify-insertion-point = TOLERANCE 指定插入點: insert = - .pdfui-pdf-scale = PDF scale: {scale}:1 + .pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1 .pdfui-specify-insertion-point = Specify insertion point: .pdfui-no-pdf-underlays = No PDF underlays found. .pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects. @@ -3516,8 +3516,8 @@ insert = .pdfui-rotation = Rotation: .pdfui-scale = Scale: .pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen - .pdfui-page-size-size = Page size: {size} - .pdfui-total-count = Total: {count} + .pdfui-page-size-size = Page size: __ocs_fmt_0__ + .pdfui-total-count = Total: __ocs_fmt_0__ .pdfui-page = Page: .pdfui-page-to-import = Page to import .pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes diff --git a/plugins/opencad-python/Cargo.lock b/plugins/opencad-python/Cargo.lock index 92f48daa7..7e293c5c1 100644 --- a/plugins/opencad-python/Cargo.lock +++ b/plugins/opencad-python/Cargo.lock @@ -5,7 +5,7 @@ version = 4 [[package]] name = "acadrust" version = "0.5.5" -source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=dd1d7bf#dd1d7bfe03f4e733d351c0396e2cf82ae9df957d" +source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=d290dbe#d290dbe1712666d83dfd0fc63341ee3246f8de76" dependencies = [ "ahash 0.8.12", "anyhow", diff --git a/src/app/update/mod.rs b/src/app/update/mod.rs index bd1cf204f..a2e027a17 100644 --- a/src/app/update/mod.rs +++ b/src/app/update/mod.rs @@ -137,6 +137,8 @@ impl OpenCADStudio { // Options opened from a PDF dialog returns to it. if self.active_modal == Some(Options) { if let Some(parent) = self.options_parent.take() { + self.options_saved = None; + self.options_close_confirm = false; self.active_modal = Some(parent); return; } @@ -1326,9 +1328,7 @@ impl OpenCADStudio { ), Message::PdfAttachPickResult(Ok((path, bytes))) => { - let i = self.active_tab; let path_str = path.to_string_lossy().into_owned(); - let _ = i; crate::scene::model::pdf_raster::register_source(&path_str, bytes); // Pages, placement and path type are chosen in the Attach // dialog; the definition is created with the underlay. @@ -1355,9 +1355,7 @@ impl OpenCADStudio { Message::PdfImportPickResult, ), Message::PdfImportPickResult(Ok((path, bytes))) => { - let i = self.active_tab; let path_str = path.to_string_lossy().into_owned(); - let _ = i; crate::scene::model::pdf_raster::register_source(&path_str, bytes); self.open_pdf_import_file(&path_str); Task::none() diff --git a/src/command.rs b/src/command.rs index 276d74313..1d2cfbf4a 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1556,13 +1556,13 @@ pub enum CmdResult { BatchCopy(Vec, Vec), /// Erase `handle` and replace with new entities; command stays active. ReplaceEntity(Handle, Vec), - /// Attach PDF pages: each page's underlay with its file (as stored) and - /// page; the host creates or reuses the definitions and commits them all - /// in one undo step, then ends the command. /// Open the PDF Import Settings dialog; the command keeps its prompt. OpenPdfImportSettings, /// Import a page of a file (PDFIMPORT File); ends the command. PdfImportFile(crate::modules::insert::pdf_import::PdfFileImport), + /// Attach PDF pages: each page's underlay with its file (as stored) and + /// page; the host creates or reuses the definitions and commits them all + /// in one undo step, then ends the command. AttachPdfPages { path: String, pages: Vec<(String, EntityType)>, diff --git a/src/modules/insert/pdf_attach.rs b/src/modules/insert/pdf_attach.rs index 8a2d7c02b..337327d48 100644 --- a/src/modules/insert/pdf_attach.rs +++ b/src/modules/insert/pdf_attach.rs @@ -329,15 +329,12 @@ impl PdfAttachCommand { } } - fn frame_at(&self, pt: DVec3) -> Vec<[f32; 3]> { + fn frame_at(&self, pt: DVec3) -> Vec<[f64; 3]> { let (w, h) = (self.page_size.0 * self.scale, self.page_size.1 * self.scale); let x = self.plane.vector_to_world(DVec3::new(w, 0.0, 0.0)); let y = self.plane.vector_to_world(DVec3::new(0.0, h, 0.0)); let corners = [pt, pt + x, pt + x + y, pt + y, pt]; - corners - .iter() - .map(|p| [p.x as f32, p.y as f32, p.z as f32]) - .collect() + corners.iter().map(|p| p.to_array()).collect() } } @@ -434,7 +431,7 @@ impl CadCommand for PdfAttachCommand { if self.step != Step::Insertion || self.page_size.0 <= 0.0 { return None; } - Some(WireModel::solid( + Some(WireModel::solid_f64( "pdf_attach_frame".into(), self.frame_at(pt), WireModel::CYAN, diff --git a/src/modules/insert/pdf_clip.rs b/src/modules/insert/pdf_clip.rs index 1d21ed186..e22669521 100644 --- a/src/modules/insert/pdf_clip.rs +++ b/src/modules/insert/pdf_clip.rs @@ -336,9 +336,9 @@ impl CadCommand for PdfClipCommand { } _ => return None, }; - let mut points: Vec<[f32; 3]> = ring.iter().map(|p| [p.x as f32, p.y as f32, p.z as f32]).collect(); + let mut points: Vec<[f64; 3]> = ring.iter().map(|p| p.to_array()).collect(); points.push(points[0]); - Some(WireModel::solid("pdf_clip_boundary".into(), points, WireModel::CYAN, false)) + Some(WireModel::solid_f64("pdf_clip_boundary".into(), points, WireModel::CYAN, false)) } } diff --git a/src/modules/insert/pdf_import.rs b/src/modules/insert/pdf_import.rs index 138579f0a..c43afb4b1 100644 --- a/src/modules/insert/pdf_import.rs +++ b/src/modules/insert/pdf_import.rs @@ -414,10 +414,9 @@ impl CadCommand for PdfImportCommand { } _ => return None, }; - let mut points: Vec<[f32; 3]> = - ring.iter().map(|p| [p.x as f32, p.y as f32, p.z as f32]).collect(); + let mut points: Vec<[f64; 3]> = ring.iter().map(|p| p.to_array()).collect(); points.push(points[0]); - Some(WireModel::solid("pdf_import_area".into(), points, WireModel::CYAN, false)) + Some(WireModel::solid_f64("pdf_import_area".into(), points, WireModel::CYAN, false)) } } diff --git a/src/scene/entity.rs b/src/scene/entity.rs index bf44295ce..eff268fa0 100644 --- a/src/scene/entity.rs +++ b/src/scene/entity.rs @@ -343,28 +343,7 @@ impl Scene { None }; - // Auto-create an ImageDefinition object for new RasterImage entities - // that don't already reference one. - if let EntityType::RasterImage(ref mut img) = entity { - if img.definition_handle.is_none() { - use acadrust::objects::{ImageDefinition, ObjectType}; - let def_handle = Handle::new(self.document.next_handle()); - if self.is_recording_undo() { - self.record_undo_object_before(def_handle, None); - } - let mut img_def = ImageDefinition::with_dimensions( - &img.file_path, - img.size.x as u32, - img.size.y as u32, - ); - img_def.handle = def_handle; - img_def.is_loaded = true; - self.document - .objects - .insert(def_handle, ObjectType::ImageDefinition(img_def)); - img.definition_handle = Some(def_handle); - } - } + self.ensure_image_definition(&mut entity); // Register the entity's layer if it names one no LAYER command created // (e.g. a plugin-supplied layer) so it survives a DWG save instead of @@ -1069,6 +1048,30 @@ impl Scene { /// caller starts an interactive insert so paste-as-block can prompt for the /// drop point. The geometry comes from the clipboard rather than live /// entities, so there is nothing to stage or erase. (#129) + /// Give a new RasterImage the ImageDefinition object it must reference, + /// unless it already names one. + fn ensure_image_definition(&mut self, entity: &mut EntityType) { + let EntityType::RasterImage(img) = entity else { + return; + }; + if img.definition_handle.is_some() { + return; + } + use acadrust::objects::{ImageDefinition, ObjectType}; + let def_handle = Handle::new(self.document.next_handle()); + if self.is_recording_undo() { + self.record_undo_object_before(def_handle, None); + } + let mut img_def = + ImageDefinition::with_dimensions(&img.file_path, img.size.x as u32, img.size.y as u32); + img_def.handle = def_handle; + img_def.is_loaded = true; + self.document + .objects + .insert(def_handle, ObjectType::ImageDefinition(img_def)); + img.definition_handle = Some(def_handle); + } + pub fn define_block_from_owned_entities( &mut self, entities: Vec, @@ -1125,6 +1128,7 @@ impl Scene { Self::reset_clone_subhandles(&mut self.document, &mut entity); entity.common_mut().handle = Handle::NULL; entity.common_mut().owner_handle = br_handle; + self.ensure_image_definition(&mut entity); let handle = self .document .add_entity(entity) diff --git a/src/scene/mod.rs b/src/scene/mod.rs index b18d0f998..cd2da312a 100644 --- a/src/scene/mod.rs +++ b/src/scene/mod.rs @@ -1268,21 +1268,15 @@ fn build_derived_caches_impl( EntityType::Ole2Frame(ole) => ImageModel::from_ole2frame(ole).map(|m| (handle, m)), EntityType::Underlay(u) => match doc.objects.get(&u.definition_handle) { Some(acadrust::objects::ObjectType::UnderlayDefinition(def)) => { - { // Paper-space underlays adjust to the white sheet. - let model = doc.objects.values().find_map(|object| match object { - acadrust::objects::ObjectType::Layout(l) if l.name == "Model" => Some(l.block_record), - _ => None, - }); let owner = u.common.owner_handle; - let background = if owner.is_null() || model.is_none_or(|m| m == owner) { + let background = if owner.is_null() || owner == model_block { LOAD_BG } else { [1.0, 1.0, 1.0, 1.0] }; ImageModel::from_underlay(u, def, background).map(|m| (handle, m)) } - } _ => None, }, _ => None, diff --git a/src/ui/window/pdf_dialogs.rs b/src/ui/window/pdf_dialogs.rs index 3e73ce7dd..f046b11fa 100644 --- a/src/ui/window/pdf_dialogs.rs +++ b/src/ui/window/pdf_dialogs.rs @@ -4,8 +4,8 @@ use std::fmt; use iced::widget::{ - button, column, combo_box, container, image, pick_list, radio, row, scrollable, text, - text_input, Space, + button, column, combo_box, container, image, pick_list, row, scrollable, text, text_input, + Space, }; use iced::{Background, Border, Element, Fill, Length, Theme}; @@ -14,7 +14,7 @@ use crate::io::xref_model::Pathtype; use crate::modules::insert::pdf_import::{ImportLayers, PdfImportSettings}; use crate::t; use crate::ui::style::common::muted_style; -use crate::ui::style::form::{button_style, field_style}; +use crate::ui::style::form::{button_style, dialog_button, field_style, form_radio}; use crate::ui::window::block_definition::{group, labeled_checkbox}; /// One edit in any of the PDF dialogs. @@ -260,18 +260,9 @@ fn read_only<'a>(label: String, value: &'a str, label_width: f32) -> Element<'a, fn footer<'a>(ok: PdfDialogMsg, help: &'static str) -> iced::widget::Row<'a, Message> { row![ Space::new().width(Fill), - button(text(t!("OK")).size(11)) - .on_press(msg(ok)) - .style(button_style(true)) - .padding([4, 16]), - button(text(t!("Cancel")).size(11)) - .on_press(Message::CloseModal) - .style(button_style(false)) - .padding([4, 12]), - button(text(t!("Help")).size(11)) - .on_press(msg(PdfDialogMsg::Help(help))) - .style(button_style(false)) - .padding([4, 12]), + dialog_button(t!("OK"), msg(ok), true), + dialog_button(t!("Cancel"), Message::CloseModal, false), + dialog_button(t!("Help"), msg(PdfDialogMsg::Help(help)), false), ] .spacing(6) .align_y(iced::Center) @@ -513,10 +504,11 @@ pub fn view_attach<'a>( } else { t!("Show Details") }; - let footer = row![button(text(details_label).size(11)) - .on_press(msg(PdfDialogMsg::AttachDetails(!state.details))) - .style(button_style(false)) - .padding([4, 12])] + let footer = row![dialog_button( + details_label, + msg(PdfDialogMsg::AttachDetails(!state.details)), + false + )] .push(footer(PdfDialogMsg::AttachOk, "attach")) .align_y(iced::Center); @@ -582,13 +574,10 @@ pub fn view_layers<'a>( .filter(|name| needle.is_empty() || name.to_lowercase().contains(&needle)) .map(|name| { let on = !t.hidden.contains(name); - let bulb = button(text("●").size(12).style(move |theme: &Theme| text::Style { - color: Some(if on { - theme.palette().warning.base.color - } else { - theme.palette().background.strong.color - }), - })) + let bulb = button(crate::ui::icons::semantic( + crate::ui::icons::layer_visible(on), + 14.0, + )) .on_press(msg(PdfDialogMsg::LayersToggle(name.clone()))) .padding([0, 4]) .style(|_: &Theme, _| button::Style::default()); @@ -649,9 +638,7 @@ fn settings_groups<'a>(s: &'a PdfImportSettings) -> (Element<'a, Message>, Eleme Length::Fill, ); let layer_radio = |label: std::borrow::Cow<'static, str>, value: ImportLayers| { - radio(label, value, Some(s.layers), |v| msg(PdfDialogMsg::Layers(v))) - .size(14) - .text_size(11) + form_radio(label, value, Some(s.layers), |v| msg(PdfDialogMsg::Layers(v))) }; let layers = group( t!("Layers").into_owned(), @@ -827,11 +814,8 @@ pub fn view_import_file<'a>( .width(Length::FillPortion(1)); let body = row![container(page_group).width(Length::FillPortion(1)), right].spacing(8); - let footer = row![button(text(t!("Options...")).size(11)) - .on_press(msg(PdfDialogMsg::Options)) - .style(button_style(false)) - .padding([4, 12])] - .push(footer(PdfDialogMsg::ImportOk, "import")) + let footer = row![dialog_button(t!("Options..."), msg(PdfDialogMsg::Options), false)] + .push(footer(PdfDialogMsg::ImportOk, "import")) .align_y(iced::Center); column![file_row, body, footer]