diff --git a/crates/effects/src/solids.rs b/crates/effects/src/solids.rs index 19b134f53b..80b0ebaf6f 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -934,8 +934,9 @@ impl Placed { } } -/// The most pairs of faces [`local_order`] compares, and the most [`cut_stroke_faces`] compares; -/// the pairs they have not reached by then keep the order of their depths. +/// The most pairs of faces [`local_order`] compares, together with the steps it takes to break +/// rings of them ([`drawn_in_pairs_order`]), and the most pairs [`cut_stroke_faces`] compares; the +/// pairs they have not reached by then keep the order of their depths. const MAX_LOCAL_CHECKS: usize = 4_000_000; /// The polygon of `f` and the sign of its turns, when `f` is a face turned toward the viewer other @@ -1164,11 +1165,11 @@ fn half(p: &[Point], values: &[f64], sign: f64) -> Vec { /// their depths where they overlap: the face nearer the viewer there goes after the other. A fill /// wall and a face of the same shape's covering stroke ([`Paints::Stroke`]) keep their order. Each /// face otherwise keeps its place in `order`, so a fill wall in the gap between two dashes stays -/// where its depth puts it. A cycle of such pairs is broken at the face that comes first in `order`. +/// where its depth puts it. A cycle of such pairs is broken at one of its own faces +/// ([`drawn_in_pairs_order`]). /// A face drawn last (a planar end turned toward the viewer, at depth `f64::MAX`) keeps its place: /// no face moves across it. Otherwise `order` as it is. fn local_order(faces: &[Placed], order: Vec) -> Vec { - use std::cmp::Reverse; // The faces of each shape that take part, from left to right for a sweep along x. let mut shapes: Vec> = vec![]; for (k, f) in faces.iter().enumerate() { @@ -1180,7 +1181,7 @@ fn local_order(faces: &[Placed], order: Vec) -> Vec { } shapes[f.member].push(k); } - if !shapes.iter().any(|list| list.iter().any(|&k| faces[k].paints != Paints::Fill)) { + if !shapes.iter().any(|list| list.iter().any(|&k| faces[k].paints != Paints::Fill)) || u32::try_from(faces.len()).is_err() { return order; } for list in &mut shapes { @@ -1223,9 +1224,9 @@ fn local_order(faces: &[Placed], order: Vec) -> Vec { // faces with a polygon and a plane that overlap goes in the order of their depths there. let mut sweep: Vec = (0..faces.len()).filter(|&k| faces[k].outline.len() >= 3 && faces[k].plane.is_some()).collect(); sweep.sort_by(|&a, &b| faces[a].bounds.x0.total_cmp(&faces[b].bounds.x0)); - // For each face, the faces drawn after it, and for each, how many go before it. - let mut after: Vec> = vec![vec![]; faces.len()]; - let mut waits = vec![0usize; faces.len()]; + // Each pair in its order: a face, and a face drawn after it (as `u32`: there are fewer faces + // than that, which is checked above). + let mut pairs: Vec<(u32, u32)> = vec![]; 'pairs: for (i, &k) in sweep.iter().enumerate() { let a = &faces[k]; for &j in sweep.iter().skip(i + 1).take_while(|&&j| faces[j].bounds.x0 < a.bounds.x1) { @@ -1243,38 +1244,117 @@ fn local_order(faces: &[Placed], order: Vec) -> Vec { let Some(a_nearer) = nearer_where_overlapping(a, b) else { continue }; a_nearer }; - let (back, front) = if a_later { (j, k) } else { (k, j) }; - after[back].push(front); - waits[front] += 1; + pairs.push(if a_later { (j as u32, k as u32) } else { (k as u32, j as u32) }); } } - // Each step draws the face that comes first in `order` of those whose faces before are drawn. + // Breaking rings has what is left of the limit. + let last: Vec = faces.iter().map(|f| f.depth >= f64::MAX).collect(); + let mut room = MAX_LOCAL_CHECKS.saturating_sub(checks); + drawn_in_pairs_order(order, &position, &last, pairs, &mut room) +} + +/// `order` with each face after the faces that go before it: each of `pairs` is a face and a face +/// drawn after it, `position` is each face's place in `order`, and `last` says of each face +/// whether it is drawn last. Each step draws the face that comes first in `order` of those whose +/// faces before are drawn. A face drawn last goes only after every face before it in `order`, so +/// a face before it never waits for it or for a face after it: those pairs, with the face drawn +/// last itself or with a face that follows it, are drawn the wrong way round. +/// +/// When no face can go next, some of the faces left go before each other in a ring, or wait for a +/// face drawn last or one that follows it. The faces that go before the first face left in `order` +/// are followed back, among the faces that come before the next face drawn last, to the first +/// group found that waits for no other of them ([`RingFinder::behind`]): a ring, or one face. That +/// group gives up its face that comes first in `order`. So when the first face left is in the +/// group, it goes next, as it would with no ring looked for; when it only waits for the group, a +/// face of the group goes instead, and the only other pairs drawn the wrong way round are pairs of +/// a ring. +/// +/// Every face and pair looked at takes one from `room`. The search is kept from one stop to the +/// next and goes on from where it stopped, and a face that is drawn is dropped from a list the +/// next time the list is looked at, so rings of a few faces take a few steps a face whether they +/// stand apart, all lie behind one face or lie one behind the other. Two costs are not in +/// proportion to the faces. A ring that is still a ring after it gives up a face is walked again +/// from the face the search reached it by, so a large ring can cost about its pairs for each face +/// it gives up: the square of its faces, even when each waits for few others (3,200 faces with +/// four pairs each at random take about 3,000,000 steps). And a face at or +/// after the next face drawn last is passed over again each time a face that waits for it is +/// looked at. Once `room` runs out the first face left in `order` goes next, ring or not. +/// A first face left that waits only for the next face drawn last or faces after it goes next +/// with no search, at no cost. +/// +/// An `order` and `position` that do not agree, or a pair of a face that is not in them, give +/// `order` back. +/// +/// The pairs come at 8 bytes each and are dropped once the lists of the faces after each face +/// are made, 4 bytes a pair; the lists of the faces before each face, as many again, are made +/// when a ring is first looked for, a step a pair not taken from `room`, and only when the room +/// left is at least a quarter of the pairs: with less, no ring is looked for and the first face +/// left goes next. So a solid whose comparing of pairs leaves less than a quarter of its pairs +/// of the limit breaks its rings as before rings were looked for. +fn drawn_in_pairs_order(order: Vec, position: &[usize], last: &[bool], pairs: Vec<(u32, u32)>, room: &mut usize) -> Vec { + use std::cmp::Reverse; + let n = order.len(); + // `order` holds each face once when each face's place in it is the place `position` gives. + let agree = position.len() == n && last.len() == n && order.iter().enumerate().all(|(at, &k)| position.get(k) == Some(&at)); + if !agree || u32::try_from(pairs.len()).is_err() || pairs.iter().any(|&(back, front)| back as usize >= n || front as usize >= n) { + return order; + } + // For each face, how many faces not drawn yet go before it, and the faces drawn after it. + let mut waits = vec![0usize; n]; + for &(_, front) in &pairs { + waits[front as usize] += 1; + } + let after = Lists::from_pairs(n, pairs.iter().map(|&(back, front)| (back as usize, front as usize))); + drop(pairs); let mut ready: std::collections::BinaryHeap> = - (0..faces.len()).filter(|&k| waits[k] == 0).map(|k| Reverse((position[k], k))).collect(); + (0..n).filter(|&k| waits[k] == 0).map(|k| Reverse((position[k], k))).collect(); // The faces drawn last, in `order`: each goes only after every face before it in `order`. - let last: Vec = order.iter().copied().filter(|&k| faces[k].depth >= f64::MAX).collect(); + let lasts: Vec = order.iter().copied().filter(|&k| last[k]).collect(); let mut next_last = 0usize; - let mut drawn = vec![false; faces.len()]; - let mut out = Vec::with_capacity(order.len()); + let mut drawn = vec![false; n]; + let mut out = Vec::with_capacity(n); let mut first = 0usize; - while out.len() < order.len() { - while last.get(next_last).is_some_and(|&k| drawn[k]) { + let mut rings: Option = None; + // For each face, how many faces not drawn yet go before it among the first `counted` of + // `order`, which keeps up with the next face drawn last. + let mut early = vec![0u32; n]; + let mut counted = 0usize; + while out.len() < n { + while lasts.get(next_last).is_some_and(|&k| drawn[k]) { next_last += 1; } - let limit = last.get(next_last).map_or(usize::MAX, |&k| position[k]); + let limit = lasts.get(next_last).map_or(usize::MAX, |&k| position[k]); + while counted < limit.min(n) { + if let Some(&back) = order.get(counted).filter(|&&back| !drawn[back]) { + for &j in after.list(back) { + early[j as usize] += 1; + } + } + counted += 1; + } let k = match ready.peek() { Some(&Reverse((at, k))) if at < limit => { ready.pop(); k } _ => { - // A cycle, or the faces left to draw before a face drawn last wait for faces after - // it: the first face in `order` not drawn yet goes next. while order.get(first).is_some_and(|&k| drawn[k]) { first += 1; } - let Some(&k) = order.get(first) else { break }; - k + let Some(&next) = order.get(first) else { break }; + // The face drawn last goes in its turn, and so does a face that waits only for it or + // faces after it: no face it waits for can go first. Any other face waits for a + // face before the face drawn last: the group behind it gives up a face, while there + // is room to look for one. The lists of the faces before each face take a step a + // pair to make, which is not taken from `room`: they are made only when the room + // left is at least a quarter of the pairs, so making them costs no more than four + // times the room left. + let mut released = None; + let room_for_lists = rings.is_some() || room.saturating_mul(4) >= after.faces.len(); + if *room > 0 && position[next] < limit && early[next] > 0 && room_for_lists { + released = rings.get_or_insert_with(|| RingFinder::new(&after)).behind(next, &drawn, position, limit, room); + } + released.unwrap_or(next) } }; if drawn[k] { @@ -1282,8 +1362,13 @@ fn local_order(faces: &[Placed], order: Vec) -> Vec { } drawn[k] = true; out.push(k); - for &j in &after[k] { + let was_counted = position[k] < counted; + for &j in after.list(k) { + let j = j as usize; waits[j] = waits[j].saturating_sub(1); + if was_counted { + early[j] = early[j].saturating_sub(1); + } if waits[j] == 0 && !drawn[j] { ready.push(Reverse((position[j], j))); } @@ -1292,6 +1377,217 @@ fn local_order(faces: &[Placed], order: Vec) -> Vec { out } +/// A list of faces for each of some faces, all in one array: the faces after each face, or the +/// faces before it. +struct Lists { + /// The list of face `k` is `faces[starts[k]..starts[k + 1]]`. + starts: Vec, + faces: Vec, +} + +impl Lists { + /// For each of `n` faces, the second faces of the `pairs` it is first in, in the order of + /// `pairs`. There are fewer than 2^32 faces and pairs ([`drawn_in_pairs_order`] checks this); + /// a pair with a face that is not one of the `n` is left out. + fn from_pairs(n: usize, pairs: impl Iterator + Clone) -> Self { + let pairs = pairs.filter(move |&(first, second)| first < n && second < n); + let mut starts = vec![0u32; n + 1]; + for (first, _) in pairs.clone() { + if let Some(count) = starts.get_mut(first + 1) { + *count += 1; + } + } + for k in 1..starts.len() { + starts[k] += starts[k - 1]; + } + let mut filled = starts.clone(); + let mut faces = vec![0u32; starts.last().map_or(0, |&end| end as usize)]; + for (first, second) in pairs { + if let Some(at) = filled.get_mut(first) { + if let Some(slot) = faces.get_mut(*at as usize) { + *slot = second as u32; + } + *at += 1; + } + } + Lists { starts, faces } + } + + /// The list of face `k`; none for a face that is not one of them. + fn list(&self, k: usize) -> &[u32] { + let (Some(&start), Some(&end)) = (self.starts.get(k), self.starts.get(k + 1)) else { return &[] }; + self.faces.get(start as usize..end as usize).unwrap_or_default() + } + + /// Each list's faces and the face it is the list of, as pairs. + fn pairs(&self) -> impl Iterator + Clone + '_ { + (0..self.starts.len().saturating_sub(1)).flat_map(move |k| self.list(k).iter().map(move |&j| (k, j as usize))) + } +} + +#[cfg(test)] +thread_local! { + /// The entries of the lists of faces before each face that [`RingFinder`] has read, counted + /// where they are read, for tests to hold the reading to the room. + pub(super) static LIST_ENTRIES_READ: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// No place among the faces reached, in [`RingFinder`]. +const NONE: usize = usize::MAX; + +/// Finds the ring behind a face for [`drawn_in_pairs_order`], and keeps its search from one stop to +/// the next. +/// +/// Every index it holds is in range: the faces of its lists are faces of the pairs +/// [`drawn_in_pairs_order`] checked against the number of faces, which is the length of the +/// `drawn` and `position` it is given, and the places it keeps are places in its own lists. +struct RingFinder { + /// For each face, the faces that go before it, lowest first. + before: Lists, + /// For each face, where its list in `before` now ends: the faces found drawn are dropped + /// from it, and those left moved up. + ends: Vec, + /// For each face, its place in `reached`; [`NONE`] for a face not reached. + marks: Vec, + /// The faces reached, in the order reached. Every one is in a group not completed yet. + reached: Vec, + /// For each face reached, the earliest place in `reached` it leads back to. + low: Vec, + /// The path from the first face reached to the one being looked at. + path: Vec, + /// The `limit` the faces reached were reached under; `None` with none reached yet. + limit: Option, +} + +/// A face on the path of [`RingFinder`]: its place in `reached`, and the entry of its list being +/// looked at. +struct Step { + place: usize, + entry: usize, +} + +impl RingFinder { + /// A finder for the faces of `after`, the faces drawn after each face. + fn new(after: &Lists) -> Self { + let n = after.starts.len() - 1; + let before = Lists::from_pairs(n, after.pairs().map(|(back, front)| (front, back))); + let ends = before.starts.get(1..).unwrap_or_default().to_vec(); + RingFinder { before, ends, marks: vec![NONE; n], reached: vec![], low: vec![], path: vec![], limit: None } + } + + /// The face to draw next when `start`, the first face not `drawn`, whose `position` is before + /// `limit`, waits for a face. Of the faces that are not drawn and come before `limit`, those + /// that go before `start` are followed back to the first group found whose faces wait for no + /// other such face: a ring of faces that go before each other, or one face. The answer is the + /// face of that group with the lowest `position`. Every face and every pair looked at takes + /// one from `room`; `None` when it runs out. + /// + /// The faces are followed depth first, each face's faces before it lowest first, and the first + /// strongly connected component completed is the group (Tarjan's algorithm, stopped there): + /// it leads to no other component. The search is kept, less that group, and the next call + /// goes on with it: the faces drawn since are the group's own and faces that waited for + /// nothing else, and none of those is in a group with a face still on the path, so what the + /// search knows of the faces left still holds. It starts afresh when `limit` moves, which + /// brings in faces it passed over. + fn behind(&mut self, start: usize, drawn: &[bool], position: &[usize], limit: usize, room: &mut usize) -> Option { + if self.limit != Some(limit) { + self.forget(0); + self.limit = Some(limit); + } + // The end of the path may be drawn: faces that only waited for the last group. + while let Some(place) = self.path.last().map(|step| step.place).filter(|&place| drawn[self.reached[place]]) { + self.forget(place); + } + if self.reached.first() != Some(&start) { + self.forget(0); + if !self.reach(start, drawn, room) { + return None; + } + } + while let Some(step) = self.path.last_mut() { + if *room == 0 { + return None; + } + *room -= 1; + let place = step.place; + let face = self.reached[place]; + if step.entry < self.ends[face] as usize { + let earlier = self.before.faces[step.entry] as usize; + if drawn[earlier] || position[earlier] >= limit { + step.entry += 1; + } else if self.marks[earlier] != NONE { + self.low[place] = self.low[place].min(self.marks[earlier]); + step.entry += 1; + } else { + // The entry is passed once the faces behind it are looked at. + if !self.reach(earlier, drawn, room) { + return None; + } + } + continue; + } + // Every face before this one is looked at: it ends a group when it leads no further + // back than itself. + let leads = self.low[place]; + if leads == place { + let found = self.reached[place..].iter().copied().min_by_key(|&face| position[face]); + // The face before it on the path keeps its entry for this one, to look at what is + // left of the group next time. + self.forget(place); + return found; + } + self.path.pop(); + if let Some(parent) = self.path.last_mut() { + self.low[parent.place] = self.low[parent.place].min(leads); + parent.entry += 1; + } + } + None + } + + /// Adds `face` to the faces reached and to the end of the path, at the start of its list, with + /// the faces now `drawn` dropped from the list: a step from `room` for each face the list held, + /// taken before the list is read. `false`, with `room` emptied and nothing read, when the list + /// is longer than the room left. + fn reach(&mut self, face: usize, drawn: &[bool], room: &mut usize) -> bool { + let (start, end) = (self.before.starts[face] as usize, self.ends[face] as usize); + let Some(left) = room.checked_sub(end - start) else { + *room = 0; + return false; + }; + *room = left; + #[cfg(test)] + LIST_ENTRIES_READ.with(|read| read.set(read.get() + (end - start))); + let mut kept = start; + for entry in start..end { + let earlier = self.before.faces[entry]; + if !drawn[earlier as usize] { + self.before.faces[kept] = earlier; + kept += 1; + } + } + // `kept` is no more than the end it replaces. + self.ends[face] = kept as u32; + let place = self.reached.len(); + self.marks[face] = place; + self.path.push(Step { place, entry: start }); + self.low.push(place); + self.reached.push(face); + true + } + + /// Takes out the faces reached from `place` on, and their part of the path. + fn forget(&mut self, place: usize) { + for face in self.reached.drain(place.min(self.reached.len())..) { + self.marks[face] = NONE; + } + self.low.truncate(place); + while self.path.last().is_some_and(|step| step.place >= place) { + self.path.pop(); + } + } +} + /// Whether face `a` is nearer the viewer than face `b` where their polygons overlap on the drawing, /// measured at the middle of the overlap. `None` when they do not overlap, when either polygon is /// not convex, or when they are at the same depth there. @@ -1425,7 +1721,8 @@ fn draw_order(faces: &[Placed], sealed: bool) -> Vec { /// of overlapping faces with a convex polygon and a plane goes in the order of its depths there, /// the face nearer the viewer after the other ([`local_order`]), and each step draws the face that /// comes first in the given order of those whose faces before are drawn, so a face without a plane -/// or a convex polygon can also move. Otherwise the order given. +/// or a convex polygon can also move. Faces that lie in front of one another in a ring give up one +/// of the ring's own faces ([`drawn_in_pairs_order`]). Otherwise the order given. pub(crate) fn surface_order<'a>(faces: impl IntoIterator, f64)>) -> Vec { let placed: Vec = faces .into_iter() diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index 378299d514..87c64060ee 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -906,10 +906,10 @@ fn local_order_puts_overlapping_fill_walls_and_stroke_faces_in_depth_order() { } } -/// A cycle of overlapping stroke faces is broken at the face that comes first by depth, and a cap -/// drawn last stays after every wall: 0 at x 0 to 10, flat at z 0; 1 at x 4 to 14, z = x - 8; 2 at -/// x 8 to 18, flat at z 1. Where they overlap, 0 is nearer than 1, 1 nearer than 2 and 2 nearer -/// than 0. 3 is the cap. +/// A cycle of overlapping stroke faces is broken at its own face that comes first by depth, and a +/// cap drawn last stays after every wall: 0 at x 0 to 10, flat at z 0; 1 at x 4 to 14, z = x - 8; +/// 2 at x 8 to 18, flat at z 1. Where they overlap, 0 is nearer than 1, 1 nearer than 2 and 2 +/// nearer than 0. 3 is the cap. #[test] fn a_depth_cycle_keeps_the_cap_last() { let square = |x: f64| vec![Point::new(x, 0.0), Point::new(x + 10.0, 0.0), Point::new(x + 10.0, 10.0), Point::new(x, 10.0)]; @@ -937,6 +937,448 @@ fn a_depth_cycle_keeps_the_cap_last() { assert_eq!(draw_order(&faces, true), [0, 2, 1, 3]); } +/// A face that lies in front of a face of a cycle, without being part of the cycle, waits for that +/// face. 0, 1 and 2 overlap in a cycle (as in `a_depth_cycle_keeps_the_cap_last`); 3, at x 16 to +/// 26 and flat at z 2, is nearer than 2 where they overlap, but its center is the farthest of all, +/// so it comes first by depth. The cycle is broken at 0, its first face by depth, and 3 follows 2. +/// Breaking it at the first face by depth of all the faces left drew 3 first, under 2. +#[test] +fn a_face_in_front_of_a_cycle_waits_for_it() { + let square = |x: f64| vec![Point::new(x, 0.0), Point::new(x + 10.0, 0.0), Point::new(x + 10.0, 10.0), Point::new(x, 10.0)]; + let at = |depth: f64, x: f64, normal: [f64; 3], offset: f64| Placed { + depth, + side: true, + away: false, + bounds: Rect::new(x, 0.0, x + 10.0, 10.0), + member: 0, + paints: Paints::Other, + outline: square(x), + plane: Some(DepthPlane { normal, offset, center: Point::ZERO, eye: None }), + }; + let flat = [0.0, 0.0, 1.0]; + let walls = || [at(1.0, 0.0, flat, 0.0), at(2.0, 4.0, [-1.0, 0.0, 1.0], -8.0), at(3.0, 8.0, flat, 1.0), at(-5.0, 16.0, flat, 2.0)]; + assert_eq!(draw_order(&walls(), true), [0, 2, 3, 1]); + // With the cap of `a_depth_cycle_keeps_the_cap_last` as well, it still goes last. + let cap = + Placed { depth: f64::MAX, side: false, bounds: Rect::new(0.0, 0.0, 26.0, 10.0), outline: vec![], plane: None, ..at(0.0, 0.0, flat, 0.0) }; + let capped: Vec = walls().into_iter().chain([cap]).collect(); + assert_eq!(draw_order(&capped, true), [0, 2, 3, 1, 4]); +} + +/// `order` with the pairs `before` (each first face drawn before the second) in their own order +/// ([`drawn_in_pairs_order`]), within `room` steps of looking for rings, and the steps taken; the +/// faces of `last` are drawn last. +fn in_pairs_order(order: &[usize], before: &[(usize, usize)], last: &[usize], room: usize) -> (Vec, usize) { + let n = order.len(); + let mut position = vec![0; n]; + for (at, &k) in order.iter().enumerate() { + position[k] = at; + } + let last: Vec = (0..n).map(|k| last.contains(&k)).collect(); + let mut left = room; + let drawn = drawn_in_pairs_order(order.to_vec(), &position, &last, narrow(before), &mut left); + (drawn, room - left) +} + +/// What [`drawn_in_pairs_order`] is to give with room enough, worked out plainly: at every stop +/// the faces behind the first face left are followed afresh, with nothing kept and no face taken +/// out of a list. +fn in_pairs_order_plainly(order: &[usize], before: &[(usize, usize)], last: &[usize]) -> Vec { + /// The first group completed behind `face`, among the faces `open`: its faces, or `None` while + /// its group goes on. `earlier` lists the faces before each face, lowest first. + fn group(face: usize, open: &[bool], earlier: &[Vec], reached: &mut Vec, low: &mut Vec) -> Option> { + let place = reached.len(); + reached.push(face); + low.push(place); + for &e in earlier[face].iter().filter(|&&e| open[e]) { + match reached.iter().position(|&f| f == e) { + Some(at) => low[place] = low[place].min(at), + None => { + let found = group(e, open, earlier, reached, low); + if found.is_some() { + return found; + } + low[place] = low[place].min(low[reached.iter().position(|&f| f == e).unwrap()]); + } + } + } + (low[place] == place).then(|| reached[place..].to_vec()) + } + let n = order.len(); + let mut at = vec![0; n]; + for (place, &k) in order.iter().enumerate() { + at[k] = place; + } + let mut earlier = vec![vec![]; n]; + for &(first, then) in before { + earlier[then].push(first); + } + earlier.iter_mut().for_each(|list| list.sort_unstable()); + let mut drawn = vec![false; n]; + let mut out: Vec = vec![]; + while out.len() < n { + let left: Vec = order.iter().copied().filter(|&k| !drawn[k]).collect(); + let limit = left.iter().find(|k| last.contains(k)).map_or(usize::MAX, |&k| at[k]); + let waits = |k: usize| earlier[k].iter().any(|&e| !drawn[e]); + let next = match left.iter().copied().find(|&k| at[k] < limit && !waits(k)) { + Some(ready) => ready, + None if at[left[0]] >= limit => left[0], + None => { + let open: Vec = (0..n).map(|k| !drawn[k] && at[k] < limit).collect(); + let found = group(left[0], &open, &earlier, &mut vec![], &mut vec![]).unwrap(); + found.into_iter().min_by_key(|&k| at[k]).unwrap() + } + }; + drawn[next] = true; + out.push(next); + } + out +} + +/// `pairs` as [`drawn_in_pairs_order`] takes them. +fn narrow(pairs: &[(usize, usize)]) -> Vec<(u32, u32)> { + pairs.iter().map(|&(first, then)| (first as u32, then as u32)).collect() +} + +/// The pairs of `before` that `drawn` draws the wrong way round. +fn broken(drawn: &[usize], before: &[(usize, usize)]) -> Vec<(usize, usize)> { + let mut at = vec![0; drawn.len()]; + for (place, &k) in drawn.iter().enumerate() { + at[k] = place; + } + before.iter().copied().filter(|&(first, then)| at[first] > at[then]).collect() +} + +/// After a ring's face is released, the faces left are looked at afresh: they may be a smaller +/// ring and faces in none. Two rings share face 1: 0 before 1 before 4 before 0, and 1 before 2 +/// before 3 before 1. By depth the order is 3, 2, 0, 4, 1. The five wait for no other face, so the +/// first stop releases 3, the first of them by depth. That leaves the one ring 0, 1, 4 and face +/// 2, which only waits for 1: 0 is released, and 2 follows 1. Only pairs of a ring are drawn the +/// wrong way round. Taking the first face left by depth at each stop drew 2 before 1 as well. +#[test] +fn the_faces_left_are_looked_at_afresh_after_each_face_released() { + let before = [(0, 1), (1, 4), (4, 0), (1, 2), (2, 3), (3, 1)]; + let (drawn, _) = in_pairs_order(&[3, 2, 0, 4, 1], &before, &[], usize::MAX); + assert_eq!(drawn, [3, 0, 1, 2, 4]); + assert_eq!(broken(&drawn, &before), [(4, 0), (2, 3)]); + assert_eq!(broken(&in_pairs_order(&[3, 2, 0, 4, 1], &before, &[], 0).0, &before), [(4, 0), (1, 2), (2, 3)]); +} + +/// A ring is the one behind the first face left by depth that waits for no face outside it: 0 +/// comes first by depth and waits for the ring 1, 2, 3, which waits for the ring 4, 5, 6. The far +/// ring is broken first (at 4) and drawn, then the near one (at 1), and 0 follows 1; one pair of +/// each ring is drawn the wrong way round, and no pair between them. Taking the first face left by +/// depth drew 0 first, under 1. +#[test] +fn the_ring_released_waits_for_no_face_outside_it() { + let before = [(1, 0), (1, 2), (2, 3), (3, 1), (4, 1), (4, 5), (5, 6), (6, 4)]; + let (drawn, _) = in_pairs_order(&[0, 1, 2, 3, 4, 5, 6], &before, &[], usize::MAX); + assert_eq!(drawn, [4, 5, 6, 1, 0, 2, 3]); + assert_eq!(broken(&drawn, &before), [(3, 1), (6, 4)]); + assert_eq!(broken(&in_pairs_order(&[0, 1, 2, 3, 4, 5, 6], &before, &[], 0).0, &before), [(1, 0), (3, 1), (4, 1), (6, 4)]); +} + +/// A ring is looked for among the faces that come before the next face drawn last: 1 comes first +/// by depth and waits for 4, a face of the ring 2, 3, 4, and for 0, which is drawn last. 0 waits +/// for no face, so it is a group of its own behind 1, but no face before it by depth can wait for +/// it. The ring gives up 2, and 1 follows 4; the pair of 1 and 0 cannot be kept. Stopping at 0 +/// drew 1 first, under 4. +#[test] +fn a_ring_is_looked_for_before_the_next_face_drawn_last() { + let before = [(2, 3), (3, 4), (4, 2), (4, 1), (0, 1)]; + let (drawn, _) = in_pairs_order(&[1, 2, 3, 4, 0], &before, &[0], usize::MAX); + assert_eq!(drawn, [2, 3, 4, 1, 0]); + assert_eq!(broken(&drawn, &before), [(4, 2), (0, 1)]); + assert_eq!(broken(&in_pairs_order(&[1, 2, 3, 4, 0], &before, &[0], 0).0, &before), [(4, 2), (4, 1), (0, 1)]); + // A face that waits only for a face after the one drawn last goes before the faces that wait + // for it: 0 waits for 1, 1 for 3, and 2 is drawn last. + let before = [(1, 0), (3, 1)]; + assert_eq!(in_pairs_order(&[0, 1, 2, 3], &before, &[2], usize::MAX).0, [1, 0, 2, 3]); + assert_eq!(in_pairs_order(&[0, 1, 2, 3], &before, &[2], 0).0, [0, 1, 2, 3]); +} + +/// Looking for rings is counted, and past the room given the first face not drawn yet goes next, +/// as before rings were looked for: the pairs of `a_face_in_front_of_a_cycle_waits_for_it`. A +/// face drawn last keeps every face before it by depth before it, ring or not. An order and +/// places in it that do not agree (an order that is not each face once), or a pair of a face that +/// is not in them, give the order back. +#[test] +fn breaking_rings_stops_at_its_room() { + let before = [(1, 0), (0, 2), (2, 1), (2, 3)]; + let order = [3, 0, 1, 2]; + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + assert_eq!(drawn, [0, 2, 3, 1]); + // The faces and pairs behind 3. + assert!((4..=16).contains(&steps), "{steps} steps"); + assert_eq!(in_pairs_order(&order, &before, &[], steps), (vec![0, 2, 3, 1], steps)); + for room in [0, 1, steps - 1] { + let (drawn, taken) = in_pairs_order(&order, &before, &[], room); + assert_eq!(drawn, [3, 0, 2, 1], "{room}"); + assert!(taken <= room, "{room}"); + } + // 0 is drawn last: 3, before it by depth, goes before it, and the ring's other faces after. + assert_eq!(in_pairs_order(&order, &before, &[0], usize::MAX).0, [3, 0, 2, 1]); + // 2 is drawn last: every other face is before it by depth, so 3 and 1, which wait only for + // it, go when they come first of the faces behind the first face left, and 0 follows 1. + assert_eq!(in_pairs_order(&order, &before, &[2], usize::MAX).0, [3, 1, 0, 2]); + assert_eq!(in_pairs_order(&order, &before, &[2], 0).0, [3, 0, 1, 2]); + let mut room = usize::MAX; + let position = [1, 2, 3, 0]; + assert_eq!(drawn_in_pairs_order(order.to_vec(), &position, &[false; 3], narrow(&before), &mut room), order); + assert_eq!(drawn_in_pairs_order(order.to_vec(), &position, &[false; 4], vec![(9, 0)], &mut room), order); + assert_eq!(drawn_in_pairs_order(order.to_vec(), &position, &[false; 4], vec![(0, 4)], &mut room), order); + assert_eq!(drawn_in_pairs_order(order[..3].to_vec(), &position, &[false; 4], narrow(&before), &mut room), order[..3]); + assert_eq!(drawn_in_pairs_order(order.to_vec(), &position[..3], &[false; 4], narrow(&before), &mut room), order); + assert_eq!(drawn_in_pairs_order(order.to_vec(), &[1, 2, 0, 3], &[false; 4], narrow(&before), &mut room), order); + assert_eq!(drawn_in_pairs_order(vec![0, 0, 1, 2], &[0, 2, 3, 0], &[false; 4], narrow(&before), &mut room), [0, 0, 1, 2]); + assert_eq!(drawn_in_pairs_order(vec![0, 1, 2, 4], &[0, 1, 2, 3], &[false; 4], narrow(&before), &mut room), [0, 1, 2, 4]); + assert_eq!(room, usize::MAX); +} + +/// A first face left that waits only for the face drawn last goes next with no search: 1,000 +/// such faces before a ring cost nothing, and the ring behind them still has its room. Each face +/// i < 1,000 waits for 1,004, which is drawn last; 1,000 to 1,003 are the pairs of +/// `breaking_rings_stops_at_its_room`, where 1,003 comes first by depth and waits for the ring. +#[test] +fn a_face_that_waits_only_for_the_face_drawn_last_costs_no_search() { + let waiting = 1000usize; + let (r, last) = (waiting, waiting + 4); + let mut before: Vec<(usize, usize)> = (0..waiting).map(|f| (last, f)).collect(); + before.extend([(r + 1, r), (r, r + 2), (r + 2, r + 1), (r + 2, r + 3)]); + let order: Vec = (0..waiting).chain([r + 3, r, r + 1, r + 2, last]).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[last], usize::MAX); + let expected: Vec = (0..waiting).chain([r, r + 2, r + 3, r + 1, last]).collect(); + assert_eq!(drawn, expected); + assert!(steps < 20, "{steps} steps"); + // The room the ring takes is enough, whatever waits before it. + assert_eq!(in_pairs_order(&order, &before, &[last], before.len().div_ceil(4).max(steps)).0, expected); +} + +/// The lists of the faces before each face are made only when the room left is at least a +/// quarter of the pairs: with less, no ring is looked for, however few steps the ring would take. +/// A ring of three behind 3,000 faces in a chain (each before the next). +#[test] +fn the_lists_for_rings_are_made_only_with_room_for_a_quarter_of_the_pairs() { + let chain = 3000usize; + let r = chain; + let mut before: Vec<(usize, usize)> = (0..chain - 1).map(|f| (f, f + 1)).collect(); + before.extend([(r + 1, r), (r, r + 2), (r + 2, r + 1), (r + 2, r + 3)]); + // As in `breaking_rings_stops_at_its_room`: 3 comes first by depth of the four and waits for + // the ring. + let order: Vec = (0..chain).chain([r + 3, r, r + 1, r + 2]).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + assert_eq!(drawn[chain..], [r, r + 2, r + 3, r + 1]); + assert!(steps < 20, "{steps} steps"); + let quarter = before.len().div_ceil(4); + let (drawn, steps) = in_pairs_order(&order, &before, &[], quarter - 1); + assert_eq!(drawn[chain..], [r + 3, r, r + 2, r + 1]); + assert_eq!(steps, 0); + assert_eq!(in_pairs_order(&order, &before, &[], quarter).0[chain..], [r, r + 2, r + 3, r + 1]); +} + +/// A list of the faces before a face is read only when the room left holds it: with less, no +/// entry of it is read, and the first face left goes next. Face 0 comes first by depth and waits +/// for 1, which waits for 2,000 faces after it in `order`, each waiting for 1: a ring of 1 with +/// each of them. +#[test] +fn a_list_longer_than_the_room_left_is_not_read() { + let wide = 2000usize; + let mut before = vec![(1, 0)]; + before.extend((2..2 + wide).flat_map(|f| [(f, 1), (1, f)])); + let order: Vec = (0..2 + wide).collect(); + // Room for the lists (a quarter of the pairs) but not for 1's list, and room for it. + for room in [before.len().div_ceil(4), wide - 1, wide + 3] { + super::LIST_ENTRIES_READ.with(|read| read.set(0)); + let (drawn, taken) = in_pairs_order(&order, &before, &[], room); + let read = super::LIST_ENTRIES_READ.with(|read| read.get()); + assert!(read <= taken && taken <= room, "room {room}: {read} entries read, {taken} steps"); + assert_eq!(drawn.len(), order.len()); + } +} + +/// The steps of breaking rings are counted, not timed, and for rings of a few faces they are a +/// few a face however the rings lie: apart, each with a face in front of it that comes first by +/// depth; all behind one face, itself in a ring whose other faces come first in its list; and one +/// behind the other. The search goes on from where it stopped, and a face drawn is dropped from +/// a list the next time the list is looked at. A ring that is still a ring after it gives up a +/// face is walked again, so a large ring can take about its pairs for each face it gives up, the +/// square of its faces even when each waits for few others. With too little room the rings not +/// reached are broken at the first face left by depth, as before. +#[test] +fn breaking_rings_takes_a_few_steps_a_face_but_for_a_ring_of_many_pairs() { + // Ring r: faces 4r, 4r + 1 and 4r + 2 in a ring, and 4r + 3 after 4r + 2. + let rings = 2000usize; + let mut before = vec![]; + for r in 0..rings { + let f = 4 * r; + before.extend([(f + 1, f), (f, f + 2), (f + 2, f + 1), (f + 2, f + 3)]); + } + // By depth: every fourth face first, then the rings. + let order: Vec = (0..rings).map(|r| 4 * r + 3).chain((0..rings).flat_map(|r| [4 * r, 4 * r + 1, 4 * r + 2])).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + assert_eq!(broken(&drawn, &before), (0..rings).map(|r| (4 * r + 1, 4 * r)).collect::>()); + assert!(steps <= 4 * order.len(), "{steps} steps for {rings} rings apart"); + // With no room the fourth faces go first, under the faces they are in front of. + assert_eq!(broken(&in_pairs_order(&order, &before, &[], 0).0, &before).len(), 2 * rings); + + // Face 0, first by depth, is in a ring with 1 and 2, which come first in its list, and after a + // face of each ring r: faces 3r + 3, 3r + 4 and 3r + 5. + let rings = 3000usize; + let mut before = vec![(1, 0), (0, 2), (2, 1)]; + for r in 0..rings { + let f = 3 * r + 3; + before.extend([(f, f + 1), (f + 1, f + 2), (f + 2, f), (f, 0)]); + } + let order: Vec = (0..3 * rings + 3).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + // One pair of each ring, face 0's among them, and no pair of face 0 with another ring's face. + assert_eq!(broken(&drawn, &before), [(1, 0)].into_iter().chain((0..rings).map(|r| (3 * r + 5, 3 * r + 3))).collect::>()); + assert!(steps <= 4 * order.len(), "{steps} steps for {rings} rings behind one face"); + // The same with a face drawn last that every ring's first face waits for: it is passed over + // each time, and nothing after it in a list is looked at twice for that. + let cap = 3 * rings + 3; + let capped: Vec<(usize, usize)> = (0..rings).map(|r| (cap, 3 * r + 3)).chain(before.iter().copied()).collect(); + let order: Vec = (0..=cap).collect(); + let (drawn, steps) = in_pairs_order(&order, &capped, &[cap], usize::MAX); + assert_eq!(broken(&drawn, &capped).len(), 2 * rings + 1); + assert!(steps <= 5 * order.len(), "{steps} steps for {rings} rings behind one face, before a face drawn last"); + + // Ring r: faces 3r, 3r + 1 and 3r + 2, the first after the last face of ring r + 1. + let rings = 3000usize; + let mut before = vec![]; + for r in 0..rings { + let f = 3 * r; + before.extend([(f, f + 1), (f + 1, f + 2), (f + 2, f)]); + if r + 1 < rings { + before.push((f + 5, f)); + } + } + let order: Vec = (0..3 * rings).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + // One pair of each ring, and no pair between rings. + assert_eq!(broken(&drawn, &before).len(), rings); + assert!(broken(&drawn, &before).iter().all(|&(first, then)| first / 3 == then / 3)); + assert!(steps <= 4 * order.len(), "{steps} steps for {rings} rings one behind the other"); + let (short, taken) = in_pairs_order(&order, &before, &[], steps / 2); + assert!(broken(&short, &before).len() > rings && taken <= steps / 2, "{} pairs, {taken} steps", broken(&short, &before).len()); + assert_eq!(short.len(), order.len()); + + // One ring: each of 200 faces before the next 99. + let faces = 200usize; + let before: Vec<(usize, usize)> = (0..faces).flat_map(|f| (1..100).map(move |d| (f, (f + d) % faces))).collect(); + let order: Vec = (0..faces).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + assert_eq!(drawn, order); + // Each face it gives up walks the ring again, so it takes many times its pairs (the cost the + // docs name), but no more than about its pairs for each face. + assert!(steps < 2 * faces * before.len(), "{steps} steps for a ring of {} pairs", before.len()); + + // Pairs at random, about four a face: one large ring and faces around it. + let steps_of = |faces: usize| { + let mut next = numbers(faces as u64); + let before: Vec<(usize, usize)> = (0..2 * faces) + .map(|_| ((next() * faces as f64) as usize, (next() * faces as f64) as usize)) + .filter(|(first, then)| first != then) + .collect(); + let order: Vec = (0..faces).collect(); + let (drawn, steps) = in_pairs_order(&order, &before, &[], usize::MAX); + assert_eq!(drawn.len(), faces); + steps + }; + // No more than the square of the faces. + let (few, more) = (steps_of(800), steps_of(1600)); + assert!(few < 800 * 800 && more < 1600 * 1600, "{few} steps for 800 faces, {more} for 1,600"); +} + +/// Numbers from 0 to 1 that are the same on every run. +fn numbers(mut seed: u64) -> impl FnMut() -> f64 { + move || { + seed = seed.wrapping_mul(6364136223846793005).wrapping_add(1442695040888963407); + (seed >> 11) as f64 / (1u64 << 53) as f64 + } +} + +/// A ring gives up its own face that comes first by depth, which draws no more pairs the wrong +/// way round than taking the first face left by depth, ring or not, as before: on 6,000 sets of +/// pairs at random (4 to 30 faces, sparse and dense, agreeing with the depths mostly or half the +/// time, the pairs in any order and some twice, with up to four faces drawn last) none has more, and they have fewer in all. Every face +/// is drawn once, a face drawn last follows every face before it by depth, and the order of every +/// set is the one that looking afresh at every stop gives. One of them is a +/// set where the ring's face that waits for the fewest faces drew 4 pairs wrong against 3. +#[test] +fn breaking_a_ring_draws_no_more_pairs_wrong_than_the_first_face_by_depth() { + let order = [3, 6, 4, 1, 0, 2, 5]; + let before = [ + (1, 0), + (2, 0), + (0, 3), + (0, 4), + (5, 0), + (6, 0), + (1, 2), + (1, 3), + (4, 1), + (5, 1), + (4, 2), + (5, 2), + (6, 2), + (3, 4), + (3, 6), + (5, 4), + (6, 4), + (5, 6), + ]; + assert_eq!(broken(&in_pairs_order(&order, &before, &[], 0).0, &before).len(), 3); + assert_eq!(broken(&in_pairs_order(&order, &before, &[], usize::MAX).0, &before).len(), 3); + + let mut next = numbers(7023); + let (mut with_rings, mut without, mut fewer) = (0usize, 0usize, 0usize); + for set in 0..6000 { + let n = 4 + (next() * 27.0) as usize; + let (dense, agrees) = (0.05 + 0.8 * next() * next(), if set % 2 == 0 { 0.5 } else { 0.85 }); + // The order by depth: the faces shuffled. + let mut order: Vec = (0..n).collect(); + for k in (1..n).rev() { + order.swap(k, (next() * (k + 1) as f64) as usize); + } + let mut before = vec![]; + for a in 0..n { + for b in a + 1..n { + if next() < dense { + before.push(if next() < agrees { (order[a], order[b]) } else { (order[b], order[a]) }); + } + } + } + // The pairs in any order, and in every fifth set some of them twice. + for k in (1..before.len()).rev() { + before.swap(k, (next() * (k + 1) as f64) as usize); + } + if set % 5 == 0 { + let again: Vec<(usize, usize)> = before.iter().copied().filter(|_| next() < 0.3).collect(); + before.extend(again); + } + // No face drawn last, or up to four. + let last: Vec = (0..set % 5).map(|_| order[(next() * n as f64) as usize]).collect(); + let (drawn, _) = in_pairs_order(&order, &before, &last, usize::MAX); + // Keeping the search from stop to stop gives what looking afresh at every stop gives. + assert_eq!(drawn, in_pairs_order_plainly(&order, &before, &last), "set {set}: {order:?} {before:?} {last:?}"); + let (plainly, _) = in_pairs_order(&order, &before, &last, 0); + let mut once = drawn.clone(); + once.sort_unstable(); + assert_eq!(once, (0..n).collect::>(), "set {set}"); + for &cap in &last { + let (at, place) = (order.iter().position(|&f| f == cap).unwrap(), drawn.iter().position(|&f| f == cap).unwrap()); + assert!(order[..at].iter().all(|f| drawn[..place].contains(f)), "set {set}"); + } + let (rings, plain) = (broken(&drawn, &before).len(), broken(&plainly, &before).len()); + assert!(rings <= plain, "set {set}: {rings} pairs wrong, {plain} with the first face by depth; {order:?} {before:?} {last:?}"); + with_rings += rings; + without += plain; + fewer += usize::from(rings < plain); + } + assert!(fewer > 500 && with_rings < without, "{with_rings} pairs wrong, {without} with the first face by depth, fewer in {fewer} sets"); +} + /// The order keeps depths except where a shape's fill wall turned toward the viewer overlaps a /// face of the same shape's stroke drawn before it: the wall then goes just before that face. A /// cap, a face turned away, another shape's stroke, a stroke face the wall does not overlap and an diff --git a/docs/effects-parity.md b/docs/effects-parity.md index cb857e15cd..d4c3df8d2b 100644 --- a/docs/effects-parity.md +++ b/docs/effects-parity.md @@ -1,6 +1,6 @@ # Effects parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: Extrude & Bevel, Inflate and Rotate seams have round joins under a white light and in the 3D (Classic) effects too, no longer reaching past the solid as thorns; previously: Effect Gallery: a thumbnail for each filter and an in-dialog preview on an original drawing; the 1–2 h for those is done; Extrude & Bevel, Inflate and Rotate merge contours that cross, touch or overlap, as type often draws a glyph, before building a solid; previously: Extrude & Bevel, Inflate and Rotate apply to groups and layers, their objects turning about one shared axis (#4506); the Transform effect's copies of a path with a fill and a stroke (or several fills and strokes, an even-odd fill, or a partly transparent one) are drawn each above the one before, as Expand Appearance makes them (#5920); Expand Appearance makes each copy of a path's Transform effect an object of its own (#5612); previously: Pixelate › Color Halftone: Max Radius in pixels of the Document Raster Effects resolution, 4–127 px, with older documents converted on opening and radii written back in points for older app versions (#3260); Effect dialogs clamp bounded length inputs immediately on commit and flash rejection on invalid input (#4638); previously: Drop Shadow Darkness uses fixed RGB subtraction and CMYK black addition; scores unchanged; Pathfinder › Trap: the Pathfinder panel's Trap… and Effect › Pathfinder › Trap… add an overprinting strip of the lighter colour where two solid colours meet; recounted with Hard Mix (#3061) and Soft Mix already in the catalogue: Pathfinder 13/13, Illustrator effects 49/50) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (Extrude & Bevel, Inflate and Revolve: a ring of overlapping faces is broken at one of its own faces, so a face in front of a ring's face is not drawn under it, #7023; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: Extrude & Bevel, Inflate and Rotate seams have round joins under a white light and in the 3D (Classic) effects too, no longer reaching past the solid as thorns; previously: Effect Gallery: a thumbnail for each filter and an in-dialog preview on an original drawing; the 1–2 h for those is done; Extrude & Bevel, Inflate and Rotate merge contours that cross, touch or overlap, as type often draws a glyph, before building a solid; previously: Extrude & Bevel, Inflate and Rotate apply to groups and layers, their objects turning about one shared axis (#4506); the Transform effect's copies of a path with a fill and a stroke (or several fills and strokes, an even-odd fill, or a partly transparent one) are drawn each above the one before, as Expand Appearance makes them (#5920); Expand Appearance makes each copy of a path's Transform effect an object of its own (#5612); previously: Pixelate › Color Halftone: Max Radius in pixels of the Document Raster Effects resolution, 4–127 px, with older documents converted on opening and radii written back in points for older app versions (#3260); Effect dialogs clamp bounded length inputs immediately on commit and flash rejection on invalid input (#4638); previously: Drop Shadow Darkness uses fixed RGB subtraction and CMYK black addition; scores unchanged; Pathfinder › Trap: the Pathfinder panel's Trap… and Effect › Pathfinder › Trap… add an overprinting strip of the lighter colour where two solid colours meet; recounted with Hard Mix (#3061) and Soft Mix already in the catalogue: Pathfinder 13/13, Illustrator effects 49/50) · **Target:** Adobe Illustrator 2026 (30.x) Every entry of Illustrator's Effect menu, by its public feature name, against VectorCraft's effects catalogue (`effect_catalog()` in `crates/effects/src/lib.rs`) and the Effect menu built from it @@ -178,8 +178,8 @@ VectorCraft choices; an original approximation, never compared with another appl | Item | Ours | |---|---| -| Revolve | initial: live, editable profile, rotation and light gizmos, default-on Cap with continuous curved rims that also closes a partial sweep's cut sides, smooth vector shading and round seam joins, overlapping faces drawn in the order of their depths where they overlap, SVG/PDF output, Expand Appearance ([revolve.md](revolve.md), #846) | -| Extrude & Bevel, Inflate, Rotate | initial: live, round seam joins, depth, twist, taper, solid or hollow caps, five original bevel shapes, Inflate volume, both sides, twist, taper and cap, Rotate of every fill and stroke, groups and layers turned about one shared axis (#4506), contours that cross, touch or overlap merged first ([three-d.md](three-d.md)), Position presets, rotation and light gizmos, SVG/PDF output, Expand Appearance ([three-d.md](three-d.md)) | +| Revolve | initial: live, editable profile, rotation and light gizmos, default-on Cap with continuous curved rims that also closes a partial sweep's cut sides, smooth vector shading and round seam joins, overlapping faces drawn in the order of their depths where they overlap, a ring of them broken at one of its own faces, SVG/PDF output, Expand Appearance ([revolve.md](revolve.md), #846) | +| Extrude & Bevel, Inflate, Rotate | initial: live, round seam joins, a ring of overlapping faces broken at one of its own faces, depth, twist, taper, solid or hollow caps, five original bevel shapes, Inflate volume, both sides, twist, taper and cap, Rotate of every fill and stroke, groups and layers turned about one shared axis (#4506), contours that cross, touch or overlap merged first ([three-d.md](three-d.md)), Position presets, rotation and light gizmos, SVG/PDF output, Expand Appearance ([three-d.md](three-d.md)) | | Materials panel, lighting, ray-traced render | Window › 3D and Materials panel with the object types (Plane, Extrude, Revolve, Inflate) and the Object, Rotation and Lighting settings of the applied effect, Render Settings › Wireframe, which draws the live effect as the edges of its faces, and Quick Actions › Expand as Wireframes ([three-d.md](three-d.md#3d-and-materials-panel)); one to ten directional lights with per-light Color (opaque RGB, white by default), Intensity, Rotation, Height, Softness and neutral Ambient Light, Revolve and colored Inflate use smooth vector shading; Extrude & Bevel and Rotate retain planar shading; original Standard, Diffuse, Top Left and Right lighting rigs; shadows behind or below the object from the first light, blurred by its Softness ([three-d.md](three-d.md#shadows)); the Materials tab's Graphics, document symbols mapped onto Extrude & Bevel's caps and onto a plane, moved with an artboard handle, and wrapped around Revolve's side ([three-d.md](three-d.md#graphics)); no base materials, graphics on Inflate or on Extrude & Bevel's walls and bevels, or ray tracing | | 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, round seam joins, Extrude Depth, Cap, five original bevel shapes with Height and Bevel Extent In or Out, Position presets and rotation gizmo, Perspective, Wireframe, No Shading, Diffuse and Plastic surfaces with one to ten lights, Light Intensity, Ambient Light, Highlight Intensity and Size, Blend Steps, Black, Custom, Black Overprint or no Shading Color ([Black Overprint](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=188)), Draw Hidden Faces ([create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/create-3d-objects.html)); Revolve (Classic) initial: live, round seam joins, Angle, Cap, Offset from the left or right edge, Position presets and rotation gizmo, Perspective, the same four surfaces, lights, highlight, Blend Steps and Shading Color, groups and layers revolved about one shared axis (same page); Rotate (Classic) initial: live, round seam joins, every fill and stroke turned as one plane, Position presets and rotation gizmo, Perspective, No Shading and Diffuse surfaces with lights, Ambient Light, Blend Steps and Shading Color ([rotate objects in 3D](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/rotate-objects-in-3d.html)); Preserve Spot Colors in all three, unavailable with a Custom Shading Color ([Preserve Spot Color](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260)); all three: a lighting sphere on the Lighting tab whose lights drag, move to the back or front, and are added at the front center or deleted down to one ([lighting options](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=272)); all three: the track cube (face, edge, Shift and ring drags, keyboard steps; [three-d.md](three-d.md#track-cube)); Map Art: none | | Turntable (30.0 beta) | none | @@ -193,6 +193,7 @@ angular cut caps, exact visibility, the rest of 3D Classic (Map Art), Turntable) | Date | Change | Summary | |---|---|---| +| 2026-11-17 | minor | 3D and Materials: where faces put in the order of their depths where they overlap (Extrude & Bevel, Inflate, Revolve) lie in front of one another in a ring, a ring that waits for no face outside it gives up its own first face by depth, so a face in front of a ring's face is no longer drawn under it ([three-d.md](three-d.md), #7023; `a_face_in_front_of_a_cycle_waits_for_it` in `crates/effects/src/solids/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-12 | minor | The seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins (the seams of Revolve and of colored lights, and 3D (Classic) Wireframe edges, were already round): no thorns on edge-on facets, and facets with no neighbor now have rounded convex corners ([three-d.md](three-d.md#seams)); scores and estimates unchanged | | 2026-11-10 | minor | Effect Gallery: each filter has a thumbnail, and the dialog has a preview of the visible stack (or the browsed filter when the stack is empty). Both are an original landscape drawing passed through the filter ([Filter Gallery overview](https://helpx.adobe.com/photoshop/desktop/effects-filters/get-started-with-filters/filter-gallery.html)). The canvas preview and one-undo OK are unchanged. Remaining hours for the gallery's thumbnails and in-dialog preview: 1–2 → none. Counts unchanged (57/57). | diff --git a/docs/revolve.md b/docs/revolve.md index 922a1218e2..c7de7062e6 100644 --- a/docs/revolve.md +++ b/docs/revolve.md @@ -111,7 +111,7 @@ with the standard command. - One Revolve per source object. Edit its options rather than applying another. - Object-level Revolve uses the top visible fill, falling back to a stroke. Per-item Revolve uses that item's paint. - Smooth diffuse shading, one to ten directional lights, no textures, cast shadows or physical materials. Smooth shading interpolates lighting in projected triangles; it does not smooth the silhouette or add specular highlights. -- Faces are drawn back to front by the depths of their centers. When that order draws the nearer of two overlapping faces of a surface first, every pair of overlapping faces goes in the order of their depths at the middle of where they overlap; the sort compares at most 4,000,000 pairs (VectorCraft's own limit), and the pairs past that keep the depths of their centers. Caps facing the camera cover their rim seams; a cap facing away is drawn behind the body except where it is nearer than a body face it overlaps. Intersecting profiles can have incorrect visibility. +- Faces are drawn back to front by the depths of their centers. When that order draws the nearer of two overlapping faces of a surface first, every pair of overlapping faces goes in the order of their depths at the middle of where they overlap; faces that lie in front of one another in a ring, so that no order draws them all correctly, give up the ring's own face that comes first by depth, as [Extrude & Bevel's do](three-d.md). The sort compares pairs and looks for rings within 4,000,000 steps in all (VectorCraft's own limit); the pairs past that keep the depths of their centers, and a ring past it is broken at the first face left by depth. Caps facing the camera cover their rim seams; a cap facing away is drawn behind the body except where it is nearer than a body face it overlaps. Intersecting profiles can have incorrect visibility. - Curves use sixteen samples per segment, and as few as four when a surface would otherwise pass its limits. Surfaces are limited to 16,384 profile points and 163,840 faces, the members of a group together. A straight segment takes one point, a curve takes at least four, and each contour takes one. Smooth shaded side quads become two triangles and share the face limit. A continuous cap retains its original radial mesh cost within this limit, and each region of a cut side counts as one face. Projected ring curves have a 0.001-point fitting tolerance and a shared 32,768-curve limit. - Axis, bounds and ordinary selection handles continue to refer to the editable 2D source profile. - Extrude & Bevel, Inflate and Rotate are described in [three-d.md](three-d.md). Materials remain unimplemented. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..f5d060fbee 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (3D: a ring of overlapping faces is broken at one of its own faces, so a face in front of a ring's face is not drawn under it, #7023; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -61,6 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-17 | minor | 3D: where overlapping faces lie in front of one another in a ring, a ring that waits for no face outside it gives up its own first face by depth and the faces left are looked at afresh, so a face in front of a ring's face is no longer drawn under it, and no more pairs are drawn the wrong way round than before (#7023; `a_face_in_front_of_a_cycle_waits_for_it`, `breaking_a_ring_draws_no_more_pairs_wrong_than_the_first_face_by_depth` in `crates/effects/src/solids/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | @@ -1451,6 +1452,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - With caps and opaque paint, Extrude & Bevel (both kinds) and Inflate draw each side face of the fill's solid before the faces of the same object's strokes that overlap it (strokes on closed paths without dashes, a width profile or a brush, in a solid color or an opaque gradient), so the stroke's walls cover the fill's walls at concave corners instead of showing stripes of the fill. Tests: `solids::tests::a_fills_walls_are_drawn_before_the_stroke_faces_over_them`, `solids::tests::the_draw_order_moves_a_fill_wall_before_the_stroke_faces_it_overlaps`, `solid::tests::facets_tell_the_sides_from_the_ends_and_the_faces_turned_away`. - When the fill and strokes are at full opacity with Normal blending, under a stroke that leaves parts of the fill's edge uncovered (dashed, with a width profile or a brush, on an open subpath, or in a paint that may show through), Extrude & Bevel (both kinds) and Inflate cut each stroke face that passes through a face of the fill's solid, or of another of the shape's strokes, where their depths meet, and draw the faces of the shape's fill and strokes that overlap in the order of their depths where they overlap, instead of by the depths of their centers. Inflate orders a plain stroke the same way, since its fill can rise in front of the stroke. The fill no longer paints over a nearer dash, and a dash's end no longer covers the fill wall in front of it; a fill wall in a gap between dashes stays visible. The same order applies inside a group member's own opacity mask or blending mode, to a gradient with transparent stops under a colored light with graphics on its caps, and to Inflate in gradients under a colored light. Tests: `solids::tests::fill_walls_and_strokes_that_leave_gaps_draw_in_the_order_of_their_depths_where_they_overlap`, `solids::tests::local_order_puts_overlapping_fill_walls_and_stroke_faces_in_depth_order`, `solids::tests::a_stroke_face_through_a_fill_wall_is_cut_where_their_depths_meet`, `solids::tests::a_masked_members_fill_and_stroke_faces_go_in_one_order`, `solids::tests::a_colored_inflate_in_gradients_draws_its_faces_in_one_order`, `solids::tests::a_depth_cycle_keeps_the_cap_last`, `solids::graphics::tests::a_transparent_gradient_with_a_graphic_keeps_the_shared_face_order`. - A graphic mapped onto Extrude & Bevel's cap or onto a Plane is drawn once when the fill is a gradient with transparent stops under a colored light and the object has a stroke (dashed or plain) with the same opacity and blending mode: the fill and stroke share it, as they do without the mask, and it is drawn after the stroke's cap with the mask of the stroke's surface (none for an opaque stroke), instead of once on the fill's cap and again on the stroke's. Members of a 3D group drawn with a mask keep graphics of their own. Unmasked fills and strokes alone draw as before. Tests: `solids::graphics::tests::a_transparent_gradient_with_a_graphic_keeps_the_shared_face_order`, `solids::graphics::tests::a_plane_in_a_transparent_gradient_with_a_stroke_draws_its_graphic_once`, `solids::graphics::tests::members_in_transparent_gradients_keep_graphics_of_their_own`. + - Where the faces put in the order of their depths where they overlap lie in front of one another in a ring (a strongly connected component of the pairs), the faces that go before the first face left by depth are followed back, among the faces that come before the next face drawn last, to a ring that waits for no other of them, and that ring gives up its own face that comes first by depth; the faces left are then looked at afresh, since they may be a smaller ring or none. So a face that is in front of a face of a ring without being part of it is drawn after that face rather than first, and the pairs drawn the wrong way round are pairs of a ring, or pairs of a face with a face drawn last or one that follows it, when that one should have gone first (a face drawn last, such as a cap, still follows every face before it by depth). On 6,000 sets of pairs at random this drew no more pairs the wrong way round than taking the first face left by depth, in any set, and fewer in all; giving up the ring's face that waits for the fewest faces drew fewer still in all but more in one to five sets in a hundred, so it was not chosen. The steps count toward the 4,000,000 the comparing of pairs counts toward (VectorCraft's own limit, one for both): a step for each face and pair looked at while looking for rings (making the lists a ring is looked for in, a step a pair, is not counted). The search goes on from where it stopped at the last ring, and a face that is drawn is dropped from a list the next time the list is looked at, so rings of a few faces take a few steps a face whether they stand apart, all lie behind one face or lie one behind the other. A ring that is still a ring after it gives up a face is walked again from the face the search reached it by, so a large ring can cost about its pairs for each face it gives up, the square of its faces even when each waits for few others (3,200 faces with four pairs each at random take about 3,000,000 steps, and about 4,000 reach the limit); and a face at or after the next face drawn last is passed over again each time a face that waits for it is looked at. A first face left that waits only for the next face drawn last or faces after it goes next with no search, at no cost. The pairs are kept as lists of 4 bytes a pair, once for the faces after each face and once more for the faces before each face when a ring is first looked for, and only when the steps left are at least a quarter of the pairs, so making them costs no more than four times the steps left; with fewer, no ring is looked for, so a solid whose comparing of pairs leaves less than a quarter of its pairs of the limit breaks its rings at the first face left by depth, as before. Past the limit the first face left by depth goes next, ring or not, as before, and a face drawn last still follows every face before it by depth (#7023). Revolve's faces share the order. Tests: `solids::tests::a_face_in_front_of_a_cycle_waits_for_it`, `solids::tests::the_faces_left_are_looked_at_afresh_after_each_face_released`, `solids::tests::the_ring_released_waits_for_no_face_outside_it`, `solids::tests::a_ring_is_looked_for_before_the_next_face_drawn_last`, `solids::tests::breaking_a_ring_draws_no_more_pairs_wrong_than_the_first_face_by_depth`, `solids::tests::breaking_rings_stops_at_its_room`, `solids::tests::breaking_rings_takes_a_few_steps_a_face_but_for_a_ring_of_many_pairs`, `solids::tests::a_face_that_waits_only_for_the_face_drawn_last_costs_no_search`, `solids::tests::the_lists_for_rings_are_made_only_with_room_for_a_quarter_of_the_pairs`, `solids::tests::a_list_longer_than_the_room_left_is_not_read`, `solids::tests::a_depth_cycle_keeps_the_cap_last`. - Revolve and Revolve (Classic) draw two overlapping faces of a surface in the order of their depths where they overlap, instead of by the depths of their centers, on one object and across a group's members, so a tilted profile with long edges or a profile of several contours no longer draws a nearer face under a farther one. A surface whose faces were already in the right order keeps it. Tests: `solids::tests_revolve_order::a_revolved_surface_draws_the_nearer_of_two_overlapping_faces_last`, `solids::tests_revolve_order::a_revolved_groups_members_draw_the_nearer_of_two_overlapping_faces_last`, `solids::tests_revolve_order::a_classic_revolved_surface_draws_the_nearer_of_two_overlapping_facets_last`, `solids::tests_revolve_order::a_surface_already_in_order_keeps_it`, `solids::tests_revolve_order::surface_order_puts_the_nearer_face_where_they_overlap_last`, `tests::a_revolved_face_measures_its_depth_on_its_plane`. - Under a colored light, an Inflate fill and strokes in solid colors, opaque with Normal blending, also draw their faces in that one order, inside a group member's own opacity mask too, instead of each solid as one composite with the stroke's faces over every fill face. Each face keeps the composite's paint, light ramps and seam width; a lone solid, the solids of an object with a translucent or blended fill or stroke, and such solids holding more than 30,720 faces together (VectorCraft's own limit) are still drawn as one composite each. Tests: `solids::tests::colored_solid_fills_and_strokes_share_face_depth_order`, `solids::tests::a_colored_solid_face_on_its_own_keeps_the_composites_colors`, `solids::tests::colored_solid_inflate_batches_channels_and_clips_once_per_surface`, `solids::tests::colored_solids_past_the_face_limit_draw_as_composites`. - Without a twist, a tapered Extrude & Bevel wall (and each bevel band) is one flat face; only a twist cuts walls into slices, so no seam between slices paints a light tick or a light line on a tapered, untwisted wall (#7019). Test: `solid::tests::a_tapered_wall_is_one_flat_face_and_a_twisted_one_is_sliced`. diff --git a/docs/three-d.md b/docs/three-d.md index 4f8d4003b5..d8ee25a857 100644 --- a/docs/three-d.md +++ b/docs/three-d.md @@ -199,18 +199,27 @@ The rest is our reading: uncovered, such as the gaps between dashes. Each face of such a stroke that passes through a face of the fill's solid, or through a face of another of the shape's strokes, where the two overlap in the drawing is cut where their depths meet, and the faces of the shape's fill and strokes that overlap are drawn in the order of their - depths where they overlap, with caps on or off. A fill wall in a gap stays in its own depth order. Inflate's - curved surfaces follow this only as closely as their flat facets do. A solid painted with a gradient that has - transparent stops under a light that is not white is drawn with an opacity mask: its faces keep their places in - this order, in runs that each carry the mask, and a graphic drawn after one of its faces carries the mask too - ([Graphics](#graphics)). Such a gradient, and a gradient with transparent stops under the classic effects' - shading, is placed once on the whole solid when it has no placement of its own, so its colors and its - transparency line up across the faces. A member of a 3D group with its own opacity - mask or blending mode draws its fill's and strokes' faces in this order inside that mask or blending mode when - they are opaque with Normal blending. Otherwise each solid is drawn on its own with its opacity and blending, the - lower item's first. With a light that is not white, a puffed, shaded Inflate surface in a solid color takes its - place in this order too, each of its faces drawn with its own light ramps; a lone solid of that kind is still - drawn as one composite, and so is each such solid when they hold more than 30,720 faces together. + depths where they overlap, with caps on or off. A fill wall in a gap stays in its own depth order. Where such + faces lie in front of one another in a ring, so that no order draws them all correctly, a ring that waits for no + face outside it gives up its own face that comes first in the order of their depths, and the faces left are + looked at afresh, as they may be a smaller ring or none. A face that is only in front of a face of a ring is + still drawn after that face. Comparing the faces and looking for rings share one limit of 4,000,000 steps + (VectorCraft's own). Rings of a few faces take a few steps a face. A ring that is still a ring after it gives up + a face is walked again, so a large ring can cost about the square of its faces (some 4,000 faces tangled at + random reach the limit). The lists a ring is looked for in are made only when the steps left are at least a + quarter of the pairs, so a solid whose comparing uses nearly all of the limit breaks its rings as before; and a + face that waits only for a face drawn last goes in its turn with no search. Past the limit the first face left by + depth goes next, ring or not. Inflate's curved surfaces follow this only as closely as their flat facets do. A + solid painted with a gradient that has transparent stops under a light that is not white is drawn with an opacity + mask: its faces keep their places in this order, in runs that each carry the mask, and a graphic drawn after one + of its faces carries the mask too ([Graphics](#graphics)). Such a gradient, and a gradient with transparent stops + under the classic effects' shading, is placed once on the whole solid when it has no placement of its own, so its + colors and its transparency line up across the faces. A member of a 3D group with its own opacity mask or + blending mode draws its fill's and strokes' faces in this order inside that mask or blending mode when they are + opaque with Normal blending. Otherwise each solid is drawn on its own with its opacity and blending, the lower + item's first. With a light that is not white, a puffed, shaded Inflate surface in a solid color takes its place + in this order too, each of its faces drawn with its own light ramps; a lone solid of that kind is still drawn as + one composite, and so is each such solid when they hold more than 30,720 faces together. - The solids turn, twist and taper about the center of the bounds of all their shapes, Inflate's grid covers those bounds, and with Perspective one eye sees every solid. A stroke too narrow to hold a point of Inflate's grid stays flat. @@ -627,6 +636,7 @@ Release measurements and a repeatable CLI scene are in [3D lighting performance] | Date | Change | |---|---| +| 2026-11-17 | Where overlapping faces lie in front of one another in a ring, the ring's own first face by depth is drawn before the faces of the ring it waits for and the rest are looked at afresh, so a face in front of a ring's faces without being one of them is no longer drawn under them (#7023). | | 2026-11-13 | Extrude & Bevel cuts its walls into slices only for a twist. A taper alone keeps each wall flat, so it is one face, without the light ticks at the joints between slices or the light line down a wall (#7019). Inflate still slices its sides for a taper. | | 2026-11-12 | The seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins (the seams of Revolve and of colored lights, and 3D (Classic) Wireframe edges, were already round): no thorns on edge-on facets, and facets with no neighbor now have rounded convex corners ([Seams](#seams)). | | 2026-11-08 | Contours that cross, touch or overlap are merged by vectorcraft-pathops before Extrude & Bevel, Inflate and Rotate build a solid, sharing its limits; others are built as drawn. |