From 9e3f8dccec3621c70d1cddb44f2bb1e6d0ade57d Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 1 Nov 2026 01:56:23 +0700 Subject: [PATCH] Fix #4950: Path Precision Tools: Divide into Dashes addon.pathtools.divideDashes cuts the selected paths (or only their direct-selected segments) into separate open paths of a dash length measured along the curve, with an optional gap (gap pieces dropped unless removeGaps is false) and Fit to Corners and Ends; pieces keep the path's appearance, one undo step, at most 100000 pieces. Geometry in vectorcraft-pathops; dialog with unit fields and Preview; tests, sweep cases, catalog rows and docs. --- ROADMAP.md | 4 +- crates/engine/src/cmd/addons/pathtools.rs | 90 ++++++- .../engine/src/cmd/addons/pathtools/tests.rs | 74 +++++ crates/engine/tests/command_sweep.rs | 3 + crates/pathops/src/addons/pathtools.rs | 5 +- crates/pathops/src/addons/pathtools/dashes.rs | 252 ++++++++++++++++++ crates/ui-egui/src/addons/pathtools.rs | 12 +- crates/ui-egui/src/addons/pathtools/dashes.rs | 91 +++++++ crates/ui-egui/src/dialogs.rs | 1 + crates/ui-egui/src/i18n/bg.tsv | 9 + crates/ui-egui/src/i18n/bs.tsv | 9 + crates/ui-egui/src/i18n/ca.tsv | 9 + crates/ui-egui/src/i18n/cs.tsv | 9 + crates/ui-egui/src/i18n/da.tsv | 9 + crates/ui-egui/src/i18n/de.tsv | 9 + crates/ui-egui/src/i18n/el.tsv | 9 + crates/ui-egui/src/i18n/es.tsv | 9 + crates/ui-egui/src/i18n/fi.tsv | 9 + crates/ui-egui/src/i18n/fr.tsv | 9 + crates/ui-egui/src/i18n/hu.tsv | 9 + crates/ui-egui/src/i18n/id.tsv | 9 + crates/ui-egui/src/i18n/it.tsv | 9 + crates/ui-egui/src/i18n/ja.tsv | 9 + crates/ui-egui/src/i18n/ka.tsv | 9 + crates/ui-egui/src/i18n/ko.tsv | 9 + crates/ui-egui/src/i18n/nl.tsv | 9 + crates/ui-egui/src/i18n/pl.tsv | 9 + crates/ui-egui/src/i18n/pt-br.tsv | 9 + crates/ui-egui/src/i18n/ru.tsv | 9 + crates/ui-egui/src/i18n/sv.tsv | 9 + crates/ui-egui/src/i18n/tr.tsv | 9 + crates/ui-egui/src/i18n/uk.tsv | 9 + crates/ui-egui/src/i18n/vi.tsv | 9 + crates/ui-egui/src/i18n/zh-hans.tsv | 9 + crates/ui-egui/src/i18n/zh-hant.tsv | 9 + crates/ui-egui/src/menus/invoke.rs | 1 + docs/mcp.md | 10 + docs/target-app-parity.md | 7 +- docs/ui-parity.md | 4 +- 39 files changed, 770 insertions(+), 18 deletions(-) create mode 100644 crates/pathops/src/addons/pathtools/dashes.rs create mode 100644 crates/ui-egui/src/addons/pathtools/dashes.rs diff --git a/ROADMAP.md b/ROADMAP.md index c943bbb02..b8365d0f0 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -9,7 +9,7 @@ **Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Progress log row for Group Overlapping Objects in the Arrange Tools add-on; headline numbers unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Progress log row for Divide into Dashes in the Path Precision Tools add-on; headline numbers unchanged) · **Target:** Adobe Illustrator 2026 (30.x) VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adobe Illustrator workflow. It runs on macOS, Windows, Linux, FreeBSD and the web (WASM), and agents can drive all of it over MCP, the CLI and a JSON @@ -129,6 +129,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap ## Progress log +- 2026-11-01: Divide into Dashes joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the selected paths, or only their direct-selected segments, are cut into separate open paths of a dash length measured along the curve, with an optional gap (left empty, or kept as pieces), each keeping the path's appearance; Fit to Corners and Ends stretches or squeezes the lengths so every run starts and ends on a dash. A dialog with Preview, one undo step, at most 100000 pieces. A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Group Overlapping Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects whose visual bounds overlap or touch, chains included, go into one group each, within their own layer or group, at the stacking place of their frontmost member; objects that overlap nothing stay as they are. One undo step, a sweep along x so thousands of loose pieces group quickly (at most 20000 objects). A VectorCraft addition: headline numbers unchanged. - 2026-10-31: Export for Screens works as the reference app's dialog: Artboards and Assets tabs with a grid or list of thumbnails, Clear Selection and Prefix, Create Sub-folders by Scale or Format (on by default), Export PDFs As Single File (the chosen artboards as one PDF's pages, `pdfs: "single"`) or Multiple Files, iOS and Android rows, format presets in a ☰ menu, and a count of the files the export writes (#4895). About 55 community PRs and fixes landed the same day: Find Font, Replace Font, Outline Stroke and Expand leave hidden and locked art alone (with a warning); DXF export writes LINE and ELLIPSE entities and outlines only the strokes a CAD line can't draw; Blob Brush Angle and Roundness; Shift-constrained Perspective Selection; Grid Repeat Options Preview; a gradient mesh from a file budgeted at about a million quads; width-profile strokes keep their shape zoomed out; `.ai`/EPS import fidelity (area type, envelopes, transparency in dictionaries, character styles); PDF import finds hyphenated and CMap-suffixed font names; Windows renders follow the process's core affinity; Enter or Escape in a floating panel's field no longer reaches the canvas (#4803); Properties shows Blend Options for any selected blend (#4817); Artwork Cleanup finds doubled type (#4835) and joins stacked lines into one object (Join Point Text, #4826). Headline numbers unchanged. - 2026-10-31: Arrange Tools, a built-in add-on (Object › Plug-ins › Arrange Tools): Arrange in Grid lays the selected objects out in rows and columns, a row or a column with gaps, from the selection's top-left or centred on the artboard; Swap Objects swaps two objects' places (and, with Swap Objects and Sizes, their sizes); Replace with Top Object puts a copy of the topmost selected object in place of each of the others, kept, stretched or fitted in proportion; Set Size of Each gives every selected object an exact width and/or height about a reference point; Zoom to Selection fits the view to the selection. Each is one undo step with a previewed dialog where it has options. A VectorCraft addition: headline numbers unchanged. @@ -205,6 +206,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap | Date | Change | Summary | |---|---|---| +| 2026-11-01 | minor | Progress log row for Divide into Dashes (Path Precision Tools add-on, #4950); headline numbers unchanged. | | 2026-11-01 | minor | Progress log row for Group Overlapping Objects (Arrange Tools add-on, #4928); headline numbers unchanged. | | 2026-10-31 | minor | Progress log row for Export for Screens laid out as the reference app's (#4895) and the 2026-10-31 community landings; headline numbers unchanged. | | 2026-10-31 | minor | Progress log row for the Arrange Tools add-on; headline numbers unchanged. | diff --git a/crates/engine/src/cmd/addons/pathtools.rs b/crates/engine/src/cmd/addons/pathtools.rs index b78eb0976..94114a59c 100644 --- a/crates/engine/src/cmd/addons/pathtools.rs +++ b/crates/engine/src/cmd/addons/pathtools.rs @@ -1,8 +1,8 @@ //! Path Precision Tools (`addon.pathtools.*`), a built-in add-on: the Anchor Eraser Brush's stroke, //! the Extend Path tool's extension, the Measure & Inspect tool's readouts, the Anchor Inspector's //! anchor edits, Split / Add Points at Crossings, Slide Anchor Along Path, the Corner Tool's corners -//! ([`corners`]), the Parametric Shape Tool's shapes ([`shape`]), and the Shared Edge Merge Tool's -//! merges with Keep Shared Points Together ([`shared_edge`]). +//! ([`corners`]), the Parametric Shape Tool's shapes ([`shape`]), the Shared Edge Merge Tool's +//! merges with Keep Shared Points Together ([`shared_edge`]), and Divide into Dashes. //! Its tools, panels and submenu (Object › Plug-ins › Path Precision Tools) are the tools crate's //! and the UI's. @@ -40,6 +40,8 @@ const MIN_RADIUS: f64 = 0.05; const MAX_DIAMETER: f64 = 2500.0; /// The farthest an end is extended at once (pt). const MAX_EXTEND: f64 = 1e6; +/// Most pieces Divide into Dashes makes at once. +const MAX_PIECES: usize = 100_000; /// Most anchors Add Points puts on each segment. const MAX_ADD: u64 = pt::MAX_ADDED_PER_SEGMENT as u64; @@ -153,6 +155,15 @@ pub fn specs() -> Vec { has_doc, slide_anchor ), + cmd!( + "addon.pathtools.divideDashes", + "Divide into Dashes", + ["Object", "Plug-ins", "Path Precision Tools"], + None, + "{dash?: pt 0.01..1000000 (10), gap?: pt 0..1000000 (0: the pieces touch), fit?: bool (false: exact lengths, the last piece of each run what is left; true: fit to corners and ends, every run between corners and ends holding whole dashes, all stretched or squeezed alike so it starts and ends on a dash), removeGaps?: bool (true: the gaps are left empty; false: they stay as pieces too)} cut the selected paths into separate open paths along the curve, each dash long with gap between them and keeping the path's appearance, as one undo step. Only the direct-selected segments (or those between two direct-selected anchors) are divided when there are any, the dash pattern running on across segments that follow one another; the rest of such a path stays, as pieces of its own. The pieces are selected; at most 100000 → {ids, dashes}", + has_selection, + divide_dashes + ), ]; v.extend(shape::specs()); v.extend(corners::specs()); @@ -583,6 +594,16 @@ fn remove_keep_shape(s: &mut Session, _: &Value) -> Result { Ok(json!({ "removed": removed })) } +/// The segments of subpath `si` (`sp`) picked: the direct-selected segments `segments` of its +/// path, else those between two of its selected `anchors`. +fn picked_segments(segments: Option<&BTreeSet<(usize, usize)>>, si: usize, sp: &SubPath, anchors: &BTreeSet) -> BTreeSet { + let n = sp.anchors.len().max(1); + match segments.filter(|set| !set.is_empty()) { + Some(set) => set.iter().filter(|(s, _)| *s == si).map(|(_, k)| *k).collect(), + None => (0..sp.segment_count()).filter(|k| anchors.contains(k) && anchors.contains(&((k + 1) % n))).collect(), + } +} + fn add_points(s: &mut Session, p: &Value) -> Result { const C: &str = "addon.pathtools.addPoints"; let count = number_or(p, "count", 1.0, C)?; @@ -597,16 +618,10 @@ fn add_points(s: &mut Session, p: &Value) -> Result { let mut changed = vec![]; for (id, by_sub) in &picked { let Some(path) = d.node(*id).and_then(|n| n.path_data()) else { continue }; - let picked_segments = st.selection.segments.get(id); let mut np = path.clone(); for (si, sp) in np.subpaths.iter_mut().enumerate() { let Some(anchors) = by_sub.get(&si) else { continue }; - let n = sp.anchors.len(); - // Picked segments, else those between two selected anchors. - let segs: BTreeSet = match picked_segments { - Some(set) => set.iter().filter(|(s, _)| *s == si).map(|(_, k)| *k).collect(), - None => (0..sp.segment_count()).filter(|k| anchors.contains(k) && anchors.contains(&((k + 1) % n.max(1)))).collect(), - }; + let segs = picked_segments(st.selection.segments.get(id), si, sp, anchors); let (out, marks) = pt::add_points(sp, Some(&segs), count as usize); added += marks.len(); *sp = out; @@ -721,3 +736,60 @@ fn crossings(s: &mut Session, p: &Value) -> Result { })?; Ok(json!({ "ids": out.iter().map(|i| i.0).collect::>(), "crossings": count })) } + +// ---------- Divide into Dashes ---------- + +fn divide_dashes(s: &mut Session, p: &Value) -> Result { + const C: &str = "addon.pathtools.divideDashes"; + let spec = pt::DashSpec { + dash: given(p, "dash", Some((0.01, 1e6)), C)?.unwrap_or(10.0), + gap: given(p, "gap", Some((0.0, 1e6)), C)?.unwrap_or(0.0), + fit: switch_or(p, "fit", false, C)?, + }; + let remove_gaps = switch_or(p, "removeGaps", true, C)?; + let picked = picked_anchors(s, true)?; + let st = s.doc()?; + let d = &st.doc; + check_size(picked.iter().filter_map(|(id, _)| d.node(*id)?.path_data()), C)?; + let (mut made, mut dashes) = (0, 0); + // Each path divided: what stays of it (the subpaths not divided, as one path) and its pieces. + let mut changed: Vec<(NodeId, Vec)> = vec![]; + for (id, by_sub) in &picked { + let Some(path) = d.node(*id).and_then(|n| n.path_data()) else { continue }; + let (mut kept, mut pieces) = (vec![], vec![]); + for (si, sp) in path.subpaths.iter().enumerate() { + let segs = by_sub.get(&si).map(|anchors| picked_segments(st.selection.segments.get(id), si, sp, anchors)).unwrap_or_default(); + if segs.is_empty() { + kept.push(sp.clone()); + continue; + } + let only = (segs.len() < sp.segment_count()).then_some(&segs); + let out = pt::divide_dashes(sp, only, spec, MAX_PIECES.saturating_sub(made)) + .ok_or_else(|| bad(C, "that makes too many pieces (at most 100000): make the dashes longer"))?; + made += out.len(); + for (piece, kind) in out.into_iter().filter(|(_, k)| !(remove_gaps && *k == pt::Piece::Gap)) { + dashes += usize::from(kind == pt::Piece::Dash); + pieces.push(PathData::single(piece)); + } + } + if !pieces.is_empty() { + changed.push((*id, (!kept.is_empty()).then(|| PathData::new(kept)).into_iter().chain(pieces).collect())); + } + } + if changed.is_empty() { + return Err(bad(C, "select paths, or segments, to divide")); + } + let ids = s.edit("Divide into Dashes", |d, sel| { + let mut all = vec![]; + let mut beside = Beside::replacing(d, &changed.iter().map(|(id, _)| *id).collect::>()); + for (id, pieces) in changed { + all.extend(replace_with_pieces(d, &mut beside, id, pieces)?); + } + beside.finish(d)?; + // The pieces join the objects selected (whole, in one go: there may be many). + let before = std::mem::take(&mut sel.objects); + sel.set(before.into_iter().chain(all.iter().copied())); + Ok(all) + })?; + Ok(json!({ "ids": ids.iter().map(|i| i.0).collect::>(), "dashes": dashes })) +} diff --git a/crates/engine/src/cmd/addons/pathtools/tests.rs b/crates/engine/src/cmd/addons/pathtools/tests.rs index 52f0c7078..cc745385c 100644 --- a/crates/engine/src/cmd/addons/pathtools/tests.rs +++ b/crates/engine/src/cmd/addons/pathtools/tests.rs @@ -674,3 +674,77 @@ fn the_slide_tool_previews_and_commits_one_step() { s.execute("edit.undo", &json!({})).unwrap(); assert_eq!(at(&s), Point::new(200.0, 100.0)); } + +fn ids(v: &Value) -> Vec { + v["ids"].as_array().unwrap().iter().map(|i| NodeId(i.as_u64().unwrap())).collect() +} + +#[test] +fn divide_into_dashes_cuts_a_path_into_open_pieces_keeping_its_look() { + let mut s = session(); + let l = line(&mut s, &[(0.0, 0.0), (100.0, 0.0)], false); + select(&mut s, &[l]); + s.execute("stroke.set", &json!({"weight": 3})).unwrap(); + let n = steps(&s); + let r = s.execute("addon.pathtools.divideDashes", &json!({"dash": 30, "gap": 10})).unwrap(); + assert_eq!(steps(&s), n + 1, "one undo step"); + // 30 + 10 + 30 + 10 + 20: the gaps are left empty. + let pieces = ids(&r); + assert_eq!((pieces.len(), r["dashes"].clone()), (3, json!(3))); + let st = s.doc().unwrap(); + let spans: Vec<(f64, f64)> = pieces.iter().map(|id| path(&s, *id).bounds().map(|b| (b.x0, b.x1)).unwrap()).collect(); + let want = [(0.0, 30.0), (40.0, 70.0), (80.0, 100.0)]; + assert!(spans.iter().zip(want).all(|(a, b)| (a.0 - b.0).abs() < 1e-6 && (a.1 - b.1).abs() < 1e-6), "{spans:?}"); + assert!(pieces.iter().all(|id| st.doc.node(*id).unwrap().appearance.stroke_width() == 3.0), "the stroke stays"); + assert_eq!(st.selection.objects, pieces); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(path(&s, l).anchor_count(), 2); + // Kept gaps; fitted 25s with no gap. + let r = s.execute("addon.pathtools.divideDashes", &json!({"dash": 30, "gap": 10, "removeGaps": false})).unwrap(); + assert_eq!((ids(&r).len(), r["dashes"].clone()), (5, json!(3))); + s.execute("edit.undo", &json!({})).unwrap(); + let r = s.execute("addon.pathtools.divideDashes", &json!({"dash": 30, "fit": true})).unwrap(); + let spans: Vec = ids(&r).iter().map(|id| path(&s, *id).bounds().unwrap().width()).collect(); + assert_eq!(spans.len(), 3); + assert!(spans.iter().all(|w| (w - 100.0 / 3.0).abs() < 1e-6), "{spans:?}"); +} + +#[test] +fn divide_into_dashes_divides_only_the_selected_segments() { + let mut s = session(); + let u = line(&mut s, &[(0.0, 0.0), (40.0, 0.0), (40.0, 40.0), (0.0, 40.0)], false); + // The middle side, between anchors 1 and 2. + select_anchors(&mut s, u, &[1, 2]); + let r = s.execute("addon.pathtools.divideDashes", &json!({"dash": 10})).unwrap(); + let pieces = ids(&r); + assert_eq!((pieces.len(), r["dashes"].clone()), (6, json!(4)), "the first side, four dashes, the last side"); + assert_eq!(path(&s, pieces[0]).bounds().unwrap().width(), 40.0); + let layer: Vec = s.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id).collect(); + assert_eq!(layer, pieces, "in the path's place, in order"); +} + +#[test] +fn divide_into_dashes_refuses_bad_params_and_too_many_pieces() { + let mut s = session(); + let l = line(&mut s, &[(0.0, 0.0), (1e5, 0.0)], false); + select(&mut s, &[l]); + refuses( + &mut s, + "addon.pathtools.divideDashes", + &[ + json!({"dash": 0}), + json!({"dash": -5}), + json!({"dash": 1e308}), + json!({"dash": "10"}), + json!({"gap": -1}), + json!({"gap": 2e6}), + json!({"fit": "yes"}), + json!({"removeGaps": 1}), + json!({"dash": 0.5}), + ], + ); + // 200000 pieces refused above; 1000 is fine. + assert_eq!(s.execute("addon.pathtools.divideDashes", &json!({"dash": 100})).unwrap()["dashes"], json!(1000)); + s.execute("select.none", &json!({})).unwrap(); + refuses(&mut s, "addon.pathtools.divideDashes", &[json!({})]); +} diff --git a/crates/engine/tests/command_sweep.rs b/crates/engine/tests/command_sweep.rs index 14d7f9559..36fe6401d 100644 --- a/crates/engine/tests/command_sweep.rs +++ b/crates/engine/tests/command_sweep.rs @@ -589,6 +589,9 @@ fn structured_junk() { ("addon.arrange.size", json!({"width": 1e6, "height": 0.001, "reference": 8, "scaleStrokes": true})), ("addon.arrange.size", json!({"width": 0.001, "proportional": true, "reference": u64::MAX})), ("addon.arrange.groupOverlapping", json!({"ids": "x", "junk": f64::MAX})), + ("addon.pathtools.divideDashes", json!({"dash": 1e-308, "gap": -1e308, "fit": "x"})), + ("addon.pathtools.divideDashes", json!({"dash": 0.01, "gap": 1e6, "fit": true, "removeGaps": false})), + ("addon.pathtools.divideDashes", json!({"dash": f64::MAX, "gap": [0], "removeGaps": null})), // Smart Pen add-on. ("addon.pen.append", json!({"id": 2, "x": 1e308, "y": 0, "in": [1e308, -1e308]})), ("addon.pen.append", json!({"id": 2, "subpath": u64::MAX, "x": 0, "y": 0, "segment": "curved"})), diff --git a/crates/pathops/src/addons/pathtools.rs b/crates/pathops/src/addons/pathtools.rs index b98778cc5..1de342ffc 100644 --- a/crates/pathops/src/addons/pathtools.rs +++ b/crates/pathops/src/addons/pathtools.rs @@ -3,9 +3,11 @@ //! ([`add_anchors`], [`smooth_anchors`], [`split_at_anchors`]), the readouts the Measure & Inspect //! tool shows over a path, open paths lengthened or shortened at an end ([`extend`]), the places //! where paths cross ([`crossings`]), anchors slid along their path ([`slide`]), touching edges -//! merged ([`shared_edge`]) and the Parametric Shape Tool's shapes ([`shapes`]). +//! merged ([`shared_edge`]), paths divided into dashes ([`divide_dashes`]) and the Parametric Shape +//! Tool's shapes ([`shapes`]). mod crossings; +mod dashes; mod extend; pub mod shapes; mod shared_edge; @@ -19,6 +21,7 @@ use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Ve use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; pub use crossings::{MAX_CROSSING_SEGMENTS, crossings, insert_at}; +pub use dashes::{DashSpec, Piece, divide_dashes}; pub use extend::{ExtendMode, extend_length_to, extend_open}; pub use shared_edge::{ COINCIDENCE, EndSide, Follow, MAX_COINCIDENCE, MergePlan, MergePreview, Stretch, apply_merge, ends_at, merge_preview, stretches_at, diff --git a/crates/pathops/src/addons/pathtools/dashes.rs b/crates/pathops/src/addons/pathtools/dashes.rs new file mode 100644 index 000000000..cec805d84 --- /dev/null +++ b/crates/pathops/src/addons/pathtools/dashes.rs @@ -0,0 +1,252 @@ +//! Divide into Dashes: a subpath (or some of its segments) cut into open pieces of a given length +//! measured along the curve, with gaps of a given length between them. + +use std::collections::BTreeSet; + +use kurbo::{CubicBez, ParamCurve, ParamCurveArclen}; +use vectorcraft_geom::{Anchor, AnchorKind, SubPath}; + +use super::{ACCURACY, TINY}; + +/// What a piece [`divide_dashes`] cuts is. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Piece { + Dash, + /// The stretch between two dashes. + Gap, + /// A stretch of segments that weren't to be divided, as it was. + Rest, +} + +/// How [`divide_dashes`] measures. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct DashSpec { + /// Each dash's length (pt), more than 0. + pub dash: f64, + /// Each gap's length (pt), 0 or more (0: the dashes touch). + pub gap: f64, + /// Fit to corners and ends: every run between corners and ends holds a whole number of dashes + /// (and the gaps between them), all stretched or squeezed alike so it starts and ends on a + /// dash; a closed subpath with no corner holds whole periods. Otherwise the lengths are exact + /// and the last piece of each run is what is left. + pub fit: bool, +} + +/// `sp` cut into open pieces in order along it: the segments `segments` picks (all when `None`) +/// cut into dashes and gaps as `spec` says, the dash pattern running on across the picked +/// segments that follow one another, and each stretch of segments not picked as one piece. `None` +/// when that would make more than `room` pieces, or `spec` is no pattern (lengths not finite, a +/// dash not more than 0, a negative gap). +pub fn divide_dashes(sp: &SubPath, segments: Option<&BTreeSet>, spec: DashSpec, room: usize) -> Option> { + let DashSpec { dash, gap, fit } = spec; + if !(dash.is_finite() && gap.is_finite() && dash > TINY && gap >= 0.0) { + return None; + } + let n = sp.segment_count(); + let picked = |k: usize| segments.is_none_or(|s| s.contains(&k)); + if !(0..n).any(picked) { + return Some(vec![(sp.clone(), Piece::Rest)]); + } + // An anchor between two segments where the outline turns: a corner a fitted run ends at. + let corner = |i: usize| sp.anchors.get(i).is_some_and(|a| Anchor::with_handles(a.p, a.h_in, a.h_out).kind != AnchorKind::Smooth); + // A closed subpath starts where picked and unpicked segments meet, else (fitting) at a corner. + let start = if sp.closed { + (0..n).find(|&k| picked(k) != picked((k + n - 1) % n)).or_else(|| (0..n).find(|&k| fit && corner(k))).unwrap_or(0) + } else { + 0 + }; + // Runs of segments alike; a fitted picked run also ends at each corner. + let mut runs: Vec<(bool, Vec)> = vec![]; + for k in (0..n).map(|i| (start + i) % n) { + let p = picked(k); + match runs.last_mut() { + Some((q, segs)) if *q == p && !(p && fit && corner(k)) => segs.push(k), + _ => runs.push((p, vec![k])), + } + } + let whole_loop = sp.closed && runs.len() == 1 && !(fit && corner(start)); + let mut out = vec![]; + for (p, segs) in runs { + let curves: Vec = segs.iter().map(|&k| sp.segment(k)).collect(); + if !p { + out.extend(from_cubics(&curves).map(|s| (s, Piece::Rest))); + continue; + } + let lens: Vec = curves.iter().map(|c| c.arclen(ACCURACY)).collect(); + let len: f64 = lens.iter().sum(); + if !(len.is_finite() && len > TINY) { + continue; + } + let cuts = spans(len, spec, whole_loop, room.checked_sub(out.len())?)?; + let mut cursor = 0; + let mut from = 0.0; + let starts: Vec = lens + .iter() + .map(|l| { + let s = from; + from += l; + s + }) + .collect(); + for (a, b, kind) in cuts { + let mut piece = vec![]; + let mut j = cursor; + while let (Some(&s0), Some(&l), Some(c)) = (starts.get(j), lens.get(j), curves.get(j)) { + if s0 >= b - TINY { + break; + } + let (t0, t1) = ((a - s0).max(0.0), (b - s0).min(l)); + if t1 - t0 > TINY { + let at = |d: f64| { + if d <= 0.0 { + 0.0 + } else if d >= l { + 1.0 + } else { + c.inv_arclen(d, ACCURACY) + } + }; + piece.push(c.subsegment(at(t0)..at(t1))); + } + if s0 + l > b + TINY { + break; + } + j += 1; + } + cursor = j; + out.extend(from_cubics(&piece).map(|s| (s, kind))); + } + } + Some(out) +} + +/// The pieces (start, end along the run, kind) of a run `len` long; `None` past `room` pieces. +fn spans(len: f64, DashSpec { dash, gap, fit }: DashSpec, whole_loop: bool, room: usize) -> Option> { + let period = dash + gap; + // A loop holds whole periods; an open run one gap fewer than dashes. + let scale = if !fit { + 1.0 + } else if whole_loop { + len / ((len / period).round().max(1.0) * period) + } else { + let count = ((len + gap) / period).round().max(1.0); + len / (count * dash + (count - 1.0) * gap) + }; + let (dash, gap) = (dash * scale, gap * scale); + // Rounding (of the length measured, over many pieces): what is left past `end` is no piece. + let end = len - (len * 1e-9).max(TINY); + let most = (end / (dash + gap)).ceil() * if gap > 0.0 { 2.0 } else { 1.0 }; + if !(most.is_finite() && most <= room as f64) { + return None; + } + let mut out = vec![]; + let (mut at, mut on) = (0.0, true); + while at < end { + let step = if on { dash } else { gap }; + if step > 0.0 { + let to = (at + step).min(len); + out.push((at, if to >= end { len } else { to }, if on { Piece::Dash } else { Piece::Gap })); + at = to; + } + on = !on; + } + Some(out) +} + +/// An open subpath through cubic segments that follow one another; `None` for none. +fn from_cubics(cs: &[CubicBez]) -> Option { + let (first, last) = (cs.first()?, cs.last()?); + let mut anchors = vec![Anchor::with_handles(first.p0, first.p0, first.p1)]; + anchors.extend(cs.windows(2).filter_map(|w| match w { + [a, b] => Some(Anchor::with_handles(b.p0, a.p2, b.p1)), + _ => None, + })); + anchors.push(Anchor::with_handles(last.p3, last.p2, last.p3)); + Some(SubPath::new(anchors, false)) +} + +#[cfg(test)] +mod tests { + use kurbo::Point; + + use super::*; + + fn line(len: f64) -> SubPath { + SubPath::polyline(&[Point::new(0.0, 0.0), Point::new(len, 0.0)], false) + } + + fn length(sp: &SubPath) -> f64 { + (0..sp.segment_count()).map(|k| sp.segment(k).arclen(ACCURACY)).sum() + } + + fn lengths(pieces: &[(SubPath, Piece)]) -> Vec<(i64, Piece)> { + pieces.iter().map(|(s, k)| ((length(s) * 1000.0).round() as i64, *k)).collect() + } + + const EXACT: DashSpec = DashSpec { dash: 10.0, gap: 0.0, fit: false }; + + #[test] + fn a_line_is_cut_into_dashes_and_gaps() { + let p = divide_dashes(&line(35.0), None, EXACT, 100).unwrap(); + assert_eq!(lengths(&p), [(10_000, Piece::Dash), (10_000, Piece::Dash), (10_000, Piece::Dash), (5_000, Piece::Dash)]); + assert_eq!(p[0].0.anchors[1].p, p[1].0.anchors[0].p, "touching"); + assert!(p[1].0.anchors[0].p.distance(Point::new(10.0, 0.0)) < 1e-6); + let p = divide_dashes(&line(35.0), None, DashSpec { gap: 5.0, ..EXACT }, 100).unwrap(); + let kinds: Vec = p.iter().map(|(_, k)| *k).collect(); + assert_eq!(kinds, [Piece::Dash, Piece::Gap, Piece::Dash, Piece::Gap, Piece::Dash]); + assert_eq!(lengths(&p)[4], (5_000, Piece::Dash)); + } + + #[test] + fn fitting_stretches_the_pattern_to_start_and_end_on_a_dash() { + // 35 with 10 + 5: three dashes and two gaps, squeezed from 40 to 35. + let p = divide_dashes(&line(35.0), None, DashSpec { dash: 10.0, gap: 5.0, fit: true }, 100).unwrap(); + let (d, g) = ((8_750, Piece::Dash), (4_375, Piece::Gap)); + assert_eq!(lengths(&p), [d, g, d, g, d]); + // A square: each side its own run, each starting and ending on a dash. + let sq = SubPath::polyline(&[Point::new(0.0, 0.0), Point::new(30.0, 0.0), Point::new(30.0, 30.0), Point::new(0.0, 30.0)], true); + let p = divide_dashes(&sq, None, DashSpec { dash: 7.0, gap: 0.0, fit: true }, 100).unwrap(); + assert_eq!(p.len(), 16, "four dashes of 7.5 on each side"); + assert!(lengths(&p).iter().all(|(l, k)| *l == 7_500 && *k == Piece::Dash)); + } + + #[test] + fn a_curve_is_measured_along_it() { + let arc = SubPath::new( + vec![ + Anchor::with_handles(Point::new(0.0, 0.0), Point::new(0.0, 0.0), Point::new(0.0, 55.0)), + Anchor::with_handles(Point::new(100.0, 100.0), Point::new(45.0, 100.0), Point::new(100.0, 100.0)), + ], + false, + ); + let total = length(&arc); + let p = divide_dashes(&arc, None, EXACT, 1000).unwrap(); + assert_eq!(p.len(), (total / 10.0).ceil() as usize); + assert!(p.iter().rev().skip(1).all(|(s, _)| (length(s) - 10.0).abs() < 1e-4)); + assert!((p.iter().map(|(s, _)| length(s)).sum::() - total).abs() < 1e-4); + } + + #[test] + fn only_the_picked_segments_are_divided() { + // Three sides of 20; the middle one picked. + let u = SubPath::polyline(&[Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(20.0, 20.0), Point::new(0.0, 20.0)], false); + let p = divide_dashes(&u, Some(&BTreeSet::from([1])), EXACT, 100).unwrap(); + assert_eq!(lengths(&p), [(20_000, Piece::Rest), (10_000, Piece::Dash), (10_000, Piece::Dash), (20_000, Piece::Rest)]); + // Closed: the unpicked rest is one piece round the start. + let sq = SubPath::polyline(&[Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(20.0, 20.0), Point::new(0.0, 20.0)], true); + let p = divide_dashes(&sq, Some(&BTreeSet::from([1])), EXACT, 100).unwrap(); + assert_eq!(lengths(&p), [(10_000, Piece::Dash), (10_000, Piece::Dash), (60_000, Piece::Rest)]); + assert!(p.iter().all(|(s, _)| !s.closed)); + } + + #[test] + fn too_many_pieces_or_no_pattern_is_none() { + assert!(divide_dashes(&line(1000.0), None, EXACT, 99).is_none()); + assert!(divide_dashes(&line(1000.0), None, EXACT, 100).is_some()); + for bad in [0.0, -1.0, f64::NAN, f64::INFINITY] { + assert!(divide_dashes(&line(10.0), None, DashSpec { dash: bad, ..EXACT }, 100).is_none()); + } + assert!(divide_dashes(&line(10.0), None, DashSpec { gap: -1.0, ..EXACT }, 100).is_none()); + assert!(divide_dashes(&line(1e6), None, DashSpec { dash: 1e-6, ..EXACT }, 100_000).is_none()); + } +} diff --git a/crates/ui-egui/src/addons/pathtools.rs b/crates/ui-egui/src/addons/pathtools.rs index b55c38ccd..9503a35e4 100644 --- a/crates/ui-egui/src/addons/pathtools.rs +++ b/crates/ui-egui/src/addons/pathtools.rs @@ -1,12 +1,13 @@ //! Path Precision Tools in the interface: its submenu (Object › Plug-ins › Path Precision Tools), -//! which selects its tools, opens its panels and runs Split / Add Points at Crossings and Convert -//! to Parametric Shape; the Anchor Inspector panel (the selected anchor's position and handles as -//! numbers, the add-on's anchor edits, the Corner Tool's values, [`corner`], and the Shared Edge -//! Merge Tool's, [`shared_edge`]); the Parametric Shape panel ([`shape`]); and its tools' options -//! dialog (a double-click on the tool). Everything acts through `addon.pathtools.*` and +//! which selects its tools, opens its panels and runs Split / Add Points at Crossings, Divide into +//! Dashes ([`dashes`]) and Convert to Parametric Shape; the Anchor Inspector panel (the selected +//! anchor's position and handles as numbers, the add-on's anchor edits, the Corner Tool's values, +//! [`corner`], and the Shared Edge Merge Tool's, [`shared_edge`]); the Parametric Shape panel +//! ([`shape`]); and its tools' options dialog (a double-click on the tool). Everything acts through `addon.pathtools.*` and //! `tool.setOption`. pub mod corner; +pub mod dashes; pub mod shape; pub mod shared_edge; @@ -63,6 +64,7 @@ pub fn menu() -> Vec { Item::Sep, Item::Cmd("Add Points at Crossings", "addon.pathtools.crossings", json!({})), Item::Cmd("Split at Crossings", "addon.pathtools.crossings", json!({ "cut": true })), + Item::Cmd("Divide into Dashes…", dashes::COMMAND, Value::Null), Item::Cmd("Convert to Parametric Shape", "addon.pathtools.shape.convert", json!({})), ] } diff --git a/crates/ui-egui/src/addons/pathtools/dashes.rs b/crates/ui-egui/src/addons/pathtools/dashes.rs new file mode 100644 index 000000000..aa798d03e --- /dev/null +++ b/crates/ui-egui/src/addons/pathtools/dashes.rs @@ -0,0 +1,91 @@ +//! Divide into Dashes in the interface: its dialog (dash and gap lengths, Fit to Corners and Ends, +//! Remove Gaps), which previews on the canvas and runs `addon.pathtools.divideDashes` on OK. + +use egui::Ui; +use serde_json::{Value, json}; + +use crate::VectorcraftApp; +use crate::dialogs::{DialogSpec, form}; +use crate::state::Dialog; +use crate::widgets; + +/// The command, and its dialog's kind. +pub const COMMAND: &str = "addon.pathtools.divideDashes"; +pub const KIND: &str = "divideDashes"; +/// The dash and gap lengths the command takes (pt). +const DASHES: std::ops::RangeInclusive = 0.01..=1e6; +const GAPS: std::ops::RangeInclusive = 0.0..=1e6; +const LABEL_W: f32 = 60.0; +const FIELD_W: f32 = 90.0; + +/// The dialog's fields to start with: the command's defaults. +pub(crate) fn fields() -> Value { + json!({ "dash": 10, "gap": 0, "fit": false, "removeGaps": true }) +} + +pub(crate) const SPEC: DialogSpec = + DialogSpec { heading: |_| tl!("Divide into Dashes").to_string(), body, confirm, preview: true, min_width: 280.0, ..DialogSpec::FORM }; + +fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { + let unit = app.session.general_unit(); + widgets::label_row(ui, tl!("Dash:"), LABEL_W, |ui| { + form::length_within(ui, d, "dash", unit, FIELD_W, Some(DASHES)); + }); + widgets::label_row(ui, tl!("Gap:"), LABEL_W, |ui| { + form::length_within(ui, d, "gap", unit, FIELD_W, Some(GAPS)); + }); + form::check(ui, d, "fit", tl!("Fit to Corners and Ends")); + // Without a gap there are no gap pieces to remove. + let gaps = d.f64("gap", 0.0) > 0.0; + ui.add_enabled_ui(gaps, |ui| form::check(ui, d, "removeGaps", tl!("Remove Gaps"))); + form::preview(app, ui, d, "Divide into Dashes", COMMAND, form::params(d)); + false +} + +/// OK: run the command (keep its preview) and close. +fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { + form::commit_preview(app, COMMAND, form::params(d)) +} + +#[cfg(test)] +mod tests { + use serde_json::json; + use vectorcraft_engine::Session; + + use crate::tests_labels::painted_text; + use crate::{VectorcraftApp, menus}; + + #[test] + fn divide_into_dashes_opens_its_dialog_previews_and_runs_on_ok() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + let anchors = json!([{"x": 0, "y": 0}, {"x": 100, "y": 0}]); + let id = app.run("path.create", json!({"anchors": anchors})).unwrap()["id"].as_u64().unwrap(); + app.run("select.set", json!({"ids": [id]})).unwrap(); + let entries = menus::menu_entries(&app); + let item = entries.iter().find(|e| e.path == ["Object", "Plug-ins", "Path Precision Tools"] && e.label == "Divide into Dashes…").unwrap(); + let (cmd, p) = menus::click_target(&item.label, item.command.as_deref().unwrap(), &item.params); + menus::invoke(&mut app, &cmd, p); + assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some(super::KIND)); + let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + for s in ["Divide into Dashes", "Dash:", "Gap:", "Fit to Corners and Ends", "Remove Gaps", "Preview"] { + assert!(shown.contains(s), "{s} in {shown}"); + } + let count = |app: &VectorcraftApp| app.session.doc().unwrap().doc.layers[0].children().unwrap().len(); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("dash".into(), json!(25)); + d.fields.insert("preview".into(), json!(true)); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert_eq!(count(&app), 4, "previewed"); + crate::dialogs::cancel(&mut app); + assert_eq!(count(&app), 1, "rolled back"); + menus::invoke(&mut app, &cmd, serde_json::Value::Null); + let n = app.session.doc().unwrap().history.undo.len(); + app.ui.dialog.as_mut().unwrap().fields.insert("gap".into(), json!(10)); + crate::dialogs::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none()); + assert_eq!(app.session.doc().unwrap().history.undo.len(), n + 1); + // 10 + 10 + … over 100: five dashes, the gaps left empty. + assert_eq!(count(&app), 5); + } +} diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index a4eac7041..0f23c2bc4 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -397,6 +397,7 @@ registry! { PathfinderOptions: [pathfinder_options::KIND] => pathfinder_options::SPEC, RearrangeArtboards: [rearrange_artboards::KIND] => rearrange_artboards::SPEC, PathToolOptions: [crate::addons::pathtools::KIND] => crate::addons::pathtools::OPTIONS_SPEC, + DivideDashes: [crate::addons::pathtools::dashes::KIND] => crate::addons::pathtools::dashes::SPEC, ArrangeTools: [crate::addons::arrange::GRID, crate::addons::arrange::REPLACE, crate::addons::arrange::SIZE] => crate::addons::arrange::SPEC, ShortcutImport: [shortcut_import::KIND] => DialogSpec::window(shortcut_import::show, shortcut_import::confirm), } diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index a960e7dd2..e92164cde 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -5929,6 +5929,15 @@ breakText Glyphs Глифи # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Групиране на припокриващи се обекти @msg too many objects selected (at most 20000) избрани са твърде много обекти (най-много 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Разделяне на тирета… + Divide into Dashes Разделяне на тирета + Dash: Тире: + Gap: Разстояние: + Fit to Corners and Ends Напасване към ъгли и краища + Remove Gaps Премахване на разстоянията +@msg that makes too many pieces (at most 100000): make the dashes longer така се получават твърде много части (най-много 100000): удължете тиретата +@msg select paths, or segments, to divide изберете пътища или сегменти за разделяне Marathi Маратхи Gujarati Гуджарати Bengali Бенгалски diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 6dba3afdf..68745fa1a 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -5963,6 +5963,15 @@ shape Open Otvoren # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Grupiši preklapajuće objekte @msg too many objects selected (at most 20000) odabrano je previše objekata (najviše 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Podijeli na crtice… + Divide into Dashes Podijeli na crtice + Dash: Crtica: + Gap: Razmak: + Fit to Corners and Ends Uklopi u uglove i krajeve + Remove Gaps Ukloni razmake +@msg that makes too many pieces (at most 100000): make the dashes longer to daje previše dijelova (najviše 100000): produžite crtice +@msg select paths, or segments, to divide odaberite putanje ili segmente za dijeljenje Marathi Marathi Gujarati Gudžarati Bengali Bengalski diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a102f7a7c..318609343 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6036,6 +6036,15 @@ breakText Glyphs Glifs # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Agrupa els objectes superposats @msg too many objects selected (at most 20000) s’han seleccionat massa objectes (com a màxim 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Divideix en guions… + Divide into Dashes Divideix en guions + Dash: Guió: + Gap: Separació: + Fit to Corners and Ends Ajusta a les cantonades i els extrems + Remove Gaps Elimina les separacions +@msg that makes too many pieces (at most 100000): make the dashes longer això fa massa trossos (com a màxim 100000): allargueu els guions +@msg select paths, or segments, to divide seleccioneu camins o segments per dividir Marathi Marathi Gujarati Gujarati Bengali Bengalí diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index b0c04ffe2..838906c88 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6046,6 +6046,15 @@ breakText Glyphs Glyfy # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Seskupit překrývající se objekty @msg too many objects selected (at most 20000) vybráno příliš mnoho objektů (nejvýše 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Rozdělit na čárky… + Divide into Dashes Rozdělit na čárky + Dash: Pomlčka: + Gap: Mezera: + Fit to Corners and Ends Přizpůsobit rohům a koncům + Remove Gaps Odstranit mezery +@msg that makes too many pieces (at most 100000): make the dashes longer tím vznikne příliš mnoho dílů (nejvýše 100000): prodlužte čárky +@msg select paths, or segments, to divide vyberte cesty nebo segmenty k rozdělení Marathi Maráthština Gujarati Gudžarátština Bengali Bengálština diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index d85c865bf..bdde0358b 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -5943,6 +5943,15 @@ breakText Glyphs Glyffer # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Gruppér overlappende objekter @msg too many objects selected (at most 20000) for mange objekter markeret (højst 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Opdel i streger… + Divide into Dashes Opdel i streger + Dash: Tankestreg: + Gap: Afstand: + Fit to Corners and Ends Tilpas til hjørner og ender + Remove Gaps Fjern mellemrum +@msg that makes too many pieces (at most 100000): make the dashes longer det giver for mange stykker (højst 100000): gør stregerne længere +@msg select paths, or segments, to divide vælg stier eller segmenter, der skal opdeles Marathi Marathi Gujarati Gujarati Bengali Bengali diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index b1e187de8..a4d2ec778 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5631,6 +5631,15 @@ breakText Glyphs Glyphen # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Überlappende Objekte gruppieren @msg too many objects selected (at most 20000) zu viele Objekte ausgewählt (höchstens 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… In Striche aufteilen… + Divide into Dashes In Striche aufteilen + Dash: Strich: + Gap: Abstand: + Fit to Corners and Ends An Ecken und Enden anpassen + Remove Gaps Lücken entfernen +@msg that makes too many pieces (at most 100000): make the dashes longer das ergibt zu viele Teile (höchstens 100000): machen Sie die Striche länger +@msg select paths, or segments, to divide wählen Sie Pfade oder Segmente zum Aufteilen aus Marathi Marathi Gujarati Gujarati Bengali Bengalisch diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 76d29ca75..e60204139 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5998,6 +5998,15 @@ breakText Glyphs Γλύφοι # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Ομαδοποίηση επικαλυπτόμενων αντικειμένων @msg too many objects selected (at most 20000) επιλέχθηκαν πάρα πολλά αντικείμενα (το πολύ 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Διαίρεση σε παύλες… + Divide into Dashes Διαίρεση σε παύλες + Dash: Παύλα: + Gap: Απόσταση: + Fit to Corners and Ends Προσαρμογή σε γωνίες και άκρα + Remove Gaps Αφαίρεση κενών +@msg that makes too many pieces (at most 100000): make the dashes longer αυτό δίνει πάρα πολλά κομμάτια (το πολύ 100000): κάντε τις παύλες μεγαλύτερες +@msg select paths, or segments, to divide επιλέξτε διαδρομές ή τμήματα για διαίρεση Marathi Μαραθικά Gujarati Γκουγιαράτι Bengali Βεγγαλικά diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f1d2645dc..8ce984b1d 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5988,6 +5988,15 @@ breakText Glyphs Glifos # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Agrupar objetos superpuestos @msg too many objects selected (at most 20000) demasiados objetos seleccionados (como máximo 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Dividir en guiones… + Divide into Dashes Dividir en guiones + Dash: Guion: + Gap: Separación: + Fit to Corners and Ends Ajustar a esquinas y extremos + Remove Gaps Quitar separaciones +@msg that makes too many pieces (at most 100000): make the dashes longer eso da demasiados trozos (como máximo 100000): alargue los guiones +@msg select paths, or segments, to divide seleccione trazados o segmentos para dividir Marathi Maratí Gujarati Guyaratí Bengali Bengalí diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 65c7df126..038074659 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6076,6 +6076,15 @@ breakText Glyphs Merkit # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Ryhmitä päällekkäiset objektit @msg too many objects selected (at most 20000) liian monta objektia valittu (enintään 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Jaa viivoiksi… + Divide into Dashes Jaa viivoiksi + Dash: Ajatusviiva: + Gap: Väli: + Fit to Corners and Ends Sovita kulmiin ja päihin + Remove Gaps Poista välit +@msg that makes too many pieces (at most 100000): make the dashes longer siitä tulee liian monta osaa (enintään 100000): pidennä viivoja +@msg select paths, or segments, to divide valitse jaettavat polut tai segmentit Marathi Marathi Gujarati Gudžarati Bengali Bengali diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index f0d74bcc7..135abca40 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -6043,6 +6043,15 @@ breakText Glyphs Glyphes # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Grouper les objets qui se chevauchent @msg too many objects selected (at most 20000) trop d’objets sélectionnés (20000 au plus) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Diviser en tirets… + Divide into Dashes Diviser en tirets + Dash: Tiret : + Gap: Écart : + Fit to Corners and Ends Ajuster aux angles et aux extrémités + Remove Gaps Supprimer les écarts +@msg that makes too many pieces (at most 100000): make the dashes longer cela donne trop de morceaux (100000 au plus) : allongez les tirets +@msg select paths, or segments, to divide sélectionnez des tracés ou des segments à diviser Marathi Marathi Gujarati Goudjarati Bengali Bengali diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index bd2b64965..9e64f5f39 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6032,6 +6032,15 @@ breakText Glyphs Glifák # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Átfedő objektumok csoportosítása @msg too many objects selected (at most 20000) túl sok objektum van kijelölve (legfeljebb 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Felosztás szaggatásokra… + Divide into Dashes Felosztás szaggatásokra + Dash: Gondolatjel: + Gap: Hézag: + Fit to Corners and Ends Illesztés a sarkokhoz és végekhez + Remove Gaps Hézagok eltávolítása +@msg that makes too many pieces (at most 100000): make the dashes longer ez túl sok darabot adna (legfeljebb 100000): hosszabbítsa meg a szaggatásokat +@msg select paths, or segments, to divide jelöljön ki felosztandó útvonalakat vagy szakaszokat Marathi Maráthi Gujarati Gudzsaráti Bengali Bengáli diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c7a2f0021..0ec84f994 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5943,6 +5943,15 @@ breakText Glyphs Glif # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Grupkan objek yang tumpang tindih @msg too many objects selected (at most 20000) terlalu banyak objek dipilih (paling banyak 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Bagi menjadi garis putus… + Divide into Dashes Bagi menjadi garis putus + Dash: Tanda pisah: + Gap: Celah: + Fit to Corners and Ends Paskan ke sudut dan ujung + Remove Gaps Hapus celah +@msg that makes too many pieces (at most 100000): make the dashes longer itu menghasilkan terlalu banyak potongan (paling banyak 100000): perpanjang garisnya +@msg select paths, or segments, to divide pilih jalur atau segmen yang akan dibagi Marathi Marathi Gujarati Gujarati Bengali Bengali diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 5f340b02b..863fa08e8 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5665,6 +5665,15 @@ breakText Glyphs Glifi # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Raggruppa oggetti sovrapposti @msg too many objects selected (at most 20000) troppi oggetti selezionati (al massimo 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Dividi in trattini… + Divide into Dashes Dividi in trattini + Dash: Trattino: + Gap: Distanza: + Fit to Corners and Ends Adatta ad angoli ed estremità + Remove Gaps Rimuovi le distanze +@msg that makes too many pieces (at most 100000): make the dashes longer così si ottengono troppi pezzi (al massimo 100000): allunga i trattini +@msg select paths, or segments, to divide seleziona tracciati o segmenti da dividere Marathi Marathi Gujarati Gujarati Bengali Bengalese diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index da7fd34f0..c6e9c62fb 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5732,6 +5732,15 @@ breakText Glyphs 字形 # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects 重なり合うオブジェクトをグループ化 @msg too many objects selected (at most 20000) 選択されたオブジェクトが多すぎます(最大 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… ダッシュに分割… + Divide into Dashes ダッシュに分割 + Dash: ダッシュ: + Gap: 間隔: + Fit to Corners and Ends コーナーと端に合わせる + Remove Gaps 間隔を削除 +@msg that makes too many pieces (at most 100000): make the dashes longer 分割数が多すぎます(最大 100000):ダッシュを長くしてください +@msg select paths, or segments, to divide 分割するパスまたはセグメントを選択してください Marathi マラーティー語 Gujarati グジャラート語 Bengali ベンガル語 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d71ee8b9b..c37dceb8e 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6035,6 +6035,15 @@ breakText Glyphs გლიფები # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects გადაფარვადი ობიექტების დაჯგუფება @msg too many objects selected (at most 20000) არჩეულია ძალიან ბევრი ობიექტი (მაქსიმუმ 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… ტირეებად დაყოფა… + Divide into Dashes ტირეებად დაყოფა + Dash: ტირე: + Gap: ღრეჩო: + Fit to Corners and Ends კუთხეებსა და ბოლოებზე მორგება + Remove Gaps ღრეჩოების მოცილება +@msg that makes too many pieces (at most 100000): make the dashes longer ეს ძალიან ბევრ ნაწილს იძლევა (მაქსიმუმ 100000): გაზარდეთ ტირეების სიგრძე +@msg select paths, or segments, to divide აირჩიეთ დასაყოფი კონტურები ან სეგმენტები Marathi მარათჰი Gujarati გუჯარათი Bengali ბენგალური diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 6b9ef0524..0d03c7496 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5628,6 +5628,15 @@ breakText Glyphs 글리프 # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects 겹치는 개체 그룹화 @msg too many objects selected (at most 20000) 선택한 개체가 너무 많습니다(최대 20000개) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… 대시로 나누기… + Divide into Dashes 대시로 나누기 + Dash: 대시: + Gap: 간격: + Fit to Corners and Ends 모퉁이와 끝에 맞추기 + Remove Gaps 간격 제거 +@msg that makes too many pieces (at most 100000): make the dashes longer 조각이 너무 많아집니다(최대 100000개). 대시를 더 길게 하십시오 +@msg select paths, or segments, to divide 나눌 패스나 세그먼트를 선택하십시오 Marathi 마라티어 Gujarati 구자라트어 Bengali 벵골어 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index c4d9c535e..acecce2dc 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5987,6 +5987,15 @@ breakText Glyphs Glyphs # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Overlappende objecten groeperen @msg too many objects selected (at most 20000) te veel objecten geselecteerd (hoogstens 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Verdelen in streepjes… + Divide into Dashes Verdelen in streepjes + Dash: Streepje: + Gap: Tussenruimte: + Fit to Corners and Ends Passend maken op hoeken en uiteinden + Remove Gaps Tussenruimten verwijderen +@msg that makes too many pieces (at most 100000): make the dashes longer dat geeft te veel stukken (hoogstens 100000): maak de streepjes langer +@msg select paths, or segments, to divide selecteer paden of segmenten om te verdelen Marathi Marathi Gujarati Gujarati Bengali Bengaals diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2418eae3c..4b42f1e2d 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5901,6 +5901,15 @@ breakText Glyphs Glify # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Grupuj nakładające się obiekty @msg too many objects selected (at most 20000) zaznaczono za dużo obiektów (najwyżej 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Podziel na kreski… + Divide into Dashes Podziel na kreski + Dash: Myślnik: + Gap: Odstęp: + Fit to Corners and Ends Dopasuj do narożników i końców + Remove Gaps Usuń odstępy +@msg that makes too many pieces (at most 100000): make the dashes longer to daje za dużo części (najwyżej 100000): wydłuż kreski +@msg select paths, or segments, to divide zaznacz ścieżki lub segmenty do podzielenia Marathi Marathi Gujarati Gudżarati Bengali Bengalski diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 34b223428..86518877a 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5965,6 +5965,15 @@ breakText Glyphs Glifos # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Agrupar objetos sobrepostos @msg too many objects selected (at most 20000) objetos demais selecionados (no máximo 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Dividir em traços… + Divide into Dashes Dividir em traços + Dash: Travessão: + Gap: Distância: + Fit to Corners and Ends Ajustar aos cantos e extremidades + Remove Gaps Remover distâncias +@msg that makes too many pieces (at most 100000): make the dashes longer isso gera peças demais (no máximo 100000): aumente os traços +@msg select paths, or segments, to divide selecione demarcadores ou segmentos para dividir Marathi Marati Gujarati Guzerate Bengali Bengali diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 747c91585..2b0b85161 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6023,6 +6023,15 @@ breakText Glyphs Глифы # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Сгруппировать перекрывающиеся объекты @msg too many objects selected (at most 20000) выделено слишком много объектов (не более 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Разделить на штрихи… + Divide into Dashes Разделить на штрихи + Dash: Тире: + Gap: Зазор: + Fit to Corners and Ends Подогнать к углам и концам + Remove Gaps Убрать зазоры +@msg that makes too many pieces (at most 100000): make the dashes longer так получится слишком много частей (не более 100000): удлините штрихи +@msg select paths, or segments, to divide выделите контуры или сегменты для разделения Marathi Маратхи Gujarati Гуджарати Bengali Бенгальский diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 26b3a1d59..e6ab91380 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6098,6 +6098,15 @@ breakText Glyphs Glyfer # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Gruppera överlappande objekt @msg too many objects selected (at most 20000) för många objekt markerade (högst 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Dela upp i streck… + Divide into Dashes Dela upp i streck + Dash: Tankstreck: + Gap: Mellanrum: + Fit to Corners and Ends Anpassa till hörn och ändar + Remove Gaps Ta bort mellanrum +@msg that makes too many pieces (at most 100000): make the dashes longer det blir för många delar (högst 100000): gör strecken längre +@msg select paths, or segments, to divide markera banor eller segment att dela upp Marathi Marathi Gujarati Gujarati Bengali Bengali diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a4851f2e3..c4b924a01 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -6003,6 +6003,15 @@ breakText Glyphs Glifler # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Çakışan Nesneleri Grupla @msg too many objects selected (at most 20000) çok fazla nesne seçili (en fazla 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Tirelere Böl… + Divide into Dashes Tirelere Böl + Dash: Tire: + Gap: Boşluk: + Fit to Corners and Ends Köşelere ve Uçlara Uydur + Remove Gaps Boşlukları Kaldır +@msg that makes too many pieces (at most 100000): make the dashes longer bu çok fazla parça oluşturur (en fazla 100000): tireleri uzatın +@msg select paths, or segments, to divide bölünecek yolları veya bölümleri seçin Marathi Marathi dili Gujarati Gücerat dili Bengali Bengalce diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index a4c04383a..d22468de3 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5645,6 +5645,15 @@ breakText Glyphs Гліфи # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Згрупувати об’єкти, що перекриваються @msg too many objects selected (at most 20000) виділено забагато об’єктів (не більше 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Розділити на штрихи… + Divide into Dashes Розділити на штрихи + Dash: Тире: + Gap: Проміжок: + Fit to Corners and Ends Припасувати до кутів і кінців + Remove Gaps Прибрати проміжки +@msg that makes too many pieces (at most 100000): make the dashes longer так вийде забагато частин (не більше 100000): подовжте штрихи +@msg select paths, or segments, to divide виділіть контури або сегменти для розділення Marathi Маратхі Gujarati Гуджараті Bengali Бенгальська diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index ab593787b..f6b12617a 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5648,6 +5648,15 @@ breakText Glyphs Glyph # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects Nhóm các đối tượng chồng lên nhau @msg too many objects selected (at most 20000) chọn quá nhiều đối tượng (tối đa 20000) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… Chia thành nét đứt… + Divide into Dashes Chia thành nét đứt + Dash: Gạch ngang: + Gap: Khoảng hở: + Fit to Corners and Ends Khớp với góc và đầu mút + Remove Gaps Gỡ các khoảng hở +@msg that makes too many pieces (at most 100000): make the dashes longer như vậy tạo ra quá nhiều mảnh (tối đa 100000): hãy kéo dài nét +@msg select paths, or segments, to divide chọn các đường dẫn hoặc đoạn để chia Marathi Tiếng Marathi Gujarati Tiếng Gujarati Bengali Tiếng Bengali diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9b506a128..9381523e5 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -5888,6 +5888,15 @@ breakText Glyphs 字形 # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects 编组重叠对象 @msg too many objects selected (at most 20000) 选择的对象过多(最多 20000 个) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… 分割为短划线… + Divide into Dashes 分割为短划线 + Dash: 短划线: + Gap: 间隙: + Fit to Corners and Ends 适合转角和端点 + Remove Gaps 移除间隙 +@msg that makes too many pieces (at most 100000): make the dashes longer 这会产生过多片段(最多 100000 个):请加长短划线 +@msg select paths, or segments, to divide 请选择要分割的路径或线段 Marathi 马拉地语 Gujarati 古吉拉特语 Bengali 孟加拉语 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 3e645ca09..0d6ae8b2b 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -5685,6 +5685,15 @@ breakText Glyphs 字符 # Arrange Tools add-on: Group Overlapping Objects. Group Overlapping Objects 群組重疊物件 @msg too many objects selected (at most 20000) 選取的物件過多(最多 20000 個) +# Path Precision Tools add-on: Divide into Dashes. + Divide into Dashes… 分割為短破折號… + Divide into Dashes 分割為短破折號 + Dash: 短破折號: + Gap: 間隙: + Fit to Corners and Ends 符合轉角和端點 + Remove Gaps 移除間隙 +@msg that makes too many pieces (at most 100000): make the dashes longer 這會產生過多片段(最多 100000 個):請加長短破折號 +@msg select paths, or segments, to divide 請選取要分割的路徑或線段 Marathi 馬拉地文 Gujarati 古吉拉特文 Bengali 孟加拉文 diff --git a/crates/ui-egui/src/menus/invoke.rs b/crates/ui-egui/src/menus/invoke.rs index 70c863971..77dd67f44 100644 --- a/crates/ui-egui/src/menus/invoke.rs +++ b/crates/ui-egui/src/menus/invoke.rs @@ -68,6 +68,7 @@ pub(super) fn menu_dialog(app: &VectorcraftApp, id: &str) -> Option<(&'static st ("splitIntoGrid", crate::dialogs::path_ops::split_fields(size.0, size.1)) } "object.vectorHalftone" => (crate::dialogs::halftone::KIND, crate::dialogs::halftone::fields()), + crate::addons::pathtools::dashes::COMMAND => (crate::addons::pathtools::dashes::KIND, crate::addons::pathtools::dashes::fields()), "artboard.rearrange" => (crate::dialogs::rearrange_artboards::KIND, crate::dialogs::rearrange_artboards::open_fields(app)), _ => return None, }) diff --git a/docs/mcp.md b/docs/mcp.md index 705b9d54b..8c1d1f907 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5966,6 +5966,16 @@ Commands: - `addon.pathtools.crossings {cut?, selfCrossings?, ids?}` adds anchors where the selected paths cross one another (and where each crosses itself, with `selfCrossings`), or with `cut` also cuts them there: a path of one subpath becomes a path per piece. Paths that meet at a shared anchor don't cross there; at most 10,000 segments at once. +- `addon.pathtools.divideDashes {dash?, gap?, fit?, removeGaps?}` cuts the selected paths into separate open paths + along the curve, each `dash` long (0.01 to 1,000,000 pt, 10 by default) with `gap` between them (0 to 1,000,000 pt, + 0 by default: the pieces touch), every piece keeping the path's appearance, as one undo step. The gap pieces are left + out unless `removeGaps` is false. With direct-selected segments (or anchors) only those runs are divided, the + pattern running on across segments that follow one another; the rest of such a path stays as pieces of its own. + With `fit`, every run between corners and ends holds a whole number of dashes, all stretched or squeezed alike so it + starts and ends on a dash (a closed path with no corner holds whole periods); otherwise the lengths are exact and the + last piece of each run is what is left. The pieces are selected; more than 100,000 is refused. → `{ids, dashes}`. + Divide into Dashes… opens a dialog (`ui.menuDialog {command}`, kind `divideDashes`) whose fields are these + parameters, with Preview. - `addon.pathtools.cornerSet {ids?, anchors?, items?, radius, kind?}` cuts live corners, the ones Direct Selection's corner widgets and the Corners dialog edit, as one undo step. `ids` (default: the selection) are the paths and `anchors` the anchor indices of each path's outline with no corners cut; without `anchors`, a path's direct-selected diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 1a0fe7d61..2f2a22642 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Arrange Tools add-on: Group Overlapping Objects, #4928; scores unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Path Precision Tools add-on: Divide into Dashes, #4950; scores unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026) ## Feature submission evidence @@ -1403,10 +1403,15 @@ dialogs, Preview and Cancel, Zoom to Selection) and `command_sweep`. Commands: ` A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Arrange Tools › Group Overlapping Objects groups the top-level selected objects wherever their visual bounds overlap or touch, chains included (A overlapping B and B overlapping C makes one group of three), only among objects of the same layer or group; objects that overlap nothing stay as they are, each new group takes its frontmost member's place in the stacking order, and the groups and the loose objects stay selected. One undo step; at most 20000 objects, compared by a sweep along x with union-find. Tests: `group_overlapping_*` in `cmd::addons::arrange::tests` in `vectorcraft-engine` (chains, loners, stacking order, layers kept apart, visual bounds, no step when nothing overlaps, many objects), `group_overlapping_objects_runs_directly` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Arrange Tools add-on. +## Path Precision Tools add-on: Divide into Dashes (2026-11-01) + +A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Path Precision Tools › Divide into Dashes… cuts the selected paths into separate open paths along the curve (arc length, not straight distance): each `dash` long (0.01 to 1000000 pt, 10 by default) with `gap` between them (0 by default: the pieces touch); the gap pieces are left out unless Remove Gaps is off. With direct-selected segments (or anchors) only those runs are divided, the pattern running on across segments that follow one another, and the rest of such a path stays as pieces of its own. Fit to Corners and Ends gives every run between corners and ends a whole number of dashes, all stretched or squeezed alike so it starts and ends on a dash (a closed path without corners holds whole periods); otherwise the lengths are exact and each run's last piece is what is left. Every piece keeps the path's appearance and is selected; one undo step; at most 100000 pieces (more is refused). The dialog takes lengths in any unit and previews on the canvas. Tests: `dashes::tests` in `vectorcraft-pathops` (exact and fitted lengths, curves measured along them, picked segments on open and closed paths, the piece cap and bad patterns), `divide_into_dashes_*` in `cmd::addons::pathtools::tests` in `vectorcraft-engine` (gaps removed or kept, fitted lengths, the stroke kept, one undo step, selected segments only, bad params and too many pieces refused), `divide_into_dashes_opens_its_dialog_previews_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on. + ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-11-01 | minor | Path Precision Tools add-on (a VectorCraft addition): Divide into Dashes (#4950); evidence added; scores unchanged. | | 2026-11-01 | minor | Arrange Tools add-on (a VectorCraft addition): Group Overlapping Objects (#4928); evidence added; scores unchanged. | | 2026-11-01 | minor | Type core: a Language per character (Character panel › Language, `text.setFormat` / `text.setRangeStyle {language}`, character styles), new type in the document's language; text is shaped in its language so fonts use their language forms (OpenType `locl`: Turkish `fi`, #4940, #4946); Hindi, Marathi, Gujarati, Bengali, Punjabi, Tamil, Telugu, Kannada, Malayalam, Odia and Urdu in the language list (#4943); scores unchanged | | 2026-10-31 | minor | Selection tools: with Alt held at the press, a Direct Selection marquee selects every path it touches whole and keeps the Group Selection pointer (#4890); a press on a selected object's centre point selects the object whole and a drag from it moves it (#4891); regression tests in `direct/tests.rs`; scores and estimates unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 6672e0f94..6c31deb0a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Arrange Tools add-on: Group Overlapping Objects, #4928) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Path Precision Tools add-on: Divide into Dashes, #4950) · **Target:** Adobe Illustrator 2026 (30.x) ## Feature submission evidence @@ -332,6 +332,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Arrange Tools add-on (VectorCraft addition): Object › Plug-ins › Arrange Tools › Group Overlapping Objects groups the selected objects whose visual bounds overlap or touch (chains included, within one layer or group), each group at its frontmost member's stacking place, one undo step | done | #4928; `addon.arrange.groupOverlapping`, `crates/engine/src/cmd/addons/arrange.rs` and its tests; not a feature of the reference app, so it is not scored | | Smart Pen add-on (VectorCraft addition): Object › Plug-ins › Smart Pen selects the Smart Pen Tool, which the All Tools drawer lists under its own heading but neither toolbar shows as shipped (no shortcut), and opens the Smart Pen panel (next segment straight or curved; Remove Points Keep Shape, Make Smooth, Make Corner, Retract Handles, Close or Join). The tool draws (click: straight or curved segment, a curve after a straight one tangent; drag: smooth anchor, Alt breaks the handle, Shift 45°, Space moves it; Tab switches a segment; rubber band; close, join, continue) and edits without switching tools (click selects a point, drag moves it, Alt-click removes it keeping the shape, Shift+Alt-click deletes it, double-click toggles smooth/corner; handle drags with Shift and Alt; segment drags reshape, Alt-click adds a point) | done | `addon.pen.*`, `crates/tools/src/addons/smart_pen.rs`, `crates/ui-egui/src/addons/pen.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its seven tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path, Shared Edge Merge Tool), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; the Shared Edge Merge Tool shows, over two paths touching at two coincident anchors, the two stretches and the edge merging them, a click merges them (half way; Shift the upper path, Alt the lower), and near anchors meet or an anchor one path lacks is added to match (Shift+Alt asks for this inside a stretch), with a Shared Edges section in the Anchor Inspector (brush diameter, coincidence 0 to 3 pt, Keep Shared Points Together, which takes coincident anchors along with the add-on's own anchor moves); a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored | +| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Divide into Dashes… (Dash and Gap in any unit, Fit to Corners and Ends, Remove Gaps; Preview) cuts the selected paths, or only their direct-selected segments, into open pieces along the curve, keeping their appearance, one undo step | done | #4950; `addon.pathtools.divideDashes`, `crates/pathops/src/addons/pathtools/dashes.rs`, `crates/ui-egui/src/addons/pathtools/dashes.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Effect › Path Effects lists its live effects (Dashes to Geometry, Add Anchors, Extend Path, Close Path, Smooth Anchors, Retract Handles, Reverse Direction, Simplify Anchors, Split at Anchors), each with the effect dialog's live Preview except Reverse Direction, which has no options, and listed in the Appearance panel like any effect | done | `addon.path.*`, `crates/effects/src/addons/path.rs`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its four tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/shape.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its six tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored | @@ -382,6 +383,7 @@ separate. Scores and hours unchanged. [Behavior and command details](development | Date | Change | Summary | |---|---|---| +| 2026-11-01 | minor | Path Precision Tools add-on (a VectorCraft addition): Divide into Dashes (#4950); scores and estimates unchanged | | 2026-11-01 | minor | Arrange Tools add-on (a VectorCraft addition): Group Overlapping Objects (#4928); scores and estimates unchanged | | 2026-11-01 | minor | Character panel › Language: the selected characters' language, from Document Setup's list, which gains Hindi, Marathi, Gujarati, Bengali, Punjabi, Tamil, Telugu, Kannada, Malayalam, Odia and Urdu (#4946, #4943); the Digits menu's numeral names keep their own translations; scores unchanged | | 2026-11-01 | minor | VectorCraft Options' Version is a menu of the versions VectorCraft writes, each named by the releases that read it, and an uncompressible version turns Use Compression off (#4931); a save refused before writing shows the Can't save alert with the reason (#4933); About › Contributors' table keeps its header row above the scrolling rows (#4944); the Gradient panel's freeform point swatch opens the point's popover (#4953); scores unchanged |