mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-21 01:44:57 +01:00
train: #7950
This commit is contained in:
commit
52873b8f25
43 files changed
+989
-3
No files matched your search
@@ -156,6 +156,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
|
||||
- 2026-11-15: Common Tangents in the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the straight lines that touch two selected convex closed paths (ellipses at any rotation and scale, or convex Bézier paths) without crossing either are added as open paths with the current stroke: external, internal or all, and the line joining the centers if asked; a path inside the other has none unless the two touch, and a message says why; a dialog with Preview, one undo step (`addon.pathtools.commonTangents`, #7845). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-18: Common Tangents also takes a point (a path of one anchor) and a convex closed path: the lines from the point that touch the path, and the line from the point to the path's center if asked; a point on the outline gets the one tangent there, and a point inside gets none, with a message (#7846). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-15: With Smart Guides and Snap to Tangent on, a Line Segment drag pressed on one convex curved path and dragged near another lands on a common tangent of the two: both ends move to where the line touches the paths, each labeled "tangent" (#7845). 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-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.
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
//! anchor edits, Split / Add Points at Crossings, Slide Anchor Along Path, the Corner Tool's corners
|
||||
//! ([`corners`]), the Parametric Shape Tool's shapes ([`shape`]), the Shared Edge Merge Tool's
|
||||
//! merges with Keep Shared Points Together ([`shared_edge`]), Divide into Dashes, Expand Dashes
|
||||
//! into Paths, Trim at Crossings ([`trim`]), Common Tangents ([`tangents`]) and Tangent Circle
|
||||
//! into Paths, Trim at Crossings ([`trim`]), Smooth Bridge ([`bridge`]), Common Tangents
|
||||
//! ([`tangents`]) and Tangent Circle
|
||||
//! ([`tangent_circle`]).
|
||||
//! Its tools, panels and submenu (Object › Plug-ins › Path Precision Tools) are the tools crate's
|
||||
//! and the UI's.
|
||||
|
||||
mod bridge;
|
||||
mod corners;
|
||||
#[cfg(test)]
|
||||
mod effect_tests;
|
||||
@@ -183,6 +185,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
v.extend(corners::specs());
|
||||
v.extend(shared_edge::specs());
|
||||
v.extend(trim::specs());
|
||||
v.extend(bridge::specs());
|
||||
v.extend(tangent_circle::specs());
|
||||
v.extend(tangents::specs());
|
||||
v
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
//! Smooth Bridge: two selected circles joined into one outline by two concave arcs that touch both
|
||||
//! circles, replacing the circles or added above them.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{NodeId, NodeKind};
|
||||
use vectorcraft_geom::PathData;
|
||||
use vectorcraft_pathops::addons::pathtools as pt;
|
||||
|
||||
use super::super::super::pathops::{Beside, remove_each};
|
||||
use super::super::super::{CommandSpec, bad, checked_ids_or_selection, cmd, has_selection, switch_or};
|
||||
use super::given;
|
||||
use crate::{EngineError, Result, Session};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
/// The command, and its undo step's name.
|
||||
const C: &str = "addon.pathtools.bridge";
|
||||
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);
|
||||
|
||||
pub(super) fn specs() -> Vec<CommandSpec> {
|
||||
vec![cmd!(
|
||||
"addon.pathtools.bridge",
|
||||
"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}",
|
||||
has_selection,
|
||||
bridge
|
||||
)]
|
||||
}
|
||||
|
||||
fn bridge(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let percent = given(p, "radius", Some(RADII), C)?.unwrap_or(RADIUS);
|
||||
let keep = switch_or(p, "keepOriginals", false, C)?;
|
||||
let roots = checked_ids_or_selection(s, p, C)?;
|
||||
let circles: Vec<(NodeId, pt::Circle)> = {
|
||||
let d = &s.doc()?.doc;
|
||||
let editable = d.editable();
|
||||
d.paint_order(roots.iter().copied())
|
||||
.into_iter()
|
||||
.filter_map(|id| match &d.node(id)?.kind {
|
||||
NodeKind::Path { path, guide: false, clipping: false, .. } if editable(id) => Some((id, pt::circle_of(path)?)),
|
||||
_ => None,
|
||||
})
|
||||
.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"));
|
||||
}
|
||||
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 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;
|
||||
}
|
||||
remove_each(d, &[below])?;
|
||||
above
|
||||
};
|
||||
sel.set([id]);
|
||||
Ok(id)
|
||||
})?;
|
||||
Ok(json!({ "id": id.0 }))
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius,
|
||||
//! and what it refuses.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{NodeId, NodeKind};
|
||||
use vectorcraft_geom::kurbo::Shape;
|
||||
|
||||
use crate::Session;
|
||||
|
||||
const BRIDGE: &str = "addon.pathtools.bridge";
|
||||
|
||||
fn session() -> Session {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
|
||||
s
|
||||
}
|
||||
|
||||
/// A circle about (`x`, `y`) with radius `r`.
|
||||
fn circle(s: &mut Session, x: f64, y: f64, r: f64) -> NodeId {
|
||||
let id = s.execute("shape.ellipse", &json!({"x": x - r, "y": y - r, "width": 2.0 * r, "height": 2.0 * r})).unwrap()["id"].as_u64().unwrap();
|
||||
NodeId(id)
|
||||
}
|
||||
|
||||
fn select(s: &mut Session, ids: &[NodeId]) {
|
||||
s.execute("select.set", &json!({"ids": ids.iter().map(|i| i.0).collect::<Vec<_>>()})).unwrap();
|
||||
}
|
||||
|
||||
fn top_level(s: &Session) -> Vec<NodeId> {
|
||||
s.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id).collect()
|
||||
}
|
||||
|
||||
fn area(s: &Session, id: NodeId) -> f64 {
|
||||
s.doc().unwrap().doc.node(id).unwrap().path_data().unwrap().to_bezpath().area().abs()
|
||||
}
|
||||
|
||||
fn err(s: &mut Session, p: Value) -> String {
|
||||
s.execute(BRIDGE, &p).unwrap_err().to_string()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_circles_become_one_outline_in_the_upper_ones_place() {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 20.0);
|
||||
let b = circle(&mut s, 160.0, 100.0, 20.0);
|
||||
select(&mut s, &[a, b]);
|
||||
let steps = s.doc().unwrap().history.undo.len();
|
||||
let r = s.execute(BRIDGE, &json!({})).unwrap();
|
||||
assert_eq!(r["id"], json!(b.0));
|
||||
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") };
|
||||
assert!(live.is_none(), "a plain path now");
|
||||
assert!(path.subpaths.len() == 1 && path.subpaths[0].closed);
|
||||
let bounds = path.bounds().unwrap();
|
||||
assert!((bounds.x0 - 80.0).abs() < 1e-2 && (bounds.x1 - 180.0).abs() < 1e-2 && (bounds.height() - 40.0).abs() < 1e-2, "{bounds:?}");
|
||||
// Both circles and the bridge between them: more than the two circles' area.
|
||||
assert!(area(&s, b) > 2.0 * std::f64::consts::PI * 400.0);
|
||||
assert_eq!(s.doc().unwrap().selection.objects.to_vec(), [b]);
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1, "one undo step");
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(top_level(&s), [a, b]);
|
||||
assert!(matches!(&s.doc().unwrap().doc.node(b).unwrap().kind, NodeKind::Path { live: Some(_), .. }), "the circle is back as it was");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keep_originals_adds_the_outline_above_the_upper_circle() {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 30.0);
|
||||
let b = circle(&mut s, 170.0, 100.0, 10.0);
|
||||
let c = circle(&mut s, 300.0, 250.0, 5.0);
|
||||
s.execute("paint.setFill", &json!({"ids": [b.0], "color": "#00ff00"})).unwrap();
|
||||
let steps = s.doc().unwrap().history.undo.len();
|
||||
let id = NodeId(s.execute(BRIDGE, &json!({"ids": [b.0, a.0], "keepOriginals": true, "radius": 400})).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(top_level(&s), [a, b, id, c]);
|
||||
let d = &s.doc().unwrap().doc;
|
||||
assert_eq!(d.node(id).unwrap().appearance, d.node(b).unwrap().appearance, "painted as the upper circle");
|
||||
assert!(matches!(&d.node(a).unwrap().kind, NodeKind::Path { live: Some(_), .. }), "the circles stay as they are");
|
||||
assert!(matches!(&d.node(b).unwrap().kind, NodeKind::Path { live: Some(_), .. }));
|
||||
let bounds = d.node(id).unwrap().path_data().unwrap().bounds().unwrap();
|
||||
assert!((bounds.x0 - 70.0).abs() < 1e-2 && (bounds.x1 - 180.0).abs() < 1e-2 && (bounds.y0 - 70.0).abs() < 1e-2, "{bounds:?}");
|
||||
assert_eq!(s.doc().unwrap().selection.objects.to_vec(), [id]);
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_kept_outline_gets_its_own_mask_art() {
|
||||
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 m = NodeId(s.execute("shape.rectangle", &json!({"x": 130, "y": 80, "width": 40, "height": 40})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("transparency.makeOpacityMask", &json!({"ids": [b.0, m.0]})).unwrap();
|
||||
let id = NodeId(s.execute(BRIDGE, &json!({"ids": [a.0, b.0], "keepOriginals": true})).unwrap()["id"].as_u64().unwrap());
|
||||
let d = &s.doc().unwrap().doc;
|
||||
let art = |n: NodeId| d.node(n).unwrap().extras().mask.as_deref().map(|m| m.art.id);
|
||||
let (kept, copied) = (art(b).unwrap(), art(id).unwrap());
|
||||
assert_ne!(kept, copied, "the outline's mask art has ids of its own");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_larger_radius_makes_a_wider_bridge() {
|
||||
let area_at = |radius: f64| {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 20.0);
|
||||
let b = circle(&mut s, 150.0, 100.0, 15.0);
|
||||
let id = NodeId(s.execute(BRIDGE, &json!({"ids": [a.0, b.0], "radius": radius})).unwrap()["id"].as_u64().unwrap());
|
||||
area(&s, id)
|
||||
};
|
||||
let (default, wider, widest) = (area_at(100.0), area_at(200.0), area_at(400.0));
|
||||
assert!(default < wider && wider < widest, "{default} {wider} {widest}");
|
||||
let (narrow, default, wide) = (area_at(65.0), default, area_at(300.0));
|
||||
assert!(narrow < default && default < wide, "{narrow} {default} {wide}");
|
||||
// The default is 100%: the smaller circle's radius.
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 20.0);
|
||||
let b = circle(&mut s, 150.0, 100.0, 15.0);
|
||||
let id = NodeId(s.execute(BRIDGE, &json!({"ids": [a.0, b.0]})).unwrap()["id"].as_u64().unwrap());
|
||||
assert!((area(&s, id) - default).abs() < 1e-9);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overlapping_and_touching_circles_are_joined() {
|
||||
for (gap, radius) in [(-15.0, 50.0), (0.0, 50.0), (0.0, 1.0)] {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 20.0);
|
||||
let b = circle(&mut s, 140.0 + gap, 100.0, 20.0);
|
||||
let id = NodeId(s.execute(BRIDGE, &json!({"ids": [a.0, b.0], "radius": radius})).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(top_level(&s), [id], "gap {gap}");
|
||||
}
|
||||
// Unequal overlapping circles at every radius, the largest included.
|
||||
for radius in [1.0, 100.0, 300.0, 1000.0] {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 10.0);
|
||||
let b = circle(&mut s, 125.0, 100.0, 30.0);
|
||||
let id = NodeId(s.execute(BRIDGE, &json!({"ids": [a.0, b.0], "radius": radius})).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(top_level(&s), [id], "radius {radius}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn far_apart_nested_and_other_objects_are_refused() {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 50.0, 100.0, 10.0);
|
||||
let far = circle(&mut s, 250.0, 100.0, 10.0);
|
||||
let near = circle(&mut s, 110.0, 100.0, 10.0);
|
||||
let inner = circle(&mut s, 52.0, 100.0, 4.0);
|
||||
let square = NodeId(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap());
|
||||
let oval = NodeId(s.execute("shape.ellipse", &json!({"x": 300, "y": 0, "width": 40, "height": 20})).unwrap()["id"].as_u64().unwrap());
|
||||
let before = top_level(&s);
|
||||
let steps = s.doc().unwrap().history.undo.len();
|
||||
// 60 pt apart: the default radius (10 pt) cannot reach, the largest (100 pt) can.
|
||||
assert!(err(&mut s, json!({"ids": [a.0, near.0]})).ends_with("too far apart for this radius: raise the radius"));
|
||||
assert!(s.execute(BRIDGE, &json!({"ids": [a.0, near.0], "radius": 1000})).is_ok());
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
// 200 pt apart even the largest radius (1000%, 100 pt) closes the neck: it stays open only above
|
||||
// ((200 / 2)² − 10²) / (2 × 10) = 495 pt. No larger radius is suggested.
|
||||
for radius in [100, 1000] {
|
||||
let e = err(&mut s, json!({"ids": [a.0, far.0], "radius": radius}));
|
||||
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}");
|
||||
}
|
||||
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"));
|
||||
assert!(err(&mut s, json!({"ids": [a.0, far.0], "keepOriginals": "yes"})).contains("`keepOriginals` must be true or false"));
|
||||
assert_eq!(top_level(&s), before);
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn locked_and_hidden_circles_are_not_bridged() {
|
||||
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);
|
||||
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"));
|
||||
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"));
|
||||
}
|
||||
@@ -46,6 +46,7 @@ pub(super) const ALLOWED: &[&str] = &[
|
||||
"addon.packaging.setRole",
|
||||
"addon.packaging.setRoleSwatch",
|
||||
"addon.pathtools.addPoints",
|
||||
"addon.pathtools.bridge",
|
||||
"addon.pathtools.close",
|
||||
"addon.pathtools.commonTangents",
|
||||
"addon.pathtools.corner",
|
||||
|
||||
@@ -1009,6 +1009,9 @@ fn structured_junk() {
|
||||
("addon.pathtools.expandDashes", json!({})),
|
||||
("addon.pathtools.expandDashes", json!({"ids": [0, 1, 2, 3, u64::MAX]})),
|
||||
("addon.pathtools.expandDashes", json!({"ids": "x", "junk": f64::MAX})),
|
||||
("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]})),
|
||||
// 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})),
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
//! 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`]), the common tangents of two convex outlines ([`common_tangents`]), the
|
||||
//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]), the common
|
||||
//! tangents of two convex outlines ([`common_tangents`]), the
|
||||
//! Parametric Shape Tool's shapes ([`shapes`]) and the circles that touch two or three shapes
|
||||
//! ([`tangent_circles`]).
|
||||
|
||||
mod bridge;
|
||||
mod crossings;
|
||||
mod dashes;
|
||||
mod extend;
|
||||
@@ -25,6 +27,7 @@ use std::collections::BTreeSet;
|
||||
use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Vec2};
|
||||
use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath};
|
||||
|
||||
pub use bridge::{BridgeError, 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};
|
||||
|
||||
@@ -0,0 +1,365 @@
|
||||
//! 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.
|
||||
|
||||
use std::f64::consts::{FRAC_PI_2, PI, SQRT_2, TAU};
|
||||
|
||||
use kurbo::{CubicBez, ParamCurve, Point, Shape, Vec2};
|
||||
use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath};
|
||||
|
||||
use super::Circle;
|
||||
|
||||
/// How far (as a share of the radius) a path's outline may stray from a circle and still be read
|
||||
/// as that circle.
|
||||
const ROUND: f64 = 1e-3;
|
||||
/// Points [`circle_of`] checks on each segment, its ends included.
|
||||
const SAMPLES: usize = 9;
|
||||
|
||||
/// Why [`smooth_bridge`] makes no outline.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum BridgeError {
|
||||
/// One circle is inside the other (or they share a center).
|
||||
Inside,
|
||||
/// The circles are too far apart for the radius: the two arcs would not reach both circles,
|
||||
/// or would cross before they do.
|
||||
TooFar,
|
||||
/// A radius or circle that is not a finite size above 0, or an outline too large for `f64`.
|
||||
Bad,
|
||||
}
|
||||
|
||||
/// The circle `path` draws: one closed subpath whose outline stays within 0.1% of its radius of
|
||||
/// a circle all the way around, once. `None` for any other path.
|
||||
pub fn circle_of(path: &PathData) -> Option<Circle> {
|
||||
let [sp] = path.subpaths.as_slice() else { return None };
|
||||
if !sp.closed || sp.anchors.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
let b = path.bounds()?;
|
||||
let (w, h) = (b.width(), b.height());
|
||||
if !(w > 0.0 && h > 0.0 && w.is_finite() && h.is_finite()) || (w - h).abs() > ROUND * w.max(h) {
|
||||
return None;
|
||||
}
|
||||
let (center, radius) = (b.center(), (w + h) / 4.0);
|
||||
let off = |q: Point| (q.distance(center) - radius).abs() > ROUND * radius;
|
||||
for k in 0..sp.segment_count() {
|
||||
let seg = sp.segment(k);
|
||||
if (0..SAMPLES).any(|i| off(seg.eval(i as f64 / (SAMPLES - 1) as f64))) {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
// Around once: a path going around twice, or back on itself, encloses a different area.
|
||||
let area = path.to_bezpath().area().abs();
|
||||
((area - PI * radius * radius).abs() <= 4.0 * ROUND * area).then_some(Circle { center, radius })
|
||||
}
|
||||
|
||||
/// The outline of circles `a` and `b` joined by two arcs of radius `radius` (pt), one on each
|
||||
/// side of the line through their centers, each touching both circles from outside. The outline
|
||||
/// runs around `a` on its side away from `b`, along one arc, around `b` on its side away from `a`
|
||||
/// and back along the other arc; every anchor is smooth, as each arc and the circle it meets share
|
||||
/// 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<SubPath, BridgeError> {
|
||||
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 {
|
||||
return Err(BridgeError::Bad);
|
||||
}
|
||||
let axis = b.center - a.center;
|
||||
// `f64::hypot`: `Vec2::hypot` squares the length, which overflows above about 1e154 pt.
|
||||
let d = axis.x.hypot(axis.y);
|
||||
if d + a.radius.min(b.radius) <= a.radius.max(b.radius) * (1.0 + 1e-9) {
|
||||
return Err(BridgeError::Inside);
|
||||
}
|
||||
// The arcs' centers are `radius` outside both circles: where circles about the two centers,
|
||||
// `radius` larger than each, cross.
|
||||
let (ra, rb) = (radius + a.radius, radius + b.radius);
|
||||
if !ra.is_finite() || !rb.is_finite() {
|
||||
return Err(BridgeError::Bad);
|
||||
}
|
||||
// Halves and no squares, so no step overflows while the lengths fit in `f64`.
|
||||
let half = ra / 2.0 + rb / 2.0;
|
||||
if d / 2.0 > half {
|
||||
return Err(BridgeError::TooFar);
|
||||
}
|
||||
let along = d / 2.0 + (ra - rb) / d * half;
|
||||
let across = (ra - along).max(0.0).sqrt() * (ra / 2.0 + along / 2.0).max(0.0).sqrt() * SQRT_2;
|
||||
if !along.is_finite() || !across.is_finite() {
|
||||
return Err(BridgeError::Bad);
|
||||
}
|
||||
// Each arc runs between its points on `a` and `b`, which lie towards the two centers from the
|
||||
// arc's center. Its point nearest the axis is the foot of its center on the axis when that foot
|
||||
// is between the two centers, else one of its ends, which are off the axis. So the two arcs
|
||||
// cross, leaving no neck, only when that foot is between the centers and nearer to the arc's
|
||||
// center than its radius.
|
||||
if along > 0.0 && along < d && across <= radius * (1.0 + 1e-9) {
|
||||
return Err(BridgeError::TooFar);
|
||||
}
|
||||
let u = axis / d;
|
||||
let n = Vec2::new(-u.y, u.x);
|
||||
let mut segs = vec![];
|
||||
// Each side's arc center and where its arc touches `a` and `b`.
|
||||
let side = |s: f64| {
|
||||
let p = a.center + u * along + n * (s * across);
|
||||
(p, a.center + (p - a.center) * (a.radius / ra), b.center + (p - b.center) * (b.radius / rb))
|
||||
};
|
||||
let ((p1, a1, b1), (p2, a2, b2)) = (side(1.0), side(-1.0));
|
||||
arc(&mut segs, a.center, a.radius, a1, a2, Some(-u));
|
||||
arc(&mut segs, p2, radius, a2, b2, None);
|
||||
arc(&mut segs, b.center, b.radius, b2, b1, Some(u));
|
||||
arc(&mut segs, p1, radius, b1, a1, None);
|
||||
let count = segs.len();
|
||||
let anchors: Vec<Anchor> = (0..count)
|
||||
.map(|i| {
|
||||
let (prev, seg) = (segs[(i + count - 1) % count], segs[i]);
|
||||
Anchor { p: seg.p0, h_in: prev.p2, h_out: seg.p1, kind: AnchorKind::Smooth }
|
||||
})
|
||||
.collect();
|
||||
let finite_point = |p: Point| p.x.is_finite() && p.y.is_finite();
|
||||
if !anchors.iter().all(|q| finite_point(q.p) && finite_point(q.h_in) && finite_point(q.h_out)) {
|
||||
return Err(BridgeError::Bad);
|
||||
}
|
||||
Ok(SubPath::new(anchors, true))
|
||||
}
|
||||
|
||||
/// Append to `out` the arc of the circle about `center` with radius `r` from `from` to `to` (both
|
||||
/// on it): through the direction `through` from the center when given, else the shorter way. In
|
||||
/// cubics of at most a quarter turn each, `from` exactly at the start and `to` at the end.
|
||||
fn arc(out: &mut Vec<CubicBez>, center: Point, r: f64, from: Point, to: Point, through: Option<Vec2>) {
|
||||
let angle = |q: Vec2| q.y.atan2(q.x);
|
||||
let start = angle(from - center);
|
||||
// The turn from `from` to `to` counter-clockwise (in the y-up sense), 0 to 2π.
|
||||
let ccw = (angle(to - center) - start).rem_euclid(TAU);
|
||||
let sweep = match through {
|
||||
Some(dir) if (angle(dir) - start).rem_euclid(TAU) <= ccw => ccw,
|
||||
Some(_) => ccw - TAU,
|
||||
None if ccw > PI => ccw - TAU,
|
||||
None => ccw,
|
||||
};
|
||||
let pieces = (sweep.abs() / FRAC_PI_2).ceil().max(1.0) as usize;
|
||||
let step = sweep / pieces as f64;
|
||||
// Handle length that makes a cubic follow the arc of `step`, signed with its direction.
|
||||
let k = 4.0 / 3.0 * (step / 4.0).tan() * r;
|
||||
let on = |t: f64| center + Vec2::new(t.cos(), t.sin()) * r;
|
||||
let tangent = |t: f64| Vec2::new(-t.sin(), t.cos());
|
||||
for i in 0..pieces {
|
||||
let (t0, t1) = (start + step * i as f64, start + step * (i + 1) as f64);
|
||||
let p0 = if i == 0 { from } else { on(t0) };
|
||||
let p3 = if i + 1 == pieces { to } else { on(t1) };
|
||||
out.push(CubicBez::new(p0, p0 + tangent(t0) * k, p3 - tangent(t1) * k, p3));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use vectorcraft_geom::shapes;
|
||||
|
||||
use super::*;
|
||||
|
||||
fn circle(x: f64, y: f64, r: f64) -> Circle {
|
||||
Circle { center: Point::new(x, y), radius: r }
|
||||
}
|
||||
|
||||
/// Every point the outline passes through, 32 to a segment.
|
||||
fn outline(sp: &SubPath) -> Vec<Point> {
|
||||
(0..sp.segment_count()).flat_map(|k| (0..32).map(move |i| sp.segment(k).eval(i as f64 / 32.0))).collect()
|
||||
}
|
||||
|
||||
/// The outline crosses the vertical line at `x` at these y values, top to bottom.
|
||||
fn crossings_at(sp: &SubPath, x: f64) -> Vec<f64> {
|
||||
let pts = outline(sp);
|
||||
let mut ys: Vec<f64> = (0..pts.len())
|
||||
.filter_map(|i| {
|
||||
let (p, q) = (pts[i], pts[(i + 1) % pts.len()]);
|
||||
((p.x - x) * (q.x - x) <= 0.0 && p.x != q.x).then(|| p.y + (q.y - p.y) * (x - p.x) / (q.x - p.x))
|
||||
})
|
||||
.collect();
|
||||
ys.sort_by(f64::total_cmp);
|
||||
ys
|
||||
}
|
||||
|
||||
/// The bridge's width at `x`, from the outline's crossings there.
|
||||
fn width_at(sp: &SubPath, x: f64) -> f64 {
|
||||
let ys = crossings_at(sp, x);
|
||||
ys.last().unwrap() - ys.first().unwrap()
|
||||
}
|
||||
|
||||
fn assert_smooth(sp: &SubPath) {
|
||||
for a in sp.anchors.iter() {
|
||||
let (i, o) = (a.p - a.h_in, a.h_out - a.p);
|
||||
assert!(i.hypot() > 1e-6 && o.hypot() > 1e-6, "both handles at {a:?}");
|
||||
assert!(i.cross(o).abs() <= 1e-9 * i.hypot() * o.hypot() && i.dot(o) > 0.0, "the outline turns at {a:?}");
|
||||
assert_eq!(a.kind, AnchorKind::Smooth);
|
||||
}
|
||||
}
|
||||
|
||||
/// Each point of the outline is on circle `c` or outside it.
|
||||
fn outside(sp: &SubPath, c: Circle) -> bool {
|
||||
outline(sp).iter().all(|p| p.distance(c.center) >= c.radius - 1e-3)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_equal_circles_join_with_a_neck_narrower_than_the_circles() {
|
||||
let (a, b) = (circle(0.0, 0.0, 20.0), circle(60.0, 0.0, 20.0));
|
||||
let sp = smooth_bridge(a, b, 20.0).unwrap();
|
||||
assert!(sp.closed);
|
||||
assert_smooth(&sp);
|
||||
// The arcs' centers are 40 from each circle's center: (30, ±√700), so the neck at x = 30 is
|
||||
// 2 × (√700 − 20) wide.
|
||||
let neck = 2.0 * (700f64.sqrt() - 20.0);
|
||||
assert!((width_at(&sp, 30.0) - neck).abs() < 1e-2, "{}", width_at(&sp, 30.0));
|
||||
assert!(width_at(&sp, 30.0) < width_at(&sp, 10.0));
|
||||
// Around each circle on its far side, and symmetric.
|
||||
let ys = crossings_at(&sp, -10.0);
|
||||
assert!((ys[0] + 300f64.sqrt()).abs() < 1e-2 && (ys[1] - 300f64.sqrt()).abs() < 1e-2, "{ys:?}");
|
||||
assert!((width_at(&sp, 50.0) - width_at(&sp, 10.0)).abs() < 1e-2);
|
||||
let b = PathData::single(sp).bounds().unwrap();
|
||||
// Within the cubics' own error from a true circle (about 0.03% of the radius).
|
||||
assert!((b.x0 + 20.0).abs() < 1e-2 && (b.x1 - 80.0).abs() < 1e-2 && (b.y1 - 20.0).abs() < 1e-2, "{b:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_arcs_touch_both_circles_and_run_on_from_them() {
|
||||
for (a, b, r) in [
|
||||
(circle(0.0, 0.0, 20.0), circle(60.0, 0.0, 20.0), 20.0),
|
||||
(circle(10.0, 5.0, 30.0), circle(70.0, 40.0, 8.0), 40.0),
|
||||
(circle(0.0, 0.0, 20.0), circle(30.0, 0.0, 15.0), 10.0),
|
||||
] {
|
||||
let sp = smooth_bridge(a, b, r).unwrap();
|
||||
assert_smooth(&sp);
|
||||
// The outline goes around the outside of both circles, never into either.
|
||||
assert!(outside(&sp, a) && outside(&sp, b));
|
||||
// On each circle the outline leaves along the circle's tangent, where an arc takes over
|
||||
// as well: two anchors on each circle are where an arc meets it.
|
||||
for c in [a, b] {
|
||||
let on: Vec<_> = sp.anchors.iter().filter(|q| (q.p.distance(c.center) - c.radius).abs() < 1e-6).collect();
|
||||
assert!(on.len() >= 2, "{}", on.len());
|
||||
for q in on {
|
||||
let radial = q.p - c.center;
|
||||
assert!(radial.dot(q.h_out - q.p).abs() <= 1e-6 * radial.hypot() * (q.h_out - q.p).hypot(), "{q:?}");
|
||||
}
|
||||
}
|
||||
assert!(sp.anchors.len() <= 12, "{}", sp.anchors.len());
|
||||
// Every segment off the two circles is part of an arc of radius `r` that touches both
|
||||
// circles from outside: its center is `r` farther than each circle's radius from it.
|
||||
let on = |q: Point, c: Circle| (q.distance(c.center) - c.radius).abs() < 1e-3;
|
||||
let mut arcs = 0;
|
||||
for k in 0..sp.segment_count() {
|
||||
let seg = sp.segment(k);
|
||||
let (p0, pm, p1) = (seg.eval(0.0), seg.eval(0.5), seg.eval(1.0));
|
||||
if on(pm, a) || on(pm, b) {
|
||||
continue;
|
||||
}
|
||||
arcs += 1;
|
||||
let (center, radius) = circumcircle(p0, pm, p1);
|
||||
assert!((radius - r).abs() < 1e-2 * r, "radius {radius} for {r}");
|
||||
assert!((center.distance(a.center) - (r + a.radius)).abs() < 1e-2 * r, "touches {a:?}");
|
||||
assert!((center.distance(b.center) - (r + b.radius)).abs() < 1e-2 * r, "touches {b:?}");
|
||||
}
|
||||
assert!((2..=4).contains(&arcs), "{arcs}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The circle through three points: its center and radius.
|
||||
fn circumcircle(p: Point, q: Point, s: Point) -> (Point, f64) {
|
||||
let d = 2.0 * (p.x * (q.y - s.y) + q.x * (s.y - p.y) + s.x * (p.y - q.y));
|
||||
let sq = |v: Point| v.x * v.x + v.y * v.y;
|
||||
let x = (sq(p) * (q.y - s.y) + sq(q) * (s.y - p.y) + sq(s) * (p.y - q.y)) / d;
|
||||
let y = (sq(p) * (s.x - q.x) + sq(q) * (p.x - s.x) + sq(s) * (q.x - p.x)) / d;
|
||||
let c = Point::new(x, y);
|
||||
(c, c.distance(p))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unequal_circles_join_round_both() {
|
||||
let (a, b) = (circle(0.0, 0.0, 30.0), circle(70.0, 0.0, 10.0));
|
||||
let sp = smooth_bridge(a, b, 40.0).unwrap();
|
||||
assert_smooth(&sp);
|
||||
let bounds = PathData::single(sp.clone()).bounds().unwrap();
|
||||
assert!((bounds.x0 + 30.0).abs() < 1e-2 && (bounds.x1 - 80.0).abs() < 1e-2 && (bounds.y0 + 30.0).abs() < 1e-2, "{bounds:?}");
|
||||
// The neck narrows from the big circle towards the small one.
|
||||
assert!(width_at(&sp, 35.0) > width_at(&sp, 50.0));
|
||||
assert!(width_at(&sp, 50.0) < 20.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unequal_circles_join_at_large_radii_overlapping_or_not() {
|
||||
// With a large radius the arcs' centers lie beyond the smaller circle, so the arcs never
|
||||
// reach the axis even though their centers are nearer to it than their radius.
|
||||
for (a, b, r) in [
|
||||
(circle(0.0, 0.0, 10.0), circle(25.0, 0.0, 30.0), 100.0),
|
||||
(circle(0.0, 0.0, 30.0), circle(25.0, 0.0, 10.0), 30.0),
|
||||
(circle(0.0, 0.0, 30.0), circle(25.0, 0.0, 10.0), 50.0),
|
||||
(circle(0.0, 0.0, 30.0), circle(60.0, 0.0, 8.0), 300.0),
|
||||
] {
|
||||
let sp = smooth_bridge(a, b, r).unwrap_or_else(|e| panic!("{a:?} {b:?} {r}: {e:?}"));
|
||||
assert_smooth(&sp);
|
||||
assert!(outside(&sp, a) && outside(&sp, b));
|
||||
// The outline crosses the axis only at the two far ends: it does not cross itself.
|
||||
let pts = outline(&sp);
|
||||
let crossings = (0..pts.len()).filter(|&i| (pts[i].y > 0.0) != (pts[(i + 1) % pts.len()].y > 0.0)).count();
|
||||
assert_eq!(crossings, 2, "{a:?} {b:?} {r}");
|
||||
// It encloses more than the larger circle.
|
||||
let area = PathData::single(sp).to_bezpath().area().abs();
|
||||
assert!(area > PI * a.radius.max(b.radius).powi(2), "{area}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overlapping_and_touching_circles_are_joined() {
|
||||
let (a, b) = (circle(0.0, 0.0, 20.0), circle(30.0, 0.0, 20.0));
|
||||
let sp = smooth_bridge(a, b, 10.0).unwrap();
|
||||
assert_smooth(&sp);
|
||||
// The circles cross at x = 15, y = ±√175; the bridge fills in the notch there.
|
||||
assert!(width_at(&sp, 15.0) > 2.0 * 175f64.sqrt());
|
||||
assert!(width_at(&sp, 15.0) < 40.0);
|
||||
let touching = smooth_bridge(circle(0.0, 0.0, 20.0), circle(40.0, 0.0, 20.0), 10.0).unwrap();
|
||||
assert_smooth(&touching);
|
||||
assert!(width_at(&touching, 20.0) > 1.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn far_apart_circles_and_nested_ones_make_no_bridge() {
|
||||
let (a, b) = (circle(0.0, 0.0, 10.0), circle(100.0, 0.0, 10.0));
|
||||
assert_eq!(smooth_bridge(a, b, 5.0), Err(BridgeError::TooFar), "arcs don't reach");
|
||||
// The arcs reach both circles (gap 80 < 2 × 45) but cross before they do.
|
||||
assert_eq!(smooth_bridge(a, b, 45.0), Err(BridgeError::TooFar), "no neck left");
|
||||
// A large enough radius bridges them: the neck stays open above (d/2)² − r² over 2r = 120.
|
||||
assert!(smooth_bridge(a, b, 130.0).is_ok());
|
||||
assert_eq!(smooth_bridge(circle(0.0, 0.0, 30.0), circle(5.0, 0.0, 10.0), 10.0), Err(BridgeError::Inside));
|
||||
assert_eq!(smooth_bridge(circle(0.0, 0.0, 30.0), circle(0.0, 0.0, 30.0), 10.0), Err(BridgeError::Inside));
|
||||
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));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn huge_circles_bridge_with_finite_anchors_or_are_refused() {
|
||||
// Squaring these lengths overflows f64.
|
||||
let (a, b) = (circle(0.0, 0.0, 5e153), circle(1.5e154, 0.0, 5e153));
|
||||
let sp = smooth_bridge(a, b, 5e153).unwrap();
|
||||
assert!(sp.anchors.iter().all(|q| [q.p, q.h_in, q.h_out].iter().all(|p| p.x.is_finite() && p.y.is_finite())));
|
||||
assert_smooth(&sp);
|
||||
// The two radius sums fit in f64, but not their total.
|
||||
let (a, b) = (circle(-5e307, 0.0, 1e307), circle(5e307, 0.0, 1e307));
|
||||
let sp = smooth_bridge(a, b, 1.5e308).unwrap();
|
||||
assert!(sp.anchors.iter().all(|q| [q.p, q.h_in, q.h_out].iter().all(|p| p.x.is_finite() && p.y.is_finite())));
|
||||
// The arcs' centers would lie beyond the largest f64.
|
||||
let (a, b) = (circle(0.0, 0.0, 1e308), circle(1.5e308, 0.0, 1e308));
|
||||
assert_eq!(smooth_bridge(a, b, 1e308), Err(BridgeError::Bad));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn circles_are_told_from_other_paths() {
|
||||
let round = shapes::ellipse(kurbo::Rect::new(10.0, 20.0, 50.0, 60.0));
|
||||
let c = circle_of(&round).unwrap();
|
||||
assert!(c.center.distance(Point::new(30.0, 40.0)) < 1e-9 && (c.radius - 20.0).abs() < 1e-9);
|
||||
let oval = shapes::ellipse(kurbo::Rect::new(0.0, 0.0, 50.0, 40.0));
|
||||
assert_eq!(circle_of(&oval), None);
|
||||
let square = PathData::single(SubPath::polyline(&[Point::ZERO, Point::new(10.0, 0.0), Point::new(10.0, 10.0), Point::new(0.0, 10.0)], true));
|
||||
assert_eq!(circle_of(&square), None);
|
||||
let mut open = round.clone();
|
||||
open.subpaths[0].closed = false;
|
||||
assert_eq!(circle_of(&open), None);
|
||||
let two = PathData::new(vec![round.subpaths[0].clone(), round.subpaths[0].clone()]);
|
||||
assert_eq!(circle_of(&two), None);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
//! Path Precision Tools in the interface: its submenu (Object › Plug-ins › Path Precision Tools),
|
||||
//! which selects its tools, opens its panels and runs Split / Add Points at Crossings, Set Corners… ([`set_corners`]), Divide into
|
||||
//! Dashes ([`dashes`]), Expand Dashes into Paths, Convert to Parametric Shape and Tangent Circle… ([`tangent_circle`]); the Anchor Inspector panel (the selected
|
||||
//! Dashes ([`dashes`]), Expand Dashes into Paths, Smooth Bridge ([`bridge`]), Convert to Parametric Shape and Tangent Circle… ([`tangent_circle`]); the Anchor Inspector panel (the selected
|
||||
//! anchor's position and handles as numbers, the add-on's anchor edits, the Corner Tool's values,
|
||||
//! [`corner`], and the Shared Edge Merge Tool's, [`shared_edge`]); the Parametric Shape panel
|
||||
//! ([`shape`]); and its tools' options dialog (a double-click on the tool). Everything acts through `addon.pathtools.*` and
|
||||
//! `tool.setOption`.
|
||||
|
||||
pub mod bridge;
|
||||
pub mod corner;
|
||||
pub mod dashes;
|
||||
pub mod set_corners;
|
||||
@@ -74,6 +75,7 @@ pub fn menu() -> Vec<Item> {
|
||||
Item::Cmd("Split at Crossings", "addon.pathtools.crossings", json!({ "cut": true })),
|
||||
Item::Cmd("Divide into Dashes…", dashes::COMMAND, Value::Null),
|
||||
Item::Cmd("Expand Dashes into Paths", "addon.pathtools.expandDashes", json!({})),
|
||||
Item::Cmd("Smooth Bridge…", bridge::COMMAND, Value::Null),
|
||||
Item::Cmd("Convert to Parametric Shape", "addon.pathtools.shape.convert", json!({})),
|
||||
Item::Cmd("Tangent Circle…", tangent_circle::COMMAND, Value::Null),
|
||||
Item::Cmd("Common Tangents…", COMMON_TANGENTS, json!({ "tangents": "all", "centerline": false })),
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
//! 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.
|
||||
|
||||
use egui::Ui;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use crate::VectorcraftApp;
|
||||
use crate::dialogs::{DialogSpec, form};
|
||||
use crate::state::Dialog;
|
||||
use crate::widgets;
|
||||
|
||||
/// The command, and its dialog's kind.
|
||||
pub const COMMAND: &str = "addon.pathtools.bridge";
|
||||
pub const KIND: &str = "smoothBridge";
|
||||
/// The radius the command takes (%), and its default.
|
||||
const RADII: std::ops::RangeInclusive<f64> = 1.0..=1000.0;
|
||||
const RADIUS: f64 = 100.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 })
|
||||
}
|
||||
|
||||
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.
|
||||
fn params(d: &Dialog) -> Value {
|
||||
json!({ "radius": d.f64("radius", RADIUS), "keepOriginals": d.bool("keepOriginals") })
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
});
|
||||
form::check(ui, d, "keepOriginals", tl!("Keep Originals"));
|
||||
form::preview(app, ui, d, "Smooth Bridge", COMMAND, params(d));
|
||||
false
|
||||
}
|
||||
|
||||
/// OK: run the command (keep its preview) and close.
|
||||
fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
form::commit_preview(app, COMMAND, params(d))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use serde_json::json;
|
||||
use vectorcraft_engine::Session;
|
||||
|
||||
use crate::tests_labels::painted_text;
|
||||
use crate::{VectorcraftApp, menus};
|
||||
|
||||
fn circle(app: &mut VectorcraftApp, x: f64, r: f64) -> u64 {
|
||||
app.run("shape.ellipse", json!({"x": x - r, "y": 100.0 - r, "width": 2.0 * r, "height": 2.0 * r})).unwrap()["id"].as_u64().unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn smooth_bridge_opens_its_dialog_previews_and_runs_on_ok() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
|
||||
let (a, b) = (circle(&mut app, 100.0, 20.0), circle(&mut app, 160.0, 20.0));
|
||||
app.run("select.set", json!({"ids": [a, b]})).unwrap();
|
||||
let entries = menus::menu_entries(&app);
|
||||
let item = entries.iter().find(|e| e.path == ["Object", "Plug-ins", "Path Precision Tools"] && e.label == "Smooth Bridge…").unwrap();
|
||||
let (cmd, p) = menus::click_target(&item.label, item.command.as_deref().unwrap(), &item.params);
|
||||
menus::invoke(&mut app, &cmd, p);
|
||||
assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some(super::KIND));
|
||||
let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx()));
|
||||
for s in ["Smooth Bridge", "Radius:", "Keep Originals", "Preview"] {
|
||||
assert!(shown.contains(s), "{s} in {shown}");
|
||||
}
|
||||
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()));
|
||||
assert_eq!(count(&app), 1, "previewed: one outline in place of the circles");
|
||||
crate::dialogs::cancel(&mut app);
|
||||
assert_eq!(count(&app), 2, "rolled back");
|
||||
menus::invoke(&mut app, &cmd, serde_json::Value::Null);
|
||||
let n = app.session.doc().unwrap().history.undo.len();
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert("keepOriginals".into(), json!(true));
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
assert!(app.ui.dialog.is_none());
|
||||
assert_eq!(app.session.doc().unwrap().history.undo.len(), n + 1);
|
||||
assert_eq!(count(&app), 3, "the circles and the outline above them");
|
||||
}
|
||||
}
|
||||
@@ -478,6 +478,7 @@ registry! {
|
||||
RenameArtboards: [rename_artboards::KIND] => rename_artboards::SPEC,
|
||||
PathToolOptions: [crate::addons::pathtools::KIND] => crate::addons::pathtools::OPTIONS_SPEC,
|
||||
DivideDashes: [crate::addons::pathtools::dashes::KIND] => crate::addons::pathtools::dashes::SPEC,
|
||||
SmoothBridge: [crate::addons::pathtools::bridge::KIND] => crate::addons::pathtools::bridge::SPEC,
|
||||
TangentCircle: [crate::addons::pathtools::tangent_circle::KIND] => crate::addons::pathtools::tangent_circle::SPEC,
|
||||
SetCorners: [crate::addons::pathtools::set_corners::KIND] => crate::addons::pathtools::set_corners::SPEC,
|
||||
NearestSwatch: [crate::addons::color::nearest::KIND] => crate::addons::color::nearest::SPEC,
|
||||
|
||||
@@ -6997,6 +6997,14 @@ breakText Glyphs Глифи
|
||||
Remove Gaps Премахване на разстоянията
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer така се получават твърде много части (най-много 100000): удължете тиретата
|
||||
@msg select paths, or segments, to divide изберете пътища или сегменти за разделяне
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… Плавен мост…
|
||||
Smooth Bridge Плавен мост
|
||||
Keep Originals Запазване на оригиналите
|
||||
@msg select two 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 кръговете са твърде далеч един от друг за този радиус
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Общи допирателни…
|
||||
Common Tangents Общи допирателни
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7046,6 +7046,14 @@ shape Open Otvoren
|
||||
Remove Gaps Ukloni razmake
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer to daje previše dijelova (najviše 100000): produžite crtice
|
||||
@msg select paths, or segments, to divide odaberite putanje ili segmente za dijeljenje
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Zajedničke tangente…
|
||||
Common Tangents Zajedničke tangente
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -7767,6 +7767,14 @@ breakText Glyphs Glifs
|
||||
Remove Gaps Elimina les separacions
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer això fa massa trossos (com a màxim 100000): allargueu els guions
|
||||
@msg select paths, or segments, to divide seleccioneu camins o segments per dividir
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Tangents comunes…
|
||||
Common Tangents Tangents comunes
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -7752,6 +7752,14 @@ breakText Glyphs Glyfy
|
||||
Remove Gaps Odstranit mezery
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer tím vznikne příliš mnoho dílů (nejvýše 100000): prodlužte čárky
|
||||
@msg select paths, or segments, to divide vyberte cesty nebo segmenty k rozdělení
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Společné tečny…
|
||||
Common Tangents Společné tečny
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9812,6 +9812,14 @@ breakText Glyphs Glyffer
|
||||
Remove Gaps Fjern mellemrum
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer det giver for mange stykker (højst 100000): gør stregerne længere
|
||||
@msg select paths, or segments, to divide vælg stier eller segmenter, der skal opdeles
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Fælles tangenter…
|
||||
Common Tangents Fælles tangenter
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7347,6 +7347,14 @@ breakText Glyphs Glyphen
|
||||
Remove Gaps Lücken entfernen
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer das ergibt zu viele Teile (höchstens 100000): machen Sie die Striche länger
|
||||
@msg select paths, or segments, to divide wählen Sie Pfade oder Segmente zum Aufteilen aus
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Gemeinsame Tangenten…
|
||||
Common Tangents Gemeinsame Tangenten
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7740,6 +7740,14 @@ breakText Glyphs Γλύφοι
|
||||
Remove Gaps Αφαίρεση κενών
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer αυτό δίνει πάρα πολλά κομμάτια (το πολύ 100000): κάντε τις παύλες μεγαλύτερες
|
||||
@msg select paths, or segments, to divide επιλέξτε διαδρομές ή τμήματα για διαίρεση
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… Ομαλή γέφυρα…
|
||||
Smooth Bridge Ομαλή γέφυρα
|
||||
Keep Originals Διατήρηση πρωτοτύπων
|
||||
@msg select two 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 οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Κοινές εφαπτόμενες…
|
||||
Common Tangents Κοινές εφαπτόμενες
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7728,6 +7728,14 @@ breakText Glyphs Glifos
|
||||
Remove Gaps Quitar separaciones
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer eso da demasiados trozos (como máximo 100000): alargue los guiones
|
||||
@msg select paths, or segments, to divide seleccione trazados o segmentos para dividir
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Tangentes comunes…
|
||||
Common Tangents Tangentes comunes
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -7816,6 +7816,14 @@ breakText Glyphs Merkit
|
||||
Remove Gaps Poista välit
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer siitä tulee liian monta osaa (enintään 100000): pidennä viivoja
|
||||
@msg select paths, or segments, to divide valitse jaettavat polut tai segmentit
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Yhteiset tangentit…
|
||||
Common Tangents Yhteiset tangentit
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -7747,6 +7747,14 @@ breakText Glyphs Glyphes
|
||||
Remove Gaps Supprimer les écarts
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer cela donne trop de morceaux (100000 au plus) : allongez les tirets
|
||||
@msg select paths, or segments, to divide sélectionnez des tracés ou des segments à diviser
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Tangentes communes…
|
||||
Common Tangents Tangentes communes
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1933,6 +1933,7 @@
|
||||
Kashidas કાશીદા
|
||||
Keep Formatting ફોર્મેટિંગ રાખો
|
||||
Keep Original મૂળ રાખો
|
||||
Keep Originals મૂળ રાખો
|
||||
Keep Plain Text સાદો ટેક્સ્ટ રાખો
|
||||
Keep Shared Points Together વહેંચાયેલા પોઇન્ટ સાથે રાખો
|
||||
Keep Tools Beside the Canvas ટૂલ્સ કેનવાસની બાજુમાં રાખો
|
||||
@@ -3873,6 +3874,8 @@
|
||||
Report Results પરિણામોનો અહેવાલ
|
||||
Smooth સ્મૂધ
|
||||
Smooth Anchors… એન્કર સ્મૂધ કરો…
|
||||
Smooth Bridge સ્મૂધ બ્રિજ
|
||||
Smooth Bridge… સ્મૂધ બ્રિજ…
|
||||
Smooth Tool સ્મૂધ ટૂલ
|
||||
Smooth… સ્મૂધ કરો…
|
||||
Smudge Stick… સ્મજ સ્ટિક…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -2599,6 +2599,7 @@ antiAlias Sharp शार्प
|
||||
Keep graphics, colors and text styles here to use them in any document. Libraries are stored on this machine — no account required. ग्राफ़िक्स, रंग और टेक्स्ट स्टाइल्स यहाँ रखें ताकि किसी भी डॉक्यूमेंट में उपयोग कर सकें। लाइब्रेरीज़ इसी कंप्यूटर पर रहती हैं — अकाउंट की ज़रूरत नहीं है।
|
||||
Keep Handles हैंडल रखें
|
||||
Keep Original मूल रखें
|
||||
Keep Originals मूल रखें
|
||||
Keep Plain Text प्लेन टेक्स्ट रखें
|
||||
Keep selected सिलेक्ट करें
|
||||
Keep Shared Points Together साझा पॉइंट्स एक साथ रखें
|
||||
@@ -5049,6 +5050,8 @@ antiAlias Sharp शार्प
|
||||
Smooth स्मूथ
|
||||
Smooth Anchors चिकना एंकर
|
||||
Smooth Anchors… चिकना एंकर…
|
||||
Smooth Bridge स्मूद ब्रिज
|
||||
Smooth Bridge… स्मूद ब्रिज…
|
||||
Smooth Color चिकना रंग
|
||||
Smooth Tool चिकना टूल
|
||||
Smooth… चिकना करें…
|
||||
@@ -8122,6 +8125,7 @@ liquify-list-end {0}, {1} {0} और {1}
|
||||
@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 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 केवल दूसरों के ऊपर या नीचे एक डॉक समूह गिर जाता है, एक दूसरे के बगल में नहीं
|
||||
@msg only an exporter or an importer declares `extensions` केवल एक्सपोर्टर या इंपोर्टर `extensions` घोषित करता है
|
||||
@msg only an object of the Global Edit other than the one it started from can be left out केवल ग्लोबल एडिट का एक ऑब्जेक्ट, इसके अलावा इसे शुरू किया जा सकता है, छोड़ दिया जा सकता है
|
||||
@@ -8468,6 +8472,7 @@ liquify-list-end {0}, {1} {0} और {1}
|
||||
@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 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 वितरित करने के लिए दो या दो से अधिक ऑब्जेक्ट चुनें
|
||||
@@ -8653,6 +8658,8 @@ liquify-list-end {0}, {1} {0} और {1}
|
||||
@msg the background worker stopped पृष्ठभूमि कार्यकर्ता बंद कर दिया
|
||||
@msg the blend has no spine मिश्रण में कोई रीढ़ नहीं है
|
||||
@msg the character's size can't be measured कैरेक्टर का आकार मापा नहीं जा सकता है
|
||||
@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 इमेज को नहीं लिखा जा सकता
|
||||
@msg the Color Picker is not open रंग पिकर खुला नहीं है
|
||||
@msg the compound shape is too complex to expand मिश्रित आकार का विस्तार करने के लिए बहुत जटिल है
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7737,6 +7737,14 @@ breakText Glyphs Glifák
|
||||
Remove Gaps Hézagok eltávolítása
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer ez túl sok darabot adna (legfeljebb 100000): hosszabbítsa meg a szaggatásokat
|
||||
@msg select paths, or segments, to divide jelöljön ki felosztandó útvonalakat vagy szakaszokat
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Közös érintők…
|
||||
Common Tangents Közös érintők
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7014,6 +7014,14 @@ breakText Glyphs Glif
|
||||
Remove Gaps Hapus celah
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer itu menghasilkan terlalu banyak potongan (paling banyak 100000): perpanjang garisnya
|
||||
@msg select paths, or segments, to divide pilih jalur atau segmen yang akan dibagi
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… Jembatan Halus…
|
||||
Smooth Bridge Jembatan Halus
|
||||
Keep Originals Pertahankan Asli
|
||||
@msg select two circles to bridge pilih dua lingkaran 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Garis Singgung Persekutuan…
|
||||
Common Tangents Garis Singgung Persekutuan
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2537 and column 5.
|
@@ -7385,6 +7385,14 @@ breakText Glyphs Glifi
|
||||
Remove Gaps Rimuovi le distanze
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer così si ottengono troppi pezzi (al massimo 100000): allunga i trattini
|
||||
@msg select paths, or segments, to divide seleziona tracciati o segmenti da dividere
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… Ponte morbido…
|
||||
Smooth Bridge Ponte morbido
|
||||
Keep Originals Mantieni originali
|
||||
@msg select two circles to bridge seleziona due 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Tangenti comuni…
|
||||
Common Tangents Tangenti comuni
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9269,6 +9269,14 @@ breakText Glyphs 字形
|
||||
Remove Gaps 間隔を削除
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer 分割数が多すぎます(最大 100000):ダッシュを長くしてください
|
||||
@msg select paths, or segments, to divide 分割するパスまたはセグメントを選択してください
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… スムーズブリッジ…
|
||||
Smooth Bridge スムーズブリッジ
|
||||
Keep Originals オリジナルを保持
|
||||
@msg select two 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 この半径では円が離れすぎています
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… 共通接線…
|
||||
Common Tangents 共通接線
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9964,6 +9964,14 @@ breakText Glyphs გლიფები
|
||||
Remove Gaps ღრეჩოების მოცილება
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer ეს ძალიან ბევრ ნაწილს იძლევა (მაქსიმუმ 100000): გაზარდეთ ტირეების სიგრძე
|
||||
@msg select paths, or segments, to divide აირჩიეთ დასაყოფი ტრაექტორიები ან სეგმენტები
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… გლუვი ხიდი…
|
||||
Smooth Bridge გლუვი ხიდი
|
||||
Keep Originals ორიგინალების შენარჩუნება
|
||||
@msg select two 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 ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… საერთო მხებები…
|
||||
Common Tangents საერთო მხებები
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7349,6 +7349,14 @@ breakText Glyphs 글리프
|
||||
Remove Gaps 간격 제거
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer 조각이 너무 많아집니다(최대 100000개). 대시를 더 길게 하십시오
|
||||
@msg select paths, or segments, to divide 나눌 패스나 세그먼트를 선택하십시오
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… 부드러운 브리지…
|
||||
Smooth Bridge 부드러운 브리지
|
||||
Keep Originals 원본 유지
|
||||
@msg select two 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 이 반경에서는 원이 너무 멀리 떨어져 있습니다
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… 공통 접선…
|
||||
Common Tangents 공통 접선
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9644,6 +9644,14 @@ breakText Glyphs Glyphs
|
||||
Remove Gaps Tussenruimten verwijderen
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer dat geeft te veel stukken (hoogstens 100000): maak de streepjes langer
|
||||
@msg select paths, or segments, to divide selecteer paden of segmenten om te verdelen
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Gemeenschappelijke raaklijnen…
|
||||
Common Tangents Gemeenschappelijke raaklijnen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7615,6 +7615,14 @@ breakText Glyphs Glify
|
||||
Remove Gaps Usuń odstępy
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer to daje za dużo części (najwyżej 100000): wydłuż kreski
|
||||
@msg select paths, or segments, to divide zaznacz ścieżki lub segmenty do podzielenia
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Wspólne styczne…
|
||||
Common Tangents Wspólne styczne
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7779,6 +7779,14 @@ breakText Glyphs Glifos
|
||||
Remove Gaps Remover distâncias
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer isso gera peças demais (no máximo 100000): aumente os traços
|
||||
@msg select paths, or segments, to divide selecione demarcadores ou segmentos para dividir
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Tangentes comuns…
|
||||
Common Tangents Tangentes comuns
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7742,6 +7742,14 @@ breakText Glyphs Глифы
|
||||
Remove Gaps Убрать зазоры
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer так получится слишком много частей (не более 100000): удлините штрихи
|
||||
@msg select paths, or segments, to divide выделите контуры или сегменты для разделения
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… Плавный мост…
|
||||
Smooth Bridge Плавный мост
|
||||
Keep Originals Сохранить оригиналы
|
||||
@msg select two 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 окружности слишком далеко друг от друга для этого радиуса
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Общие касательные…
|
||||
Common Tangents Общие касательные
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7786,6 +7786,14 @@ breakText Glyphs Glyfer
|
||||
Remove Gaps Ta bort mellanrum
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer det blir för många delar (högst 100000): gör strecken längre
|
||||
@msg select paths, or segments, to divide markera banor eller segment att dela upp
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Gemensamma tangenter…
|
||||
Common Tangents Gemensamma tangenter
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9642,6 +9642,14 @@ breakText Glyphs Glifler
|
||||
Remove Gaps Boşlukları Kaldır
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer bu çok fazla parça oluşturur (en fazla 100000): tireleri uzatın
|
||||
@msg select paths, or segments, to divide bölünecek yolları veya bölümleri seçin
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Ortak Teğetler…
|
||||
Common Tangents Ortak Teğetler
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7367,6 +7367,14 @@ breakText Glyphs Гліфи
|
||||
Remove Gaps Прибрати проміжки
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer так вийде забагато частин (не більше 100000): подовжте штрихи
|
||||
@msg select paths, or segments, to divide виділіть контури або сегменти для розділення
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… Плавний міст…
|
||||
Smooth Bridge Плавний міст
|
||||
Keep Originals Зберегти оригінали
|
||||
@msg select two 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 кола надто далеко одне від одного для цього радіуса
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Спільні дотичні…
|
||||
Common Tangents Спільні дотичні
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7403,6 +7403,14 @@ breakText Glyphs Glyph
|
||||
Remove Gaps Gỡ các khoảng hở
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer như vậy tạo ra quá nhiều mảnh (tối đa 100000): hãy kéo dài nét
|
||||
@msg select paths, or segments, to divide chọn các đường dẫn hoặc đoạn để chia
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
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 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
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… Tiếp tuyến chung…
|
||||
Common Tangents Tiếp tuyến chung
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7597,6 +7597,14 @@ breakText Glyphs 字形
|
||||
Remove Gaps 移除间隙
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer 这会产生过多片段(最多 100000 个):请加长短划线
|
||||
@msg select paths, or segments, to divide 请选择要分割的路径或线段
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… 平滑桥接…
|
||||
Smooth Bridge 平滑桥接
|
||||
Keep Originals 保留原稿
|
||||
@msg select two 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 对于此半径,两个圆相距太远
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… 公切线…
|
||||
Common Tangents 公切线
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7408,6 +7408,14 @@ breakText Glyphs 字符
|
||||
Remove Gaps 移除間隙
|
||||
@msg that makes too many pieces (at most 100000): make the dashes longer 這會產生過多片段(最多 100000 個):請加長短破折號
|
||||
@msg select paths, or segments, to divide 請選取要分割的路徑或線段
|
||||
# Path Precision Tools add-on: Smooth Bridge.
|
||||
Smooth Bridge… 平滑橋接…
|
||||
Smooth Bridge 平滑橋接
|
||||
Keep Originals 保留原始物件
|
||||
@msg select two 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 就此半徑而言,兩個圓形相距太遠
|
||||
# Path Precision Tools add-on: Common Tangents.
|
||||
Common Tangents… 公切線…
|
||||
Common Tangents 公切線
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -79,6 +79,7 @@ pub(super) fn menu_dialog(app: &VectorcraftApp, id: &str) -> Option<(&'static st
|
||||
(crate::addons::pathtools::set_corners::KIND, crate::addons::pathtools::set_corners::fields(app))
|
||||
}
|
||||
crate::addons::pathtools::dashes::COMMAND => (crate::addons::pathtools::dashes::KIND, crate::addons::pathtools::dashes::fields()),
|
||||
crate::addons::pathtools::bridge::COMMAND => (crate::addons::pathtools::bridge::KIND, crate::addons::pathtools::bridge::fields()),
|
||||
crate::addons::pathtools::tangent_circle::COMMAND => {
|
||||
(crate::addons::pathtools::tangent_circle::KIND, crate::addons::pathtools::tangent_circle::fields(app))
|
||||
}
|
||||
|
||||
+12
@@ -13172,6 +13172,18 @@ 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.tangentCircle {ids?, radius?, circle?}` draws the circles that touch two paths or compound paths
|
||||
and have `radius` (0.01 to 1,000,000 pt, needed with two), or that touch three (which set the radius themselves, so
|
||||
`radius` is then an error), as one undo step (Object › Plug-ins › Path Precision Tools › Tangent Circle…). `ids`
|
||||
|
||||
@@ -2765,6 +2765,10 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov
|
||||
|
||||
A trim reads the selection through a set and changes it once at the end, instead of going through the selected objects once for each trimmed path and each piece, with the same resulting selection as before. With 2,000 selected lines each split in two, the selection update took 7.7 ms and now takes 0.2 ms (the whole command about 75 ms); with 7,000 lines it took 96 ms and now takes 0.7 ms. The times are wall-clock medians of 7 runs while other builds shared the CPU. Test: `the_selection_after_a_trim_is_the_one_changing_it_one_id_at_a_time_gives` in `cmd::addons::pathtools::trim::tests` in `vectorcraft-engine`.
|
||||
|
||||
## Path Precision Tools add-on: Smooth Bridge (2026-11-15)
|
||||
|
||||
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.
|
||||
|
||||
## 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 `<name>_YYYY-MM-DD_HH-MM.<ext>` (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.
|
||||
|
||||
@@ -506,6 +506,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 (also in the Scissors tool's group in both shipped toolbars, after the Knife, and listed there in the All Tools drawer; a toolbar edited before keeps its saved layout until Reset Toolbar; no shortcut until one is set in Edit › Keyboard Shortcuts › Tools; the Knife's cursor, drawn as a knife with the blade's point on the hotspot) 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 removes every stretch its rectangle touches, and an Alt-drag removes every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing; hovering shows in red the stretch a click would remove, and a drag that reaches few paths shows what its release would remove | 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 › Tangent Circle… draws the circles that touch two selected paths or compound paths at a radius, or three of them, each touching the outlines without crossing them; Radius (two shapes), a Circle menu (All or one by number) and Preview; one undo step | done | `addon.pathtools.tangentCircle` (in `crates/engine/src/cmd/addons/pathtools/tangent_circle.rs`, geometry in `crates/pathops/src/addons/pathtools/tangent_circle.rs`) and its 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 |
|
||||
|
||||
Reference in new issue
Block a user