Path Precision Tools: the Tangent Circle Tool keeps its first segment until the circle is drawn

- The release returns shape.circleThroughPoints followed by a Notify,
  and the tool forgets the first segment only when it is told, so a
  command that fails leaves the segment picked (as the Direct Selection
  tool's FRAME_PICKED notice follows its command).
- The preview leaves out circles that three of their points cannot give
  back, so the note shows where a click would draw nothing.
- A double-click draws nothing more: the canvas sends it after the
  second click's release, which drew the circle.
- The re-exports for the tool are a separate `pub use` in the pathops
  pathtools module, whose module comment is unchanged.
- Circles of one radius at places tried close together along the
  first segment are no longer taken for repeats: a repeat also touches
  the first segment at the same point. At a radius of 1,000,000 pt the
  513 places along a 100 pt line were cut to 86.
- A test checks the note's row in every complete catalog.

Docs: a drag's circle may touch the first segment anywhere along it;
the circles that are left out; an out-of-range radius option leaves
the radius as it is. The ROADMAP, target-app-parity and ui-parity
entries move next to related entries, and docs/mcp.md is rewrapped to
120 columns.

Part of #7178.
This commit is contained in:
dotCooCoo
2026-11-17 21:16:04 -08:00
parent a561f666a6
commit 51194f584b
10 changed files with 121 additions and 65 deletions
+1 -1
View File
@@ -149,11 +149,11 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
- 2026-11-01: Randomize Opacity joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): each selected object gets its own opacity at random between a minimum and a maximum percent, with a seed that repeats the result, as one undo step (`addon.arrange.randomizeOpacity`, #4925).
- 2026-11-01: Sort Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects are sorted by width, height, area, position, opacity or stacking order (small to large, large to small or at random) and take another of those in that order, trading their values or stepping them evenly, as one undo step (`addon.arrange.sort`, #4917).
- 2026-11-15: Tangent Circle joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the circles that touch two selected paths or compound paths at a set radius, or three of them (up to eight for three circles), touching each outline without crossing it; circles, rotated ellipses and other paths alike. A dialog that previews every circle or one picked by number, the current paint, one undo step (`addon.pathtools.tangentCircle`). A VectorCraft addition: headline numbers unchanged.
- 2026-11-17: Tangent Circle Tool joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools, and the All Tools drawer): click a path segment, then another, to draw the circle tangent to the first where it was clicked that touches the second; Shift uses the tool's radius, and a drag from the second segment sets the radius (Shift in round steps, Cmd/Ctrl slowly). The circle shows with its center and radii before the click, one undo step (`tangentCircle`). A VectorCraft addition: headline numbers unchanged.
- 2026-11-01: New Symbols from Layers joins the Document Tools add-on (Object › Plug-ins › Document Tools): one symbol of each top-level layer's art (the layers highlighted in the Layers panel when two or more are, else every layer), named after the layer, made as New Symbol makes one; Convert Layers to Symbols also puts an instance of each in place of its layer's art. Empty layers are skipped and reported; one undo step. A VectorCraft addition: headline numbers unchanged.
- 2026-11-01: Document Tools, a built-in add-on (Object › Plug-ins › Document Tools), starts with Save a Timestamped Copy: a copy of the document named `<name>_YYYY-MM-DD_HH-MM` (UTC; `-2`, `-3`… when that name is taken) goes next to it, or into a folder picked for a document never saved, written as File › Save a Copy writes it, so the document keeps its path, title and modified state. Off on the web, which has no clock. A VectorCraft addition: headline numbers unchanged.
- 2026-11-01: Divide into Dashes joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the selected paths, or only their direct-selected segments, are cut into separate open paths of a dash length measured along the curve, with an optional gap (left empty, or kept as pieces), each keeping the path's appearance; Fit to Corners and Ends stretches or squeezes the lengths so every run starts and ends on a dash. A dialog with Preview, one undo step, at most 100000 pieces. A VectorCraft addition: headline numbers unchanged.
- 2026-11-15: 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-17: Tangent Circle Tool joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools, and the All Tools drawer): click a path segment, then another, to draw the circle tangent to the first where it was clicked that touches the second; Shift uses the tool's radius and a drag from the second segment sets the radius (Shift in round steps, Cmd/Ctrl slowly), the circle then touching the first segment anywhere along it. The circle shows with its center and radii before the click, one undo step (`tangentCircle`). 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-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.
+6 -7
View File
@@ -5,9 +5,8 @@
//! 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
//! Parametric Shape Tool's shapes ([`shapes`]), the circles that touch two or three shapes
//! ([`tangent_circles`]) and the Tangent Circle tool's circles on two segments
//! ([`circles_through`], [`circles_of_radius`]).
//! Parametric Shape Tool's shapes ([`shapes`]) and the circles that touch two or three shapes
//! ([`tangent_circles`]).
mod crossings;
mod dashes;
@@ -33,13 +32,13 @@ pub use shared_edge::{
COINCIDENCE, EndSide, Follow, MAX_COINCIDENCE, MergePlan, MergePreview, Stretch, apply_merge, ends_at, merge_preview, stretches_at,
};
pub use slide::{MAX_SLIDE, slide_anchor, slide_stops, slide_t_at};
pub use tangent_circle::{
Circle, MAX_TANGENT_CIRCLE_SEGMENTS, MAX_TANGENT_CIRCLES, SegmentCircle, TangentCircleError, circles_of_radius, circles_through,
tangent_circle_segments, tangent_circles,
};
pub use tangent_circle::{Circle, MAX_TANGENT_CIRCLE_SEGMENTS, MAX_TANGENT_CIRCLES, TangentCircleError, tangent_circle_segments, tangent_circles};
pub use tangents::{Coincide, MAX_TANGENT_SEGMENTS, Outline, OutlineError, Tangent, TangentKind, common_tangents};
pub use trim::{Span, slice, span_at, spans, without_spans};
// The Tangent Circle tool's circles on two picked segments.
pub use tangent_circle::{SegmentCircle, circles_of_radius, circles_through};
use crate::fit::{end_tangent, start_tangent};
/// The auto-smooth rule's handle length as a share of the nearer neighbour's distance: the share
@@ -10,6 +10,9 @@
//! from a point to an outline changes by at most the distance the point moves, so a cell whose
//! center is too far from every condition holds no center and is dropped. The cells left are
//! refined with Newton's method on the exact curves.
//!
//! The Tangent Circle tool's circles on two picked segments are [`circles_through`] and
//! [`circles_of_radius`].
use kurbo::{CubicBez, ParamCurve, Point, Vec2};
use vectorcraft_geom::PathData;
@@ -193,15 +193,18 @@ fn touching(center: Point, r: f64, second: &[CubicBez], scale: f64) -> Option<Po
}
/// `found` without circles that cross `first`, that touch the two at one point, or that repeat an
/// earlier one.
/// earlier one (the same center, touching `first` at the same point).
fn keep(found: Vec<SegmentCircle>, first: &CubicBez) -> Vec<SegmentCircle> {
let own = scale(first, &[]).unwrap_or(0.0);
let mut out: Vec<SegmentCircle> = vec![];
for c in found {
let r = c.circle.radius;
let crosses = nearest(c.circle.center, std::slice::from_ref(first)).is_none_or(|(d, _)| d < r * (1.0 - 1e-6));
let one_point = (c.first - c.second).hypot() <= SAME * r;
// The roots come in order along their parameter, so a repeat follows its first.
let repeat = out.last().is_some_and(|o| (o.circle.center - c.circle.center).hypot() <= SAME * r * 10.0);
// The roots come in order along their parameter, so a repeat follows its first. Circles of
// one large radius at places tried close together along `first` are not repeats.
let repeat =
out.last().is_some_and(|o| (o.circle.center - c.circle.center).hypot() <= SAME * r * 10.0 && (o.first - c.first).hypot() <= SAME * own);
if !(crosses || one_point || repeat) && r.is_finite() && r > 0.0 {
out.push(c);
}
@@ -606,6 +606,9 @@ fn lines_twice_the_radius_apart_give_circles_all_along() {
assert!(found.iter().all(|c| (c.circle.center.y - 20.0).abs() < 1e-9 && c.circle.radius == 20.0), "{found:?}");
let xs: Vec<f64> = found.iter().map(|c| c.circle.center.x).collect();
assert!(xs.iter().any(|x| *x < 1.0) && xs.iter().any(|x| *x > 99.0), "from end to end: {xs:?}");
// At a radius of 1,000,000 pt the places tried along the line, 0.2 pt apart, stay apart.
let found = circles_of_radius(line((0.0, 0.0), (100.0, 0.0)), &[line((0.0, 2e6), (100.0, 2e6))], 1e6);
assert_eq!(found.len(), 513, "{}", found.len());
}
#[test]
+76 -39
View File
@@ -2,15 +2,17 @@
//! not, to draw the circle that is tangent to the first segment where it was clicked and touches the
//! second ([`circles_through`]). With Shift held over the second segment the circle has the tool's
//! `radius` instead, anywhere along the first segment ([`circles_of_radius`]). A drag from the
//! second segment sets the radius to the drag's length: Shift steps it by a round number of points
//! about 4 screen pixels long, and Cmd/Ctrl pressed during the drag moves it by a tenth of the
//! pointer's movement (held at the press, Cmd/Ctrl lends the selection tool as it does for every
//! tool). The segments on either side of the second one count with it (the first one excepted),
//! and of the circles found the one touching them nearest the pointer is drawn. While the pointer
//! is over the second segment the circle shows with its center and radii; where there is none, a
//! note says so. The circle is a new ellipse with the current paint, drawn with
//! second segment sets the radius to the drag's length, the circle again anywhere along the first
//! segment: Shift steps it by a round number of points about 4 screen pixels long, and Cmd/Ctrl
//! pressed during the drag moves it by a tenth of the pointer's movement (held at the press,
//! Cmd/Ctrl lends the selection tool as it does for every tool). The segments on either side of the
//! second one count with it (the first one excepted), and of the circles found the one touching
//! them nearest the pointer is drawn. While the pointer is over the second segment the circle shows
//! with its center and radii; where there is none, or none that its three points can draw, a note
//! says so. The circle is a new ellipse with the current paint, drawn with
//! `shape.circleThroughPoints` in one undo step, so Align New Objects to Pixel Grid leaves it in
//! place. Escape, an edit or Undo outside the tool, or another document forgets the first segment.
//! place; the first segment stays picked until the circle is drawn. Escape, an edit or Undo outside
//! the tool, or another document forgets the first segment.
use kurbo::{CubicBez, Shape};
use serde_json::{Value, json};
@@ -117,11 +119,17 @@ fn second_set(cx: &ToolContext, first: &Pick, second: &Pick) -> Vec<CubicBez> {
indices.into_iter().filter(|k| *k < n && !is_first(*k)).map(|k| sp.segment(k)).collect()
}
/// Of `circles`, the one touching the second segments nearest `at`.
fn nearest_to(circles: Vec<SegmentCircle>, at: Point) -> Option<SegmentCircle> {
circles.into_iter().min_by(|a, b| (a.second - at).hypot().total_cmp(&(b.second - at).hypot()))
/// Of `circles`, the one touching the second segments nearest `at`, leaving out those [`draw`] cannot
/// draw within `tol`.
fn nearest_to(circles: Vec<SegmentCircle>, at: Point, tol: f64) -> Option<SegmentCircle> {
circles.into_iter().filter(|c| draw(c, tol).is_some()).min_by(|a, b| (a.second - at).hypot().total_cmp(&(b.second - at).hypot()))
}
/// How far (screen pixels) the circle three points give back may be from the circle found.
const DRAW_PX: f64 = 0.05;
/// What the tool is told once its circle is drawn: then it forgets the first segment.
const DRAWN: &str = "tangentCircle.drawn";
/// The circles on `first` and `second`: tangent at the first pick, or of `radius`.
fn circles(first: &Pick, second: &[CubicBez], radius: Option<f64>) -> Vec<SegmentCircle> {
match radius {
@@ -199,7 +207,7 @@ impl TangentCircleTool {
self.looked = false;
let Some(hover) = self.hover.clone().filter(|_| self.first.is_some()) else { return };
let found = self.circles_on(cx, &hover, mods.shift.then_some(self.radius));
self.found = nearest_to(found, p);
self.found = nearest_to(found, p, cx.tol(DRAW_PX));
self.looked = true;
}
@@ -218,7 +226,7 @@ impl TangentCircleTool {
press.radius = Some(r);
let shown = Self::shown_radius(cx, r, ev.mods.shift);
// Dragged back to the press: a radius of 0, and no circle.
self.found = if shown > 0.0 { nearest_to(circles(first, &press.second, Some(shown)), press.at) } else { None };
self.found = if shown > 0.0 { nearest_to(circles(first, &press.second, Some(shown)), press.at, cx.tol(DRAW_PX)) } else { None };
}
fn forget(&mut self) {
@@ -258,7 +266,7 @@ impl Tool for TangentCircleTool {
};
let second = second_set(cx, &first, &pick);
let found = self.circles_on(cx, &pick, ev.mods.shift.then_some(self.radius));
self.found = nearest_to(found, ev.pos);
self.found = nearest_to(found, ev.pos, cx.tol(DRAW_PX));
self.looked = true;
self.hover = None;
self.press = Some(Press { second, at: ev.pos, reach: 0.0, radius: None });
@@ -268,20 +276,21 @@ impl Tool for TangentCircleTool {
self.drag_to(cx, ev);
vec![]
}
// The second click of a double-click releases with `DoubleClick` instead of `Up`.
PointerKind::Up | PointerKind::DoubleClick => {
PointerKind::Up => {
// The release's own position and keys set the radius of a drag.
self.drag_to(cx, ev);
if self.press.take().is_none() {
return vec![];
}
// No circle, or one the three points cannot draw: the first segment stays picked,
// for another try.
let Some(action) = self.found.take().and_then(|c| draw(&c, cx.tol(0.05))) else { return vec![] };
self.forget();
vec![action]
// for another try. It also stays when the command fails: only a drawn circle tells
// the tool (`notify`) to forget it.
let Some(action) = self.found.take().and_then(|c| draw(&c, cx.tol(DRAW_PX))) else { return vec![] };
self.looked = false;
vec![action, Action::Notify(DRAWN.into())]
}
PointerKind::TripleClick => vec![],
// The canvas sends a double-click after the second click's `Up`, which drew the circle.
PointerKind::DoubleClick | PointerKind::TripleClick => vec![],
}
}
@@ -296,6 +305,12 @@ impl Tool for TangentCircleTool {
key == ToolKey::Escape && self.first.is_some()
}
fn notify(&mut self, _cx: &ToolContext, what: &str) {
if what == DRAWN {
self.forget();
}
}
/// An edit, Undo or Redo outside the tool, or another document: the first segment may be gone.
fn history_moved(&mut self) {
self.forget();
@@ -399,10 +414,22 @@ mod tests {
e
}
/// A release, with the tool told what its actions tell it, as the session does once the command
/// before the `Notify` has run.
fn up(t: &mut TangentCircleTool, cx: &ToolContext, e: &PointerEvent) -> Vec<Action> {
let acts = t.pointer(cx, e);
for a in &acts {
if let Action::Notify(what) = a {
t.notify(cx, what);
}
}
acts
}
/// The circle an action list draws, as the box around it: (x, y, width, height).
fn drawn(actions: &[Action]) -> (f64, f64, f64, f64) {
let [Action::Exec(cmd, p)] = actions else { panic!("{actions:?}") };
assert_eq!(cmd, "shape.circleThroughPoints");
let [Action::Exec(cmd, p), Action::Notify(what)] = actions else { panic!("{actions:?}") };
assert_eq!((cmd.as_str(), what.as_str()), ("shape.circleThroughPoints", DRAWN));
let pts: Vec<Point> = p["points"].as_array().unwrap().iter().map(|q| Point::new(q[0].as_f64().unwrap(), q[1].as_f64().unwrap())).collect();
let (at, r) = vectorcraft_geom::shapes::circle_through(pts[0], pts[1], pts[2]).unwrap();
(at.x - r, at.y - r, 2.0 * r, 2.0 * r)
@@ -432,15 +459,22 @@ mod tests {
t.pointer(&cx, &ev(PointerKind::Move, 250.0, 139.0));
assert_eq!(t.cache, kept);
assert!(t.pointer(&cx, &ev(PointerKind::Down, 200.0, 139.0)).is_empty());
let up = t.pointer(&cx, &ev(PointerKind::Up, 200.0, 139.0));
assert!(close(drawn(&up), (130.0, 100.0, 40.0, 40.0)), "{up:?}");
let released = t.pointer(&cx, &ev(PointerKind::Up, 200.0, 139.0));
assert!(close(drawn(&released), (130.0, 100.0, 40.0, 40.0)), "{released:?}");
// Until the command has run and the tool is told, the first segment stays: a command that
// fails leaves it picked.
assert!(t.first.is_some() && !t.busy());
t.notify(&cx, DRAWN);
assert!(t.first.is_none() && t.overlays(&cx).is_empty(), "ready for the next circle");
// A quick second click on the second segment releases with a double-click: the same circle.
t.pointer(&cx, &ev(PointerKind::Down, 150.0, 101.0));
t.pointer(&cx, &ev(PointerKind::Up, 150.0, 101.0));
t.pointer(&cx, &ev(PointerKind::Down, 200.0, 139.0));
let up = t.pointer(&cx, &ev(PointerKind::DoubleClick, 200.0, 139.0));
assert!(close(drawn(&up), (130.0, 100.0, 40.0, 40.0)) && !t.busy(), "{up:?}");
// A quick second click on the second segment: the canvas sends its `Up` and then a
// double-click, which draws nothing more.
for (kind, x, y) in [(PointerKind::Down, 150.0, 101.0), (PointerKind::Up, 150.0, 101.0), (PointerKind::Down, 200.0, 139.0)] {
assert!(t.pointer(&cx, &ev(kind, x, y)).is_empty());
}
let released = up(&mut t, &cx, &ev(PointerKind::Up, 200.0, 139.0));
assert!(close(drawn(&released), (130.0, 100.0, 40.0, 40.0)), "{released:?}");
assert!(t.pointer(&cx, &ev(PointerKind::DoubleClick, 200.0, 139.0)).is_empty());
assert!(t.first.is_none() && !t.busy());
}
#[test]
@@ -450,15 +484,13 @@ mod tests {
let cx = cx(&d, &sel, &p);
let mut t = TangentCircleTool::default();
t.set_option("radius", &json!(10));
t.set_option("radius", &json!(0));
t.set_option("radius", &json!(f64::NAN));
assert_eq!(t.options()["radius"], json!(10.0));
// The L's two segments: the circle of radius 10 in its corner.
t.pointer(&cx, &ev(PointerKind::Down, 150.0, 300.0));
t.pointer(&cx, &ev(PointerKind::Up, 150.0, 300.0));
t.pointer(&cx, &shifted(PointerKind::Down, 300.0, 350.0));
let up = t.pointer(&cx, &shifted(PointerKind::Up, 300.0, 350.0));
assert!(close(drawn(&up), (280.0, 300.0, 20.0, 20.0)), "{up:?}");
let released = up(&mut t, &cx, &shifted(PointerKind::Up, 300.0, 350.0));
assert!(close(drawn(&released), (280.0, 300.0, 20.0, 20.0)), "{released:?}");
}
#[test]
@@ -482,8 +514,8 @@ mod tests {
slow.mods.cmd = true;
t.pointer(&cx, &slow);
assert!((t.found.unwrap().circle.radius - 13.3).abs() < 1e-6, "{:?}", t.found);
let up = t.pointer(&cx, &ev(PointerKind::Up, 300.0, 372.3));
assert!(close(drawn(&up), (286.7 - 13.3, 300.0, 26.6, 26.6)), "{up:?}");
let released = up(&mut t, &cx, &ev(PointerKind::Up, 300.0, 372.3));
assert!(close(drawn(&released), (286.7 - 13.3, 300.0, 26.6, 26.6)), "{released:?}");
// A drag back past its press asks for no radius: no circle, not one through the first click.
t.pointer(&cx, &ev(PointerKind::Down, 150.0, 300.0));
t.pointer(&cx, &ev(PointerKind::Up, 150.0, 300.0));
@@ -497,8 +529,8 @@ mod tests {
// A release away from the last drag event: the release sets the radius.
t.pointer(&cx, &ev(PointerKind::Down, 300.0, 350.0));
t.pointer(&cx, &ev(PointerKind::Drag, 300.0, 360.0));
let up = t.pointer(&cx, &ev(PointerKind::Up, 300.0, 365.0));
assert!(close(drawn(&up), (300.0 - 30.0, 300.0, 30.0, 30.0)), "{up:?}");
let released = up(&mut t, &cx, &ev(PointerKind::Up, 300.0, 365.0));
assert!(close(drawn(&released), (300.0 - 30.0, 300.0, 30.0, 30.0)), "{released:?}");
t.pointer(&cx, &ev(PointerKind::Down, 150.0, 300.0));
t.pointer(&cx, &ev(PointerKind::Up, 150.0, 300.0));
// Cmd/Ctrl held from the start: a 20 pt drag gives 2 pt.
@@ -562,6 +594,11 @@ mod tests {
// At 10⁹ pt from the origin, where coordinates step by about 1.2e-7 pt, a radius of 5e-8 pt
// rounds the three points onto one line.
assert!(draw(&circle(1e9, 5e-8), 1e-3).is_none());
// The preview leaves such a circle out, even nearest the pointer: no red circle for a click
// that draws nothing.
let at = Point::new(1e9, 0.0);
assert_eq!(nearest_to(vec![circle(1e9, 5e-8), circle(100.0, 20.0)], at, 1e-3), Some(circle(100.0, 20.0)));
assert_eq!(nearest_to(vec![circle(1e9, 5e-8)], at, 1e-3), None);
let d = doc();
let (sel, p) = (Selection::default(), paint());
let cx = cx(&d, &sel, &p);
+9
View File
@@ -601,6 +601,15 @@ fn marquee_selection_labels_are_in_complete_catalogs() {
}
}
/// The note the Tangent Circle tool shows on the canvas over a segment that gives no circle.
#[test]
fn tangent_circle_tool_note_is_in_complete_catalogs() {
let label = vectorcraft_tools::addons::tangent_circle::NO_CIRCLE;
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
assert!(lang.catalog().plain(label).is_some(), "{} is missing {label}", lang.code);
}
}
/// Preferences › Performance › Use Monitor Profile for Canvas and the note under it.
#[test]
fn monitor_profile_labels_are_in_complete_catalogs() {
+12 -10
View File
@@ -12869,9 +12869,9 @@ the desktop app it lives in Object › Plug-ins › Path Precision Tools, in its
and in nine tools: `anchorEraserBrush`, `extendPath`, `measureInspect`, `parametricShape`, `cornerTool`, `slideAnchor`,
`sharedEdge`, `tangentCircle` and `trimAtCrossings`. The toolbars don't show the first eight until they are added from
the All Tools drawer (or chosen with `tool.select`); `trimAtCrossings` is in the Scissors tool's group in both shipped
toolbars, after the Knife, and `ui.tool.list` lists it there. A toolbar edited before it joined keeps its saved layout until
Reset Toolbar. None has a shortcut; one can be set in Edit › Keyboard Shortcuts › Tools. Each edit is one undo step,
and an edit that changes nothing makes no step.
toolbars, after the Knife, and `ui.tool.list` lists it there. A toolbar edited before it joined keeps its saved layout
until Reset Toolbar. None has a shortcut; one can be set in Edit › Keyboard Shortcuts › Tools. Each edit is one undo
step, and an edit that changes nothing makes no step.
Tools:
@@ -12925,18 +12925,20 @@ Tools:
center, its radii to the two touch points and its radius, or a note that there is none. A click there draws the
circle that is tangent to the first segment at the point clicked and touches the second (its center on the first
segment's normal there). With Shift the circle instead has the tool's `radius` and may touch the first segment
anywhere along it. A drag from the second segment sets the radius to the drag's length; Shift steps it by 1, 2 or 5
times a power of 10 pt, at least 4 screen pixels long (2 pt at 200%), and Cmd/Ctrl pressed during the drag moves
it by a tenth of the pointer's movement (held at the press, Cmd/Ctrl lends the selection tool, as for every tool).
anywhere along it. A drag from the second segment sets the radius to the drag's length, and the circle may again
touch the first segment anywhere along it; Shift steps the radius by 1, 2 or 5 times a power of 10 pt, at least 4
screen pixels long (2 pt at 200%), and Cmd/Ctrl pressed during the drag moves it by a tenth of the pointer's
movement (held at the press, Cmd/Ctrl lends the selection tool, as for every tool).
The segments on either side of the second one, on its subpath, count with it (the first segment excepted; the two
may be on the same path, and the first segment picked again gives no circle), and of the circles found the one
touching them nearest the pointer is drawn. A circle touches them when they lie outside it with a point on it, and
it never crosses the first segment. The circle is a new ellipse with the current paint, drawn through three of its
points with `shape.circleThroughPoints` so that Align New Objects to Pixel Grid leaves it in place, one undo step.
With no circle, or one too small or too large for its three points to give it back in floating point, nothing is
drawn and the first segment stays picked. Escape, an edit, Undo or Redo outside the tool, or another document
forgets the first segment. Option (`tool.setOption`, or a double-click on the tool): `radius` (pt, 0.01 to 1000000,
36).
A circle too small or too large for its three points to give it back in floating point counts as no circle. With
no circle the note shows, a click draws nothing and the first segment stays picked; it also stays when drawing the
circle fails. Escape, an edit, Undo or Redo outside the tool, or another document forgets the first segment.
Option (`tool.setOption`, or a double-click on the tool): `radius` (pt, 0.01 to 1000000, 36; a value outside that
range, or not a number, leaves the radius as it is).
- **Trim at Crossings Tool** (`trimAtCrossings`): removes stretches of paths between the places where they are crossed,
on any path that can be edited, selected or not. A click runs `addon.pathtools.trim` with `at`, for the path within 4
screen pixels of the pointer. A drag draws a rectangle and runs it with `rect` on release; once the pointer has
+4 -4
View File
@@ -2694,14 +2694,14 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov
A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Tangent Circle… (`addon.pathtools.tangentCircle`) draws the circles that touch two selected paths or compound paths at a set radius, or that touch three of them; for three circles these are the solutions of the [problem of Apollonius](https://en.wikipedia.org/wiki/Problem_of_Apollonius), up to eight. The rest is VectorCraft's own: a circle touches a shape when it meets the outline without crossing it (the whole outline outside the circle or inside it), so it is tangent at a smooth point and passes through a corner or an open end; circles, ellipses at any angle and other closed or open paths all take part, a compound path's members as one outline. Circles are solved in closed form, each answer then moved onto the drawn Bézier outlines; other shapes are searched on a grid and refined with Newton's method on the curves, and with three shapes circles up to 64 times the diagonal of the box around the shapes' anchors and handles are found. The circles are listed by radius, then top to bottom, then left to right; the dialog previews every circle found, or one picked by number, and OK draws them with the current paint as one undo step. No circle, more than 64 (shapes touched along a whole curve) and more than 2000 segments are errors. Tests: `tangent_circle::tests` in `vectorcraft-pathops` (three circles: two known circles and eight distinct ones in a steady order; two circles and a radius; the search against the closed form; rotated and skewed ellipses against an independent solve of every combination; two circles close together; squares; a compound path moved far off and scaled; open paths and the errors), `cmd::addons::pathtools::tangent_circle::tests` in `vectorcraft-engine`, `tangent_circle_previews_picks_one_cancels_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
## Path Precision Tools add-on: Tangent Circle Tool (2026-11-17)
A VectorCraft addition, so no area score moves. The Tangent Circle Tool (`tangentCircle`; Object › Plug-ins › Path Precision Tools and the All Tools drawer) draws a circle on two clicked path segments: tangent to the first at the point clicked (its center on the normal there) and touching the second segment or one beside it on its subpath, the touch nearest the pointer winning. Shift gives the circle the tool's radius anywhere along the first segment, and a drag from the second segment sets the radius to the drag's length (Shift: steps of 1, 2 or 5 times a power of 10 pt, at least 4 screen pixels; Cmd/Ctrl: a tenth of the movement). Before the click the circle shows with its center, radii and radius, or a note says there is none. The circles are found by sampling the distance to the second segments along the first segment's normal (or along the first segment, for a radius) and taking the places where it equals the radius (samples, bisection where it crosses, and a search where it only touches); circles that cross the first segment or touch both at one point are left out. The circle is a new ellipse with the current paint, one undo step. Tests: `tangent_circle::tests` in `vectorcraft-pathops` (parallel and crossing lines, a curved second segment, a corner's fillet, lines twice the radius apart, a touch between the places tried, the ends of a line with its handles on its anchors, no circle), `addons::tangent_circle::tests` in `vectorcraft-tools` (two clicks, Shift, a drag with Shift and Cmd/Ctrl, no circle and Escape) and the Path Precision Tools menu and options tests in `vectorcraft-ui-egui`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
## Path Precision Tools add-on: Expand Dashes into Paths (2026-11-01)
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns the dashed stroke of each selected path and compound path into separate open paths, one per dash, for cutters and plotters that need the centre lines rather than Outline Stroke's filled outlines. The dashes are laid out by the renderer's own dash code, so they match what the canvas draws: the dash pattern, its offset and Align Dashes to Corners and Path Ends, a dash running on through the start of a closed path, a dash all the way round staying closed, and under a round or projecting cap each dot (a dash of no length) as a path on its point. Each dash keeps the path's appearance with the top stroke's dashes and arrowheads off; the path's fills stay on it, below its dashes; a compound path's dashes are plain paths. One undo step; the dashes are selected; at most 100000 (more, or a pattern too fine to draw, is refused). Tests: `expand_dashes_*` in `cmd::addons::pathtools::tests` in `vectorcraft-engine` (the stroke kept with dashes off, the offset, one undo step, the fill kept below, dashes centred on corners when aligned, dots under round and butt caps, compound paths, refusals and the piece cap), `the_plugins_submenu_selects_the_tools_and_opens_the_anchor_inspector` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
## Path Precision Tools add-on: Tangent Circle Tool (2026-11-17)
A VectorCraft addition, so no area score moves. The Tangent Circle Tool (`tangentCircle`; Object › Plug-ins › Path Precision Tools and the All Tools drawer) draws a circle on two clicked path segments: tangent to the first at the point clicked (its center on the normal there) and touching the second segment or one beside it on its subpath, the touch nearest the pointer winning. Shift gives the circle the tool's radius, and a drag from the second segment sets the radius to the drag's length (Shift: steps of 1, 2 or 5 times a power of 10 pt, at least 4 screen pixels; Cmd/Ctrl: a tenth of the movement); with a radius the circle may touch the first segment anywhere along it. Before the click the circle shows with its center, radii and radius, or a note says there is none. The circles are found by sampling the distance to the second segments along the first segment's normal (or along the first segment, for a radius) and taking the places where it equals the radius (samples, bisection where it crosses, and a search where it only touches). Left out are circles whose nearest point of the second segments is not on the circle (within a millionth of the radius: where the first segment turns back on itself the distance jumps past the radius without a touch), circles that cross the first segment, circles that touch both segments at one point, and circles too small or too large for three of their points to give them back in floating point. The circle is a new ellipse with the current paint, one undo step; the first segment stays picked until it is drawn. Tests: `tangent_circle::tests` in `vectorcraft-pathops` (parallel and crossing lines, a curved second segment, a corner's fillet, lines twice the radius apart, a touch between the places tried, the ends of a line with its handles on its anchors, a circle that crosses the first segment, a first segment that turns back, no circle), `addons::tangent_circle::tests` in `vectorcraft-tools` (two clicks, Shift, a drag with Shift and Cmd/Ctrl, no circle and Escape, a circle its three points cannot draw) and the Path Precision Tools menu, options, drawer and catalog tests in `vectorcraft-ui-egui`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
## Path Precision Tools add-on: Trim at Crossings (2026-11-13)
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Path Precision Tools › Trim at Crossings Tool (also in the Scissors tool's group in both shipped toolbars, after the Knife, since 2026-11-16; a toolbar edited before keeps its saved layout until Reset Toolbar; no shortcut) removes stretches of paths between the places where they are crossed by another path or by themselves, on any path that can be edited, 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; each is one undo step, and Escape during a drag removes nothing. A closed path that loses a stretch becomes open, an open path that loses a middle stretch becomes two paths with its appearance in its place in the stacking order, a path that nothing crosses is removed whole, and the stretches that stay get no new anchors. Hidden and locked paths, guides and clipping paths are not trimmed and do not count as crossing. Add Points at / Split at Crossings share the crossing search: segments that meet at an anchor now count where they cross again elsewhere, and with Self Crossings a curved segment that loops over itself crosses itself. Command `addon.pathtools.trim`; `vectorcraft_pathops::addons::pathtools::{crossings_on, spans, without_spans}`. Hovering shows in red the stretch a click would remove, worked out by the same code the command uses (`vectorcraft_tools::addons::trim::plan`), and a drag that reaches at most 32 paths shows what its release would remove; a preview spends at most a twentieth of the crossing work a click may (2026-11-15; tests `hovering_*`, `in_isolation_mode_*`, `a_path_whose_crossings_*` and `a_small_drag_*` in `addons::trim` in `vectorcraft-tools`, `hovering_with_the_tool_shows_the_stretch_its_click_removes` and `what_the_tool_shows_*` in `vectorcraft-engine`). Not yet: crossings with type, images and symbol instances. Tests: `crossings_on_*`, `segments_*`, `a_segment_that_loops_over_itself_crosses_itself`, `one_work_budget_*`, `spans_divide_*`, `a_subpath_without_*` and `a_slice_*` in `addons::pathtools::tests` in `vectorcraft-pathops`, `addons::trim` in `vectorcraft-tools` (click, rectangle, freehand line, Escape), `cmd::addons::pathtools::trim::tests` in `vectorcraft-engine` (a middle and an end stretch, a closed path opening, a rectangle and a line as one undo step, locked and hidden paths, guides and clipping paths, paths nothing crosses, compound path members, the selection, 3,000 other paths, a path too large to search left alone until touched, bad params refused), `the_plugins_submenu_selects_the_tools_and_opens_the_anchor_inspector` in `vectorcraft-ui-egui`, `edit_toolbar::tests` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on. The tool shows the Knife's cursor, now drawn as a knife with the blade's point on the hotspot (2026-11-16; tests `trim_at_crossings_is_in_the_scissors_flyout` and `a_saved_toolbar_without_trim_at_crossings_keeps_its_layout` in `edit_toolbar::tests`, `trim_at_crossings_is_in_the_scissors_group_once` in `addons::tests`, `headless_backend_methods` in `vectorcraft-mcp`, `the_knife_shows_a_knife_with_its_point_on_the_hotspot` in `cursors::tests` and `drawing_tools_show_their_own_cursor` in `vectorcraft-tools`).
+1 -1
View File
@@ -499,9 +499,9 @@ 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 › Divide into Dashes… (Dash and Gap in any unit, Fit to Corners and Ends, Remove Gaps; Preview) cuts the selected paths, or only their direct-selected segments, into open pieces along the curve, keeping their appearance, one undo step | done | #4950; `addon.pathtools.divideDashes`, `crates/pathops/src/addons/pathtools/dashes.rs`, `crates/ui-egui/src/addons/pathtools/dashes.rs` and their tests; not a feature of the reference app, so it is not scored |
| Path Precision Tools add-on (VectorCraft addition): 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 › Tangent Circle Tool (also in the All Tools drawer): a click on a path segment, then on another, draws the circle tangent to the first at the point clicked that touches the second or a segment beside it; Shift uses the tool's radius (36 pt to start, set in its options) and a drag from the second segment sets the radius (Shift in round steps, Cmd/Ctrl slowly), the circle then touching the first segment anywhere along it; the circle shows with its center and radii first, or a note when there is none; one undo step | done | tool `tangentCircle` (in `crates/tools/src/addons/tangent_circle.rs`, geometry in `crates/pathops/src/addons/pathtools/tangent_circle/on_segments.rs`) and its tests; a VectorCraft addition, 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 › 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): Object › Plug-ins › Path Precision Tools › Tangent Circle Tool (also in the All Tools drawer): a click on a path segment, then on another, draws the circle tangent to the first at the point clicked that touches the second or a segment beside it; Shift uses the tool's radius (36 pt to start, set in its options), a drag from the second segment sets the radius (Shift in round steps, Cmd/Ctrl slowly); the circle shows with its center and radii first, or a note when there is none; one undo step | done | tool `tangentCircle` (in `crates/tools/src/addons/tangent_circle.rs`, geometry in `crates/pathops/src/addons/pathtools/tangent_circle/on_segments.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 |
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its six tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored |