diff --git a/ROADMAP.md b/ROADMAP.md index 317174e231..9fab724e07 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -144,7 +144,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap - 2026-11-01: New Symbols from Layers joins the Document Tools add-on (Object › Plug-ins › Document Tools): one symbol of each top-level layer's art (the layers highlighted in the Layers panel when two or more are, else every layer), named after the layer, made as New Symbol makes one; Convert Layers to Symbols also puts an instance of each in place of its layer's art. Empty layers are skipped and reported; one undo step. A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Document Tools, a built-in add-on (Object › Plug-ins › Document Tools), starts with Save a Timestamped Copy: a copy of the document named `_YYYY-MM-DD_HH-MM` (UTC; `-2`, `-3`… when that name is taken) goes next to it, or into a folder picked for a document never saved, written as File › Save a Copy writes it, so the document keeps its path, title and modified state. Off on the web, which has no clock. A VectorCraft addition: headline numbers unchanged. - 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-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), and Keep Originals adds the outline above the circles instead of replacing them. A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged. +- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), or with Constant Gap the smaller circle's radius plus a gap, and Keep Originals adds the outline above the circles instead of replacing them. With three or more circles, every two whose outlines are within Reach (10 pt by default) are joined, the bridges that connect become one shape each, and a circle bridged to no other stays as it is (at most 2000 circles). A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged. - 2026-11-03: Text Tweaker, the first tool of the Type Tools add-on (Object › Plug-ins › Type Tools): one character attribute (size, baseline shift, rotation, horizontal or vertical scale, tracking, leading or stroke weight) goes letter by letter from a start value to an end value along a straight ramp, an ease, a bow, a spike or at random with a seed, set as the Character panel sets it, while the text stays live; a dialog with Preview, one undo step (`addon.type.textTweaker`, #4924). 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. diff --git a/crates/engine/src/cmd/addons/pathtools/bridge.rs b/crates/engine/src/cmd/addons/pathtools/bridge.rs index 2120b040e7..1c7181f43e 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge.rs @@ -1,5 +1,6 @@ //! Smooth Bridge: two selected circles joined into one outline by two concave arcs that touch both -//! circles, replacing the circles or added above them. +//! circles, or three or more each joined the same way to the others within reach and united where +//! the bridges connect, replacing the circles or added above them. use serde_json::{Value, json}; use vectorcraft_doc::{NodeId, NodeKind}; @@ -20,6 +21,12 @@ const LABEL: &str = "Smooth Bridge"; /// The arcs' radius as a percentage of the smaller circle's radius: by default, and the range. const RADIUS: f64 = 100.0; const RADII: (f64, f64) = (1.0, 1000.0); +/// The gap (pt) added to the smaller circle's radius to give the arcs' radius: the range. +const GAPS: (f64, f64) = (0.0, 1000.0); +/// How far apart (pt) the outlines of two of three or more circles may be for a bridge between +/// them: by default, and the range. +const REACH: f64 = 10.0; +const REACHES: (f64, f64) = (0.0, 10000.0); pub(super) fn specs() -> Vec { vec![cmd!( @@ -27,16 +34,33 @@ pub(super) fn specs() -> Vec { "Smooth Bridge", ["Object", "Plug-ins", "Path Precision Tools"], None, - "{radius?: % 1..1000 (100; the radius of the bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), keepOriginals?: bool (false: the outline replaces the two circles, painted as the upper one; true: it goes directly above the upper one and the circles stay), ids?: [id, id] (default: the selection)} join two circles (paths whose outline is a circle, not hidden or locked) into one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. Overlapping and touching circles are joined too; one circle inside the other, or circles too far apart for the radius (the arcs would not reach both, or would cross), is an error, which suggests a larger radius when one up to 1000% would bridge them. One undo step; the outline is selected → {id}", + "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", has_selection, bridge )] } fn bridge(s: &mut Session, p: &Value) -> Result { - let percent = given(p, "radius", Some(RADII), C)?.unwrap_or(RADIUS); + let percent = given(p, "radius", Some(RADII), C)?; + let gap = given(p, "gap", Some(GAPS), C)?; + let reach = given(p, "reach", Some(REACHES), C)?.unwrap_or(REACH); + if percent.is_some() && gap.is_some() { + // As the parameter check words it (`EXCLUSIVE_KEYS`), for a caller that skips that check. + let (key, other) = ("radius", "gap"); + return Err(bad(C, format!("give `{key}` or `{other}`, not both"))); + } + let arc = match gap { + Some(gap) => pt::ArcRadius::Gap(gap), + None => pt::ArcRadius::Share(percent.unwrap_or(RADIUS) / 100.0), + }; let keep = switch_or(p, "keepOriginals", false, C)?; - let roots = checked_ids_or_selection(s, p, C)?; + let mut roots = checked_ids_or_selection(s, p, C)?; + // An id given twice is one circle. + roots.sort_unstable(); + roots.dedup(); + if roots.len() > pt::MAX_BRIDGED_CIRCLES { + return Err(bad(C, "select at most 2000 circles to bridge")); + } let circles: Vec<(NodeId, pt::Circle)> = { let d = &s.doc()?.doc; let editable = d.editable(); @@ -48,48 +72,94 @@ fn bridge(s: &mut Session, p: &Value) -> Result { }) .collect() }; - let ([(below, a), (above, b)], 2) = (circles.as_slice(), roots.len()) else { - return Err(bad(C, "select two circles to bridge")); - }; - let (below, above) = (*below, *above); - let at = |percent: f64| pt::smooth_bridge(*a, *b, a.radius.min(b.radius) * percent / 100.0); - let outline = match at(percent) { - Ok(sp) => PathData::single(sp), - Err(pt::BridgeError::Inside) => return Err(bad(C, "one circle is inside the other")), - // A larger radius bridges circles a smaller one cannot, so only suggest one that is allowed. - Err(pt::BridgeError::TooFar) if at(RADII.1).is_ok() => { - return Err(bad(C, "the circles are too far apart for this radius: raise the radius")); + if circles.len() != roots.len() || circles.len() < 2 { + return Err(bad(C, "select two or more circles to bridge")); + } + let only: Vec = circles.iter().map(|(_, c)| *c).collect(); + // Each shape: the circles it joins, in paint order, and its outline. + let (shapes, alone): (Vec<(Vec, PathData)>, Vec) = match only.as_slice() { + [a, b] => match pt::smooth_bridge(*a, *b, arc.between(*a, *b)) { + Ok(sp) => (vec![(roots_of(&circles, &[0, 1]), PathData::single(sp))], vec![]), + Err(e) => return Err(refusal(e, arc, *a, *b)), + }, + _ => { + let made = pt::bridge_many(&only, arc, reach).map_err(|e| match e { + pt::ManyError::TooManyCircles => bad(C, "select at most 2000 circles to bridge"), + pt::ManyError::TooManyBridges => bad(C, "that makes too many bridges (at most 8000): lower the reach"), + pt::ManyError::NoneInReach => bad(C, "no two circles are within reach: raise the reach"), + pt::ManyError::TooComplex => bad(C, "the bridged circles are too complex to unite"), + pt::ManyError::Pair(i, j, e) => match (only.get(i), only.get(j)) { + (Some(a), Some(b)) => refusal(e, arc, *a, *b), + _ => bad(C, "select two or more circles to bridge"), + }, + pt::ManyError::Bad => bad(C, "select two or more circles to bridge"), + })?; + let shapes = made.joined.into_iter().map(|j| (roots_of(&circles, &j.members), j.outline)).collect(); + (shapes, roots_of(&circles, &made.alone)) } - Err(pt::BridgeError::TooFar) => return Err(bad(C, "the circles are too far apart for this radius")), - Err(pt::BridgeError::Bad) => return Err(bad(C, "select two circles to bridge")), }; - let id = s.edit(LABEL, |d, sel| { - let id = if keep { - // A copy of the upper circle (its appearance) with the outline as its path, right above - // it; the circles stay as they are, live shapes included. - // Fresh ids throughout, its opacity mask's art included. - let upper = d.node(above).cloned().ok_or(EngineError::NoNode(above))?; - let mut n = d.reid(&upper); - if let NodeKind::Path { path, live, .. } = &mut n.kind { - *path = outline; - *live = None; + let made = s.edit(LABEL, |d, sel| { + let mut made = Vec::with_capacity(shapes.len()); + if keep { + // A copy of each shape's topmost circle (its appearance) with the outline as its path, + // right above it; the circles stay as they are, live shapes included. Fresh ids + // throughout, an opacity mask's art included. + let tops: Vec = shapes.iter().filter_map(|(members, _)| members.last().copied()).collect(); + let mut beside = Beside::above(d, &tops); + for ((_, outline), top) in shapes.into_iter().zip(tops) { + let upper = d.node(top).cloned().ok_or(EngineError::NoNode(top))?; + let mut n = d.reid(&upper); + if let NodeKind::Path { path, live, .. } = &mut n.kind { + *path = outline; + *live = None; + } + made.push(n.id); + beside.put(d, top, vec![n])?; } - let id = n.id; - let mut beside = Beside::above(d, &[above]); - beside.put(d, above, vec![n])?; beside.finish(d)?; - id } else { - // The upper circle becomes the outline (a plain path now) and the lower one goes. - if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(above).map(|n| &mut n.kind) { - *path = outline; - *live = None; + // Each shape's topmost circle becomes its outline (a plain path now) and the others go. + let mut gone = vec![]; + for (members, outline) in shapes { + let Some((&top, rest)) = members.split_last() else { continue }; + if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(top).map(|n| &mut n.kind) { + *path = outline; + *live = None; + } + made.push(top); + gone.extend_from_slice(rest); } - remove_each(d, &[below])?; - above - }; - sel.set([id]); - Ok(id) + remove_each(d, &gone)?; + } + sel.set(made.iter().chain(&alone).copied()); + Ok(made) })?; - Ok(json!({ "id": id.0 })) + let mut out = json!({ "ids": made.iter().map(|id| id.0).collect::>(), "alone": alone.iter().map(|id| id.0).collect::>() }); + if let ([id], 2) = (made.as_slice(), only.len()) { + out["id"] = json!(id.0); + } + Ok(out) +} + +/// The ids of `circles` at indices `at`, in paint order (the circles are listed in paint order). +fn roots_of(circles: &[(NodeId, pt::Circle)], at: &[usize]) -> Vec { + at.iter().filter_map(|&i| circles.get(i)).map(|(id, _)| *id).collect() +} + +/// The error for circles `a` and `b` that arcs of `arc` can't bridge. A larger radius or gap +/// bridges circles a smaller one cannot, so it suggests one only when the largest allowed would. +fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, a: pt::Circle, b: pt::Circle) -> EngineError { + let largest = match arc { + pt::ArcRadius::Share(_) => pt::ArcRadius::Share(RADII.1 / 100.0), + pt::ArcRadius::Gap(_) => pt::ArcRadius::Gap(GAPS.1), + }; + let would = pt::smooth_bridge(a, b, largest.between(a, b)).is_ok(); + match (e, arc, would) { + (pt::BridgeError::Inside, ..) => bad(C, "one circle is inside the other"), + (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), true) => bad(C, "the circles are too far apart for this radius: raise the radius"), + (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), false) => bad(C, "the circles are too far apart for this radius"), + (pt::BridgeError::TooFar, pt::ArcRadius::Gap(_), true) => bad(C, "the circles are too far apart for this gap: raise the gap"), + (pt::BridgeError::TooFar, pt::ArcRadius::Gap(_), false) => bad(C, "the circles are too far apart for this gap"), + (pt::BridgeError::Bad, ..) => bad(C, "select two or more circles to bridge"), + } } diff --git a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs index 01320c07c1..6c491904e6 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs @@ -1,5 +1,5 @@ -//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius, -//! and what it refuses. +//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius or +//! gap, many circles joined to their neighbors within reach, and what it refuses. use serde_json::{Value, json}; use vectorcraft_doc::{NodeId, NodeKind}; @@ -46,6 +46,8 @@ fn two_circles_become_one_outline_in_the_upper_ones_place() { let steps = s.doc().unwrap().history.undo.len(); let r = s.execute(BRIDGE, &json!({})).unwrap(); assert_eq!(r["id"], json!(b.0)); + assert_eq!(r["ids"], json!([b.0]), "the same result fields as for more circles"); + assert_eq!(r["alone"], json!([])); assert_eq!(top_level(&s), [b]); let d = &s.doc().unwrap().doc; let NodeKind::Path { path, live, .. } = &d.node(b).unwrap().kind else { panic!("a path") }; @@ -158,9 +160,11 @@ fn far_apart_nested_and_other_objects_are_refused() { assert!(e.ends_with("the circles are too far apart for this radius"), "{e}"); } assert!(err(&mut s, json!({"ids": [a.0, inner.0]})).contains("one circle is inside the other")); - for ids in [json!([a.0, square.0]), json!([a.0, oval.0]), json!([a.0]), json!([a.0, far.0, inner.0])] { - assert!(err(&mut s, json!({ "ids": ids })).contains("select two circles to bridge"), "{ids}"); + for ids in [json!([a.0, square.0]), json!([a.0, oval.0]), json!([a.0]), json!([a.0, far.0, square.0])] { + assert!(err(&mut s, json!({ "ids": ids })).contains("select two or more circles to bridge"), "{ids}"); } + // Three circles: each two within reach are bridged, and one inside another is refused there too. + assert!(err(&mut s, json!({"ids": [a.0, far.0, inner.0]})).contains("one circle is inside the other")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": 0.5})).contains("`radius` must be from 1 to 1000")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": 1001})).contains("`radius`")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": "big"})).contains("`radius` must be a number")); @@ -169,6 +173,157 @@ fn far_apart_nested_and_other_objects_are_refused() { assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); } +/// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), in rows from (100, 100). +fn grid(s: &mut Session) -> Vec { + (0..9).map(|k| circle(s, 100.0 + 24.0 * (k % 3) as f64, 100.0 + 24.0 * (k / 3) as f64, 10.0)).collect() +} + +fn ids(v: &Value) -> Vec { + v.as_array().unwrap().iter().map(|i| NodeId(i.as_u64().unwrap())).collect() +} + +fn path(s: &Session, id: NodeId) -> vectorcraft_geom::PathData { + s.doc().unwrap().doc.node(id).unwrap().path_data().unwrap().clone() +} + +#[test] +fn a_grid_of_circles_joins_each_to_its_neighbors_in_one_shape() { + let mut s = session(); + let g = grid(&mut s); + select(&mut s, &g); + let steps = s.doc().unwrap().history.undo.len(); + // Reach 5: the side neighbors (4 apart) are bridged, the diagonal ones (about 13.9 apart) not. + let r = s.execute(BRIDGE, &json!({"gap": 4, "reach": 5})).unwrap(); + assert_eq!(ids(&r["ids"]), [g[8]], "one shape, in the topmost circle's place"); + assert_eq!(ids(&r["alone"]), []); + assert_eq!(top_level(&s), [g[8]]); + assert_eq!(s.doc().unwrap().selection.objects.to_vec(), [g[8]]); + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1, "one undo step"); + // Its outline and a hole in each square of four circles, which no diagonal bridge fills. + let outline = path(&s, g[8]); + assert_eq!(outline.subpaths.len(), 5, "{}", outline.subpaths.len()); + let inside = |p: &vectorcraft_geom::PathData, x: f64, y: f64| p.to_bezpath().winding(vectorcraft_geom::kurbo::Point::new(x, y)) != 0; + assert!(inside(&outline, 112.0, 100.0) && inside(&outline, 100.0, 112.0) && !inside(&outline, 112.0, 112.0)); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(top_level(&s), g); + // Reach 15 takes in the diagonal neighbors, whose bridges fill the middle of each square. + select(&mut s, &g); + s.execute(BRIDGE, &json!({"gap": 4, "reach": 15})).unwrap(); + let outline = path(&s, g[8]); + assert_eq!(outline.subpaths.len(), 1); + assert!(inside(&outline, 112.0, 112.0)); +} + +#[test] +fn a_circle_with_no_neighbor_in_reach_stays_as_it_is() { + let mut s = session(); + let g = grid(&mut s); + let far = circle(&mut s, 300.0, 250.0, 10.0); + let pair = [circle(&mut s, 300.0, 40.0, 8.0), circle(&mut s, 320.0, 40.0, 8.0)]; + let mut all = g.clone(); + all.extend([far, pair[0], pair[1]]); + let r = s.execute(BRIDGE, &json!({"ids": all.iter().map(|i| i.0).collect::>(), "reach": 5})).unwrap(); + assert_eq!(ids(&r["ids"]), [g[8], pair[1]]); + assert_eq!(ids(&r["alone"]), [far]); + assert_eq!(top_level(&s), [g[8], far, pair[1]]); + assert!(matches!(&s.doc().unwrap().doc.node(far).unwrap().kind, NodeKind::Path { live: Some(_), .. }), "untouched"); + let mut selected = s.doc().unwrap().selection.objects.to_vec(); + selected.sort(); + let mut want = vec![g[8], pair[1], far]; + want.sort(); + assert_eq!(selected, want, "the shapes and the circle left alone"); +} + +#[test] +fn keep_originals_adds_each_shape_above_its_topmost_circle() { + let mut s = session(); + let row: Vec = (0..3).map(|i| circle(&mut s, 100.0 + 25.0 * i as f64, 100.0, 10.0)).collect(); + let other = [circle(&mut s, 100.0, 200.0, 10.0), circle(&mut s, 122.0, 200.0, 10.0)]; + s.execute("paint.setFill", &json!({"ids": [row[2].0], "color": "#00ff00"})).unwrap(); + let all: Vec = row.iter().chain(&other).map(|i| i.0).collect(); + let r = s.execute(BRIDGE, &json!({"ids": all, "keepOriginals": true})).unwrap(); + let made = ids(&r["ids"]); + assert_eq!(made.len(), 2); + assert_eq!(top_level(&s), [row[0], row[1], row[2], made[0], other[0], other[1], made[1]]); + let d = &s.doc().unwrap().doc; + assert_eq!(d.node(made[0]).unwrap().appearance, d.node(row[2]).unwrap().appearance, "painted as the topmost circle"); + let b = d.node(made[0]).unwrap().path_data().unwrap().bounds().unwrap(); + assert!((b.x0 - 90.0).abs() < 1e-2 && (b.x1 - 160.0).abs() < 1e-2, "{b:?}"); +} + +#[test] +fn the_gap_form_gives_arcs_the_smaller_radius_plus_the_gap() { + let area_with = |p: Value| { + let mut s = session(); + let a = circle(&mut s, 100.0, 100.0, 10.0); + let b = circle(&mut s, 124.0, 100.0, 10.0); + let mut p = p; + p["ids"] = json!([a.0, b.0]); + let id = NodeId(s.execute(BRIDGE, &p).unwrap()["id"].as_u64().unwrap()); + area(&s, id) + }; + // Radius 10 plus a gap of 4 is 140% of 10. + let (gap, percent) = (area_with(json!({"gap": 4})), area_with(json!({"radius": 140}))); + assert!((gap - percent).abs() < 1e-9, "{gap} {percent}"); + assert!(area_with(json!({"gap": 0})) < gap && gap < area_with(json!({"gap": 20}))); +} + +#[test] +fn many_circle_and_gap_refusals() { + let mut s = session(); + let a = circle(&mut s, 50.0, 100.0, 10.0); + let b = circle(&mut s, 250.0, 100.0, 10.0); + let c = circle(&mut s, 330.0, 100.0, 10.0); + let far = circle(&mut s, 380.0, 100.0, 10.0); + let before = top_level(&s); + let steps = s.doc().unwrap().history.undo.len(); + assert!(err(&mut s, json!({"ids": [a.0, b.0], "radius": 100, "gap": 4})).contains("give `radius` or `gap`, not both")); + // Centers 200 apart: a gap of 0 does not bridge them, the largest (1000 pt) does. With centers + // 330 apart even that one closes the neck: it stays open only below 2 × √(10² + 2 × 10 × 1010) + // ≈ 285. + assert!(err(&mut s, json!({"ids": [a.0, b.0], "gap": 0})).ends_with("too far apart for this gap: raise the gap")); + assert!(err(&mut s, json!({"ids": [a.0, far.0], "gap": 0})).ends_with("the circles are too far apart for this gap")); + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": 5})).contains("no two circles are within reach: raise the reach")); + // b and c are 60 apart: within a reach of 100, but too far for the default radius. + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": 100})).ends_with("too far apart for this radius: raise the radius")); + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": -1})).contains("`reach` must be from 0 to 10000")); + assert!(err(&mut s, json!({"ids": [a.0, b.0], "gap": 1001})).contains("`gap` must be from 0 to 1000")); + assert_eq!(top_level(&s), before); + assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); +} + +#[test] +fn too_many_circles_or_bridges_are_refused() { + let mut s = session(); + // 130 overlapping circles in a row: 8,385 pairs within reach. + let row: Vec = (0..130).map(|i| circle(&mut s, 20.0 + i as f64 * 0.2, 100.0, 10.0).0).collect(); + assert!(err(&mut s, json!({ "ids": row })).contains("that makes too many bridges (at most 8000): lower the reach")); + let many: Vec = (0..2001).map(|i| circle(&mut s, 20.0 + (i % 50) as f64 * 7.0, 150.0 + (i / 50) as f64 * 3.0, 1.0).0).collect(); + assert!(err(&mut s, json!({ "ids": many })).contains("select at most 2000 circles to bridge")); +} + +#[test] +fn an_id_given_twice_is_one_circle() { + let mut s = session(); + let a = circle(&mut s, 100.0, 100.0, 20.0); + let b = circle(&mut s, 150.0, 100.0, 20.0); + let r = s.execute(BRIDGE, &json!({"ids": [a.0, a.0, b.0]})).unwrap(); + assert_eq!(r["id"], json!(b.0), "two circles, bridged"); + assert_eq!(top_level(&s), [b]); +} + +#[test] +fn small_circles_at_the_default_reach_bridge_the_pairs_the_arcs_can_join() { + let mut s = session(); + // Radius 3: arcs of 3 pt (100%) join a and b (2 apart) but close before reaching c (6 from b, + // within the default reach of 10). + let (a, b, c) = (circle(&mut s, 100.0, 100.0, 3.0), circle(&mut s, 108.0, 100.0, 3.0), circle(&mut s, 120.0, 100.0, 3.0)); + let r = s.execute(BRIDGE, &json!({"ids": [a.0, b.0, c.0]})).unwrap(); + assert_eq!(ids(&r["ids"]), [b]); + assert_eq!(ids(&r["alone"]), [c]); + assert_eq!(top_level(&s), [b, c]); +} + #[test] fn locked_and_hidden_circles_are_not_bridged() { let mut s = session(); @@ -176,9 +331,9 @@ fn locked_and_hidden_circles_are_not_bridged() { let b = circle(&mut s, 150.0, 100.0, 20.0); select(&mut s, &[b]); s.execute("object.lock", &json!({})).unwrap(); - assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two circles to bridge")); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two or more circles to bridge")); s.execute("object.unlockAll", &json!({})).unwrap(); select(&mut s, &[a]); s.execute("object.hide", &json!({})).unwrap(); - assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two circles to bridge")); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two or more circles to bridge")); } diff --git a/crates/engine/src/cmd/params.rs b/crates/engine/src/cmd/params.rs index fdf7dd4b19..098bd473de 100644 --- a/crates/engine/src/cmd/params.rs +++ b/crates/engine/src/cmd/params.rs @@ -258,7 +258,8 @@ pub fn check_keys(id: &str, doc: &'static str, params: &Value) -> Result<()> { /// Parameters a command takes instead of one another: (command, key, other key). Giving both, /// neither null, is a parameter error ([`check_exclusive_keys`]). -const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids")]; +const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = + &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids"), ("addon.pathtools.bridge", "radius", "gap")]; /// `params` of command `id` give at most one of each pair in [`EXCLUSIVE_KEYS`], or the parameter /// error naming the pair. diff --git a/crates/engine/tests/command_sweep.rs b/crates/engine/tests/command_sweep.rs index 42286f2efd..b3c11f1c0f 100644 --- a/crates/engine/tests/command_sweep.rs +++ b/crates/engine/tests/command_sweep.rs @@ -990,6 +990,8 @@ fn structured_junk() { ("addon.pathtools.bridge", json!({"radius": 1e-308, "keepOriginals": "x"})), ("addon.pathtools.bridge", json!({"radius": 1000, "keepOriginals": true, "ids": [0, 1, 2, 3, u64::MAX]})), ("addon.pathtools.bridge", json!({"radius": f64::MAX, "ids": [1, 1], "junk": [0]})), + ("addon.pathtools.bridge", json!({"gap": -1e308, "reach": f64::MAX, "ids": [0, 1, 2]})), + ("addon.pathtools.bridge", json!({"gap": 1000, "reach": 10000, "radius": null, "keepOriginals": true})), // Refused before anything is written: no format of that name, a time that is no time. ("addon.document.saveTimestampedCopy", json!({"format": "png", "folder": 7})), ("addon.document.saveTimestampedCopy", json!({"format": "svg", "time": [1e308], "folder": null})), diff --git a/crates/pathops/src/addons/pathtools.rs b/crates/pathops/src/addons/pathtools.rs index fb3cf15520..6e7ac43bb6 100644 --- a/crates/pathops/src/addons/pathtools.rs +++ b/crates/pathops/src/addons/pathtools.rs @@ -4,7 +4,8 @@ //! tool shows over a path, open paths lengthened or shortened at an end ([`extend`]), the places //! where paths cross ([`crossings`]), the stretches between them ([`spans`]), anchors slid along //! their path ([`slide`]), touching edges merged ([`shared_edge`]), paths divided into dashes -//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]) and the +//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]) or many circles +//! joined to their neighbors ([`bridge_many`]) and the //! Parametric Shape Tool's shapes ([`shapes`]). mod bridge; @@ -23,7 +24,9 @@ use std::collections::BTreeSet; use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Vec2}; use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; -pub use bridge::{BridgeError, Circle, circle_of, smooth_bridge}; +pub use bridge::{ + ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, circle_of, smooth_bridge, +}; pub use crossings::{MAX_CROSSED_BY_SEGMENTS, MAX_CROSSING_SEGMENTS, Place, Work, crossings, crossings_on, crossings_on_within, insert_at}; pub use dashes::{DashSpec, Piece, divide_dashes}; pub use extend::{ExtendMode, extend_length_to, extend_open}; diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index d30c0ce87a..89cee8977b 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -1,10 +1,14 @@ //! Smooth Bridge: two circles joined into one outline by two concave arcs, each touching both -//! circles from outside, so the outline runs on smoothly from each circle into the bridge. +//! circles from outside, so the outline runs on smoothly from each circle into the bridge; and +//! many circles joined at once, each to the others within reach ([`bridge_many`]). +use std::collections::{BTreeMap, HashMap, HashSet}; use std::f64::consts::{FRAC_PI_2, PI, TAU}; use kurbo::{CubicBez, ParamCurve, Point, Shape, Vec2}; -use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; +use vectorcraft_geom::{Anchor, AnchorKind, FillRule, PathData, SubPath, shapes}; + +use crate::boolean::{DEFAULT_PRECISION, try_unite_all_with}; /// How far (as a share of the radius) a path's outline may stray from a circle and still be read /// as that circle. @@ -63,6 +67,58 @@ pub fn circle_of(path: &PathData) -> Option { /// a tangent there. Overlapping and touching circles are joined too. A larger radius makes a wider, /// gentler bridge; farther apart circles make a narrower one, until the arcs would cross. pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result { + let t = touches(a, b, radius)?; + let mut segs = vec![]; + arc(&mut segs, a.center, a.radius, t.a1, t.a2, Some(-t.u)); + arc(&mut segs, t.p2, radius, t.a2, t.b2, None); + arc(&mut segs, b.center, b.radius, t.b2, t.b1, Some(t.u)); + arc(&mut segs, t.p1, radius, t.b1, t.a1, None); + Ok(closed(&segs, AnchorKind::Smooth)) +} + +/// The part of [`smooth_bridge`]'s outline between the circles: the two arcs, joined across each +/// circle by a straight line between the arc ends on it. Each line lies inside its circle, so the +/// two circles and this shape unite into the outline, with each circle drawn once however many +/// bridges it has. +fn neck(a: Circle, b: Circle, radius: f64) -> Result { + let t = touches(a, b, radius)?; + let line = |p: Point, q: Point| CubicBez::new(p, p, q, q); + let mut segs = vec![]; + arc(&mut segs, t.p2, radius, t.a2, t.b2, None); + segs.push(line(t.b2, t.b1)); + arc(&mut segs, t.p1, radius, t.b1, t.a1, None); + segs.push(line(t.a1, t.a2)); + Ok(closed(&segs, AnchorKind::Corner)) +} + +/// A closed subpath through the cubics `segs`, each starting where the one before it ends, with +/// anchors of `kind`. +fn closed(segs: &[CubicBez], kind: AnchorKind) -> SubPath { + let count = segs.len(); + let anchors = (0..count) + .filter_map(|i| { + let (prev, seg) = (segs.get((i + count - 1) % count)?, segs.get(i)?); + Some(Anchor { p: seg.p0, h_in: prev.p2, h_out: seg.p1, kind }) + }) + .collect(); + SubPath::new(anchors, true) +} + +/// Where the arcs of radius `radius` that bridge circles `a` and `b` lie: the unit vector from +/// `a`'s center to `b`'s, and on each side the arc's center (`p1`, `p2`) and where it touches `a` +/// and `b`. +struct Touches { + u: Vec2, + p1: Point, + a1: Point, + b1: Point, + p2: Point, + a2: Point, + b2: Point, +} + +/// The arcs of [`smooth_bridge`], or why there are none. +fn touches(a: Circle, b: Circle, radius: f64) -> Result { let finite = |x: f64| x.is_finite() && x > 0.0; let points = [a.center, b.center].iter().all(|c| c.x.is_finite() && c.y.is_finite()); if !finite(radius) || !finite(a.radius) || !finite(b.radius) || !points { @@ -81,6 +137,10 @@ pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result Result f64 { + let r = a.radius.min(b.radius); + match self { + ArcRadius::Share(share) => r * share, + ArcRadius::Gap(gap) => r + gap, + } + } +} + +/// Circles that bridges join into one shape: their indices, ascending, and the shape's outline. +#[derive(Clone, Debug, PartialEq)] +pub struct Joined { + pub members: Vec, + pub outline: PathData, +} + +/// What [`bridge_many`] makes: the joined shapes, in the order of their first member, and the +/// indices of the circles left alone, ascending. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Bridged { + pub joined: Vec, + pub alone: Vec, +} + +/// Why [`bridge_many`] makes nothing. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ManyError { + /// More than [`MAX_BRIDGED_CIRCLES`] circles. + TooManyCircles, + /// More than [`MAX_BRIDGES`] pairs of circles within reach that the arcs can bridge. + TooManyBridges, + /// No two circles are within reach of each other. + NoneInReach, + /// The circles at these indices are within reach but [`smooth_bridge`] can't join them: one is + /// inside the other, or no pair within reach is near enough for the arcs (the first such pair). + Pair(usize, usize, BridgeError), + /// A reach that is not a finite size of 0 or more, or a circle that is not a finite size above 0. + Bad, + /// A joined shape too complex to unite. + TooComplex, +} + +/// Every pair of `circles` whose outlines are at most `reach` (pt) apart, overlapping ones +/// included, joined by a [`smooth_bridge`] with arcs of radius `arc`, and the bridges that connect +/// united into one shape each, without holes smaller than 1% of the smallest circle's area. A pair +/// too far apart for the arcs gets no bridge; a circle bridged to no other is left alone. One +/// circle inside another is an error, and so is no pair that the arcs can join. +pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result { + if circles.len() > MAX_BRIDGED_CIRCLES { + return Err(ManyError::TooManyCircles); + } + let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; + if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { + return Err(ManyError::Bad); + } + let (pairs, too_far) = pairs_within(circles, reach, arc)?; + match (pairs.is_empty(), too_far) { + (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), + (true, None) => return Err(ManyError::NoneInReach), + (false, _) => {} + } + // Each set of connected circles, under its lowest index. + let mut parent: Vec = (0..circles.len()).collect(); + let mut necks = Vec::with_capacity(pairs.len()); + for &(i, j) in &pairs { + let (a, b) = (circles[i], circles[j]); + let sp = neck(a, b, arc.between(a, b)).map_err(|e| ManyError::Pair(i, j, e))?; + necks.push(((i, j), PathData::single(sp))); + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let mut sets: BTreeMap, Vec<&PathData>)> = BTreeMap::new(); + for &((i, j), ref neck) in &necks { + let (members, parts) = sets.entry(root(&mut parent, i)).or_default(); + members.extend([i, j]); + parts.push(neck); + } + let mut out = Bridged::default(); + for (_, (mut members, parts)) in sets { + members.sort_unstable(); + members.dedup(); + // Each circle once, and the necks between them. + let rounds: Vec = members + .iter() + .filter_map(|&i| circles.get(i)) + .map(|c| shapes::ellipse(kurbo::Rect::from_center_size(c.center, (2.0 * c.radius, 2.0 * c.radius)))) + .collect(); + let fills: Vec<(&PathData, FillRule)> = rounds.iter().chain(parts).map(|p| (p, FillRule::NonZero)).collect(); + let smallest = members.iter().filter_map(|&i| circles.get(i)).map(|c| c.radius).fold(f64::INFINITY, f64::min); + // Fine enough for the smallest circle, whose bridges are narrower than it. + let precision = DEFAULT_PRECISION.min(smallest * 1e-3); + let mut outline = try_unite_all_with(&fills, precision).map_err(|_| ManyError::TooComplex)?; + // Where three bridges' arcs nearly meet, the union leaves a speck of a hole; a contour that + // encloses a circle is far larger than this. + let speck = SPECK * PI * smallest * smallest; + outline.subpaths.retain(|sp| PathData::single(sp.clone()).to_bezpath().area().abs() >= speck); + out.joined.push(Joined { members, outline }); + } + let joined: HashSet = necks.iter().flat_map(|&((i, j), _)| [i, j]).collect(); + out.alone = (0..circles.len()).filter(|i| !joined.contains(i)).collect(); + Ok(out) +} + +/// Two circles' indices, the lower first. +type Pair = (usize, usize); + +/// The set `i` is in: the lowest index in it, with the path to it shortened on the way. +fn root(parent: &mut [usize], mut i: usize) -> usize { + while parent[i] != i { + parent[i] = parent[parent[i]]; + i = parent[i]; + } + i +} + +/// Every pair of indices `(i, j)`, `i < j`, ascending, of `circles` whose outlines are at most +/// `reach` apart and that arcs of `arc` can bridge, and the lowest pair within reach that they +/// can't because it is too far apart for them. Circles go into a grid of cells as wide as the +/// farthest two centers within reach can be, so each circle is compared only with those in its own +/// cell and the eight around it. +fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec, Option), ManyError> { + let biggest = circles.iter().map(|c| c.radius).fold(0.0, f64::max); + let cell = 2.0 * biggest + reach; + if !(cell.is_finite() && cell > 0.0) { + return Err(ManyError::Bad); + } + // Saturating casts: a cell beyond i64 shares the last one, which only adds comparisons. + let key = |p: Point| ((p.x / cell).floor() as i64, (p.y / cell).floor() as i64); + let mut grid: HashMap<(i64, i64), Vec> = HashMap::new(); + for (i, c) in circles.iter().enumerate() { + grid.entry(key(c.center)).or_default().push(i); + } + let (mut pairs, mut too_far) = (vec![], None::); + for (i, &c) in circles.iter().enumerate() { + let (x, y) = key(c.center); + for (dx, dy) in (-1..=1).flat_map(|dx| (-1..=1).map(move |dy| (dx, dy))) { + let Some(near) = grid.get(&(x.saturating_add(dx), y.saturating_add(dy))) else { continue }; + for &j in near.iter().filter(|&&j| j > i) { + let o = circles[j]; + if c.center.distance(o.center) - c.radius - o.radius > reach { + continue; + } + // Only the arcs' ends are worked out here; the bridge itself is made later. + match touches(c, o, arc.between(c, o)) { + Ok(_) => pairs.push((i, j)), + Err(BridgeError::TooFar) => too_far = Some(too_far.map_or((i, j), |t| t.min((i, j)))), + Err(e) => return Err(ManyError::Pair(i, j, e)), + } + } + } + // Saturated cells can list a pair twice, so the count is checked again after `dedup`. + if pairs.len() > 9 * MAX_BRIDGES { + return Err(ManyError::TooManyBridges); + } + } + pairs.sort_unstable(); + pairs.dedup(); + if pairs.len() > MAX_BRIDGES { + return Err(ManyError::TooManyBridges); + } + Ok((pairs, too_far)) } /// Append to `out` the arc of the circle about `center` with radius `r` from `from` to `to` (both @@ -321,6 +553,188 @@ mod tests { assert_eq!(smooth_bridge(a, b, 0.0), Err(BridgeError::Bad)); assert_eq!(smooth_bridge(a, b, f64::NAN), Err(BridgeError::Bad)); assert_eq!(smooth_bridge(circle(f64::INFINITY, 0.0, 10.0), b, 10.0), Err(BridgeError::Bad)); + // Finite sizes whose squares overflow. + assert_eq!(smooth_bridge(circle(0.0, 0.0, 1e154), circle(1e154, 0.0, 1e154), 1e154), Err(BridgeError::Bad)); + } + + /// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), top-left at the origin. + fn grid() -> Vec { + (0..9).map(|k| circle(24.0 * (k % 3) as f64, 24.0 * (k / 3) as f64, 10.0)).collect() + } + + fn area(path: &PathData) -> f64 { + crate::area(path, FillRule::NonZero) + } + + fn inside(path: &PathData, x: f64, y: f64) -> bool { + path.to_bezpath().winding(Point::new(x, y)) != 0 + } + + #[test] + fn a_grid_joins_each_circle_to_its_neighbors_within_reach() { + // Reach 5: the side neighbors (4 apart) are joined, the diagonal ones (about 13.9 apart) not. + let b = bridge_many(&grid(), ArcRadius::Gap(4.0), 5.0).unwrap(); + assert_eq!(b.alone, Vec::::new()); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert_eq!(one.members, (0..9).collect::>()); + for (x, y) in [(12.0, 0.0), (0.0, 12.0), (36.0, 48.0), (48.0, 36.0), (24.0, 24.0)] { + assert!(inside(&one.outline, x, y), "bridged at ({x}, {y})"); + } + // Between four circles the side bridges' arcs leave a hole: no diagonal bridge fills it. + for (x, y) in [(12.0, 12.0), (36.0, 36.0)] { + assert!(!inside(&one.outline, x, y), "a hole at ({x}, {y})"); + } + let hull = PathData::single(SubPath::polyline( + &[Point::new(-10.0, -10.0), Point::new(58.0, -10.0), Point::new(58.0, 58.0), Point::new(-10.0, 58.0)], + true, + )); + assert!(area(&one.outline) < area(&hull)); + assert_eq!(one.outline.subpaths.len(), 5, "the outline and a hole in each square"); + // Reach 15 takes in the diagonal neighbors too, and their bridges fill the middle of each + // square. The specks of holes (about 0.1 pt²) where side and diagonal arcs nearly meet are + // filled. + let b = bridge_many(&grid(), ArcRadius::Gap(4.0), 15.0).unwrap(); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert!(inside(&one.outline, 12.0, 12.0) && inside(&one.outline, 36.0, 36.0)); + assert_eq!(one.outline.subpaths.len(), 1); + } + + #[test] + fn a_circle_with_no_neighbor_in_reach_is_left_alone() { + let mut circles = grid(); + circles.truncate(2); + circles.push(circle(200.0, 0.0, 10.0)); + circles.push(circle(224.0, 0.0, 10.0)); + circles.push(circle(100.0, 100.0, 10.0)); + let b = bridge_many(&circles, ArcRadius::Share(1.0), 5.0).unwrap(); + assert_eq!(b.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![0, 1], vec![2, 3]]); + assert_eq!(b.alone, [4]); + // Each pair alone is the two-circle bridge. + let two = smooth_bridge(circles[0], circles[1], 10.0).unwrap(); + let (got, want) = (area(&b.joined[0].outline), area(&PathData::single(two))); + assert!((got - want).abs() < 1e-3 * want, "{got} {want}"); + } + + #[test] + fn a_ring_around_an_empty_place_leaves_a_round_hole_the_gap_wider_than_a_circle() { + // Six circles of radius 10 around an empty place at the origin, each 4 from its two + // neighbors and from where a seventh circle would be (centers 24 from the origin). + let ring: Vec = (0..6).map(|k| f64::from(k) * PI / 3.0).map(|t| circle(24.0 * t.cos(), 24.0 * t.sin(), 10.0)).collect(); + let b = bridge_many(&ring, ArcRadius::Gap(4.0), 5.0).unwrap(); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert_eq!(one.members, (0..6).collect::>()); + assert_eq!(one.outline.subpaths.len(), 2, "the outline and the hole"); + // The hole's edge is 14 from the origin all the way round: a circle of radius 10 there + // would be 4 from the shape everywhere, the same as from each of the six. + let hole = one.outline.subpaths.iter().min_by(|p, q| { + let size = |sp: &SubPath| PathData::single(sp.clone()).to_bezpath().area().abs(); + size(p).total_cmp(&size(q)) + }); + let edge = outline(hole.unwrap()); + let (near, far) = edge.iter().map(|p| p.distance(Point::ZERO)).fold((f64::INFINITY, 0.0f64), |(n, f), d| (n.min(d), f.max(d))); + assert!((near - 14.0).abs() < 1e-2 && (far - 14.0).abs() < 1e-2, "{near} to {far}"); + } + + #[test] + fn many_circles_make_the_two_circle_outline_for_each_pair() { + // Overlapping, touching, unequal and unequal overlapping pairs, each with a far circle. + for (a, b, share) in [ + (circle(0.0, 0.0, 20.0), circle(30.0, 0.0, 20.0), 0.5), + (circle(0.0, 0.0, 20.0), circle(40.0, 0.0, 20.0), 0.5), + (circle(0.0, 0.0, 30.0), circle(70.0, 0.0, 10.0), 4.0), + (circle(0.0, 0.0, 10.0), circle(25.0, 0.0, 30.0), 10.0), + // Circles far smaller than the union's usual precision (0.01 pt). + (circle(0.0, 0.0, 0.004), circle(0.01, 0.0, 0.004), 1.0), + ] { + let made = bridge_many(&[a, b, circle(1000.0, 0.0, 5.0)], ArcRadius::Share(share), 40.0).unwrap(); + assert_eq!(made.alone, [2]); + let two = smooth_bridge(a, b, share * a.radius.min(b.radius)).unwrap(); + let (got, want) = (area(&made.joined[0].outline), area(&PathData::single(two))); + assert!((got - want).abs() < 1e-3 * want, "{a:?}: {got} {want}"); + } + } + + #[test] + fn a_pair_too_far_apart_for_the_arcs_gets_no_bridge() { + // b and c are within reach (6 apart) but arcs of radius 3 close before they reach both. + let (a, b, c) = (circle(0.0, 0.0, 3.0), circle(8.0, 0.0, 3.0), circle(20.0, 0.0, 3.0)); + assert_eq!(smooth_bridge(b, c, 3.0), Err(BridgeError::TooFar)); + let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 10.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![0, 1]]); + assert_eq!(made.alone, [2]); + // 260 touching circles in a row with a wide reach: 33,670 pairs within reach, far more than + // the bridge limit, but only the 259 touching pairs are near enough for the arcs. + let row: Vec = (0..260).map(|i| circle(f64::from(i) * 20.0, 0.0, 10.0)).collect(); + let made = bridge_many(&row, ArcRadius::Share(1.0), 6000.0).unwrap(); + let [one] = made.joined.as_slice() else { panic!("{} shapes", made.joined.len()) }; + assert_eq!(one.members.len(), 260); + assert!(made.alone.is_empty()); + } + + #[test] + fn the_gap_form_keeps_the_gap_from_a_circle_at_each_arcs_center() { + // Two circles 4 apart; with a gap of 4 each arc's center is 24 from both centers, where a + // third circle of the same size is 4 from both (as in a triangular grid). + let (a, b) = (circle(0.0, 0.0, 10.0), circle(24.0, 0.0, 10.0)); + let r = ArcRadius::Gap(4.0).between(a, b); + assert_eq!(r, 14.0); + let sp = smooth_bridge(a, b, r).unwrap(); + for third in [circle(12.0, 432f64.sqrt(), 10.0), circle(12.0, -(432f64.sqrt()), 10.0)] { + let gaps: Vec = outline(&sp).iter().map(|p| p.distance(third.center) - third.radius).collect(); + // No part of the bridge comes nearer than the gap, and a stretch of it is that gap away. + assert!(gaps.iter().all(|&g| g > 4.0 - 1e-2), "{:?}", gaps.iter().copied().fold(f64::INFINITY, f64::min)); + let along = gaps.iter().filter(|&&g| (g - 4.0).abs() < 1e-2).count(); + assert!(along >= 32, "{along}"); + } + // The same for unequal circles: the gap is kept from a circle of the smaller one's size. + let (a, b) = (circle(0.0, 0.0, 15.0), circle(30.0, 5.0, 8.0)); + let r = ArcRadius::Gap(3.0).between(a, b); + let sp = smooth_bridge(a, b, r).unwrap(); + let d = (b.center - a.center).hypot(); + let (ra, rb) = (15.0 + r, 8.0 + r); + let along = (d * d + ra * ra - rb * rb) / (2.0 * d); + let u = (b.center - a.center) / d; + let center = a.center + u * along + Vec2::new(-u.y, u.x) * (ra * ra - along * along).sqrt(); + let gaps: Vec = outline(&sp).iter().map(|p| p.distance(center) - 8.0).collect(); + assert!(gaps.iter().all(|&g| g > 3.0 - 1e-2) && gaps.iter().filter(|&&g| (g - 3.0).abs() < 1e-2).count() >= 16); + } + + #[test] + fn the_gap_form_is_the_percentage_form_of_the_radius_plus_the_gap() { + for (a, b, gap) in [(circle(0.0, 0.0, 10.0), circle(24.0, 0.0, 10.0), 4.0), (circle(0.0, 0.0, 20.0), circle(40.0, 30.0, 10.0), 7.5)] { + let small = a.radius.min(b.radius); + let share = ArcRadius::Share((small + gap) / small); + assert!((ArcRadius::Gap(gap).between(a, b) - share.between(a, b)).abs() < 1e-12); + let (g, s) = (smooth_bridge(a, b, ArcRadius::Gap(gap).between(a, b)).unwrap(), smooth_bridge(a, b, share.between(a, b)).unwrap()); + for (p, q) in g.anchors.iter().zip(&s.anchors) { + assert!(p.p.distance(q.p) < 1e-9 && p.h_in.distance(q.h_in) < 1e-9 && p.h_out.distance(q.h_out) < 1e-9); + } + assert_eq!(g.anchors.len(), s.anchors.len()); + } + // Over a grid the two forms make the same shape too. + let by_gap = bridge_many(&grid(), ArcRadius::Gap(4.0), 5.0).unwrap(); + let by_share = bridge_many(&grid(), ArcRadius::Share(1.4), 5.0).unwrap(); + let (g, s) = (area(&by_gap.joined[0].outline), area(&by_share.joined[0].outline)); + assert!((g - s).abs() < 1e-6 * g, "{g} {s}"); + } + + #[test] + fn too_many_circles_or_bridges_and_bad_pairs_are_refused() { + let many = vec![circle(0.0, 0.0, 1.0); MAX_BRIDGED_CIRCLES + 1]; + assert_eq!(bridge_many(&many, ArcRadius::Share(1.0), 1.0), Err(ManyError::TooManyCircles)); + // 200 circles in a tight row: 19,900 pairs within reach. + let row: Vec = (0..200).map(|i| circle(i as f64 * 0.1, 0.0, 10.0)).collect(); + assert_eq!(bridge_many(&row, ArcRadius::Share(1.0), 1.0), Err(ManyError::TooManyBridges)); + let spread: Vec = (0..3).map(|i| circle(i as f64 * 100.0, 0.0, 10.0)).collect(); + assert_eq!(bridge_many(&spread, ArcRadius::Share(1.0), 5.0), Err(ManyError::NoneInReach)); + let nested = [circle(0.0, 0.0, 30.0), circle(5.0, 0.0, 10.0), circle(200.0, 0.0, 10.0)]; + assert_eq!(bridge_many(&nested, ArcRadius::Share(1.0), 5.0), Err(ManyError::Pair(0, 1, BridgeError::Inside))); + // Within reach (40 apart) but too far for arcs of radius 1. + let far = [circle(0.0, 0.0, 10.0), circle(60.0, 0.0, 10.0), circle(300.0, 0.0, 10.0)]; + assert_eq!(bridge_many(&far, ArcRadius::Share(0.1), 50.0), Err(ManyError::Pair(0, 1, BridgeError::TooFar))); + assert_eq!(bridge_many(&far, ArcRadius::Share(1.0), f64::NAN), Err(ManyError::Bad)); + assert_eq!(bridge_many(&far, ArcRadius::Share(1.0), -1.0), Err(ManyError::Bad)); + assert_eq!(bridge_many(&[circle(f64::INFINITY, 0.0, 1.0), far[0]], ArcRadius::Share(1.0), 1.0), Err(ManyError::Bad)); } #[test] diff --git a/crates/ui-egui/src/addons/pathtools/bridge.rs b/crates/ui-egui/src/addons/pathtools/bridge.rs index 4b9926d616..5d6a18d282 100644 --- a/crates/ui-egui/src/addons/pathtools/bridge.rs +++ b/crates/ui-egui/src/addons/pathtools/bridge.rs @@ -1,6 +1,7 @@ //! Smooth Bridge in the interface: its dialog (the arcs' radius as a percentage of the smaller -//! circle's radius, Keep Originals), which previews on the canvas and runs `addon.pathtools.bridge` -//! on OK. +//! circle's radius, or with Constant Gap that radius plus a gap; the reach, unavailable with two +//! circles selected; Keep Originals), which previews on the canvas and runs +//! `addon.pathtools.bridge` on OK. use egui::Ui; use serde_json::{Value, json}; @@ -16,27 +17,61 @@ pub const KIND: &str = "smoothBridge"; /// The radius the command takes (%), and its default. const RADII: std::ops::RangeInclusive = 1.0..=1000.0; const RADIUS: f64 = 100.0; +/// The gap the command takes (pt), and the dialog's first one. +const GAPS: std::ops::RangeInclusive = 0.0..=1000.0; +const GAP: f64 = 4.0; +/// The reach the command takes (pt), and its default. +const REACHES: std::ops::RangeInclusive = 0.0..=10000.0; +const REACH: f64 = 10.0; 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!({ "radius": RADIUS, "keepOriginals": false }) + json!({ "radius": RADIUS, "constantGap": false, "gap": GAP, "reach": REACH, "keepOriginals": false }) } pub(crate) const SPEC: DialogSpec = DialogSpec { heading: |_| tl!("Smooth Bridge").to_string(), body, confirm, preview: true, min_width: 280.0, ..DialogSpec::FORM }; -/// The command's parameters from the dialog's fields. +/// The command's parameters from the dialog's fields: the radius, or with Constant Gap the gap. fn params(d: &Dialog) -> Value { - json!({ "radius": d.f64("radius", RADIUS), "keepOriginals": d.bool("keepOriginals") }) + let (reach, keep) = (d.f64("reach", REACH), d.bool("keepOriginals")); + if d.bool("constantGap") { + json!({ "gap": d.f64("gap", GAP), "reach": reach, "keepOriginals": keep }) + } else { + json!({ "radius": d.f64("radius", RADIUS), "reach": reach, "keepOriginals": keep }) + } } fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { - widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| { - if let Some(v) = widgets::range_field(ui, ("dlg-num", "radius"), d.f64("radius", RADIUS), RADII, "%", 0, FIELD_W) { - d.fields.insert("radius".into(), json!(v)); + let unit = app.session.general_unit(); + form::check(ui, d, "constantGap", tl!("Constant Gap")); + if d.bool("constantGap") { + widgets::label_row(ui, tl!("Gap:"), LABEL_W, |ui| { + form::length_within(ui, d, "gap", unit, FIELD_W, Some(GAPS)); + }); + } else { + widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| { + if let Some(v) = widgets::range_field(ui, ("dlg-num", "radius"), d.f64("radius", RADIUS), RADII, "%", 0, FIELD_W) { + d.fields.insert("radius".into(), json!(v)); + } + }); + } + // The reach applies to three or more circles; two are bridged at any distance. Counted once, + // before a preview replaces the selection with its result. + let many = match d.fields.get("many").and_then(Value::as_bool) { + Some(many) => many, + None => { + let many = app.session.doc().map(|doc| doc.selection.objects.len() > 2).unwrap_or(true); + d.fields.insert("many".into(), json!(many)); + many } + }; + ui.add_enabled_ui(many, |ui| { + widgets::label_row(ui, tl!("Reach:"), LABEL_W, |ui| { + form::length_within(ui, d, "reach", unit, FIELD_W, Some(REACHES)); + }); }); form::check(ui, d, "keepOriginals", tl!("Keep Originals")); form::preview(app, ui, d, "Smooth Bridge", COMMAND, params(d)); @@ -72,9 +107,11 @@ mod tests { 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 ["Smooth Bridge", "Radius:", "Keep Originals", "Preview"] { + for s in ["Smooth Bridge", "Constant Gap", "Radius:", "Reach:", "Keep Originals", "Preview"] { assert!(shown.contains(s), "{s} in {shown}"); } + assert!(!shown.contains("Gap:"), "{shown}"); + assert!(!app.ui.dialog.as_ref().unwrap().bool("many"), "Reach unavailable for two circles"); let count = |app: &VectorcraftApp| app.session.doc().unwrap().doc.layers[0].children().unwrap().len(); app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true)); painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); @@ -89,4 +126,30 @@ mod tests { assert_eq!(app.session.doc().unwrap().history.undo.len(), n + 1); assert_eq!(count(&app), 3, "the circles and the outline above them"); } + + #[test] + fn constant_gap_shows_the_gap_and_bridges_many_circles_within_reach() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + // Three circles 4 apart in a row and one far off. + let ids: Vec = [100.0, 124.0, 148.0, 300.0].iter().map(|&x| circle(&mut app, x, 10.0)).collect(); + app.run("select.set", json!({ "ids": ids })).unwrap(); + menus::invoke(&mut app, super::COMMAND, serde_json::Value::Null); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("constantGap".into(), json!(true)); + let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert!(shown.contains("Gap:") && !shown.contains("Radius:"), "{shown}"); + // A preview leaves two objects selected (one shape and the far circle); Reach stays + // available for the four circles the command still bridges. + app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true)); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert_eq!(app.session.doc().unwrap().selection.objects.len(), 2, "previewed"); + assert!(app.ui.dialog.as_ref().unwrap().bool("many"), "Reach available for four circles"); + let p = super::params(app.ui.dialog.as_ref().unwrap()); + assert_eq!(p, json!({"gap": 4.0, "reach": 10.0, "keepOriginals": false}), "the gap, not the radius"); + crate::dialogs::confirm(&mut app).unwrap(); + let top: Vec = app.session.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id.0).collect(); + assert_eq!(top, [ids[2], ids[3]], "one shape in the topmost joined circle's place, and the far circle"); + } } diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index c02d223cc5..47dcc1b925 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6730,10 +6730,18 @@ breakText Glyphs Глифи Smooth Bridge… Плавен мост… Smooth Bridge Плавен мост Keep Originals Запазване на оригиналите -@msg select two circles to bridge изберете два кръга за свързване +@msg select two or more circles to bridge изберете два или повече кръга за свързване @msg one circle is inside the other единият кръг е вътре в другия @msg the circles are too far apart for this radius: raise the radius кръговете са твърде далеч един от друг за този радиус: увеличете радиуса @msg the circles are too far apart for this radius кръговете са твърде далеч един от друг за този радиус + Constant Gap Постоянно разстояние + Reach: Обхват: +@msg the circles are too far apart for this gap: raise the gap кръговете са твърде далеч един от друг за това разстояние: увеличете разстоянието +@msg the circles are too far apart for this gap кръговете са твърде далеч един от друг за това разстояние +@msg no two circles are within reach: raise the reach няма два кръга в обхват: увеличете обхвата +@msg select at most 2000 circles to bridge изберете най-много 2000 кръга за свързване +@msg that makes too many bridges (at most 8000): lower the reach това дава твърде много мостове (най-много 8000): намалете обхвата +@msg the bridged circles are too complex to unite свързаните кръгове са твърде сложни за обединяване # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Разширяване на тиретата в пътища @msg select paths with dashed strokes to expand изберете пътища с прекъснат щрих за разширяване diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a12ad12217..ae6efda00e 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6782,10 +6782,18 @@ shape Open Otvoren Smooth Bridge… Glatki most… Smooth Bridge Glatki most Keep Originals Zadrži originale -@msg select two circles to bridge odaberite dva kruga za premošćavanje +@msg select two or more circles to bridge odaberite dva ili više krugova za premošćavanje @msg one circle is inside the other jedan krug je unutar drugog @msg the circles are too far apart for this radius: raise the radius krugovi su predaleko jedan od drugog za ovaj radijus: povećajte radijus @msg the circles are too far apart for this radius krugovi su predaleko jedan od drugog za ovaj radijus + Constant Gap Stalni razmak + Reach: Domet: +@msg the circles are too far apart for this gap: raise the gap krugovi su predaleko jedan od drugog za ovaj razmak: povećajte razmak +@msg the circles are too far apart for this gap krugovi su predaleko jedan od drugog za ovaj razmak +@msg no two circles are within reach: raise the reach nijedna dva kruga nisu u dometu: povećajte domet +@msg select at most 2000 circles to bridge odaberite najviše 2000 krugova za premošćavanje +@msg that makes too many bridges (at most 8000): lower the reach to daje previše mostova (najviše 8000): smanjite domet +@msg the bridged circles are too complex to unite premošteni krugovi su previše složeni za spajanje # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Proširi crtice u putanje @msg select paths with dashed strokes to expand odaberite putanje s isprekidanim potezom za proširivanje diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3331879355..f203d1c391 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7362,10 +7362,18 @@ breakText Glyphs Glifs Smooth Bridge… Pont suau… Smooth Bridge Pont suau Keep Originals Conserva els originals -@msg select two circles to bridge seleccioneu dos cercles per unir-los +@msg select two or more circles to bridge seleccioneu dos o més cercles per unir-los @msg one circle is inside the other un cercle és dins de l’altre @msg the circles are too far apart for this radius: raise the radius els cercles estan massa separats per a aquest radi: augmenteu el radi @msg the circles are too far apart for this radius els cercles estan massa separats per a aquest radi + Constant Gap Separació constant + Reach: Abast: +@msg the circles are too far apart for this gap: raise the gap els cercles estan massa separats per a aquesta separació: augmenteu la separació +@msg the circles are too far apart for this gap els cercles estan massa separats per a aquesta separació +@msg no two circles are within reach: raise the reach no hi ha dos cercles dins de l’abast: augmenteu l’abast +@msg select at most 2000 circles to bridge seleccioneu com a màxim 2000 cercles per unir-los +@msg that makes too many bridges (at most 8000): lower the reach això fa massa ponts (com a màxim 8000): reduïu l’abast +@msg the bridged circles are too complex to unite els cercles units són massa complexos per combinar-los # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandeix els guions en camins @msg select paths with dashed strokes to expand seleccioneu camins amb traç discontinu per expandir diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 2414401f14..93298b77d3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -7366,10 +7366,18 @@ breakText Glyphs Glyfy Smooth Bridge… Hladký most… Smooth Bridge Hladký most Keep Originals Zachovat originály -@msg select two circles to bridge vyberte dva kruhy k propojení +@msg select two or more circles to bridge vyberte dva nebo více kruhů k propojení @msg one circle is inside the other jeden kruh je uvnitř druhého @msg the circles are too far apart for this radius: raise the radius kruhy jsou pro tento poloměr příliš daleko od sebe: zvětšete poloměr @msg the circles are too far apart for this radius kruhy jsou pro tento poloměr příliš daleko od sebe + Constant Gap Stálá mezera + Reach: Dosah: +@msg the circles are too far apart for this gap: raise the gap kruhy jsou pro tuto mezeru příliš daleko od sebe: zvětšete mezeru +@msg the circles are too far apart for this gap kruhy jsou pro tuto mezeru příliš daleko od sebe +@msg no two circles are within reach: raise the reach žádné dva kruhy nejsou v dosahu: zvětšete dosah +@msg select at most 2000 circles to bridge vyberte nejvýše 2000 kruhů k propojení +@msg that makes too many bridges (at most 8000): lower the reach to dává příliš mnoho mostů (nejvýše 8000): zmenšete dosah +@msg the bridged circles are too complex to unite propojené kruhy jsou příliš složité na sloučení # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Rozložit čárky na cesty @msg select paths with dashed strokes to expand vyberte cesty s čárkovaným tahem k rozložení diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 15937fb835..60b4e7ba73 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7415,10 +7415,18 @@ breakText Glyphs Glyffer Smooth Bridge… Blød bro… Smooth Bridge Blød bro Keep Originals Behold originaler -@msg select two circles to bridge vælg to cirkler, der skal forbindes +@msg select two or more circles to bridge vælg to eller flere cirkler, der skal forbindes @msg one circle is inside the other den ene cirkel er inden i den anden @msg the circles are too far apart for this radius: raise the radius cirklerne er for langt fra hinanden til denne radius: gør radius større @msg the circles are too far apart for this radius cirklerne er for langt fra hinanden til denne radius + Constant Gap Konstant afstand + Reach: Rækkevidde: +@msg the circles are too far apart for this gap: raise the gap cirklerne er for langt fra hinanden til denne afstand: gør afstanden større +@msg the circles are too far apart for this gap cirklerne er for langt fra hinanden til denne afstand +@msg no two circles are within reach: raise the reach ingen to cirkler er inden for rækkevidde: gør rækkevidden større +@msg select at most 2000 circles to bridge vælg højst 2000 cirkler, der skal forbindes +@msg that makes too many bridges (at most 8000): lower the reach det giver for mange broer (højst 8000): gør rækkevidden mindre +@msg the bridged circles are too complex to unite de forbundne cirkler er for komplekse til at blive samlet # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Udvid streger til stier @msg select paths with dashed strokes to expand vælg stier med stiplet streg, der skal udvides diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 03edf98a47..c96832b28d 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6957,10 +6957,18 @@ breakText Glyphs Glyphen Smooth Bridge… Weiche Brücke… Smooth Bridge Weiche Brücke Keep Originals Originale beibehalten -@msg select two circles to bridge wählen Sie zwei Kreise zum Verbinden aus +@msg select two or more circles to bridge wählen Sie zwei oder mehr Kreise zum Verbinden aus @msg one circle is inside the other ein Kreis liegt im anderen @msg the circles are too far apart for this radius: raise the radius die Kreise liegen für diesen Radius zu weit auseinander: vergrößern Sie den Radius @msg the circles are too far apart for this radius die Kreise liegen für diesen Radius zu weit auseinander + Constant Gap Konstanter Abstand + Reach: Reichweite: +@msg the circles are too far apart for this gap: raise the gap die Kreise liegen für diesen Abstand zu weit auseinander: vergrößern Sie den Abstand +@msg the circles are too far apart for this gap die Kreise liegen für diesen Abstand zu weit auseinander +@msg no two circles are within reach: raise the reach keine zwei Kreise liegen in Reichweite: vergrößern Sie die Reichweite +@msg select at most 2000 circles to bridge wählen Sie höchstens 2000 Kreise zum Verbinden aus +@msg that makes too many bridges (at most 8000): lower the reach das ergibt zu viele Brücken (höchstens 8000): verringern Sie die Reichweite +@msg the bridged circles are too complex to unite die verbundenen Kreise sind zu komplex zum Vereinen # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Striche in Pfade umwandeln @msg select paths with dashed strokes to expand wählen Sie Pfade mit gestrichelter Kontur zum Umwandeln aus diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 95c95ebb07..37d7874dc4 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7335,10 +7335,18 @@ breakText Glyphs Γλύφοι Smooth Bridge… Ομαλή γέφυρα… Smooth Bridge Ομαλή γέφυρα Keep Originals Διατήρηση πρωτοτύπων -@msg select two circles to bridge επιλέξτε δύο κύκλους για γεφύρωση +@msg select two or more circles to bridge επιλέξτε δύο ή περισσότερους κύκλους για γεφύρωση @msg one circle is inside the other ο ένας κύκλος βρίσκεται μέσα στον άλλο @msg the circles are too far apart for this radius: raise the radius οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα: αυξήστε την ακτίνα @msg the circles are too far apart for this radius οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα + Constant Gap Σταθερή απόσταση + Reach: Εμβέλεια: +@msg the circles are too far apart for this gap: raise the gap οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την απόσταση: αυξήστε την απόσταση +@msg the circles are too far apart for this gap οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την απόσταση +@msg no two circles are within reach: raise the reach δεν υπάρχουν δύο κύκλοι εντός εμβέλειας: αυξήστε την εμβέλεια +@msg select at most 2000 circles to bridge επιλέξτε έως 2000 κύκλους για γεφύρωση +@msg that makes too many bridges (at most 8000): lower the reach αυτό δημιουργεί πάρα πολλές γέφυρες (έως 8000): μειώστε την εμβέλεια +@msg the bridged circles are too complex to unite οι γεφυρωμένοι κύκλοι είναι πολύ σύνθετοι για ένωση # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Επέκταση παυλών σε διαδρομές @msg select paths with dashed strokes to expand επιλέξτε διαδρομές με διακεκομμένο περίγραμμα για επέκταση diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c8efe22c3f..19129e08c6 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7323,10 +7323,18 @@ breakText Glyphs Glifos Smooth Bridge… Puente suave… Smooth Bridge Puente suave Keep Originals Conservar originales -@msg select two circles to bridge seleccione dos círculos para unir +@msg select two or more circles to bridge seleccione dos o más círculos para unir @msg one circle is inside the other un círculo está dentro del otro @msg the circles are too far apart for this radius: raise the radius los círculos están demasiado separados para este radio: aumente el radio @msg the circles are too far apart for this radius los círculos están demasiado separados para este radio + Constant Gap Separación constante + Reach: Alcance: +@msg the circles are too far apart for this gap: raise the gap los círculos están demasiado separados para esta separación: aumente la separación +@msg the circles are too far apart for this gap los círculos están demasiado separados para esta separación +@msg no two circles are within reach: raise the reach no hay dos círculos dentro del alcance: aumente el alcance +@msg select at most 2000 circles to bridge seleccione como máximo 2000 círculos para unir +@msg that makes too many bridges (at most 8000): lower the reach eso crea demasiados puentes (como máximo 8000): reduzca el alcance +@msg the bridged circles are too complex to unite los círculos unidos son demasiado complejos para combinarlos # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandir guiones en trazados @msg select paths with dashed strokes to expand seleccione trazados con trazo discontinuo para expandir diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 2360844d2d..80bd584ac2 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7411,10 +7411,18 @@ breakText Glyphs Merkit Smooth Bridge… Pehmeä silta… Smooth Bridge Pehmeä silta Keep Originals Säilytä alkuperäiset -@msg select two circles to bridge valitse kaksi yhdistettävää ympyrää +@msg select two or more circles to bridge valitse vähintään kaksi yhdistettävää ympyrää @msg one circle is inside the other toinen ympyrä on toisen sisällä @msg the circles are too far apart for this radius: raise the radius ympyrät ovat liian kaukana toisistaan tälle säteelle: suurenna sädettä @msg the circles are too far apart for this radius ympyrät ovat liian kaukana toisistaan tälle säteelle + Constant Gap Vakioväli + Reach: Ulottuvuus: +@msg the circles are too far apart for this gap: raise the gap ympyrät ovat liian kaukana toisistaan tälle välille: suurenna väliä +@msg the circles are too far apart for this gap ympyrät ovat liian kaukana toisistaan tälle välille +@msg no two circles are within reach: raise the reach mitkään kaksi ympyrää eivät ole ulottuvilla: suurenna ulottuvuutta +@msg select at most 2000 circles to bridge valitse enintään 2000 yhdistettävää ympyrää +@msg that makes too many bridges (at most 8000): lower the reach siitä tulee liikaa siltoja (enintään 8000): pienennä ulottuvuutta +@msg the bridged circles are too complex to unite yhdistetyt ympyrät ovat liian monimutkaisia koottaviksi yhdeksi muodoksi # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Laajenna viivat poluiksi @msg select paths with dashed strokes to expand valitse laajennettavat polut, joissa on katkoviiva diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index fc5bdc4a41..e22e233840 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7361,10 +7361,18 @@ breakText Glyphs Glyphes Smooth Bridge… Pont lissé… Smooth Bridge Pont lissé Keep Originals Conserver les originaux -@msg select two circles to bridge sélectionnez deux cercles à relier +@msg select two or more circles to bridge sélectionnez au moins deux cercles à relier @msg one circle is inside the other un cercle est à l’intérieur de l’autre @msg the circles are too far apart for this radius: raise the radius les cercles sont trop éloignés pour ce rayon : augmentez le rayon @msg the circles are too far apart for this radius les cercles sont trop éloignés pour ce rayon + Constant Gap Écart constant + Reach: Portée : +@msg the circles are too far apart for this gap: raise the gap les cercles sont trop éloignés pour cet écart : augmentez l’écart +@msg the circles are too far apart for this gap les cercles sont trop éloignés pour cet écart +@msg no two circles are within reach: raise the reach aucun couple de cercles n’est à portée : augmentez la portée +@msg select at most 2000 circles to bridge sélectionnez au plus 2000 cercles à relier +@msg that makes too many bridges (at most 8000): lower the reach cela crée trop de ponts (au plus 8000) : réduisez la portée +@msg the bridged circles are too complex to unite les cercles reliés sont trop complexes pour être réunis # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Décomposer les tirets en tracés @msg select paths with dashed strokes to expand sélectionnez des tracés à contour pointillé à décomposer diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 972d2a2c50..efd5f80a48 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -702,6 +702,7 @@ Constrain મર્યાદિત કરો Constrain Angle ખૂણો મર્યાદિત કરો Constrain Width and Height Proportions પહોળાઈ અને ઊંચાઈનો પ્રમાણ મર્યાદિત કરો + Constant Gap સ્થિર ગેપ Construction Guides બાંધકામ ગાઇડ્સ Contextual Alternates સંદર્ભિત વૈકલ્પિક અક્ષરો Contextual Task Bar સંદર્ભિત ટાસ્ક બાર @@ -2857,6 +2858,7 @@ Rating: રેટિંગ: Ratio ગુણોત્તર Rays કિરણો + Reach: પહોંચ: Read Action Set File ક્રિયા સેટ ફાઇલ વાંચો Read Shortcut Set File શોર્ટકટ સેટ ફાઇલ વાંચો Read files you open in its format and make documents from them તમે ખોલો તે ફાઇલોને તેના ફોર્મેટમાં વાંચો અને તેમાંથી દસ્તાવેજ બનાવો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 544d82a416..7467d75acf 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1014,6 +1014,7 @@ antiAlias Sharp शार्प Connect Selected End Points सिलेक्टेड एंड पॉइंट्स कनेक्ट करें Consider Open Filled Paths as Closed बंद के रूप में ओपन भरा पाथ पर विचार करें Consolidate All Windows सभी विंडो एक साथ लाएँ + Constant Gap स्थिर गैप Constrain सीमित करें Constrain Angle कंस्ट्रेन एंगल Constrain Width and Height Proportions चौड़ाई और ऊंचाई का अनुपात बनाए रखें @@ -3838,6 +3839,7 @@ antiAlias Sharp शार्प Rating: रेटिंग: Ratio अनुपात Rays रे + Reach: पहुँच: Read Action Set File एक्शन सेट फ़ाइल पढ़ें Read Shortcut Set File शॉर्टकट सेट फ़ाइल पढ़ें Reads or sets environment variables एनवायरनमेंट वेरिएबल्स पढ़ता है या सेट करता है @@ -7757,6 +7759,7 @@ antiAlias Sharp शार्प @msg Offset Path: select paths ऑफसेट पाथ: सिलेक्शन पाथ @msg Offset Path: the offset leaves nothing of the selected paths (an inset larger than the shapes) ऑफसेट पाथ: ऑफ़सेट सिलेक्टेड पाथ की कुछ भी नहीं छोड़ता है (आकार की तुलना में एक निर्धारित बड़ा) @msg Offset Path: the path is too complex to offset ऑफसेट पाथ: पाथ ऑफसेट करने के लिए बहुत जटिल है +@msg no two circles are within reach: raise the reach कोई भी दो वृत्त पहुँच के भीतर नहीं हैं: पहुँच बढ़ाएँ @msg on must be true or false on को true या false होना चाहिए @msg one circle is inside the other एक वृत्त दूसरे के अंदर है @msg only a dock group above or below others collapses, not one beside another केवल दूसरों के ऊपर या नीचे एक डॉक समूह गिर जाता है, एक दूसरे के बगल में नहीं @@ -8019,6 +8022,7 @@ antiAlias Sharp शार्प @msg select artwork to make a group of its colours अपने रंगों का एक समूह बनाने के लिए आर्टवर्क सिलेक्ट करें @msg select artwork to recolour, or give a colour `group` रंग बदलने के लिए आर्टवर्क चुनें या रंग `group` दें @msg select at least two objects कम से कम दो ऑब्जेक्ट चुनें +@msg select at most 2000 circles to bridge जोड़ने के लिए अधिकतम 2000 वृत्त चुनें @msg Select dimensions to update अद्यतन करने के लिए आयाम सिलेक्ट करें @msg select exactly two objects वास्तव में दो ऑब्जेक्ट चुनें @msg select exactly two path ends to join जोड़ने के लिए ठीक दो पाथ एंड पॉइंट्स सिलेक्ट करें @@ -8067,7 +8071,7 @@ antiAlias Sharp शार्प @msg select the objects to attach to the path ऑब्जेक्ट्स का सिलेक्ट करने के लिए संलग्न करने के लिए पाथ @msg select the objects to bind ऑब्जेक्ट्स को बांधने के लिए चुनें @msg select the objects to transform in perspective ऑब्जेक्ट्स को पर्सपेक्टिव में बदलने के लिए चुनें -@msg select two circles to bridge जोड़ने के लिए दो वृत्त चुनें +@msg select two or more circles to bridge जोड़ने के लिए दो या अधिक वृत्त चुनें @msg select two open path ends, or two open paths, to average and join औसत निकालकर जोड़ने के लिए दो खुले पाथ एंड पॉइंट्स या दो खुले पाथ सिलेक्ट करें @msg select two or more graphic styles to merge दो या अधिक ग्राफिक स्टाइल्स का सिलेक्ट करने के लिए विलय @msg select two or more objects to distribute वितरित करने के लिए दो या दो से अधिक ऑब्जेक्ट चुनें @@ -8144,6 +8148,7 @@ antiAlias Sharp शार्प @msg the active document changed while the question was open; nothing was deleted प्रश्न खुला रहते हुए सक्रिय डॉक्यूमेंट बदल गया; कुछ भी नहीं हटाया गया @msg that document is no longer open यह डॉक्यूमेंट अब खुला नहीं है @msg that makes more than {MAX_PIECES} slices जो {MAX_PIECES} स्लाइस से अधिक बनाता है +@msg that makes too many bridges (at most 8000): lower the reach इससे बहुत अधिक ब्रिज बनते हैं (अधिकतम 8000): पहुँच घटाएँ @msg that makes too many pieces (at most 100000): make the dashes longer जो बहुत सारे टुकड़े बनाता है (अधिकांश 100000 में): डैश को लंबे समय तक बनाते हैं @msg that object is not in the overlap उस ऑब्जेक्ट को ओवरलैप में नहीं है @msg the {tool} tool has no options {tool} टूल में कोई ऑप्शन्स नहीं है @@ -8232,7 +8237,10 @@ antiAlias Sharp शार्प @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size आर्टबोर्ड कैनवास पर फिट नहीं हैं: कम आर्टबोर्ड, कम रिक्ति या छोटे आकार @msg the background worker stopped पृष्ठभूमि कार्यकर्ता बंद कर दिया @msg the blend has no spine मिश्रण में कोई रीढ़ नहीं है +@msg the bridged circles are too complex to unite जोड़े गए वृत्त मिलाने के लिए बहुत जटिल हैं @msg the character's size can't be measured कैरेक्टर का आकार मापा नहीं जा सकता है +@msg the circles are too far apart for this gap इस गैप के लिए वृत्त एक-दूसरे से बहुत दूर हैं +@msg the circles are too far apart for this gap: raise the gap इस गैप के लिए वृत्त एक-दूसरे से बहुत दूर हैं: गैप बढ़ाएँ @msg the circles are too far apart for this radius इस त्रिज्या के लिए वृत्त एक-दूसरे से बहुत दूर हैं @msg the circles are too far apart for this radius: raise the radius इस त्रिज्या के लिए वृत्त एक-दूसरे से बहुत दूर हैं: त्रिज्या बढ़ाएँ @msg the CMYK image couldn't be written CMYK इमेज को नहीं लिखा जा सकता diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 2e844865bc..d386463076 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -7351,10 +7351,18 @@ breakText Glyphs Glifák Smooth Bridge… Sima híd… Smooth Bridge Sima híd Keep Originals Eredetik megtartása -@msg select two circles to bridge jelöljön ki két kört az összekötéshez +@msg select two or more circles to bridge jelöljön ki legalább két kört az összekötéshez @msg one circle is inside the other az egyik kör a másikon belül van @msg the circles are too far apart for this radius: raise the radius a körök túl messze vannak egymástól ehhez a sugárhoz: növelje a sugarat @msg the circles are too far apart for this radius a körök túl messze vannak egymástól ehhez a sugárhoz + Constant Gap Állandó hézag + Reach: Hatótávolság: +@msg the circles are too far apart for this gap: raise the gap a körök túl messze vannak egymástól ehhez a hézaghoz: növelje a hézagot +@msg the circles are too far apart for this gap a körök túl messze vannak egymástól ehhez a hézaghoz +@msg no two circles are within reach: raise the reach nincs két kör hatótávolságon belül: növelje a hatótávolságot +@msg select at most 2000 circles to bridge legfeljebb 2000 kört jelöljön ki az összekötéshez +@msg that makes too many bridges (at most 8000): lower the reach ez túl sok hidat eredményez (legfeljebb 8000): csökkentse a hatótávolságot +@msg the bridged circles are too complex to unite az összekötött körök túl összetettek az egyesítéshez # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Szaggatások kibontása útvonalakká @msg select paths with dashed strokes to expand jelöljön ki szaggatott körvonalú útvonalakat a kibontáshoz diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 1c1778af25..e1d304f9e8 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6745,10 +6745,18 @@ breakText Glyphs Glif Smooth Bridge… Jembatan Halus… Smooth Bridge Jembatan Halus Keep Originals Pertahankan Asli -@msg select two circles to bridge pilih dua lingkaran untuk dijembatani +@msg select two or more circles to bridge pilih dua lingkaran atau lebih untuk dijembatani @msg one circle is inside the other satu lingkaran berada di dalam lingkaran lainnya @msg the circles are too far apart for this radius: raise the radius lingkaran terlalu berjauhan untuk radius ini: perbesar radius @msg the circles are too far apart for this radius lingkaran terlalu berjauhan untuk radius ini + Constant Gap Celah Tetap + Reach: Jangkauan: +@msg the circles are too far apart for this gap: raise the gap lingkaran terlalu berjauhan untuk celah ini: perbesar celah +@msg the circles are too far apart for this gap lingkaran terlalu berjauhan untuk celah ini +@msg no two circles are within reach: raise the reach tidak ada dua lingkaran dalam jangkauan: perbesar jangkauan +@msg select at most 2000 circles to bridge pilih paling banyak 2000 lingkaran untuk dijembatani +@msg that makes too many bridges (at most 8000): lower the reach itu membuat terlalu banyak jembatan (paling banyak 8000): perkecil jangkauan +@msg the bridged circles are too complex to unite lingkaran yang dijembatani terlalu rumit untuk disatukan # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Perluas garis putus menjadi jalur @msg select paths with dashed strokes to expand pilih jalur dengan stroke putus-putus yang akan diperluas diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08149bf5b9..d662cc1bac 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6993,10 +6993,18 @@ breakText Glyphs Glifi Smooth Bridge… Ponte morbido… Smooth Bridge Ponte morbido Keep Originals Mantieni originali -@msg select two circles to bridge seleziona due cerchi da unire +@msg select two or more circles to bridge seleziona due o più cerchi da unire @msg one circle is inside the other un cerchio è dentro l’altro @msg the circles are too far apart for this radius: raise the radius i cerchi sono troppo distanti per questo raggio: aumenta il raggio @msg the circles are too far apart for this radius i cerchi sono troppo distanti per questo raggio + Constant Gap Distanza costante + Reach: Portata: +@msg the circles are too far apart for this gap: raise the gap i cerchi sono troppo lontani per questa distanza: aumenta la distanza +@msg the circles are too far apart for this gap i cerchi sono troppo lontani per questa distanza +@msg no two circles are within reach: raise the reach nessuna coppia di cerchi è entro la portata: aumenta la portata +@msg select at most 2000 circles to bridge seleziona al massimo 2000 cerchi da unire +@msg that makes too many bridges (at most 8000): lower the reach così si creano troppi ponti (al massimo 8000): riduci la portata +@msg the bridged circles are too complex to unite i cerchi uniti sono troppo complessi da fondere # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Espandi trattini in tracciati @msg select paths with dashed strokes to expand seleziona tracciati con traccia tratteggiata da espandere diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 63d4f273e2..f69bcf3bc9 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8870,10 +8870,18 @@ breakText Glyphs 字形 Smooth Bridge… スムーズブリッジ… Smooth Bridge スムーズブリッジ Keep Originals オリジナルを保持 -@msg select two circles to bridge ブリッジでつなぐ円を 2 つ選択してください +@msg select two or more circles to bridge ブリッジでつなぐ円を 2 つ以上選択してください @msg one circle is inside the other 一方の円がもう一方の円の内側にあります @msg the circles are too far apart for this radius: raise the radius この半径では円が離れすぎています:半径を大きくしてください @msg the circles are too far apart for this radius この半径では円が離れすぎています + Constant Gap 一定の間隔 + Reach: 到達距離: +@msg the circles are too far apart for this gap: raise the gap この間隔では円が離れすぎています:間隔を大きくしてください +@msg the circles are too far apart for this gap この間隔では円が離れすぎています +@msg no two circles are within reach: raise the reach 到達距離内にある円の組がありません:到達距離を大きくしてください +@msg select at most 2000 circles to bridge ブリッジでつなぐ円は 2000 個以下で選択してください +@msg that makes too many bridges (at most 8000): lower the reach ブリッジが多すぎます(最大 8000):到達距離を小さくしてください +@msg the bridged circles are too complex to unite ブリッジでつないだ円が複雑すぎて合体できません # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 破線をパスに拡張 @msg select paths with dashed strokes to expand 拡張する破線のパスを選択してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 754a5e5400..7f035abf30 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9482,10 +9482,18 @@ breakText Glyphs გლიფები Smooth Bridge… გლუვი ხიდი… Smooth Bridge გლუვი ხიდი Keep Originals ორიგინალების შენარჩუნება -@msg select two circles to bridge აირჩიეთ ორი წრე დასაკავშირებლად +@msg select two or more circles to bridge აირჩიეთ ორი ან მეტი წრე დასაკავშირებლად @msg one circle is inside the other ერთი წრე მეორის შიგნითაა @msg the circles are too far apart for this radius: raise the radius ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა: გაზარდეთ რადიუსი @msg the circles are too far apart for this radius ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა + Constant Gap მუდმივი ღრეჩო + Reach: მიწვდომა: +@msg the circles are too far apart for this gap: raise the gap ამ ღრეჩოსთვის წრეები ერთმანეთისგან ძალიან შორსაა: გაზარდეთ ღრეჩო +@msg the circles are too far apart for this gap ამ ღრეჩოსთვის წრეები ერთმანეთისგან ძალიან შორსაა +@msg no two circles are within reach: raise the reach არცერთი ორი წრე არ არის მიწვდომის ფარგლებში: გაზარდეთ მიწვდომა +@msg select at most 2000 circles to bridge აირჩიეთ არაუმეტეს 2000 წრე დასაკავშირებლად +@msg that makes too many bridges (at most 8000): lower the reach ეს ძალიან ბევრ ხიდს ქმნის (არაუმეტეს 8000): შეამცირეთ მიწვდომა +@msg the bridged circles are too complex to unite დაკავშირებული წრეები ძალიან რთულია გასაერთიანებლად # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths ტირეების ტრაექტორიებად გაშლა @msg select paths with dashed strokes to expand აირჩიეთ გასაშლელი ტირეებიანი ხაზის კონტურები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 6a87fcbba7..38db9b6000 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6957,10 +6957,18 @@ breakText Glyphs 글리프 Smooth Bridge… 부드러운 브리지… Smooth Bridge 부드러운 브리지 Keep Originals 원본 유지 -@msg select two circles to bridge 연결할 원 두 개를 선택하십시오 +@msg select two or more circles to bridge 연결할 원을 두 개 이상 선택하십시오 @msg one circle is inside the other 한 원이 다른 원 안에 있습니다 @msg the circles are too far apart for this radius: raise the radius 이 반경에서는 원이 너무 멀리 떨어져 있습니다. 반경을 늘리십시오 @msg the circles are too far apart for this radius 이 반경에서는 원이 너무 멀리 떨어져 있습니다 + Constant Gap 일정한 간격 + Reach: 도달 거리: +@msg the circles are too far apart for this gap: raise the gap 이 간격에서는 원이 너무 멀리 떨어져 있습니다. 간격을 늘리십시오 +@msg the circles are too far apart for this gap 이 간격에서는 원이 너무 멀리 떨어져 있습니다 +@msg no two circles are within reach: raise the reach 도달 거리 안에 있는 두 원이 없습니다. 도달 거리를 늘리십시오 +@msg select at most 2000 circles to bridge 연결할 원을 2000개 이하로 선택하십시오 +@msg that makes too many bridges (at most 8000): lower the reach 브리지가 너무 많아집니다(최대 8000개). 도달 거리를 줄이십시오 +@msg the bridged circles are too complex to unite 연결된 원이 너무 복잡하여 합칠 수 없습니다 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 대시를 패스로 확장 @msg select paths with dashed strokes to expand 확장할 점선 획의 패스를 선택하십시오 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 45a370bd76..f8526a466e 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9240,10 +9240,18 @@ breakText Glyphs Glyphs Smooth Bridge… Vloeiende brug… Smooth Bridge Vloeiende brug Keep Originals Originelen behouden -@msg select two circles to bridge selecteer twee cirkels om te verbinden +@msg select two or more circles to bridge selecteer twee of meer cirkels om te verbinden @msg one circle is inside the other de ene cirkel ligt binnen de andere @msg the circles are too far apart for this radius: raise the radius de cirkels liggen te ver uit elkaar voor deze straal: vergroot de straal @msg the circles are too far apart for this radius de cirkels liggen te ver uit elkaar voor deze straal + Constant Gap Constante tussenruimte + Reach: Bereik: +@msg the circles are too far apart for this gap: raise the gap de cirkels liggen te ver uit elkaar voor deze tussenruimte: vergroot de tussenruimte +@msg the circles are too far apart for this gap de cirkels liggen te ver uit elkaar voor deze tussenruimte +@msg no two circles are within reach: raise the reach geen twee cirkels liggen binnen bereik: vergroot het bereik +@msg select at most 2000 circles to bridge selecteer hoogstens 2000 cirkels om te verbinden +@msg that makes too many bridges (at most 8000): lower the reach dat geeft te veel bruggen (hoogstens 8000): verklein het bereik +@msg the bridged circles are too complex to unite de verbonden cirkels zijn te complex om samen te voegen # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Streepjes uitbreiden tot paden @msg select paths with dashed strokes to expand selecteer paden met een streepjeslijn om uit te breiden diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 6dd5772422..23c245e8b1 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -7222,10 +7222,18 @@ breakText Glyphs Glify Smooth Bridge… Gładki most… Smooth Bridge Gładki most Keep Originals Zachowaj oryginały -@msg select two circles to bridge zaznacz dwa okręgi do połączenia +@msg select two or more circles to bridge zaznacz co najmniej dwa okręgi do połączenia @msg one circle is inside the other jeden okrąg jest wewnątrz drugiego @msg the circles are too far apart for this radius: raise the radius okręgi są zbyt daleko od siebie dla tego promienia: zwiększ promień @msg the circles are too far apart for this radius okręgi są zbyt daleko od siebie dla tego promienia + Constant Gap Stały odstęp + Reach: Zasięg: +@msg the circles are too far apart for this gap: raise the gap okręgi są zbyt daleko od siebie dla tego odstępu: zwiększ odstęp +@msg the circles are too far apart for this gap okręgi są zbyt daleko od siebie dla tego odstępu +@msg no two circles are within reach: raise the reach żadne dwa okręgi nie są w zasięgu: zwiększ zasięg +@msg select at most 2000 circles to bridge zaznacz najwyżej 2000 okręgów do połączenia +@msg that makes too many bridges (at most 8000): lower the reach to daje zbyt wiele mostów (najwyżej 8000): zmniejsz zasięg +@msg the bridged circles are too complex to unite połączone okręgi są zbyt złożone, aby je scalić # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Rozszerz kreski na ścieżki @msg select paths with dashed strokes to expand zaznacz ścieżki z przerywanym konturem do rozszerzenia diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 952535aed2..325ff1570f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -7397,10 +7397,18 @@ breakText Glyphs Glifos Smooth Bridge… Ponte suave… Smooth Bridge Ponte suave Keep Originals Manter originais -@msg select two circles to bridge selecione dois círculos para unir +@msg select two or more circles to bridge selecione dois ou mais círculos para unir @msg one circle is inside the other um círculo está dentro do outro @msg the circles are too far apart for this radius: raise the radius os círculos estão muito afastados para este raio: aumente o raio @msg the circles are too far apart for this radius os círculos estão muito afastados para este raio + Constant Gap Distância constante + Reach: Alcance: +@msg the circles are too far apart for this gap: raise the gap os círculos estão muito afastados para esta distância: aumente a distância +@msg the circles are too far apart for this gap os círculos estão muito afastados para esta distância +@msg no two circles are within reach: raise the reach nenhum par de círculos está dentro do alcance: aumente o alcance +@msg select at most 2000 circles to bridge selecione no máximo 2000 círculos para unir +@msg that makes too many bridges (at most 8000): lower the reach isso cria pontes demais (no máximo 8000): diminua o alcance +@msg the bridged circles are too complex to unite os círculos unidos são complexos demais para combinar # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandir traços em demarcadores @msg select paths with dashed strokes to expand selecione demarcadores com traçado tracejado para expandir diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 2a53122c4d..9469c1db83 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -7356,10 +7356,18 @@ breakText Glyphs Глифы Smooth Bridge… Плавный мост… Smooth Bridge Плавный мост Keep Originals Сохранить оригиналы -@msg select two circles to bridge выделите две окружности для соединения +@msg select two or more circles to bridge выделите две или более окружностей для соединения @msg one circle is inside the other одна окружность находится внутри другой @msg the circles are too far apart for this radius: raise the radius окружности слишком далеко друг от друга для этого радиуса: увеличьте радиус @msg the circles are too far apart for this radius окружности слишком далеко друг от друга для этого радиуса + Constant Gap Постоянный зазор + Reach: Охват: +@msg the circles are too far apart for this gap: raise the gap окружности слишком далеко друг от друга для этого зазора: увеличьте зазор +@msg the circles are too far apart for this gap окружности слишком далеко друг от друга для этого зазора +@msg no two circles are within reach: raise the reach нет двух окружностей в пределах охвата: увеличьте охват +@msg select at most 2000 circles to bridge выделите не более 2000 окружностей для соединения +@msg that makes too many bridges (at most 8000): lower the reach получается слишком много мостов (не более 8000): уменьшите охват +@msg the bridged circles are too complex to unite соединяемые окружности слишком сложны для объединения # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Разобрать штрихи на контуры @msg select paths with dashed strokes to expand выделите контуры со штриховой обводкой для разбора diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index a9f7159b01..9b5de2988f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -7382,10 +7382,18 @@ breakText Glyphs Glyfer Smooth Bridge… Mjuk brygga… Smooth Bridge Mjuk brygga Keep Originals Behåll original -@msg select two circles to bridge markera två cirklar att förbinda +@msg select two or more circles to bridge markera två eller fler cirklar att förbinda @msg one circle is inside the other den ena cirkeln ligger inuti den andra @msg the circles are too far apart for this radius: raise the radius cirklarna ligger för långt ifrån varandra för den här radien: öka radien @msg the circles are too far apart for this radius cirklarna ligger för långt ifrån varandra för den här radien + Constant Gap Konstant mellanrum + Reach: Räckvidd: +@msg the circles are too far apart for this gap: raise the gap cirklarna ligger för långt ifrån varandra för det här mellanrummet: öka mellanrummet +@msg the circles are too far apart for this gap cirklarna ligger för långt ifrån varandra för det här mellanrummet +@msg no two circles are within reach: raise the reach inga två cirklar ligger inom räckvidd: öka räckvidden +@msg select at most 2000 circles to bridge markera högst 2000 cirklar att förbinda +@msg that makes too many bridges (at most 8000): lower the reach det ger för många bryggor (högst 8000): minska räckvidden +@msg the bridged circles are too complex to unite de förbundna cirklarna är för komplexa för att slås ihop # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandera streck till banor @msg select paths with dashed strokes to expand markera banor med streckad kontur att expandera diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 3527e14166..0abeed0e99 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9244,10 +9244,18 @@ breakText Glyphs Glifler Smooth Bridge… Yumuşak Köprü… Smooth Bridge Yumuşak Köprü Keep Originals Orijinalleri Koru -@msg select two circles to bridge köprüyle birleştirilecek iki daire seçin +@msg select two or more circles to bridge köprüyle birleştirilecek iki veya daha fazla daire seçin @msg one circle is inside the other bir daire diğerinin içinde @msg the circles are too far apart for this radius: raise the radius daireler bu yarıçap için birbirinden çok uzak: yarıçapı artırın @msg the circles are too far apart for this radius daireler bu yarıçap için birbirinden çok uzak + Constant Gap Sabit Boşluk + Reach: Erişim: +@msg the circles are too far apart for this gap: raise the gap daireler bu boşluk için birbirinden çok uzak: boşluğu artırın +@msg the circles are too far apart for this gap daireler bu boşluk için birbirinden çok uzak +@msg no two circles are within reach: raise the reach erişim içinde hiçbir iki daire yok: erişimi artırın +@msg select at most 2000 circles to bridge köprüyle birleştirmek için en fazla 2000 daire seçin +@msg that makes too many bridges (at most 8000): lower the reach bu çok fazla köprü oluşturur (en fazla 8000): erişimi azaltın +@msg the bridged circles are too complex to unite köprülenen daireler birleştirilemeyecek kadar karmaşık # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Tireleri Yollara Genişlet @msg select paths with dashed strokes to expand genişletilecek kesikli konturlu yolları seçin diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 6d828ad424..9debbdf5f8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6975,10 +6975,18 @@ breakText Glyphs Гліфи Smooth Bridge… Плавний міст… Smooth Bridge Плавний міст Keep Originals Зберегти оригінали -@msg select two circles to bridge виділіть два кола для з’єднання +@msg select two or more circles to bridge виділіть два або більше кіл для з’єднання @msg one circle is inside the other одне коло всередині іншого @msg the circles are too far apart for this radius: raise the radius кола надто далеко одне від одного для цього радіуса: збільште радіус @msg the circles are too far apart for this radius кола надто далеко одне від одного для цього радіуса + Constant Gap Сталий проміжок + Reach: Охоплення: +@msg the circles are too far apart for this gap: raise the gap кола надто далеко одне від одного для цього проміжку: збільште проміжок +@msg the circles are too far apart for this gap кола надто далеко одне від одного для цього проміжку +@msg no two circles are within reach: raise the reach жодні два кола не перебувають у межах охоплення: збільште охоплення +@msg select at most 2000 circles to bridge виділіть не більше 2000 кіл для з’єднання +@msg that makes too many bridges (at most 8000): lower the reach це дає забагато мостів (не більше 8000): зменште охоплення +@msg the bridged circles are too complex to unite з’єднані кола надто складні для об’єднання # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Розібрати штрихи на контури @msg select paths with dashed strokes to expand виділіть контури зі штриховим обведенням для розбору diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index d9999727b7..78b6fc364d 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6992,10 +6992,18 @@ breakText Glyphs Glyph Smooth Bridge… Cầu nối mượt… Smooth Bridge Cầu nối mượt Keep Originals Giữ bản gốc -@msg select two circles to bridge chọn hai hình tròn để nối +@msg select two or more circles to bridge chọn hai hình tròn trở lên để nối @msg one circle is inside the other một hình tròn nằm bên trong hình tròn kia @msg the circles are too far apart for this radius: raise the radius các hình tròn cách nhau quá xa so với bán kính này: hãy tăng bán kính @msg the circles are too far apart for this radius các hình tròn cách nhau quá xa so với bán kính này + Constant Gap Khoảng hở cố định + Reach: Tầm với: +@msg the circles are too far apart for this gap: raise the gap các hình tròn cách nhau quá xa so với khoảng hở này: hãy tăng khoảng hở +@msg the circles are too far apart for this gap các hình tròn cách nhau quá xa so với khoảng hở này +@msg no two circles are within reach: raise the reach không có hai hình tròn nào trong tầm với: hãy tăng tầm với +@msg select at most 2000 circles to bridge chọn tối đa 2000 hình tròn để nối +@msg that makes too many bridges (at most 8000): lower the reach thao tác này tạo quá nhiều cầu nối (tối đa 8000): hãy giảm tầm với +@msg the bridged circles are too complex to unite các hình tròn được nối quá phức tạp để hợp nhất # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Mở rộng nét đứt thành đường dẫn @msg select paths with dashed strokes to expand chọn các đường dẫn có nét đứt để mở rộng diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 665b125122..da05670943 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -7207,10 +7207,18 @@ breakText Glyphs 字形 Smooth Bridge… 平滑桥接… Smooth Bridge 平滑桥接 Keep Originals 保留原稿 -@msg select two circles to bridge 请选择两个要桥接的圆 +@msg select two or more circles to bridge 请选择两个或更多要桥接的圆 @msg one circle is inside the other 一个圆位于另一个圆内部 @msg the circles are too far apart for this radius: raise the radius 对于此半径,两个圆相距太远:请增大半径 @msg the circles are too far apart for this radius 对于此半径,两个圆相距太远 + Constant Gap 固定间隙 + Reach: 范围: +@msg the circles are too far apart for this gap: raise the gap 对于此间隙,两个圆相距太远:请增大间隙 +@msg the circles are too far apart for this gap 对于此间隙,两个圆相距太远 +@msg no two circles are within reach: raise the reach 范围内没有任何两个圆:请增大范围 +@msg select at most 2000 circles to bridge 最多选择 2000 个圆进行桥接 +@msg that makes too many bridges (at most 8000): lower the reach 这会产生过多桥接(最多 8000 个):请减小范围 +@msg the bridged circles are too complex to unite 桥接的圆过于复杂,无法合并 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 将短划线扩展为路径 @msg select paths with dashed strokes to expand 请选择要扩展的虚线描边路径 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1616c01b65..f20e64b7d8 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -7016,10 +7016,18 @@ breakText Glyphs 字符 Smooth Bridge… 平滑橋接… Smooth Bridge 平滑橋接 Keep Originals 保留原始物件 -@msg select two circles to bridge 請選取兩個要橋接的圓形 +@msg select two or more circles to bridge 請選取兩個或更多要橋接的圓形 @msg one circle is inside the other 一個圓形位於另一個圓形內 @msg the circles are too far apart for this radius: raise the radius 就此半徑而言,兩個圓形相距太遠:請增加半徑 @msg the circles are too far apart for this radius 就此半徑而言,兩個圓形相距太遠 + Constant Gap 固定間隙 + Reach: 範圍: +@msg the circles are too far apart for this gap: raise the gap 就此間隙而言,兩個圓形相距太遠:請增加間隙 +@msg the circles are too far apart for this gap 就此間隙而言,兩個圓形相距太遠 +@msg no two circles are within reach: raise the reach 範圍內沒有任何兩個圓形:請增加範圍 +@msg select at most 2000 circles to bridge 最多選取 2000 個圓形進行橋接 +@msg that makes too many bridges (at most 8000): lower the reach 這會產生過多橋接(最多 8000 個):請減少範圍 +@msg the bridged circles are too complex to unite 橋接的圓形過於複雜,無法合併 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 將短破折號展開為路徑 @msg select paths with dashed strokes to expand 請選取要展開的虛線筆畫路徑 diff --git a/docs/mcp.md b/docs/mcp.md index 7fdd7a1375..a1eb90ae8b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11845,18 +11845,33 @@ Commands: drawn, and the path's fills stay on it, below its dashes (a path without fills goes). A compound path's dashes are plain paths with its appearance. Paths without a dashed stroke stay as they are, and it is an error if none has one. The dashes are selected; more than 100,000 (or a pattern too fine to draw) is refused. → `{ids, dashes}`. -- `addon.pathtools.bridge {radius?, keepOriginals?, ids?}` joins two circles (`ids`, default: the selection; paths - whose outline is a circle, not hidden or locked) into one closed outline, as one undo step (Object › Plug-ins › Path - Precision Tools › Smooth Bridge…). The outline goes around each circle on its side away from the other and along two - concave arcs, one on each side of the line through the centers, each touching both circles from outside, so every - anchor is smooth. `radius` is the arcs' radius as a percentage of the smaller circle's radius (1 to 1,000, 100 by - default): a larger radius makes a wider, gentler bridge. Overlapping and touching circles are joined at every radius. - One circle inside the other is an error, and so are circles too far apart for the radius: the arcs would not reach - both circles, or would cross before they do. The error suggests a larger radius only when one up to 1,000 would - bridge the circles. The outline replaces the two circles, painted as the upper one (a plain - path), unless `keepOriginals` is true: then it goes directly above the upper circle, painted as it, and the circles - stay. The outline is selected. → `{id}`. Smooth Bridge… opens a dialog (`ui.menuDialog {command}`, kind - `smoothBridge`) with a Radius field in percent, Keep Originals and Preview. +- `addon.pathtools.bridge {radius?, gap?, reach?, keepOriginals?, ids?}` joins circles (`ids`, default: the selection; + paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes, as one undo step (Object › + Plug-ins › Path Precision Tools › Smooth Bridge…). Two circles become one closed outline that goes around each circle + on its side away from the other and along two concave arcs, one on each side of the line through the centers, each + touching both circles from outside, so every anchor is smooth. `radius` is the arcs' radius as a percentage of the + smaller circle's radius (1 to 1,000, 100 by default): a larger radius makes a wider, gentler bridge. `gap` (0 to 1,000 + pt) sets the arcs' radius instead to the smaller circle's radius plus the gap, so each arc stays that gap away from a + circle of the smaller circle's size about the arc's center. For equal circles that gap apart, that center is where a + third circle the gap from both would sit, as in a triangular grid, so the channels around an empty place in such a + grid are one width; in a square grid they are not. Giving both `radius` and `gap` is an error. Overlapping and + touching circles are joined at every radius. One circle inside the other is an error, and so are circles too far apart + for the radius or gap: the arcs would not reach both circles, or would cross before they do. The error suggests a + larger radius or gap only when the largest (1,000% or 1,000 pt) would bridge the circles. The outline replaces the two + circles, painted as the upper one (a plain path), unless `keepOriginals` is true: then it goes directly above the + upper circle, painted as it, and the circles stay. The outline is selected. Two circles are bridged however far apart + their outlines are; `reach` does not apply to them. + With three or more circles, every two whose outlines are at most `reach` apart (0 to 10,000 pt, 10 by default; + overlapping ones included) are bridged the same way, and the bridges that connect are united into one shape each, + which can have holes where bridges enclose space; holes smaller than 1% of the smallest circle's area are filled. A + pair within reach but too far apart for the radius or gap gets no bridge. Each shape replaces its circles, painted as + the topmost of them and in its place, or with `keepOriginals` goes directly above that circle. A circle bridged to no + other stays as it is. The shapes and the circles left as they are are selected. It is an error when any pair within + reach has one circle inside the other, when no pair within reach can be bridged (with the same suggestion of a larger + radius or gap), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: + the shapes and the circles left as they are, with `id` as well for two circles. Smooth Bridge… opens a dialog + (`ui.menuDialog {command}`, kind `smoothBridge`) with Constant Gap (a Gap field in place of the Radius field in + percent), Reach (unavailable with two circles selected), Keep Originals and Preview. - `addon.pathtools.cornerSet {ids?, anchors?, items?, radius, kind?, every?, minAngle?, maxAngle?}` 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 9b7a3bf20b..4a824d38bd 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2458,6 +2458,8 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Smooth Bridge… (`addon.pathtools.bridge`) joins two selected circles into one closed outline, like two drops of liquid pulling apart: the outline goes around each circle on its side away from the other and along two concave arcs, one on each side, each touching both circles from outside, so the outline runs on smoothly from each circle into the bridge and every anchor is smooth. The arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default); a larger radius makes a wider, gentler bridge, and circles farther apart make a narrower one. Overlapping and touching circles are joined at every radius; one circle inside the other, or circles too far apart for the radius (the arcs would not reach both circles, or would cross), is refused with a message, which suggests a larger radius only when one up to 1000% would bridge them. The outline replaces the two circles, painted as the upper one, or with Keep Originals goes directly above the upper circle and the circles stay. One undo step; the dialog previews on the canvas. Tests: `bridge::tests` in `vectorcraft-pathops` (equal and unequal circles, overlapping and touching ones, unequal ones at large radii, the neck's width, the arcs tangent to both circles at every anchor, far apart and nested circles refused, circles told from other paths), `bridge::tests` in `cmd::addons::pathtools` in `vectorcraft-engine` (the outline in place of the circles or above them, one undo step, the radius, unequal overlapping circles up to the largest radius, refused selections and parameters with and without a larger radius suggested, locked and hidden circles), `smooth_bridge_opens_its_dialog_previews_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on. +Constant Gap sets the arcs' radius to the smaller circle's radius plus a gap in points (`gap`), so each arc stays that gap from a circle of the smaller circle's size about the arc's center: in a triangular grid of equal circles that gap apart, the channels around an empty place are one width. With three or more circles selected, every two whose outlines are within Reach (`reach`, 10 pt by default) are bridged, the bridges that connect are united into one shape each (holes included, except those smaller than 1% of the smallest circle's area), a pair too far apart for the radius gets no bridge, and a circle bridged to no other stays as it is; at most 2000 circles and 8000 bridges, found through a grid of cells so each circle is compared only with its near neighbors. Reach is unavailable in the dialog with two circles selected, which are bridged at any distance. Tests: `bridge::tests` in `vectorcraft-pathops` (a 3 × 3 grid joined by side neighbors only or with the diagonal ones, a ring of six around an empty place leaving a round hole the gap wider than a circle, each pair's shape the two-circle outline for overlapping, touching and unequal circles, a circle out of reach left alone, a pair too far apart for the arcs left unbridged, the gap form against the percentage form, too many circles or bridges and pairs that can't be bridged refused), `bridge::tests` in `cmd::addons::pathtools` in `vectorcraft-engine` (the grid as one shape in the topmost circle's place with its holes, one undo step, a circle left alone, small circles at the default reach, an id given twice, Keep Originals for several shapes, the gap form, refusals and their messages) and `constant_gap_shows_the_gap_and_bridges_many_circles_within_reach` in `vectorcraft-ui-egui`. + ## Document Tools add-on: Save a Timestamped Copy (2026-11-01) A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Document Tools › Save a Timestamped Copy writes a copy of the document named `_YYYY-MM-DD_HH-MM.` (the date and time in UTC, through chrono; `-2`, `-3`… added when that name is taken) next to the document, or into a folder picked (the folder picker) when it was never saved, in the document's own format or another save format. It writes through File › Save a Copy's save, so the document keeps its path, title and modified state, no undo step is made, and the write stays inside the automation roots in force. It is off on the web, which has no clock. Tests: `cmd::addons::document::tests` in `vectorcraft-engine` (the name and place, numbered names, the document unchanged and its content in the copy, an unsaved document needing a folder, other formats, bad params refused, automation roots), `addons::document::tests` in `vectorcraft-ui-egui` (the submenu, beside the document, the folder picked or cancelled) and `command_sweep`. Commands: `docs/mcp.md` › Document Tools add-on. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 86a4a10e8b..35e56b1b3a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -481,7 +481,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Set Corners… (also a button in the Anchor Inspector's Corners section: Radius in any unit, Corner kind, Anchors: All, Odd-Numbered or Even-Numbered, counted from each path's first anchor; Angle: from … to …°, only the corners whose sides meet at an angle in that range; Preview) cuts corners on the chosen anchors of every selected path, one undo step | done | #5546, #5545; `addon.pathtools.cornerSet` (`every`, `minAngle`, `maxAngle`), `crates/ui-egui/src/addons/pathtools/set_corners.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 › Trim at Crossings Tool (in the All Tools drawer under the add-on's heading, in neither toolbar as shipped, no shortcut) removes stretches of paths between the places where they are crossed, on any editable path, selected or not: a click removes the stretch under the pointer, a drag every stretch its rectangle touches, an Alt-drag every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing | done | `addon.pathtools.trim` (in `crates/engine/src/cmd/addons/pathtools/trim.rs`), `crates/tools/src/addons/trim.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 › Expand Dashes into Paths turns each selected path's dashed stroke into separate open paths, one per dash, laid out as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off; one undo step | done | #4922; `addon.pathtools.expandDashes` (in `crates/engine/src/cmd/addons/pathtools.rs`, using the renderer's dash layout) and its 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 › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | +| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, 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 |