From 2ffaa673fedab7f562a0c4477ada46256396b657 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 22:12:33 -0800 Subject: [PATCH 01/16] 3D and Materials: graphics map onto Inflate objects A Materials-tab graphic now lies on Inflate's puffed front, and on its puffed back when Both sides and Cap are on. The graphic is placed in the art's plane with the same X, Y, Scale and Rotation as on a cap and is carried straight out onto the puff, so it follows the membrane; Twist and Taper turn and shrink the back's graphics with it. The membrane is cut into triangles that draw their part of the graphic shaded with them and only where the outside faces the viewer, in Revolve's side order with its seams and limits. The blue handle sits on the puffed face. threeD.mapGraphic refuses a back graphic on Inflate without Both sides and Cap, and changing the type to Inflate keeps the graphics. The panel note, the params text and docs/three-d.md, docs/mcp.md and docs/effects-parity.md list Inflate. --- crates/effects/src/catalog.rs | 4 +- crates/effects/src/revolve.rs | 10 +- crates/effects/src/revolve/tests_graphics.rs | 6 +- crates/effects/src/solids.rs | 155 ++++++++++- crates/effects/src/solids/graphics.rs | 243 ++++++++++++++---- crates/effects/src/solids/tests.rs | 2 + crates/effects/src/solids/tests_graphics.rs | 85 +++++- crates/engine/src/cmd/effectcmd/graphics.rs | 12 +- .../src/cmd/effectcmd/graphics_tests.rs | 33 ++- crates/three-d/src/solid.rs | 16 +- crates/three-d/src/solid/build.rs | 2 + crates/three-d/src/solid/inflate.rs | 65 ++++- crates/three-d/src/solid/tests.rs | 43 +++- .../ui-egui/src/dialogs/three_d_materials.rs | 6 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 4 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/gu.tsv | 2 +- crates/ui-egui/src/i18n/hi.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 4 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 4 +- crates/ui-egui/src/i18n/zh-hant.tsv | 4 +- crates/ui-egui/src/panels/tests_three_d.rs | 8 +- docs/effects-parity.md | 2 +- docs/mcp.md | 8 +- docs/three-d.md | 29 ++- 43 files changed, 656 insertions(+), 131 deletions(-) diff --git a/crates/effects/src/catalog.rs b/crates/effects/src/catalog.rs index 1c1ca96d9f..06db1cb2b3 100644 --- a/crates/effects/src/catalog.rs +++ b/crates/effects/src/catalog.rs @@ -196,8 +196,8 @@ pub fn effect_catalog() -> Vec { INFLATE, "Inflate…", &["Effect", "3D and Materials"], - "{depth: pt (0..2000, 0; flat depth between front and back), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: no back, a shell open behind), volume: % (0..100, 50; 50 rounds the edge like a half sphere), bothSides: bool (false: flat back), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), perspective: % (0..100; the earlier form, read as the perspectiveAngle that shows the same view), shade: bool (true), lightColor: #rrggbb (white, #ffffff; legacy directional light color), lights: null or array of 1..10 objects (color: #rrggbb, intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, softness: % 0..100, behind: bool; overrides the single-light fields; ambient is shared), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 80), lightSoftness: % (0..100, 0; how far round the object the light reaches), ambient: % (0..200, 25; Ambient Light), lightAzimuth: degrees (the earlier form: with lightElevation, read as the lightRotation, lightHeight and lightBehind of the same light), lightElevation: degrees (the earlier form, with lightAzimuth), shadow: bool (false; the first light casts a hard-edged shadow, black at 50% times the art's opacity), shadowPosition: behind|below (behind; behind: on a plane square to the view, below: on the floor under the object, turned with it), shadowDistance: % (0..100, 0; how far the plane is from the object, as a share of its largest size), shadowBounds: % (10..400, 100; how far the plane reaches: at 100 it is four times the object's largest size across)}. Painted with the top fill (else the top stroke).", - json!({"depth":0.0,"twist":0.0,"taper":100.0,"cap":true,"volume":50.0,"bothSides":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"shade":true,"lightColor":"#ffffff","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":80.0,"lightSoftness":0.0,"ambient":25.0,"shadow":false,"shadowPosition":"behind","shadowDistance":0.0,"shadowBounds":100.0}), + "{depth: pt (0..2000, 0; flat depth between front and back), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: no back, a shell open behind), volume: % (0..100, 50; 50 rounds the edge like a half sphere), bothSides: bool (false: flat back), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), perspective: % (0..100; the earlier form, read as the perspectiveAngle that shows the same view), shade: bool (true), lightColor: #rrggbb (white, #ffffff; legacy directional light color), lights: null or array of 1..10 objects (color: #rrggbb, intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, softness: % 0..100, behind: bool; overrides the single-light fields; ambient is shared), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 80), lightSoftness: % (0..100, 0; how far round the object the light reaches), ambient: % (0..200, 25; Ambient Light), lightAzimuth: degrees (the earlier form: with lightElevation, read as the lightRotation, lightHeight and lightBehind of the same light), lightElevation: degrees (the earlier form, with lightAzimuth), shadow: bool (false; the first light casts a hard-edged shadow, black at 50% times the art's opacity), shadowPosition: behind|below (behind; behind: on a plane square to the view, below: on the floor under the object, turned with it), shadowDistance: % (0..100, 0; how far the plane is from the object, as a share of its largest size), shadowBounds: % (10..400, 100; how far the plane reaches: at 100 it is four times the object's largest size across), graphics: array of 0..64 objects ([]; the 3D and Materials panel's Graphics on the puffed front and back, see threeD.mapGraphic: symbol: name of a document symbol, face: front|back (front; the back reads left to right as seen from behind and takes graphics with bothSides and cap on), x: pt (0; the offset of the graphic's center from the center of the object's bounds, in the art's plane), y: pt (0), scale: % (1..10000, 100; of the symbol's own size), rotation: degrees (-360..360, 0; counterclockwise); carried straight out from the art's plane onto the puffed face, twist and taper turning and shrinking the back's with it, shaded with the surface and drawn only where its outside faces the viewer)}. Painted with the top fill (else the top stroke).", + json!({"depth":0.0,"twist":0.0,"taper":100.0,"cap":true,"volume":50.0,"bothSides":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"shade":true,"lightColor":"#ffffff","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":80.0,"lightSoftness":0.0,"ambient":25.0,"shadow":false,"shadowPosition":"behind","shadowDistance":0.0,"shadowBounds":100.0,"graphics":[]}), ), g( ROTATE, diff --git a/crates/effects/src/revolve.rs b/crates/effects/src/revolve.rs index a9c9482d1d..7c2ac3ff56 100644 --- a/crates/effects/src/revolve.rs +++ b/crates/effects/src/revolve.rs @@ -6,7 +6,7 @@ use serde_json::Value; use vectorcraft_doc::color::{Color, Paint}; use vectorcraft_doc::{Appearance, AppearanceItem, Document, Effect, FillLayer, Node, NodeId, NodeKind}; use vectorcraft_geom::{PathData, PathEl, Point, Rect, Vec2}; -use vectorcraft_three_d::{Edge, Revolve, SolidFaces}; +use vectorcraft_three_d::{Edge, PlanarFace, Revolve, SolidFaces}; use crate::solids::wireframe::WireFace; use crate::solids::{ @@ -162,7 +162,7 @@ pub(crate) fn validate_in(doc: Option<&Document>, n: &Node, id: &str, p: &Value) // With no member to carry them, the graphics' art must still fit its limits. None => { crate::solids::graphics::validate_symbols(doc, p)?; - crate::solids::graphics::validate_surface_symbols(doc, p)?; + crate::solids::graphics::validate_surface_symbols(doc, p, PlanarFace::Front)?; } } } @@ -191,10 +191,10 @@ fn check_graphics(doc: Option<&Document>, id: &str, path: &PathData, b: Rect, op let graphics = crate::solids::mapped_graphics(p); let Some(doc) = doc.filter(|_| id == REVOLVE && !graphics.is_empty()) else { return Ok(()) }; crate::solids::graphics::validate_symbols(doc, p)?; - crate::solids::graphics::validate_surface_symbols(doc, p)?; + crate::solids::graphics::validate_surface_symbols(doc, p, PlanarFace::Front)?; let faces = vectorcraft_three_d::revolve(path, b, options)?; let mut used = *copies; - match crate::solids::graphics::surface_parts(Some(doc), NodeId(0), &graphics, &faces, &|_, c| Paint::solid(c), &mut used) { + match crate::solids::graphics::surface_parts(Some(doc), NodeId(0), (&graphics, PlanarFace::Front), &faces, &|_, c| Paint::solid(c), &mut used) { Some(_) => { *copies = used; Ok(()) @@ -481,7 +481,7 @@ fn surface( let mut parts = if graphics.is_empty() { vec![] } else { - match crate::solids::graphics::surface_parts(doc, n.id, &graphics, &faces, &shade, &mut used) { + match crate::solids::graphics::surface_parts(doc, n.id, (&graphics, PlanarFace::Front), &faces, &shade, &mut used) { Some(parts) => { copies.graphics = used; parts diff --git a/crates/effects/src/revolve/tests_graphics.rs b/crates/effects/src/revolve/tests_graphics.rs index 5d9500628b..0d39d6dfe1 100644 --- a/crates/effects/src/revolve/tests_graphics.rs +++ b/crates/effects/src/revolve/tests_graphics.rs @@ -365,7 +365,8 @@ fn revolve_takes_graphics_on_its_side_only() { let kept = three_d_params_as(crate::EXTRUDE, &both, REVOLVE); assert_eq!(kept["graphics"].as_array().map(Vec::len), Some(1)); assert_eq!(kept["graphics"][0]["symbol"], "Red"); - assert_eq!(three_d_params_as(REVOLVE, &front, crate::INFLATE).get("graphics"), None); + // Inflate keeps them, and its front takes them. + assert_eq!(three_d_params_as(REVOLVE, &front, crate::INFLATE)["graphics"], front["graphics"]); } #[test] @@ -503,7 +504,8 @@ fn the_copies_of_a_graphics_paint_have_a_budget_of_their_own() { let faces = vectorcraft_three_d::revolve(path, path.bounds().unwrap(), options_of(REVOLVE, &p)).unwrap(); let parts_of = |symbol: &str, copies: &mut usize| { let graphics = crate::solids::mapped_graphics(&json!({"graphics": [{"symbol": symbol}]})); - crate::solids::graphics::surface_parts(Some(&d), NodeId(0), &graphics, &faces, &|_, c| Paint::solid(c), copies).map(|p| p.concat().len()) + crate::solids::graphics::surface_parts(Some(&d), NodeId(0), (&graphics, PlanarFace::Front), &faces, &|_, c| Paint::solid(c), copies) + .map(|p| p.concat().len()) }; // Each opaque part copies the paint into its fill and its seam stroke; a part with // transparent stops takes no seam stroke and copies it once. diff --git a/crates/effects/src/solids.rs b/crates/effects/src/solids.rs index c0d44947d7..b8323084f8 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -173,6 +173,7 @@ pub fn inflate_options(p: &Value) -> Inflate { twist: num(p, "twist", 0.0), taper: num(p, "taper", 100.0) / 100.0, cap: flag(p, "cap", true), + map_surface: false, } } @@ -324,6 +325,7 @@ fn validate_solid_for(doc: Option<&Document>, n: &Node, id: &str, p: &Value, at: let b = union_bounds(&shapes).ok_or_else(|| format!("{label} requires a group holding a shape with at least two anchors"))?; check_profiles(id, p, &shapes, b)?; check_solids(id, p, &shapes)?; + check_membrane_graphics(doc, n, id, p, &shapes)?; return cast_shadow(id, p, &shapes).map(|_| ()); } let (path, rule) = object_profile(n, label)?; @@ -342,9 +344,33 @@ fn validate_solid_for(doc: Option<&Document>, n: &Node, id: &str, p: &Value, at: let shapes = [Profile { path, rule, items, opacity: 1.0, scopes: vec![] }]; check_profiles(id, p, &shapes, b)?; check_solids(id, p, &shapes)?; + check_membrane_graphics(doc, n, id, p, &shapes)?; cast_shadow(id, p, &shapes).map(|_| ()) } +/// An error when the graphics of Inflate `id` with parameters `p`, with the symbols of `doc`, are +/// past their limits on the front and puffed back of the solids of `shapes`: their art, or the +/// parts they draw on its pieces ([`graphics::surface_parts`]), or when the solids can't be built +/// with their pieces carrying the graphics. They are built as the art builds them +/// ([`surfaces_with`]). Without `doc` nothing is drawn, and nothing is checked. +fn check_membrane_graphics(doc: Option<&Document>, n: &Node, id: &str, p: &Value, shapes: &[Profile]) -> Result<(), String> { + let Some(doc) = doc else { return Ok(()) }; + if id != INFLATE || mapped_graphics(p).is_empty() { + return Ok(()); + } + for face in PlanarFace::ALL { + graphics::validate_surface_symbols(doc, p, face)?; + } + let fx = Effect { id: id.into(), params: p.clone(), visible: true }; + let mut dropped = false; + // Art that can't be built with the graphics draws without them. + let built = surfaces_with(Some(doc), n, &fx, shapes, false, true, &mut dropped); + if dropped || built.is_none() { + return Err("The graphics are too complex: simplify the symbols' art".into()); + } + Ok(()) +} + /// Do the solids 3D effect `id` with parameters `p` builds from the profiles of `shapes` about `b` /// build? Only the profiles no solid of [`check_solids`] is built from are built here: every /// shape's for Rotate, and for Extrude & Bevel and Inflate the profile of a shape with no fill, @@ -632,6 +658,55 @@ fn surface(n: &Node, facets: Vec, paint: &Paint, opacity: f32, blend: Ble group } +/// The parts of `graphics` that fall on each of `facets`, the facets of one of Inflate's solids in +/// drawing order, built with their front and puffed back carrying the graphics +/// ([`vectorcraft_three_d::Inflate::map_surface`]): for each facet, the parts of the graphics on +/// its face to draw right after it ([`graphics::surface_parts`]), shaded as a solid color is on +/// that facet. `copies` counts the bytes of the paint copies of the object's graphics. `None` past +/// the graphics' limits. +fn membrane_parts( + doc: Option<&Document>, + id: NodeId, + graphics: &[MappedGraphic], + facets: &[Facet], + copies: &mut usize, +) -> Option>>> { + let shade = |f: &graphics::OnFace<'_>, c: vectorcraft_doc::color::Color| Paint::solid(crate::lighting::shade(c, f.facet.illumination)); + let mut out: Vec>> = vec![vec![]; facets.len()]; + for face in PlanarFace::ALL.into_iter().filter(|face| graphics.iter().any(|g| g.face == *face)) { + let on: Vec> = facets.iter().map(|facet| graphics::OnFace { facet, face }).collect(); + let parts = graphics::surface_parts(doc, id, (graphics, face), &on, &shade, copies)?; + for (slot, extra) in out.iter_mut().zip(parts) { + slot.extend(extra); + } + } + Some(out) +} + +/// `surface`, a plain group of one face for each facet ([`surface`]), with each face followed by +/// the parts of the graphics that `parts` holds for its facet ([`membrane_parts`]): a face with +/// parts becomes a group of the face and its parts, so nearer faces drawn after it cover them too. +/// `surface` is returned as it is when no facet has a part or it is not such a group. +fn with_surface_parts(id: NodeId, mut surface: Node, parts: Vec>>) -> Node { + if parts.iter().all(Vec::is_empty) { + return surface; + } + let NodeKind::Group { children, clip: false } = &mut surface.kind else { return surface }; + if children.len() != parts.len() { + return surface; + } + for (child, extra) in children.iter_mut().zip(parts) { + if extra.is_empty() { + continue; + } + let mut list = Vec::with_capacity(extra.len() + 1); + list.push(child.clone()); + list.extend(extra); + *child = Arc::new(Node::group(id, list)); + } + surface +} + /// The width of the stroke of a facet's own paint that closes the seams between `face` and its /// neighbors. No wider than the facet is thick: seen at a grazing angle a facet can be thinner than /// the stroke, and its stroke would then paint over its neighbors. @@ -740,7 +815,7 @@ fn built_solids<'a>( bounds: Rect, limit: usize, ) -> impl Iterator>, String>> + 'a { - built_solids_cast(id, p, parts, bounds, limit, false).map(|r| r.map(|s| s.map(|(f, _)| f))) + built_solids_cast(id, p, parts, bounds, limit, false, false).map(|r| r.map(|s| s.map(|(f, _)| f))) } /// One solid's facets and, when its shadow is cast, the faces it is cast from. @@ -751,7 +826,9 @@ type CastingSolid = (Vec, Option); type SurfacesAndFaces = (Vec>, Vec>); /// [`built_solids`], and with `cast` for Extrude & Bevel or Inflate each solid's faces its shadow -/// is cast from, from the same build ([`SolidFaces`]). +/// is cast from, from the same build ([`SolidFaces`]). With `membrane`, Inflate's solids are built +/// with the pieces of their front and puffed back carrying where they lie in the art's plane, for +/// the graphics drawn on them ([`vectorcraft_three_d::Inflate::map_surface`]). fn built_solids_cast<'a>( id: &'a str, p: &'a Value, @@ -759,11 +836,12 @@ fn built_solids_cast<'a>( bounds: Rect, limit: usize, cast: bool, + membrane: bool, ) -> impl Iterator, String>> + 'a { // Inflate's eye is placed for every puff together, as far away as the highest needs. let mut inflated = (id == INFLATE).then(|| -> Box>> { let shapes: Vec<(&PathData, FillRule)> = parts.iter().map(|(_, _, area, rule, _, _)| (area, *rule)).collect(); - let (o, view) = (inflate_options(p), view_options(p)); + let (o, view) = (Inflate { map_surface: membrane, ..inflate_options(p) }, view_options(p)); if cast { Box::new(vectorcraft_three_d::inflate_shadowed(&shapes, bounds, o, view).map(|r| r.map(|(f, faces)| (f, Some(faces))))) } else { @@ -1720,8 +1798,32 @@ fn seen_ends(f: &[Facet]) -> impl Iterator { /// [`art_for`] without the shadow: the solids' surfaces, with the graphics mapped onto their planar /// faces drawn right after the last of the solids' surfaces that holds that face. With `cast`, each /// solid built also keeps the faces its shadow is cast from, from the same build, in the order the -/// solids are built ([`cast_built`]); `None` for a stroke's solid left out of the art. +/// solids are built ([`cast_built`]); `None` for a stroke's solid left out of the art. Inflate's +/// graphics are drawn on the pieces of its front and puffed back; when its solids can't be built +/// with those pieces, or the graphics are past their limits on them, the solids draw without them. fn surfaces_for(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile], cast: bool) -> Option { + let p = crate::merged_params(&fx.id, &fx.params); + if fx.id == INFLATE && doc.is_some() && !mapped_graphics(&p).is_empty() { + let mut dropped = false; + if let Some(built) = surfaces_with(doc, n, fx, shapes, cast, true, &mut dropped).filter(|_| !dropped) { + return Some(built); + } + } + surfaces_with(doc, n, fx, shapes, cast, false, &mut false) +} + +/// [`surfaces_for`], with `membrane` building Inflate's solids with their front and puffed back +/// carrying the graphics ([`built_solids_cast`]), and setting `dropped` when those graphics are past +/// their limits on the pieces drawn and the solids draw without them. +fn surfaces_with( + doc: Option<&Document>, + n: &Node, + fx: &Effect, + shapes: &[Profile], + cast: bool, + membrane: bool, + dropped: &mut bool, +) -> Option { let b = union_bounds(shapes)?; let p = crate::merged_params(&fx.id, &fx.params); let classic = fx.id == CLASSIC_EXTRUDE || fx.id == CLASSIC_ROTATE; @@ -1766,7 +1868,8 @@ fn surfaces_for(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile let (parts, bounds) = solid_parts(shapes, b); let mut solids = vec![]; let mut built = vec![]; - for ((item, opacity, _, _, scopes, member), f) in parts.iter().zip(built_solids_cast(&fx.id, &p, &parts, bounds, MAX_OBJECT_FACES, cast)) { + let made = built_solids_cast(&fx.id, &p, &parts, bounds, MAX_OBJECT_FACES, cast, membrane); + for ((item, opacity, _, _, scopes, member), f) in parts.iter().zip(made) { let item: &AppearanceItem = item; match f { Ok(Some((f, _))) if !crate::revolve::paint_copies_add(&mut paint_bytes, facet_copies(&f, paint_ref(item), colored), paint_ref(item)) => { @@ -1776,8 +1879,12 @@ fn surfaces_for(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile solids.push((item, *opacity, *scopes, f, *member)); built.push(faces); } - // A stroke's outline past the limits is left out; the fill's solid still draws. - Ok(None) => built.push(None), + // A stroke's outline past the limits is left out; the fill's solid still draws. Built + // with the graphics' pieces, a stroke past the limits draws without the graphics. + Ok(None) => { + built.push(None); + *dropped |= membrane; + } // A loaded file or a shape edited past the limits (its own, or those of the object's // solids together) keeps drawing its source path instead of failing the frame; // commands validate the same evaluator and report its errors. @@ -1861,6 +1968,9 @@ fn surfaces_for(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile // ([`in_one_order`], [`underlaid_surface`]). let seals: Vec = solids.iter().map(|(.., f, _)| underlaid(f, colored)).collect(); let seal = |range: std::ops::Range| seals.get(range).is_some_and(|s| s.iter().any(|s| *s)); + let membrane_graphics = if membrane && graphics_on { mapped_graphics(&p) } else { vec![] }; + // The paint copies of Inflate's graphics, apart from those of the surfaces, as on Revolve. + let mut graphic_copies = 0usize; let surfaces: Vec = solids .into_iter() .map(|(item, member, scopes, f, shape)| { @@ -1868,10 +1978,21 @@ fn surfaces_for(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile let depths: Vec = f.iter().map(|f| Placed::of(f, shape, paints)).collect(); let ends = f.iter().map(|f| f.end.filter(|_| !f.away)).collect(); let (paint, opacity, blend) = paint_of(item, member); + // The pieces of Inflate's front and back draw the parts of the graphics that fall on + // them; past the graphics' limits the solid draws without them. + let parts = if membrane_graphics.is_empty() || !f.iter().any(|f| f.surface.is_some()) { + vec![] + } else { + let parts = membrane_parts(doc, n.id, &membrane_graphics, &f, &mut graphic_copies); + *dropped |= parts.is_none(); + parts.unwrap_or_default() + }; + let drawn = parts.iter().any(|p| !p.is_empty()); let art = if classic { classic::surface(n, f, &paint, opacity, blend, &p) } else { - surface(n, f, &paint, opacity, blend, colored, split && shared.get(shape).copied().unwrap_or(false)) + let faces = drawn || (split && shared.get(shape).copied().unwrap_or(false)); + with_surface_parts(n.id, surface(n, f, &paint, opacity, blend, colored, faces), parts) }; (depths, art, scopes, ends) }) @@ -2157,14 +2278,15 @@ fn group_solid_art(doc: Option<&Document>, n: &Node) -> Option { /// Where the graphics of the 3D effect of `n` (on the object itself with `item` `None`, else on its /// fill or stroke `item`) are drawn: the bounds its solids are built with and the maps of their -/// planar faces ([`graphics::GraphicFrame`]). `None` when `n` has no visible Extrude & Bevel or -/// Rotate there, or its art can't be built. +/// planar faces, or Inflate's puffed faces ([`graphics::GraphicFrame`]). `None` when `n` has no +/// visible Extrude & Bevel, Inflate or Rotate there, or its art can't be built. pub fn graphic_frame(doc: Option<&Document>, n: &Node, item: Option) -> Option { frame_of(doc, n, item, &solid) } /// [`graphic_frame`] of the 3D effect at `index` in that list, which must be a visible Extrude & -/// Bevel, Rotate or Revolve. Revolve's frame is its unrolled side seen from the front, centered on +/// Bevel, Rotate, Revolve or Inflate. Inflate's frame places handles on the pieces of its puffed +/// front and back the viewer sees. Revolve's frame is its unrolled side seen from the front, centered on /// the origin, with no face maps: it sizes a new graphic and places no handles. pub fn graphic_frame_at(doc: Option<&Document>, n: &Node, item: Option, index: usize) -> Option { frame_of(doc, n, item, &|fx: &[Effect]| fx.get(index).filter(|e| e.visible && is_three_d(&e.id)).map(|e| (index, e))) @@ -2231,7 +2353,16 @@ fn frame_of(doc: Option<&Document>, n: &Node, item: Option, pick: &Pick<' let plane = vectorcraft_three_d::plane_face_map(b, view); return Some(graphics::GraphicFrame::new(b, plane, None)); } - let (_, bounds) = solid_parts(&shapes, b); + let (parts, bounds) = solid_parts(&shapes, b); + if fx.id == INFLATE { + // Inflate's graphics lie on its puffed front and back: the pieces the viewer sees place + // their handles. Solids that can't be built place none. + let built: Vec = built_solids_cast(INFLATE, &p, &parts, bounds, MAX_OBJECT_FACES, false, true) + .filter_map(|r| r.ok().flatten()) + .flat_map(|(f, _)| f) + .collect(); + return Some(graphics::GraphicFrame::inflated(bounds, graphics::MembraneFrame::of(&built))); + } let options = extrude_options(&p); let map = |face| vectorcraft_three_d::extrude_face_map(bounds, options, view, face); Some(graphics::GraphicFrame::new(bounds, map(PlanarFace::Front), map(PlanarFace::Back))) diff --git a/crates/effects/src/solids/graphics.rs b/crates/effects/src/solids/graphics.rs index 7c0087e15b..1d7e4e8d45 100644 --- a/crates/effects/src/solids/graphics.rs +++ b/crates/effects/src/solids/graphics.rs @@ -13,7 +13,14 @@ //! ([`vectorcraft_three_d::SurfaceCell`]): x and y are the offset of the graphic's center from the //! middle of that surface, x around the axis and y along the profile, and each face of the side //! draws the part of the graphics that falls on it ([`surface_parts`]). +//! +//! On Inflate the graphics lie on the puffed front, and on the puffed back when Both Sides is on: +//! each is placed in the art's plane as on Extrude & Bevel's caps and carried straight out onto +//! the surface above it, so it follows the puff. Each piece of the surface draws the part of the +//! graphics that falls on it, as on Revolve's side, and the twist and taper carry the back's +//! graphics with the back. +use std::borrow::Cow; use std::sync::Arc; use serde_json::{Map, Value, json}; @@ -47,7 +54,7 @@ const MAX_NESTING: usize = 8; const MAX_LEVELS: usize = 4 * vectorcraft_doc::MAX_DEPTH; /// The error for graphics on a 3D effect that takes none. -pub const NOT_TAKEN: &str = "Graphics map onto the Plane, Extrude and Revolve object types"; +pub const NOT_TAKEN: &str = "Graphics map onto the Plane, Extrude, Revolve and Inflate object types"; /// The buckets around the unrolled side surface that the pieces of Revolve's graphics are sorted /// into, so each face looks only at the pieces near it. @@ -148,10 +155,10 @@ impl MappedGraphic { } } -/// The 3D effects that take graphics: Extrude & Bevel (its caps), Rotate (the plane) and Revolve -/// (its swept side). +/// The 3D effects that take graphics: Extrude & Bevel (its caps), Rotate (the plane), Revolve (its +/// swept side) and Inflate (its puffed front and back). pub fn takes_graphics(id: &str) -> bool { - id == super::EXTRUDE || id == super::ROTATE || id == crate::REVOLVE + id == super::EXTRUDE || id == super::ROTATE || id == crate::REVOLVE || id == super::INFLATE } /// The graphics in parameters `p`, leaving out entries that are not valid (a file may hold @@ -163,9 +170,9 @@ pub fn mapped_graphics(p: &Value) -> Vec { } } -/// Are the graphics in parameters `p` of 3D effect `id` valid? Only Extrude & Bevel, Rotate and -/// Revolve take graphics; a plane has only a front, and Revolve's graphics go on its side, named -/// the front. +/// Are the graphics in parameters `p` of 3D effect `id` valid? Only Extrude & Bevel, Rotate, +/// Revolve and Inflate take graphics; a plane has only a front, and Revolve's graphics go on its +/// side, named the front. pub fn validate(id: &str, p: &Value) -> Result<(), String> { let list = match p.get(GRAPHICS) { None => return Ok(()), @@ -533,14 +540,15 @@ struct Unrolled { place: Affine, } -/// The areas of `graphics` (those of the front: Revolve's side) placed on the unrolled side -/// surface, cut into straight pieces. A graphic whose symbol `doc` does not have, or whose art is +/// The areas of `graphics` on `face` (the front, for Revolve's side; Inflate's front or back) +/// placed on the unrolled side surface, or in the art's plane about the center of the object's +/// bounds, cut into straight pieces. A graphic whose symbol `doc` does not have, or whose art is /// past the limits of [`pieces_of`], is left out. `None` when the pieces take more than /// [`MAX_ELEMENTS`] points together. -fn unrolled(doc: &Document, graphics: &[MappedGraphic]) -> Option> { +fn unrolled(doc: &Document, graphics: &[MappedGraphic], face: PlanarFace) -> Option> { let mut pieces = vec![]; let mut points = 0usize; - for g in graphics.iter().filter(|g| g.face == PlanarFace::Front) { + for g in graphics.iter().filter(|g| g.face == face) { let Some(symbol) = doc.symbols.iter().find(|s| s.name == g.symbol) else { continue }; let Ok(art) = pieces_of(doc, symbol) else { continue }; let Some(bounds) = art.iter().filter_map(|p| p.path.bounds()).reduce(|a, b| a.union(b)) else { continue }; @@ -617,20 +625,85 @@ fn straight_pieces(path: &BezPath, points: &mut usize) -> Option> (*points <= MAX_ELEMENTS).then_some(polygons) } -/// Do the graphics in Revolve parameters `p` fit the limits with the symbols of `doc`? Their art, -/// cut into straight pieces on the side surface, may take up to [`MAX_ELEMENTS`] points together. -pub(crate) fn validate_surface_symbols(doc: &Document, p: &Value) -> Result<(), String> { +/// Do the graphics on `face` in parameters `p` (the front of Revolve; Inflate's front or back) fit +/// the limits with the symbols of `doc`? Their art, cut into straight pieces on the surface, may +/// take up to [`MAX_ELEMENTS`] points together. +pub(crate) fn validate_surface_symbols(doc: &Document, p: &Value, face: PlanarFace) -> Result<(), String> { let list = mapped_graphics(p); - if list.is_empty() || unrolled(doc, &list).is_some() { + if !list.iter().any(|g| g.face == face) || unrolled(doc, &list, face).is_some() { return Ok(()); } Err("The graphics are too complex: simplify the symbols' art".into()) } -/// The parts of `graphics` that fall on each of `faces`, a revolved surface's faces in drawing -/// order, for an object with id `id`: for each face, the nodes to draw right after it. Only faces -/// of the swept side that show their outside to the viewer carry a part, so a graphic narrows -/// toward the silhouette, is hidden past it and is covered by the nearer faces drawn after it. +/// A face of a surface that graphics are drawn on ([`surface_parts`]): a face of Revolve's swept +/// side, or a piece of Inflate's front or back. +pub(crate) trait SurfaceFace { + /// Where the face lies on the surface, when it carries graphics and shows the surface's outside + /// to the viewer. + fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell>; + /// The outline the face's parts are cut to, when it is not the polygon of its cell's corners: + /// its curved outline, when its edges along an end are curved, or the outline of a piece cut + /// from a larger face. + fn curved(&self) -> Option>; + fn rgb_light(&self) -> Option; + fn light(&self) -> [f64; 3]; + fn outline_path(&self) -> PathData; +} + +impl SurfaceFace for vectorcraft_three_d::Face { + fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell> { + self.surface.as_ref().filter(|c| c.outward && !self.cap) + } + fn curved(&self) -> Option> { + self.outline.as_ref().map(Cow::Borrowed) + } + fn rgb_light(&self) -> Option { + self.rgb_gradient + } + fn light(&self) -> [f64; 3] { + self.illumination + } + fn outline_path(&self) -> PathData { + self.path() + } +} + +/// A piece of Inflate's front or back ([`Facet::membrane`]) that carries graphics on `face` only. +pub(crate) struct OnFace<'a> { + pub(crate) facet: &'a Facet, + pub(crate) face: PlanarFace, +} + +impl SurfaceFace for OnFace<'_> { + fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell> { + self.facet.surface.as_ref().filter(|c| c.outward && self.facet.membrane == Some(self.face)) + } + fn curved(&self) -> Option> { + if let Some(outline) = &self.facet.outline { + return Some(Cow::Borrowed(outline)); + } + // A piece of a stroke's face cut where it passes through another face keeps its face's + // cell, and its parts are cut to its own outline. + let cut = self.facet.surface.as_ref().is_some_and(|c| self.facet.contours.len() != 1 || self.facet.contours.first() != Some(&c.page)); + cut.then(|| Cow::Owned(self.facet.path())) + } + fn rgb_light(&self) -> Option { + self.facet.rgb_gradient + } + fn light(&self) -> [f64; 3] { + self.facet.illumination + } + fn outline_path(&self) -> PathData { + self.facet.path() + } +} + +/// The parts of the graphics on `face` of `graphics` (the front of Revolve; Inflate's front or +/// back) that fall on each of `faces`, a surface's faces in drawing order, for an object with id +/// `id`: for each face, the nodes to draw right after it. Only faces of the surface that show their +/// outside to the viewer carry a part, so a graphic narrows toward the silhouette, is hidden past +/// it and is covered by the nearer faces drawn after it. /// `shade` gives the paint of a solid color on a face, as the surface under it is shaded; the /// colors of gradients and patterns are multiplied by the face's light. A graphic whose symbol /// `doc` does not have, or that is past the limits of its art, draws nothing. `None` past @@ -638,17 +711,17 @@ pub(crate) fn validate_surface_symbols(doc: &Document, p: &Value) -> Result<(), /// after, [`MAX_SURFACE_CUTS`] points cut, or when the copies of their paints in the parts take /// `copies`, the bytes of the copies of the object's graphics so far, past Revolve's budget for /// them: commands refuse such graphics, and a loaded file draws the surface without them. -pub(crate) fn surface_parts( +pub(crate) fn surface_parts( doc: Option<&Document>, id: NodeId, - graphics: &[MappedGraphic], - faces: &[vectorcraft_three_d::Face], - shade: &dyn Fn(&vectorcraft_three_d::Face, vectorcraft_doc::color::Color) -> Paint, + (graphics, face): (&[MappedGraphic], PlanarFace), + faces: &[F], + shade: &dyn Fn(&F, vectorcraft_doc::color::Color) -> Paint, copies: &mut usize, ) -> Option>>> { let mut out: Vec>> = vec![vec![]; faces.len()]; let Some(doc) = doc else { return Some(out) }; - let pieces = unrolled(doc, graphics)?; + let pieces = unrolled(doc, graphics, face)?; let Some(all) = pieces.iter().map(|p| p.bounds).reduce(|a, b| a.union(b)) else { return Some(out) }; // Each piece listed in the buckets of the surface's x its bounds reach across. let width = (all.width() / SURFACE_BUCKETS as f64).max(1e-9); @@ -664,11 +737,12 @@ pub(crate) fn surface_parts( let mut cut_points = 0usize; let mut triangle_id = 0usize; for (face, parts) in faces.iter().zip(out.iter_mut()) { - let Some(cell) = face.surface.as_ref().filter(|c| c.outward && !face.cap) else { continue }; + let Some(cell) = face.outer_cell() else { continue }; if cell.uv.len() != cell.page.len() || !(3..=4).contains(&cell.uv.len()) { continue; } let triangles: &[[usize; 3]] = if cell.uv.len() == 3 { &[[0, 1, 2]] } else { &[[0, 1, 2], [0, 2, 3]] }; + let curved = face.curved(); for corners in triangles { triangle_id += 1; let pick = |of: &[Point]| corners.iter().map(|k| of.get(*k).copied()).collect::>>(); @@ -679,7 +753,7 @@ pub(crate) fn surface_parts( // where the graphic runs past the end of the profile. A four-cornered face is cut into // two triangles along its diagonal from corner 0 to corner 2: each takes the part of // the outline on its own side of it. - let window = if face.outline.is_some() { grown(window, 3.0) } else { window }; + let window = if curved.is_some() { grown(window, 3.0) } else { window }; // The pieces are looked up over the whole of the window they are cut to. let Some(reach) = window.iter().map(|p| Rect::from_points(*p, *p)).reduce(|a, b| a.union(b)) else { continue }; if reach.x1 < all.x0 || reach.x0 > all.x1 || reach.y1 < all.y0 || reach.y0 > all.y1 { @@ -706,7 +780,7 @@ pub(crate) fn surface_parts( } near.sort_unstable(); let own = corners.iter().find(|k| **k != 0 && **k != 2).and_then(|k| cell.page.get(*k)).filter(|_| triangles.len() == 2); - let rim = face.outline.as_ref().map(|outline| match (own, cell.page.first(), cell.page.get(2)) { + let rim = curved.as_deref().map(|outline| match (own, cell.page.first(), cell.page.get(2)) { (Some(&toward), Some(&a), Some(&b)) => { let side = side_of(a, b, toward); vectorcraft_pathops::boolean(outline, FillRule::NonZero, &side, FillRule::NonZero, vectorcraft_pathops::BoolOp::Intersect) @@ -769,21 +843,21 @@ pub(crate) fn surface_parts( /// The node of the part `path` (on the page, filled under `rule`) of `piece`, which `map` takes /// from the unrolled surface onto `face`. -fn surface_piece( +fn surface_piece( id: NodeId, piece: &Unrolled, (path, rule): (BezPath, FillRule), map: Affine, - face: &vectorcraft_three_d::Face, - shade: &dyn Fn(&vectorcraft_three_d::Face, vectorcraft_doc::color::Color) -> Paint, + face: &F, + shade: &dyn Fn(&F, vectorcraft_doc::color::Color) -> Paint, ) -> Node { let gradient_map = map * piece.place; // Under several lights a face's light varies across it in each channel: a solid color draws // as the face's own lit art in that color, clipped to the part. An opaque part also draws that // art clipped to a band of the seam stroke's width around its edges, as the other parts take // a stroke over their seams. - if let (Some(c), Some(light)) = (piece.paint.color().filter(|_| matches!(piece.paint, Paint::Solid { .. })), face.rgb_gradient) { - let lit = Arc::new(crate::lighting::rgb_gradient_art(id, &face.path(), &Paint::solid(c), light)); + if let (Some(c), Some(light)) = (piece.paint.color().filter(|_| matches!(piece.paint, Paint::Solid { .. })), face.rgb_light()) { + let lit = Arc::new(crate::lighting::rgb_gradient_art(id, &face.outline_path(), &Paint::solid(c), light)); let clipped = |area: &BezPath, rule: FillRule| { let mut clip = Node::path(id, PathData::from_bezpath(area), Appearance::default()); if let NodeKind::Path { rule: r, .. } = &mut clip.kind { @@ -816,7 +890,7 @@ fn surface_piece( match solid { Some(c) => f.paint = shade(face, c), None => { - vectorcraft_doc::recolor::map_paint(&mut f.paint, &|c| crate::lighting::shade(c, face.illumination)); + vectorcraft_doc::recolor::map_paint(&mut f.paint, &|c| crate::lighting::shade(c, face.light())); } } } @@ -931,17 +1005,82 @@ pub(super) fn art_bounds(doc: &Document, name: &str) -> Option { } /// Where a 3D object's graphics are drawn: the bounds its solids are built with (the graphics' -/// offsets are from their center) and the maps of its front and back faces, when it has them. -#[derive(Clone, Copy, Debug, PartialEq)] +/// offsets are from their center), the maps of its front and back faces, when it has them, and +/// for Inflate the pieces of its puffed faces the viewer sees. +#[derive(Clone, Debug, PartialEq)] pub struct GraphicFrame { pub bounds: Rect, front: Option, back: Option, + membrane: Option, +} + +/// The pieces of Inflate's front and puffed back that show their outside to the viewer, as the +/// graphics are drawn on them ([`surface_parts`]): each piece's face, its corners in the art's plane +/// (offsets from the center of the object's bounds) and on the page, and its depth (larger is +/// nearer). +#[derive(Clone, Debug, Default, PartialEq)] +pub struct MembraneFrame { + pieces: Vec, +} + +#[derive(Clone, Debug, PartialEq)] +struct MembranePiece { + face: PlanarFace, + uv: [Point; 3], + page: [Point; 3], + depth: f64, +} + +impl MembraneFrame { + /// The pieces of `facets` that carry where they lie in the art's plane and show the outside of + /// Inflate's front or back. + pub(super) fn of<'a>(facets: impl IntoIterator) -> Self { + let pieces = facets + .into_iter() + .filter_map(|f| { + let face = f.membrane?; + let cell = f.surface.as_ref().filter(|c| c.outward)?; + let uv = <[Point; 3]>::try_from(cell.uv.as_slice()).ok()?; + let page = <[Point; 3]>::try_from(cell.page.as_slice()).ok()?; + Some(MembranePiece { face, uv, page, depth: f.depth }) + }) + .collect(); + Self { pieces } + } + + /// Point `p` of `face` in the art's plane mapped onto the page, or with `from_page` a page point + /// mapped into the art's plane, through the nearest piece of that face that holds it. `None` + /// when no piece the viewer sees holds it. + fn map(&self, face: PlanarFace, p: Point, from_page: bool) -> Option { + let inside = |t: &[Point; 3], q: Point| { + let side = |a: Point, b: Point| (b - a).cross(q - a); + let s = [side(t[0], t[1]), side(t[1], t[2]), side(t[2], t[0])]; + s.iter().all(|v| *v >= -1e-9) || s.iter().all(|v| *v <= 1e-9) + }; + let mut best: Option<(Point, f64)> = None; + for piece in self.pieces.iter().filter(|piece| piece.face == face) { + let (from, to) = if from_page { (&piece.page, &piece.uv) } else { (&piece.uv, &piece.page) }; + if !inside(from, p) || best.is_some_and(|(_, depth)| depth >= piece.depth) { + continue; + } + if let Some(q) = triangle_map(from, to).map(|m| m * p).filter(|q| q.is_finite()) { + best = Some((q, piece.depth)); + } + } + best.map(|(q, _)| q) + } } impl GraphicFrame { pub(super) fn new(bounds: Rect, front: Option, back: Option) -> Self { - Self { bounds, front, back } + Self { bounds, front, back, membrane: None } + } + + /// The frame of an Inflate object built about `bounds`, whose graphics are drawn on the pieces + /// of `membrane`. + pub(super) fn inflated(bounds: Rect, membrane: MembraneFrame) -> Self { + Self { bounds, front: None, back: None, membrane: Some(membrane) } } pub fn map(&self, face: PlanarFace) -> Option<&FaceMap> { @@ -962,19 +1101,37 @@ impl GraphicFrame { } /// Where graphic `g`'s center lands on the page, and whether its face is turned toward the - /// viewer. `None` when the object has no such face or the point has no page point. + /// viewer. `None` when the object has no such face or the point has no page point. On Inflate + /// the center lands on the puffed face above it, and is `None` where the viewer does not see + /// that face. pub fn handle(&self, g: &MappedGraphic) -> Option<(Point, bool)> { + if let Some(membrane) = &self.membrane { + let uv = match g.face { + PlanarFace::Front => Point::new(g.x, g.y), + PlanarFace::Back => Point::new(-g.x, g.y), + }; + return Some((membrane.map(g.face, uv, false)?, true)); + } let map = self.map(g.face)?; Some((map.to_page(self.art_point(g.face, (g.x, g.y)))?, map.visible)) } - /// The offset of a graphic on `face` whose center lands on page point `page`. + /// The offset of a graphic on `face` whose center lands on page point `page`. On Inflate, only + /// a point on the part of the puffed face the viewer sees has one. pub fn offset_at(&self, face: PlanarFace, page: Point) -> Option<(f64, f64)> { - let art = self.map(face)?.to_art(page)?; - let c = self.bounds.center(); - let (x, y) = match face { - PlanarFace::Front => (art.x - c.x, art.y - c.y), - PlanarFace::Back => (c.x - art.x, art.y - c.y), + let (x, y) = if let Some(membrane) = &self.membrane { + let uv = membrane.map(face, page, true)?; + match face { + PlanarFace::Front => (uv.x, uv.y), + PlanarFace::Back => (-uv.x, uv.y), + } + } else { + let art = self.map(face)?.to_art(page)?; + let c = self.bounds.center(); + match face { + PlanarFace::Front => (art.x - c.x, art.y - c.y), + PlanarFace::Back => (c.x - art.x, art.y - c.y), + } }; (x.abs() <= MAX_OFFSET && y.abs() <= MAX_OFFSET).then_some((x, y)) } diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index 945eb639aa..27f41eb9a1 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -774,6 +774,8 @@ fn a_stroke_face_through_a_fill_wall_is_cut_where_their_depths_meet() { side: true, away: false, end: None, + surface: None, + membrane: None, plane: Some(DepthPlane { normal, offset, center: Point::ZERO, eye: None }), }; let wall = facet(0.0, [0.0, 0.0, 1.0], 0.0); diff --git a/crates/effects/src/solids/tests_graphics.rs b/crates/effects/src/solids/tests_graphics.rs index f0da6b992b..0729ddf2ba 100644 --- a/crates/effects/src/solids/tests_graphics.rs +++ b/crates/effects/src/solids/tests_graphics.rs @@ -504,7 +504,8 @@ fn graphics_are_checked() { assert!(check(EXTRUDE, bad.clone()).is_err(), "{bad}"); } assert!(check(ROTATE, json!([{"symbol": "Mark", "face": "back"}])).is_err()); - assert!(check(INFLATE, json!([{"symbol": "Mark"}])).is_err()); + // Inflate takes graphics on its front and its puffed back. + assert!(check(INFLATE, json!([{"symbol": "Mark"}, {"symbol": "Mark", "face": "back"}])).is_ok()); // Revolve takes graphics on its side, named the front; Revolve (Classic) takes none. assert!(validate_three_d_params(crate::REVOLVE, &json!({"graphics": [{"symbol": "Mark"}]})).is_ok()); assert!(validate_three_d_params(crate::REVOLVE, &json!({"graphics": [{"symbol": "Mark", "face": "back"}]})).is_err()); @@ -924,3 +925,85 @@ fn only_an_opaque_part_on_revolve_takes_a_seam_stroke() { // A pattern's tile may hold transparent art, which the overlap would show. assert!(!takes_seam(&piece(Paint::Pattern { pattern: "Dots".into(), xf: Affine::IDENTITY }, 1.0, BlendMode::Normal))); } + +/// The paths in `art` filled in a shade of red: the parts of the "Mark" graphic. +fn red_parts(art: &Node) -> Vec { + let mut out = vec![]; + art.walk(&mut |n| { + let Some(path) = n.path_data() else { return }; + let red = n.appearance.items.iter().any(|i| match i { + AppearanceItem::Fill(f) => f.paint.color().is_some_and(|c| c.to_rgb()[0] > 0.3 && c.to_rgb()[1] < 0.1 && c.to_rgb()[2] < 0.1), + AppearanceItem::Stroke(_) => false, + }); + if red { + out.push(path.clone()); + } + }); + out +} + +fn reach(parts: &[PathData]) -> Rect { + parts.iter().filter_map(PathData::bounds).reduce(|a, b| a.union(b)).unwrap() +} + +#[test] +fn an_inflate_graphic_lies_on_its_puffed_front_where_the_art_is() { + let d = document(); + let n = object(INFLATE, json!({"graphics": [{"symbol": "Mark", "x": 20.0, "y": -10.0, "scale": 200.0}]})); + let art = solid_art_in(Some(&d), &n).unwrap(); + // Straight on, the puff rises toward the viewer and the graphic is carried straight out onto it: + // a 20 × 20 square centered 20 right of and 10 above (50, 50). + let parts = red_parts(&art); + assert!(!parts.is_empty()); + assert!(close(reach(&parts), Rect::new(60.0, 30.0, 80.0, 50.0)), "{:?}", reach(&parts)); + // Turned, the graphic moves and foreshortens with the puff under it. + let n = object(INFLATE, json!({"rotationY": 40.0, "graphics": [{"symbol": "Mark", "scale": 200.0}]})); + let turned = reach(&red_parts(&solid_art_in(Some(&d), &n).unwrap())); + assert!(turned.width() < 20.0 - 0.5 && (turned.height() - 20.0).abs() < 2.0, "{turned:?}"); + // Without the document nothing is drawn. + assert!(red_parts(&solid_art_in(None, &n).unwrap()).is_empty()); +} + +#[test] +fn an_inflate_back_takes_its_graphic_with_both_sides_and_twist_carries_it() { + let d = document(); + let back = |extra: Value| { + let mut p = json!({"rotationY": 180.0, "graphics": [{"symbol": "Mark", "face": "back", "x": 20.0, "scale": 200.0}]}); + p.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone()); + red_parts(&solid_art_in(Some(&d), &object(INFLATE, p)).unwrap()) + }; + // Without Both sides the back is flat and open, with no puffed face to carry the graphic. + assert!(back(json!({})).is_empty()); + // Seen from behind, the back reads left to right: 20 to the right as seen from behind is 20 to + // the left of the art's center, which turned half a turn lies 20 right on the page. + let plain = back(json!({"bothSides": true})); + assert!(!plain.is_empty()); + let r = reach(&plain); + assert!((r.center().x - 70.0).abs() < 0.5 && (r.center().y - 50.0).abs() < 0.5 && (r.width() - 20.0).abs() < 0.5, "{r:?}"); + // Twist turns the back, and the graphic turns with it. + let twisted = reach(&back(json!({"bothSides": true, "twist": 45.0}))); + assert!(twisted.width() > r.width() + 3.0, "{twisted:?} {r:?}"); +} + +#[test] +fn an_inflate_frame_puts_the_handle_on_the_puff_and_reads_it_back() { + let d = document(); + let n = object(INFLATE, json!({"bothSides": true})); + let frame = graphic_frame(Some(&d), &n, None).unwrap(); + let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "x": 20.0, "y": -10.0})).unwrap(); + let (page, shown) = frame.handle(&g).unwrap(); + assert!(shown && (page.x - 70.0).abs() < 1e-6 && (page.y - 40.0).abs() < 1e-6, "{page:?}"); + let (x, y) = frame.offset_at(PlanarFace::Front, page).unwrap(); + assert!((x - 20.0).abs() < 1e-6 && (y + 10.0).abs() < 1e-6, "{x} {y}"); + // From the front the back is out of sight: it has no handle and no offset. + let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "back"})).unwrap(); + assert!(frame.handle(&g).is_none()); + assert!(frame.offset_at(PlanarFace::Back, Point::new(50.0, 50.0)).is_none()); + // Turned half a turn, the back's handle reads back its offset, as seen from behind. + let n = object(INFLATE, json!({"bothSides": true, "rotationY": 180.0})); + let frame = graphic_frame(Some(&d), &n, None).unwrap(); + let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "back", "x": 15.0, "y": 5.0})).unwrap(); + let (page, _) = frame.handle(&g).unwrap(); + let (x, y) = frame.offset_at(PlanarFace::Back, page).unwrap(); + assert!((x - 15.0).abs() < 1e-6 && (y - 5.0).abs() < 1e-6, "{x} {y}"); +} diff --git a/crates/engine/src/cmd/effectcmd/graphics.rs b/crates/engine/src/cmd/effectcmd/graphics.rs index e80c1b2d36..1c9d3e2afa 100644 --- a/crates/engine/src/cmd/effectcmd/graphics.rs +++ b/crates/engine/src/cmd/effectcmd/graphics.rs @@ -1,5 +1,6 @@ //! Window › 3D and Materials › Materials › Graphics: art kept as a document symbol (Add as Single -//! Graphic) and mapped onto 3D objects (Extrude & Bevel's caps, a plane, Revolve's side). The +//! Graphic) and mapped onto 3D objects (Extrude & Bevel's caps, a plane, Revolve's side, Inflate's +//! puffed front and back). The //! graphics an object shows are the `graphics` parameter of its 3D effect, which `effect.setParams` //! also edits. @@ -28,7 +29,7 @@ pub(super) fn specs() -> Vec { "Map Graphic", [], None, - "{symbol: name of a document symbol, face?: front|back (front; Plane has only a front; the back reads left to right as seen from behind; on Revolve the front is its swept side, which is the only face), x?: pt, y?: pt (0, 0: the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on Revolve from the middle of the side unrolled flat, x around the axis and y along the profile), scale?: % (1..10000; default 100, or less so the graphic fits inside the object, on Revolve inside the half of the side seen from the front), rotation?: degrees (-360..360, 0; counterclockwise), index?: int (the 3D effect's position; default: each object's first 3D effect, its own before its fills' and strokes'), item?: appearance item index|null (refused without index; as effect.setParams), ids?|id?} add a graphic to the 3D effect of each selected object, drawn on that face turned, foreshortened and shaded with it and clipped to it (on Revolve wrapped around the side, and drawn only where its outside faces the viewer); every object's 3D effect must be Extrude & Bevel (on a solid cap), Rotate (the Plane type) or Revolve; one undo step → {ids, graphic}", + "{symbol: name of a document symbol, face?: front|back (front; Plane has only a front; the back reads left to right as seen from behind; on Revolve the front is its swept side, which is the only face; on Inflate the back takes graphics only with Both sides and Cap on), x?: pt, y?: pt (0, 0: the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on Inflate in the art's plane, the graphic carried straight out onto the puffed face; on Revolve from the middle of the side unrolled flat, x around the axis and y along the profile), scale?: % (1..10000; default 100, or less so the graphic fits inside the object, on Revolve inside the half of the side seen from the front), rotation?: degrees (-360..360, 0; counterclockwise), index?: int (the 3D effect's position; default: each object's first 3D effect, its own before its fills' and strokes'), item?: appearance item index|null (refused without index; as effect.setParams), ids?|id?} add a graphic to the 3D effect of each selected object, drawn on that face turned, foreshortened and shaded with it and clipped to it (on Revolve wrapped around the side, and on Inflate following the puff, Twist and Taper carrying the back's, each drawn only where its outside faces the viewer); every object's 3D effect must be Extrude & Bevel (on a solid cap), Rotate (the Plane type), Revolve or Inflate; one undo step → {ids, graphic}", has_doc, map_graphic ), @@ -124,6 +125,13 @@ fn map_graphic(s: &mut Session, p: &Value) -> Result { if base.face == effects::PlanarFace::Back && extrude.is_some_and(|o| o.depth <= 0.0) { return Err(bad(C, format!("object {}: with a depth of 0 the object has one face: map its graphics onto the front", id.0))); } + // Inflate's back takes graphics where it puffs out: with Both sides and Cap on. + if base.face == effects::PlanarFace::Back && effect.id == effects::INFLATE { + let o = effects::inflate_options(&merged); + if !(o.both_sides && o.cap) { + return Err(bad(C, format!("object {}: Inflate's back takes graphics with Both sides and Cap on", id.0))); + } + } let mut graphic = base.clone(); if p.get("scale").is_none() && let (Some(frame), Some(art)) = (effects::graphic_frame_at(Some(d), n, item, index), effects::graphic_bounds(d, &graphic.symbol)) diff --git a/crates/engine/src/cmd/effectcmd/graphics_tests.rs b/crates/engine/src/cmd/effectcmd/graphics_tests.rs index a9d3a754ce..dcd4c1e99c 100644 --- a/crates/engine/src/cmd/effectcmd/graphics_tests.rs +++ b/crates/engine/src/cmd/effectcmd/graphics_tests.rs @@ -95,10 +95,10 @@ fn map_graphic_puts_a_graphic_on_the_side_of_a_revolve() { #[test] fn map_graphic_refuses_what_cannot_take_it_and_changes_nothing() { - let (mut s, id) = setup("threeD.inflate"); + let (mut s, id) = setup("threeD.classicExtrude"); let history = undo_len(&s); let e = s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "ids": [id.0]})).unwrap_err().to_string(); - assert!(e.contains("Plane, Extrude and Revolve"), "{e}"); + assert!(e.contains("Plane, Extrude, Revolve and Inflate"), "{e}"); let (mut s, id) = setup("threeD.rotate"); for (p, says) in [ (json!({"symbol": "Gone"}), "no symbol named"), @@ -147,11 +147,36 @@ fn set_params_edits_graphics_and_checks_them() { let null = json!({"ids": [id.0], "index": 0, "item": null, "params": {"graphics": null}}); assert!(s.execute("effect.setParams", &null).is_err()); assert_eq!(graphics(&s, id), moved); - // Extrude to Plane keeps the graphics; to Inflate drops them. + // Extrude to Plane keeps the graphics, and so does Inflate. s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "threeDType": "plane"})).unwrap(); assert_eq!(graphics(&s, id), moved); s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "threeDType": "inflate"})).unwrap(); - assert_eq!(graphics(&s, id), Value::Null); + assert_eq!(graphics(&s, id), moved); +} + +#[test] +fn map_graphic_puts_a_graphic_on_an_inflate_and_its_back_only_with_both_sides() { + let (mut s, id) = setup("threeD.inflate"); + let plain = { + let d = &s.doc().unwrap().doc; + vectorcraft_render::effects::solid_art_in(Some(d), d.node(id).unwrap()) + }; + let history = undo_len(&s); + s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "ids": [id.0]})).unwrap(); + assert_eq!(graphics(&s, id), json!([{"symbol": "Mark", "face": "front", "x": 0.0, "y": 0.0, "scale": 100.0, "rotation": 0.0}])); + assert_eq!(undo_len(&s), history + 1); + let d = &s.doc().unwrap().doc; + assert_ne!(vectorcraft_render::effects::solid_art_in(Some(d), d.node(id).unwrap()), plain, "the graphic is drawn"); + // The back is flat until Both sides puffs it. + let history = undo_len(&s); + let e = s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id.0]})).unwrap_err().to_string(); + assert!(e.contains("Both sides and Cap"), "{e}"); + assert_eq!(undo_len(&s), history); + s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "params": {"bothSides": true, "cap": false}})).unwrap(); + assert!(s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id.0]})).is_err()); + s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "params": {"cap": true}})).unwrap(); + s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id.0]})).unwrap(); + assert_eq!(graphics(&s, id)[1]["face"], "back"); } #[test] diff --git a/crates/three-d/src/solid.rs b/crates/three-d/src/solid.rs index 18ef7d6d1b..a66e72af1c 100644 --- a/crates/three-d/src/solid.rs +++ b/crates/three-d/src/solid.rs @@ -241,11 +241,15 @@ pub struct Inflate { pub taper: f64, /// A closed back (a solid) or none, so the inflated front is a shell open behind. pub cap: bool, + /// Graphics are mapped onto the front or the puffed back: the pieces of those faces are drawn + /// as triangles, each carrying where its corners lie in the art's plane ([`Facet::surface`]). + /// Off by default, which leaves the facets without one. + pub map_surface: bool, } impl Default for Inflate { fn default() -> Self { - Self { depth: 0.0, volume: 50.0, both_sides: false, twist: 0.0, taper: 1.0, cap: true } + Self { depth: 0.0, volume: 50.0, both_sides: false, twist: 0.0, taper: 1.0, cap: true, map_surface: false } } } @@ -296,6 +300,14 @@ pub struct Facet { /// The planar end of the solid the facet is: Extrude & Bevel's front or back cap, or a plane /// (its front). `None` for every other facet. pub end: Option, + /// For a piece of Inflate's front or puffed back built for graphics ([`Inflate::map_surface`]): + /// where its corners lie in the art's plane, as offsets from the center of the bounds the solid + /// was built with ([`crate::SurfaceCell`]). The back's corners are where they were in the art + /// before the twist and taper turned and scaled it. + pub surface: Option, + /// The face of Inflate's solid that a facet with a [`Facet::surface`] is a piece of: its front + /// or its puffed back. + pub membrane: Option, /// The face's plane in view space and the projection it was drawn with, for its depth at a /// point of the drawing ([`Facet::depth_at`]). `None` for a face whose corners lie more than /// 0.001 pt off one plane (a piece of a twisted wall) or reach the eye. @@ -384,6 +396,8 @@ impl Facet { // A revolved cap is not one of the planar faces graphics map onto. end: None, away: false, + surface: None, + membrane: None, plane: face.plane, #[cfg(test)] view: vec![], diff --git a/crates/three-d/src/solid/build.rs b/crates/three-d/src/solid/build.rs index d734161343..9cff25bab5 100644 --- a/crates/three-d/src/solid/build.rs +++ b/crates/three-d/src/solid/build.rs @@ -211,6 +211,8 @@ impl<'a> Builder<'a> { side: false, away: behind, end: None, + surface: None, + membrane: None, plane, #[cfg(test)] view, diff --git a/crates/three-d/src/solid/inflate.rs b/crates/three-d/src/solid/inflate.rs index 5edf57a894..5b3c883211 100644 --- a/crates/three-d/src/solid/inflate.rs +++ b/crates/three-d/src/solid/inflate.rs @@ -1,7 +1,7 @@ use super::build::{Builder, Built, Camera, Keep, Order, Turn, check_bounds, cuts, fit, newell, outward}; use super::membrane::{Edges, MAX_MATERIAL_SEGMENTS, Membrane, cell_triangles, clip, crossings, filled, material}; use super::rings::{MAX_SOLID_POINTS, TOO_COMPLEX_SURFACE, curve_pieces, signed_area, solid_rings}; -use super::{Facet, FillRule, Inflate, MAX_FACES, MAX_SOLID_FACES, PathData, Point, Rect, V3, Vec2, View}; +use super::{Facet, FillRule, Inflate, MAX_FACES, MAX_SOLID_FACES, PathData, PlanarFace, Point, Rect, V3, Vec2, View}; /// The slices the sides are cut into: more to follow a twist or taper. fn slices(o: &Inflate) -> usize { @@ -198,6 +198,22 @@ thread_local! { pub(super) static GRID_WORK: std::cell::Cell = const { std::cell::Cell::new(0) }; } +/// Marks the facet the builder `b` added after it held `before` facets, if it added one, as a piece +/// of `face` (Inflate's front or puffed back) whose corners lie at the art points `points`, as +/// offsets from `center` ([`Facet::surface`]). `outward` is the triangle's normal pointing out of +/// the solid: the piece shows the outside of the surface when it was neither turned around to show +/// its inside (on a shell open behind) nor kept turned away. +fn mark_surface(b: &mut Builder<'_>, before: usize, points: [Point; 3], center: Point, outward: V3, face: PlanarFace) { + if b.facets.len() <= before { + return; + } + let Some(f) = b.facets.last_mut() else { return }; + let Some(page) = f.contours.first().filter(|c| c.len() == 3).cloned() else { return }; + let shows = !f.away && f.normal[0] * outward.0 + f.normal[1] * outward.1 + f.normal[2] * outward.2 > 0.0; + f.surface = Some(crate::SurfaceCell { page, uv: points.iter().map(|q| Point::new(q.x - center.x, q.y - center.y)).collect(), outward: shows }); + f.membrane = Some(face); +} + /// The facets of one inflated shape, for a camera that allows for a puff `reach` high (or the /// shape's own, if higher): `reach` is the highest puff of the shapes drawn together. Its faces /// before projection instead, or both, as `keep` asks. @@ -241,6 +257,8 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee }; let smooth = view.shade && view.has_colored_lights(); let camera = Camera::new(view, bounds, o.depth + 2.0 * height.max(reach)); + // A graphic's offsets are from the center of the bounds the solid is built with. + let center = bounds.center(); // Without its back cap the object is a shell open behind, its inside showing. let mut b = Builder::new(&camera, o.cap, false, keep); let half = o.depth / 2.0; @@ -410,22 +428,47 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee out }) .collect(); - if height > 0.0 - && smooth + // Smooth shading draws the pieces as triangles, and so do graphics mapped onto + // the front or back: each triangle then carries where its corners lie in the + // art's plane. + let smoothed = height > 0.0 && smooth; + if (smoothed || o.map_surface) && let Some(triangles) = cell_triangles(&pieces) { + let order = if flat { Order::Last } else { Order::Depth }; for points in triangles { let front = points.map(|q| camera.place(q, half + lift(q))); - b.smooth_triangle(front, points.map(|q| camera.rotate(normal(q))), false)?; + let before = b.facets.len(); + let outward = newell(&[front.to_vec()]); + if smoothed { + b.smooth_triangle(front, points.map(|q| camera.rotate(normal(q))), false)?; + } else { + b.face(vec![front.to_vec()], outward, order)?; + } + if o.map_surface { + mark_surface(&mut b, before, points, center, outward, PlanarFace::Front); + } if o.both_sides && o.cap { let back = points.map(|q| camera.place(back_turn.apply(q), -half - lift(q) * back_turn.scale)); - let normals = points.map(|q| { - let n = normal(q); - // A uniform taper scales all three coordinates equally; - // twist turns the back normal about the shape's z-axis. - camera.rotate(V3(back_turn.cos * n.0 - back_turn.sin * n.1, back_turn.sin * n.0 + back_turn.cos * n.1, -n.2)) - }); - b.smooth_triangle(back, normals, true)?; + let before = b.facets.len(); + let n = newell(&[back.to_vec()]); + // The back winds the same way round as the front, so its outward + // normal is reversed. + let outward = V3(-n.0, -n.1, -n.2); + if smoothed { + let normals = points.map(|q| { + let n = normal(q); + // A uniform taper scales all three coordinates equally; + // twist turns the back normal about the shape's z-axis. + camera.rotate(V3(back_turn.cos * n.0 - back_turn.sin * n.1, back_turn.sin * n.0 + back_turn.cos * n.1, -n.2)) + }); + b.smooth_triangle(back, normals, true)?; + } else { + b.face(vec![back.to_vec()], outward, order)?; + } + if o.map_surface { + mark_surface(&mut b, before, points, center, outward, PlanarFace::Back); + } } } continue; diff --git a/crates/three-d/src/solid/tests.rs b/crates/three-d/src/solid/tests.rs index a75821e696..8dd1662e4d 100644 --- a/crates/three-d/src/solid/tests.rs +++ b/crates/three-d/src/solid/tests.rs @@ -423,6 +423,47 @@ fn inflate_leaves_holes_open() { assert!(close(area(&f), 100.0 * 100.0 - 40.0 * 40.0, 1e-3), "{}", area(&f)); } +#[test] +fn inflate_marks_where_each_piece_lies_in_the_art_for_graphics() { + let (p, r) = shape(&square(0.0, 0.0, 100.0)); + let on = |o: Inflate, view: View| inflate(&p, FillRule::EvenOdd, r, Inflate { map_surface: true, ..o }, view).unwrap(); + // Without the request no piece carries a surface point. + assert!(inflate(&p, FillRule::EvenOdd, r, Inflate::default(), front()).unwrap().iter().all(|f| f.surface.is_none() && f.membrane.is_none())); + // Straight on, every piece is a front triangle whose corners lie where the art does, as + // offsets from the center of the bounds, and together they cover the shape. + let f = on(Inflate::default(), front()); + let marked: Vec<&Facet> = f.iter().filter(|f| f.surface.is_some()).collect(); + assert!(marked.len() > 20, "{}", marked.len()); + assert!(close(marked.iter().map(|f| signed_area(&f.contours[0]).abs()).sum::(), 100.0 * 100.0, 1e-3)); + for f in &marked { + let s = f.surface.as_ref().unwrap(); + assert_eq!(f.membrane, Some(PlanarFace::Front)); + assert!(s.outward); + for (page, uv) in s.page.iter().zip(&s.uv) { + assert!(close(page.x, uv.x + 50.0, 1e-6) && close(page.y, uv.y + 50.0, 1e-6), "{page:?} {uv:?}"); + } + } + // Both sides puffs a back: seen from behind its pieces show their outside, and under Twist + // they keep the untwisted art points while the pieces turn on the page. + let behind = View { rotation_y: 180.0, ..front() }; + let back = |o: Inflate| { + on(o, behind) + .into_iter() + .filter(|f| f.membrane == Some(PlanarFace::Back) && f.surface.as_ref().is_some_and(|s| s.outward)) + .collect::>() + }; + let plain = back(Inflate { both_sides: true, ..Inflate::default() }); + assert!(!plain.is_empty()); + let twisted = back(Inflate { both_sides: true, twist: 30.0, ..Inflate::default() }); + assert!(!twisted.is_empty()); + let uv_extent = + |f: &[Facet]| f.iter().flat_map(|f| f.surface.as_ref().unwrap().uv.clone()).fold(Rect::new(0.0, 0.0, 0.0, 0.0), |r, q| r.union_pt(q)); + assert!(close(uv_extent(&twisted).width(), 100.0, 1e-6) && close(uv_extent(&twisted).height(), 100.0, 1e-6)); + assert!(extent(&twisted).width() > extent(&plain).width() + 10.0, "{:?} {:?}", extent(&twisted), extent(&plain)); + // Without Both sides there is no back to mark. + assert!(on(Inflate::default(), behind).iter().all(|f| f.membrane != Some(PlanarFace::Back))); +} + #[test] fn malformed_and_degenerate_input_is_bounded() { let (p, b) = shape(&square(0.0, 0.0, 100.0)); @@ -446,7 +487,7 @@ fn malformed_and_degenerate_input_is_bounded() { &p, FillRule::EvenOdd, b, - Inflate { depth: -5.0, volume: f64::NAN, both_sides: true, twist: f64::INFINITY, taper: f64::NAN, cap: true }, + Inflate { depth: -5.0, volume: f64::NAN, both_sides: true, twist: f64::INFINITY, taper: f64::NAN, cap: true, map_surface: false }, front() ) .is_ok() diff --git a/crates/ui-egui/src/dialogs/three_d_materials.rs b/crates/ui-egui/src/dialogs/three_d_materials.rs index 3091a00cac..e0af93a825 100644 --- a/crates/ui-egui/src/dialogs/three_d_materials.rs +++ b/crates/ui-egui/src/dialogs/three_d_materials.rs @@ -1,6 +1,6 @@ //! The 3D and Materials panel's Materials tab: the document's Graphics (its symbols) as thumbnails, -//! Add as Single Graphic, and the graphics mapped onto the selected 3D object (its planar faces, or -//! Revolve's side) with their face, position, size and turn. Picking a thumbnail maps that graphic +//! Add as Single Graphic, and the graphics mapped onto the selected 3D object (its planar faces, +//! Revolve's side, or Inflate's puffed faces) with their face, position, size and turn. Picking a thumbnail maps that graphic //! onto the selected objects (`threeD.mapGraphic`); art dropped on the thumbnails becomes a graphic //! (`threeD.addGraphic`). Editing a mapped graphic changes the effect's `graphics` parameter, which //! the panel sends as it sends every other setting. @@ -96,7 +96,7 @@ pub(crate) fn controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) } ui.add_space(10.0); if !takes { - dim_label(ui, tl!("Graphics map onto the Plane, Extrude and Revolve object types.")); + dim_label(ui, tl!("Graphics map onto the Plane, Extrude, Revolve and Inflate object types.")); return; } let raw = d.fields.get(GRAPHICS).cloned().unwrap_or(Value::Null); diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3ed3ca8331..a19eb6864f 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6229,7 +6229,7 @@ digits Malayalam Malaiàlam @msg `{GRAPHICS}` face must be front or back face de `{GRAPHICS}` ha de ser front o back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` ha de ser un nombre de {lo} a {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` ha de ser una matriu -@msg Graphics map onto the Plane, Extrude and Revolve object types Els gràfics s’apliquen als tipus d’objecte Pla, Extrusió i Revolució +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Els gràfics s’apliquen als tipus d’objecte Pla, Extrusió, Revolució i Infla @msg Revolve maps graphics onto its side: map them onto the front Revoluciona aplica els gràfics al seu lateral: aplica’ls a la cara davantera @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Els gràfics són massa complexos per a aquesta superfície: simplifica la il·lustració dels símbols o redueix Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admet com a màxim {MAX_GRAPHICS} gràfics diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 161e235c56..3e0962a519 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6045,7 +6045,7 @@ mark-style Japanese Japonské @msg `{GRAPHICS}` face must be front or back face v `{GRAPHICS}` musí být front nebo back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} v `{GRAPHICS}` musí být číslo od {lo} do {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` musí být pole -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafika se mapuje na typy objektu Rovina, Vysunutí a Rotační těleso +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafika se mapuje na typy objektu Rovina, Vysunutí, Rotační těleso a Nafouknutí @msg Revolve maps graphics onto its side: map them onto the front Rotační těleso mapuje grafiku na svůj bok: umístěte ji na přední stranu @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafika je pro tento povrch příliš složitá: zjednodušte kresbu symbolů nebo snižte Segmenty @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` přijímá nejvýše {MAX_GRAPHICS} grafik diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index fd0b7c042e..69a7f64c4e 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -318,7 +318,7 @@ @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}`: face skal være front eller back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`: {key} skal være et tal fra {lo} til {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` skal være et array -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafik kortlægges på objekttyperne Plan, Ekstrudér og Omdrej +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik kortlægges på objekttyperne Plan, Ekstrudér, Omdrej og Pust op @msg Revolve maps graphics onto its side: map them onto the front Omdrej kortlægger grafik på siden: kortlæg den på forsiden @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikken er for kompleks til denne overflade: forenkl symbolernes grafik, eller reducér Segmenter @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tager højst {MAX_GRAPHICS} grafikelementer diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 2a5f32a5d9..72ce446449 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5619,7 +5619,7 @@ lighting Light Licht @msg `{GRAPHICS}` face must be front or back face in `{GRAPHICS}` muss front oder back sein @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} in `{GRAPHICS}` muss eine Zahl von {lo} bis {hi} sein @msg `{GRAPHICS}` must be an array `{GRAPHICS}` muss ein Array sein -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafiken werden auf die Objekttypen Ebene, Extrudieren und Kreiseln abgebildet +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiken werden auf die Objekttypen Ebene, Extrudieren, Kreiseln und Aufblasen abgebildet @msg Revolve maps graphics onto its side: map them onto the front Kreiseln bildet Grafiken auf seiner Mantelfläche ab: Bilden Sie sie auf der Vorderseite ab @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Die Grafiken sind für diese Oberfläche zu komplex: Vereinfachen Sie das Bildmaterial der Symbole oder verringern Sie Segmente @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nimmt höchstens {MAX_GRAPHICS} Grafiken auf diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b1b7b4d039..d1e476d8cf 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5406,7 +5406,7 @@ digits Malayalam Μαλαγιάλαμ @msg `{GRAPHICS}` face must be front or back το face του `{GRAPHICS}` πρέπει να είναι front ή back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} το {key} του `{GRAPHICS}` πρέπει να είναι αριθμός από {lo} έως {hi} @msg `{GRAPHICS}` must be an array το `{GRAPHICS}` πρέπει να είναι πίνακας -@msg Graphics map onto the Plane, Extrude and Revolve object types Τα γραφικά αντιστοιχίζονται στους τύπους αντικειμένου Επίπεδο, Εξώθηση και Περιστροφή γύρω από άξονα +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Τα γραφικά αντιστοιχίζονται στους τύπους αντικειμένου Επίπεδο, Εξώθηση, Περιστροφή γύρω από άξονα και Φούσκωμα @msg Revolve maps graphics onto its side: map them onto the front Η Περιστροφή γύρω από άξονα αντιστοιχίζει τα γραφικά στην πλευρική της επιφάνεια: αντιστοιχίστε τα στην μπροστινή όψη @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Τα γραφικά είναι πολύ σύνθετα για αυτή την επιφάνεια: απλοποιήστε το σχέδιο των συμβόλων ή μειώστε τα Τμήματα @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics το `{GRAPHICS}` δέχεται το πολύ {MAX_GRAPHICS} γραφικά diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 5b3c675f7b..b85486760c 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5988,8 +5988,8 @@ mark-style Japanese Japonesas @msg `{GRAPHICS}` face must be front or back face de `{GRAPHICS}` debe ser front o back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` debe ser un número de {lo} a {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` debe ser una matriz -@msg Graphics map onto the Plane, Extrude and Revolve object types Los gráficos se asignan a los tipos de objeto Plano, Extrusión y Revolución - Graphics map onto the Plane, Extrude and Revolve object types. Los gráficos se asignan a los tipos de objeto Plano, Extrusión y Revolución. +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar + Graphics map onto the Plane, Extrude, Revolve and Inflate object types. Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar. @msg Revolve maps graphics onto its side: map them onto the front Revolución asigna los gráficos a su lateral: asígnelos a la cara frontal @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Los gráficos son demasiado complejos para esta superficie: simplifique la ilustración de los símbolos o reduzca Segmentos @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admite como máximo {MAX_GRAPHICS} gráficos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index e77a617c52..a512131070 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5928,7 +5928,7 @@ mark-style Japanese Japanilainen @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}`-kohteen face-arvon on oltava front tai back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`-kohteen {key}-arvon on oltava luku, joka on vähintään {lo} ja enintään {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` on oltava taulukko -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafiikat sijoitetaan objektityypeille Taso, Pursota ja Pyöräytä +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiikat sijoitetaan objektityypeille Taso, Pursota, Pyöräytä ja Täytä ilmalla @msg Revolve maps graphics onto its side: map them onto the front Pyöräytä sijoittaa grafiikat kylkeensä: sijoita ne etupuolelle @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiikat ovat liian monimutkaisia tälle pinnalle: yksinkertaista symbolien kuvitusta tai pienennä Segmentit-arvoa @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` hyväksyy enintään {MAX_GRAPHICS} grafiikkaa diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 2762d2a954..a91bacd012 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5613,7 +5613,7 @@ lighting Light Lumière @msg `{GRAPHICS}` face must be front or back face de `{GRAPHICS}` doit valoir front ou back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` doit être un nombre de {lo} à {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` doit être un tableau -@msg Graphics map onto the Plane, Extrude and Revolve object types Les graphiques s'appliquent aux types d'objet Plan, Extrusion et Révolution +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Les graphiques s'appliquent aux types d'objet Plan, Extrusion, Révolution et Gonfler @msg Revolve maps graphics onto its side: map them onto the front Révolution applique les graphiques sur sa face latérale : appliquez-les sur la face avant @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Les graphiques sont trop complexes pour cette surface : simplifiez l'illustration des symboles ou réduisez Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accepte au plus {MAX_GRAPHICS} graphiques diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 1c96900b2b..aebe0dc3af 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4619,7 +4619,7 @@ antiAlias Sharp શાર્પ Align On: આના પર સંરેખિત કરો: Delete Tab ટૅબ કાઢી નાખો Face સપાટી - Graphics map onto the Plane, Extrude and Revolve object types. ગ્રાફિક્સને Plane, Extrude અને Revolve પ્રકારના ઑબ્જેક્ટ્સ પર મેપ કરી શકાય છે. + Graphics map onto the Plane, Extrude, Revolve and Inflate object types. ગ્રાફિક્સને Plane, Extrude, Revolve અને Inflate પ્રકારના ઑબ્જેક્ટ્સ પર મેપ કરી શકાય છે. Justify with last line aligned center છેલ્લી લાઇન મધ્યમાં રાખીને જસ્ટિફાઇ કરો Justify with last line aligned right છેલ્લી લાઇન જમણે રાખીને જસ્ટિફાઇ કરો Leader: લીડર: diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 548f961f51..fd22ef72f2 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8059,7 +8059,7 @@ antiAlias Sharp शार्प @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}` का face, front या back होना चाहिए @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` का {key}, {lo} से {hi} तक की संख्या होना चाहिए @msg `{GRAPHICS}` must be an array `{GRAPHICS}` एक ऐरे होना चाहिए -@msg Graphics map onto the Plane, Extrude and Revolve object types ग्राफ़िक्स समतल, एक्सट्रूड और रिवॉल्व ऑब्जेक्ट प्रकारों पर लगते हैं +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types ग्राफ़िक्स समतल, एक्सट्रूड, रिवॉल्व और फुलाएँ ऑब्जेक्ट प्रकारों पर लगते हैं @msg Revolve maps graphics onto its side: map them onto the front रिवॉल्व ग्राफ़िक्स को अपनी बगल वाली सतह पर लगाता है: उन्हें सामने वाले फ़ेस पर लगाएँ @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments ग्राफ़िक्स इस सतह के लिए बहुत जटिल हैं: सिंबल्स के आर्ट को सरल बनाएँ या सेगमेंट कम करें @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` अधिकतम {MAX_GRAPHICS} ग्राफ़िक्स लेता है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 200b45d1b1..2cb919f15b 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6028,7 +6028,7 @@ imageTrace Outline Körvonal @msg `{GRAPHICS}` face must be front or back a `{GRAPHICS}` face értéke front vagy back lehet @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} a `{GRAPHICS}` {key} értéke {lo} és {hi} közötti szám lehet @msg `{GRAPHICS}` must be an array a `{GRAPHICS}` értéke tömb kell legyen -@msg Graphics map onto the Plane, Extrude and Revolve object types A grafikák a Sík, a Kihúzás és a Forgatás tengely körül objektumtípusra kerülnek +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types A grafikák a Sík, a Kihúzás, a Forgatás tengely körül és a Felfújás objektumtípusra kerülnek @msg Revolve maps graphics onto its side: map them onto the front A Forgatás tengely körül a grafikákat a palástjára helyezi: az elülső oldalra helyezze őket @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments A grafikák túl összetettek ehhez a felülethez: egyszerűsítse a szimbólumok rajzát, vagy csökkentse a Szakaszok értékét @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics a `{GRAPHICS}` legfeljebb {MAX_GRAPHICS} grafikát fogad diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 90ec79404c..a6753f670d 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5661,7 +5661,7 @@ lighting Light Luce @msg `{GRAPHICS}` face must be front or back face di `{GRAPHICS}` deve essere front o back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} di `{GRAPHICS}` deve essere un numero da {lo} a {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve essere un array -@msg Graphics map onto the Plane, Extrude and Revolve object types Le grafiche si applicano ai tipi di oggetto Piano, Estrusione e Rivoluzione +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Le grafiche si applicano ai tipi di oggetto Piano, Estrusione, Rivoluzione e Gonfia @msg Revolve maps graphics onto its side: map them onto the front Rivoluzione applica le grafiche sul suo lato: applicatele sulla faccia anteriore @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Le grafiche sono troppo complesse per questa superficie: semplificate il disegno dei simboli o riducete Segmenti @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accetta al massimo {MAX_GRAPHICS} grafiche diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d98acfa22d..c6b574b9db 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5703,8 +5703,8 @@ lighting Light ライト @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}` の face には front または back を指定してください @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` の {key} は {lo} から {hi} までの数値にしてください @msg `{GRAPHICS}` must be an array `{GRAPHICS}` は配列にしてください -@msg Graphics map onto the Plane, Extrude and Revolve object types グラフィックはオブジェクトの種類が平面、押し出し、回転体のときにマッピングされます - Graphics map onto the Plane, Extrude and Revolve object types. グラフィックはオブジェクトの種類が平面、押し出し、回転体のときにマッピングされます。 +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます + Graphics map onto the Plane, Extrude, Revolve and Inflate object types. グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます。 @msg Revolve maps graphics onto its side: map them onto the front 回転体はグラフィックを側面にマッピングします。前面にマッピングしてください @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments グラフィックがこのサーフェスには複雑すぎます。シンボルのアートを単純化するか、分割数を減らしてください @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` に指定できるグラフィックは {MAX_GRAPHICS} 個までです diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 794e5454a9..b2d8e56f4d 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -5326,7 +5326,7 @@ font-technology Variable ცვლადი @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}`-ის face უნდა იყოს front ან back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`-ის {key} უნდა იყოს რიცხვი {lo}-დან {hi}-მდე @msg `{GRAPHICS}` must be an array `{GRAPHICS}` უნდა იყოს მასივი -@msg Graphics map onto the Plane, Extrude and Revolve object types გრაფიკა თავსდება ობიექტის ტიპებზე „სიბრტყე“, „ამოწევა“ და „ბრუნვა“ +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types გრაფიკა თავსდება ობიექტის ტიპებზე „სიბრტყე“, „ამოწევა“, „ბრუნვა“ და „გაბერვა“ @msg Revolve maps graphics onto its side: map them onto the front ბრუნვა გრაფიკას თავის გვერდით ზედაპირზე ათავსებს: განათავსეთ ისინი წინა მხარეზე @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments გრაფიკა ზედმეტად რთულია ამ ზედაპირისთვის: გაამარტივეთ სიმბოლოების ნახატი ან შეამცირეთ სეგმენტები @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` იღებს მაქსიმუმ {MAX_GRAPHICS} გრაფიკას diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index bb8676df71..5f907c5480 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5622,7 +5622,7 @@ lighting Light 광원 @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}`의 face는 front 또는 back이어야 합니다 @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`의 {key}은(는) {lo}에서 {hi} 사이의 숫자여야 합니다 @msg `{GRAPHICS}` must be an array `{GRAPHICS}`은(는) 배열이어야 합니다 -@msg Graphics map onto the Plane, Extrude and Revolve object types 그래픽은 평면, 돌출, 회전체 개체 유형에 매핑됩니다 +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 그래픽은 평면, 돌출, 회전체, 부풀리기 개체 유형에 매핑됩니다 @msg Revolve maps graphics onto its side: map them onto the front 회전체는 그래픽을 옆면에 매핑합니다. 앞면에 매핑하십시오 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 그래픽이 이 표면에 비해 너무 복잡합니다. 심볼의 아트를 단순화하거나 세그먼트를 줄이십시오 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}`에는 그래픽을 최대 {MAX_GRAPHICS}개까지 넣을 수 있습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index a597a03fd0..37b0232c9a 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -7805,7 +7805,7 @@ mark-style Japanese Japans @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} in `{GRAPHICS}` moet een getal van {lo} tot {hi} zijn @msg `{GRAPHICS}` must be an array `{GRAPHICS}` moet een array zijn @msg Graphics map onto planar faces: use the Extrude or Plane object type Illustraties worden op platte vlakken geplaatst: gebruik het objecttype Extruderen of Vlak -@msg Graphics map onto the Plane, Extrude and Revolve object types Illustraties worden op de objecttypen Vlak, Extruderen en Draaien geplaatst +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Illustraties worden op de objecttypen Vlak, Extruderen, Draaien en Opblazen geplaatst @msg Revolve maps graphics onto its side: map them onto the front Draaien plaatst illustraties op de zijkant: plaats ze op de voorkant @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments De illustraties zijn te complex voor dit oppervlak: vereenvoudig de illustraties van de symbolen of verlaag Segmenten @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` neemt maximaal {MAX_GRAPHICS} illustraties op diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 99ee2080b8..b04f60ab7e 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5876,7 +5876,7 @@ mark-style Japanese Japońskie @msg `{GRAPHICS}` face must be front or back face w `{GRAPHICS}` musi mieć wartość front lub back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} w `{GRAPHICS}` musi być liczbą od {lo} do {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` musi być tablicą -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafiki są nakładane na obiekty typu Płaszczyzna, Wyciągnięcie i Obrót +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiki są nakładane na obiekty typu Płaszczyzna, Wyciągnięcie, Obrót i Nadmuchanie @msg Revolve maps graphics onto its side: map them onto the front Obrót nakłada grafiki na swoją powierzchnię boczną: umieść je na przedniej stronie @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiki są zbyt złożone dla tej powierzchni: uprość rysunki symboli lub zmniejsz Segmenty @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` przyjmuje najwyżej {MAX_GRAPHICS} grafik diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 677c8e460f..d86a571004 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5994,7 +5994,7 @@ mark-style Japanese Japonesas @msg `{GRAPHICS}` face must be front or back face de `{GRAPHICS}` deve ser front ou back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` deve ser um número de {lo} a {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve ser uma matriz -@msg Graphics map onto the Plane, Extrude and Revolve object types Os gráficos são mapeados nos tipos de objeto Plano, Extrusão e Revolver +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Os gráficos são mapeados nos tipos de objeto Plano, Extrusão, Revolver e Inflar @msg Revolve maps graphics onto its side: map them onto the front Revolver mapeia os gráficos na sua lateral: mapeie-os na face frontal @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Os gráficos são complexos demais para esta superfície: simplifique a arte dos símbolos ou reduza Segmentos @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` aceita no máximo {MAX_GRAPHICS} gráficos diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 106343cddd..6533a1dfd4 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5648,7 +5648,7 @@ lighting Light Свет @msg `{GRAPHICS}` face must be front or back face в `{GRAPHICS}` должен быть front или back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} в `{GRAPHICS}` должен быть числом от {lo} до {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` должен быть массивом -@msg Graphics map onto the Plane, Extrude and Revolve object types Графика наносится на объекты типов «Плоскость», «Выдавливание» и «Вращение» +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графика наносится на объекты типов «Плоскость», «Выдавливание», «Вращение» и «Надувание» @msg Revolve maps graphics onto its side: map them onto the front «Вращение» наносит графику на свою боковую поверхность: размещайте её на передней стороне @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графика слишком сложна для этой поверхности: упростите иллюстрации символов или уменьшите «Сегменты» @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` принимает не более {MAX_GRAPHICS} графических элементов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index cc854aa362..2f61b31373 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5512,7 +5512,7 @@ lighting Light Ljus @msg `{GRAPHICS}` face must be front or back face i `{GRAPHICS}` måste vara front eller back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} i `{GRAPHICS}` måste vara ett tal från {lo} till {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` måste vara en matris -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafik placeras på objekttyperna Plan, Extrudera och Rotera runt axel +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp @msg Revolve maps graphics onto its side: map them onto the front Rotera runt axel placerar grafik på sin mantelyta: placera den på framsidan @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiken är för komplex för den här ytan: förenkla symbolernas teckning eller minska Segment @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tar högst {MAX_GRAPHICS} grafiker diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index f2888a30f0..583ac05f33 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5375,7 +5375,7 @@ lighting Light Işık @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}` face değeri front veya back olmalıdır @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` {key} değeri {lo} ile {hi} arasında bir sayı olmalıdır @msg `{GRAPHICS}` must be an array `{GRAPHICS}` bir dizi olmalıdır -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafikler Düzlem, Ekstrüzyon ve Döndür nesne türlerine eşlenir +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafikler Düzlem, Ekstrüzyon, Döndür ve Şişir nesne türlerine eşlenir @msg Revolve maps graphics onto its side: map them onto the front Döndür grafikleri yan yüzeyine eşler: onları ön yüze eşle @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikler bu yüzey için çok karmaşık: sembollerin resmini basitleştir veya Segmentler değerini azalt @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` en fazla {MAX_GRAPHICS} grafik alır diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 411b2c3baf..405fd9814f 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5641,7 +5641,7 @@ lighting Light Світло @msg `{GRAPHICS}` face must be front or back face у `{GRAPHICS}` має бути front або back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} у `{GRAPHICS}` має бути числом від {lo} до {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` має бути масивом -@msg Graphics map onto the Plane, Extrude and Revolve object types Графіка наноситься на об’єкти типів «Площина», «Видавлювання» та «Обертання» +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графіка наноситься на об’єкти типів «Площина», «Видавлювання», «Обертання» та «Надування» @msg Revolve maps graphics onto its side: map them onto the front «Обертання» наносить графіку на свою бічну поверхню: розміщуйте її на передній стороні @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графіка надто складна для цієї поверхні: спростіть ілюстрації символів або зменште «Сегменти» @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` приймає не більше {MAX_GRAPHICS} графічних елементів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 1460910197..6dfc1e65f9 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5429,7 +5429,7 @@ theme Appearance Giao diện @msg `{GRAPHICS}` face must be front or back face của `{GRAPHICS}` phải là front hoặc back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} của `{GRAPHICS}` phải là số từ {lo} đến {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` phải là một mảng -@msg Graphics map onto the Plane, Extrude and Revolve object types Đồ họa được đặt lên các loại đối tượng Mặt phẳng, Kéo dài và Xoay tròn +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Đồ họa được đặt lên các loại đối tượng Mặt phẳng, Kéo dài, Xoay tròn và Phình @msg Revolve maps graphics onto its side: map them onto the front Xoay tròn đặt đồ họa lên mặt bên của nó: hãy đặt chúng lên mặt trước @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Đồ họa quá phức tạp cho bề mặt này: hãy đơn giản hóa hình vẽ của các ký hiệu hoặc giảm Đoạn @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nhận tối đa {MAX_GRAPHICS} đồ họa diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 3fe2f9e009..2033b20112 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -5915,8 +5915,8 @@ lighting Light 光源 @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}` 的 face 必须是 front 或 back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` 的 {key} 必须是 {lo} 到 {hi} 之间的数字 @msg `{GRAPHICS}` must be an array `{GRAPHICS}` 必须是数组 -@msg Graphics map onto the Plane, Extrude and Revolve object types 图形映射到平面、突出和回转对象类型上 - Graphics map onto the Plane, Extrude and Revolve object types. 图形映射到平面、突出和回转对象类型上。 +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 图形映射到平面、突出、回转和膨胀对象类型上 + Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 图形映射到平面、突出、回转和膨胀对象类型上。 @msg Revolve maps graphics onto its side: map them onto the front 回转将图形映射到其侧面:请将图形映射到正面 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 图形对此表面过于复杂:请简化符号的图稿或减少分段数 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 个图形 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index ab7f9d9dd2..29ada7e4a4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -5750,8 +5750,8 @@ lighting Light 光源 @msg `{GRAPHICS}` face must be front or back `{GRAPHICS}` 的 face 必須是 front 或 back @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` 的 {key} 必須是介於 {lo} 到 {hi} 之間的數字 @msg `{GRAPHICS}` must be an array `{GRAPHICS}` 必須是陣列 -@msg Graphics map onto the Plane, Extrude and Revolve object types 圖形會對應到「平面」、「突出」與「迴轉」物件類型 - Graphics map onto the Plane, Extrude and Revolve object types. 圖形會對應到「平面」、「突出」與「迴轉」物件類型。 +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型 + Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型。 @msg Revolve maps graphics onto its side: map them onto the front 迴轉會將圖形對應到其側面:請將圖形對應到正面 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 圖形對此表面過於複雜:請簡化符號的圖稿或減少分段數 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 個圖形 diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index 72ce8004b5..a76c6ce05c 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -438,12 +438,16 @@ fn the_materials_tab_lists_the_graphics_and_maps_one_in_one_undo_step() { let nodes = controls(&mut app, &ctx); named(&nodes, "Remove Graphic"); named(&nodes, "Scale"); - // Inflate takes no graphics. + // Inflate keeps the graphic and lists it with its face and settings. set_type(&mut app, "inflate").unwrap(); + assert_eq!(graphics(&app).as_array().map(Vec::len), Some(1)); + let nodes = controls(&mut app, &ctx); + named(&nodes, "Remove Graphic"); + named(&nodes, "Scale"); let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(&mut app, ui)); out.textures_delta.clear(); let text = crate::tests_labels::shapes_text(&out); - assert!(text.contains("Graphics map onto the Plane, Extrude and Revolve object types"), "{text}"); + assert!(text.contains("Face") && !text.contains("Graphics map onto"), "{text}"); } #[test] diff --git a/docs/effects-parity.md b/docs/effects-parity.md index 342a5171b6..219e5b9621 100644 --- a/docs/effects-parity.md +++ b/docs/effects-parity.md @@ -180,7 +180,7 @@ VectorCraft choices; an original approximation, never compared with another appl |---|---| | Revolve | initial: live, editable profile, rotation and light gizmos, default-on Cap with continuous curved rims, 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)) | -| 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, 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; hard-edged shadows behind or below the object from the first light ([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, soft shadows or ray tracing | +| 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, 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; hard-edged shadows behind or below the object from the first light ([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, wrapped around Revolve's side, and carried onto Inflate's puffed front and back ([three-d.md](three-d.md#graphics)); no base materials, graphics on Extrude & Bevel's walls and bevels, soft shadows 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 or no Shading Color, 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)); Map Art: none | | Turntable (30.0 beta) | none | | Export 3D objects (OBJ, USDA, glTF) | initial: Asset Export's Export 3D Object collects an object with Extrude & Bevel, Revolve, Inflate or Rotate as a 3D asset, and Export writes its solids as a USDA (the default), USDZ, glTF or OBJ mesh with a material in each solid's paint color (`assets.add3D`, `assets.set3DFormat`, `assets.export3D`); no textures, map art or shading ([3D export help](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/export-3d-vector-artwork.html)) | diff --git a/docs/mcp.md b/docs/mcp.md index 8ca4121032..12b57030b1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -4114,15 +4114,17 @@ offset in points of the graphic's center from the center of the object's bounds percentage of the symbol's size (1..10000; omitted, 100 or less so the graphic fits inside the object) and `rotation` is in degrees counterclockwise (-360..360). Without `index` each object's first 3D effect takes it, and `item` is refused. Every object's 3D effect must be Extrude & Bevel with Cap on (front only at a depth of 0), Rotate (the Plane type, -front only) or Revolve (front only: its swept side), and `symbol` must name a document symbol; otherwise the command is refused and nothing changes. It returns `{ids, graphic}`. +front only), Revolve (front only: its swept side) or Inflate (back only with Both sides and Cap on), and `symbol` must name a document symbol; otherwise the command is refused and nothing changes. It returns `{ids, graphic}`. On Revolve, `x` and `y` are measured on the side unrolled flat from its middle, and a graphic that does not fit starts scaled to fit the half of the side seen from the front ([three-d.md](three-d.md#graphics)). +On Inflate, `x` and `y` are measured in the art's plane, and the graphic is carried straight out onto the puffed +face, Twist and Taper turning and shrinking the back's with it. -The graphics are the `graphics` parameter of `threeD.extrude`, `threeD.rotate` and `threeD.revolve`, which `effect.setParams` also +The graphics are the `graphics` parameter of `threeD.extrude`, `threeD.rotate`, `threeD.revolve` and `threeD.inflate`, which `effect.setParams` also edits: an array of up to 64 `{symbol, face, x, y, scale, rotation}` objects, drawn on the face turned, foreshortened and shaded with it and clipped to it ([Map artworks on 3D object](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/map-artwork-on-3d-objects.html)). Revolve takes graphics on its swept side and shades them with the object's light ([the archived reference, page 185](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=185)); -how a graphic wraps around the side is VectorCraft's own rule. +how a graphic wraps around the side, and how one follows Inflate's puff, are VectorCraft's own rules. A graphic naming a symbol the document does not have is refused, unless the effect already holds a graphic of it. The drawing rules are VectorCraft's own; see [three-d.md](three-d.md#graphics). diff --git a/docs/three-d.md b/docs/three-d.md index f12ca4675c..acfa006845 100644 --- a/docs/three-d.md +++ b/docs/three-d.md @@ -364,8 +364,8 @@ The public [Map artworks on 3D object](https://helpx.adobe.com/illustrator/deskt page describes graphics: art kept with the document and placed on single surfaces of a 3D object, and the [3D and Materials panel options](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/3d-materials-panel-options.html) page lists Graphics and Add Materials and Graphics on the Materials tab. VectorCraft maps graphics onto -Extrude & Bevel's front and back caps, the plane of the Plane type (Rotate), and the swept side of Revolve, which the -public page's example of a label on a bottle describes. +Extrude & Bevel's front and back caps, the plane of the Plane type (Rotate), the swept side of Revolve, which the +public page's example of a label on a bottle describes, and Inflate's puffed front and back. - The panel's **Materials** tab shows the document's graphics as thumbnails. A graphic is a document symbol, as the public page allows existing symbols to be used. **Add as Single Graphic** keeps the selected art as a new @@ -374,7 +374,7 @@ public page's example of a label on a bottle describes. - Clicking a thumbnail maps that graphic onto the front of the 3D effect of each selected object (`threeD.mapGraphic`), in one undo step. A graphic larger than the object starts scaled down to fit inside it. - Below the thumbnails the tab lists the graphics mapped onto the first selected object. The selected one shows - its Face (Front or Back; Plane and Revolve show no Face, as a plane has only a front and Revolve's graphics go + its Face (Front or Back, on Inflate its puffed front or back; Plane and Revolve show no Face, as a plane has only a front and Revolve's graphics go on its side), X and Y (the offset of its center from the center of the object's bounds, in the face's plane), Scale (a percentage of the symbol's size) and Rotation (counterclockwise), and **Remove Graphic** takes it off. Each change is one undo step. @@ -397,6 +397,17 @@ These rules are VectorCraft's own: their own. A graphic on a face turned away from the viewer is not drawn. - On the back cap, X runs to the right as the back is seen from behind, so the graphic reads the right way round there. +- On Inflate a graphic is placed in the art's plane, X and Y measured from the center of the object's bounds as on + a cap, and carried straight out onto the puffed face above each point, so it follows the puff. The back takes + graphics only with Both sides and Cap on (`threeD.mapGraphic` refuses one otherwise, and one already there is + not drawn); it reads the right way round from behind, and Twist and Taper turn and shrink its graphics with it. + The membrane is cut into triangles, and each one draws the part of the graphic that falls on it, shaded as + that triangle is shaded and drawn only where the surface's outside faces the viewer; nearer triangles drawn + after it cover it. A cell of the membrane that cannot be cut into triangles takes no graphic. Every solid of + the object (a fill's, and a stroke's outline) carries the graphics. The handle sits on the point of the puffed + face above the graphic's center, and only where the viewer sees that face. The cutting into straight pieces, + the seam strokes and the limits below are those of Revolve; when the triangles take more faces than a 3D + effect draws, the object draws without its graphics and commands refuse them. - On Revolve a graphic lies on the swept side, which has one face (Front), unrolled flat. X runs around the axis: the angle from the middle of the side times the profile's distance from the axis at that point, so a graphic keeps its size at every distance and wraps farther around the axis where the profile comes nearer to it. Y runs @@ -431,9 +442,9 @@ These rules are VectorCraft's own: past either limit. A loaded file draws the object without a graphic past the first limit, and without all of its graphics past the second. - A hollow Extrude & Bevel has no caps, so its graphics are not drawn until Cap is turned on again, and - `threeD.mapGraphic` refuses to map a new one onto it. Changing the type to Inflate drops the graphics, and - changing between Extrude, Plane and Revolve keeps them, except that Plane and Revolve drop the graphics on the - back cap; on Revolve the front's graphics go on its side. + `threeD.mapGraphic` refuses to map a new one onto it. Changing between Extrude, Plane, Revolve and Inflate keeps + the graphics, except that Plane and Revolve drop the graphics on the back cap; on Revolve the front's graphics go + on its side, and on Inflate they go on the puffed faces. - `effect.apply` and `effect.setParams` refuse a graphic that names a symbol the document does not have, unless the effect already holds a graphic of that symbol. A graphic whose symbol is deleted is no longer drawn. Renaming a symbol renames it in the graphics that use it, in the layers, in the art of symbols, patterns, graph designs, brushes and opacity masks, and in graphic @@ -447,7 +458,7 @@ These rules are VectorCraft's own: uses: `rotationX`, `rotationY`, `rotationZ`, `perspectiveAngle` (degrees), `shade`, `lightColor` (`#rrggbb`, default `#ffffff`), `lightIntensity` (%), `lightRotation`, `lightHeight` (degrees), `lightSoftness` (%), `ambient` (%, to 200), `lightBehind`. Lengths are points and scale with the object (Scale Strokes & Effects). Commands validate the shape and the parameters before the document changes. All four also take `lights`: null (the default, use the earlier single-light fields), or an array of one to ten objects. Each object takes `color` (opaque `#rrggbb`, white), `intensity` (0..100%, 80), `rotation` (-180..180 degrees, 125.26), `height` (0..90 degrees, 30), `softness` (0..100%, 0), and `behind` (boolean, false). Omitted settings use those defaults. An explicit list replaces the earlier single light; `ambient` and `shade` remain shared. Set `lights` to null to return to the single-light fields. Invalid lists, counts, keys and values are rejected before editing; malformed loaded lists fall back to the earlier light safely. All four take `shadow` (boolean, false), `shadowPosition` (`behind` or `below`), `shadowDistance` (0..100%, 0) and `shadowBounds` (10..400%, 100) ([Shadows](#shadows)); values out of range are rejected before editing. -`threeD.extrude`, `threeD.rotate` and `threeD.revolve` take `graphics` ([Graphics](#graphics)): an array of up to 64 objects, each +`threeD.extrude`, `threeD.rotate`, `threeD.revolve` and `threeD.inflate` take `graphics` ([Graphics](#graphics)): an array of up to 64 objects, each with `symbol` (the name of a document symbol), `face` (`front` or `back`, default `front`; `threeD.rotate` and `threeD.revolve` take `front` only), `x` and `y` (points, default 0), `scale` (1..10000%, default 100) and `rotation` (-360..360 degrees, default 0). Other keys, values out of range and graphics on the other 3D effects are rejected before editing. @@ -459,10 +470,10 @@ and [Create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effe pages, and the archived Extrude & Bevel option list (depth 0–2,000, cap on/off, bevel height, bevel extent in or out, perspective). No Adobe software, assets, presets or bevel shapes were used. -- **Materials** (base and Adobe Substance), graphics on Inflate and on Extrude & Bevel's walls and bevels, soft +- **Materials** (base and Adobe Substance), graphics on Extrude & Bevel's walls and bevels, soft shadows, shadows of lights after the first, and **ray-traced rendering** are not built: shading uses directional lights, in the paint of the fill or stroke the solid is built for ([Fills and strokes](#fills-and-strokes)), and - the shadow is hard-edged ([Shadows](#shadows)). Graphics map onto planar faces and Revolve's side only + the shadow is hard-edged ([Shadows](#shadows)). Graphics map onto planar faces, Revolve's side and Inflate's puffed faces only ([Graphics](#graphics)). - The bevel shapes and their names are our own; custom bevel paths are not supported. - Visibility is a painter's algorithm: faces of a closed solid turned away are left out, and the rest are drawn From 0dc5ecfbb0f439c725d3b24e2c062ecf197a9ab2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 07:29:28 -0800 Subject: [PATCH 02/16] i18n: Map Graphic's Inflate back refusal is translated threeD.mapGraphic refuses Inflate's back while Both sides or Cap is off, and that message had no @msg row in any catalog, so it showed in English in every language. Each complete-message catalog now has a row for it, next to the Revolve refusal, and a test checks that the refusal shows translated, with the object's number, in every complete-message language. --- crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tests.rs | 22 ++++++++++++++++++++++ crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + 25 files changed, 46 insertions(+) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index f552f968f8..bc61095051 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6357,6 +6357,7 @@ digits Malayalam Malaiàlam @msg `{GRAPHICS}` must be an array `{GRAPHICS}` ha de ser una matriu @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Els gràfics s’apliquen als tipus d’objecte Pla, Extrusió, Revolució i Infla @msg Revolve maps graphics onto its side: map them onto the front Revoluciona aplica els gràfics al seu lateral: aplica’ls a la cara davantera +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on l’objecte {_1}: la cara posterior d’Infla només admet gràfics amb Tots dos costats i Tapa activats @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Els gràfics són massa complexos per a aquesta superfície: simplifica la il·lustració dels símbols o redueix Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admet com a màxim {MAX_GRAPHICS} gràfics @msg A plane has one face: map its graphics onto the front Un pla té una sola cara: aplica’n els gràfics a la cara davantera diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 5bd83f10cc..bc93c728ad 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6154,6 +6154,7 @@ mark-style Japanese Japonské @msg `{GRAPHICS}` must be an array `{GRAPHICS}` musí být pole @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafika se mapuje na typy objektu Rovina, Vysunutí, Rotační těleso a Nafouknutí @msg Revolve maps graphics onto its side: map them onto the front Rotační těleso mapuje grafiku na svůj bok: umístěte ji na přední stranu +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekt {_1}: zadní strana Nafouknutí přijímá grafiku jen se zapnutými volbami Obě strany a Uzávěr @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafika je pro tento povrch příliš složitá: zjednodušte kresbu symbolů nebo snižte Segmenty @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` přijímá nejvýše {MAX_GRAPHICS} grafik @msg A plane has one face: map its graphics onto the front Rovina má jednu stranu: umístěte její grafiku na přední stranu diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index d5464fa7f8..d1c920ea61 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -333,6 +333,7 @@ @msg `{GRAPHICS}` must be an array `{GRAPHICS}` skal være et array @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik kortlægges på objekttyperne Plan, Ekstrudér, Omdrej og Pust op @msg Revolve maps graphics onto its side: map them onto the front Omdrej kortlægger grafik på siden: kortlæg den på forsiden +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objektet {_1}: bagsiden af Pust op tager kun imod grafik, når Begge sider og Kappe er slået til @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikken er for kompleks til denne overflade: forenkl symbolernes grafik, eller reducér Segmenter @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tager højst {MAX_GRAPHICS} grafikelementer @msg A plane has one face: map its graphics onto the front Et plan har én flade: kortlæg dets grafik på forsiden diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 7ab61d0481..518d4c1c01 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5725,6 +5725,7 @@ lighting Light Licht @msg `{GRAPHICS}` must be an array `{GRAPHICS}` muss ein Array sein @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiken werden auf die Objekttypen Ebene, Extrudieren, Kreiseln und Aufblasen abgebildet @msg Revolve maps graphics onto its side: map them onto the front Kreiseln bildet Grafiken auf seiner Mantelfläche ab: Bilden Sie sie auf der Vorderseite ab +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on Objekt {_1}: Die Rückseite von „Aufblasen“ nimmt Grafiken nur mit aktivierten Optionen „Beidseitig“ und „Deckflächen“ auf @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Die Grafiken sind für diese Oberfläche zu komplex: Vereinfachen Sie das Bildmaterial der Symbole oder verringern Sie Segmente @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nimmt höchstens {MAX_GRAPHICS} Grafiken auf @msg A plane has one face: map its graphics onto the front Eine Ebene hat nur eine Seite: Bilden Sie ihre Grafiken auf der Vorderseite ab diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 13d301b21b..69f29e8d8b 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5528,6 +5528,7 @@ digits Malayalam Μαλαγιάλαμ @msg `{GRAPHICS}` must be an array το `{GRAPHICS}` πρέπει να είναι πίνακας @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Τα γραφικά αντιστοιχίζονται στους τύπους αντικειμένου Επίπεδο, Εξώθηση, Περιστροφή γύρω από άξονα και Φούσκωμα @msg Revolve maps graphics onto its side: map them onto the front Η Περιστροφή γύρω από άξονα αντιστοιχίζει τα γραφικά στην πλευρική της επιφάνεια: αντιστοιχίστε τα στην μπροστινή όψη +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on το αντικείμενο {_1}: η πίσω όψη του Φουσκώματος δέχεται γραφικά μόνο με ενεργά τα Και οι δύο πλευρές και Κλείσιμο άκρου @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Τα γραφικά είναι πολύ σύνθετα για αυτή την επιφάνεια: απλοποιήστε το σχέδιο των συμβόλων ή μειώστε τα Τμήματα @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics το `{GRAPHICS}` δέχεται το πολύ {MAX_GRAPHICS} γραφικά @msg A plane has one face: map its graphics onto the front Ένα επίπεδο έχει μία όψη: αντιστοιχίστε τα γραφικά του στην μπροστινή όψη diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9b31169a5f..ca1ed2ad54 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -6108,6 +6108,7 @@ mark-style Japanese Japonesas @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar Graphics map onto the Plane, Extrude, Revolve and Inflate object types. Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar. @msg Revolve maps graphics onto its side: map them onto the front Revolución asigna los gráficos a su lateral: asígnelos a la cara frontal +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on el objeto {_1}: la cara posterior de Inflar admite gráficos solo con Ambos lados y Tapa activados @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Los gráficos son demasiado complejos para esta superficie: simplifique la ilustración de los símbolos o reduzca Segmentos @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admite como máximo {MAX_GRAPHICS} gráficos @msg A plane has one face: map its graphics onto the front Un plano tiene una sola cara: asigne sus gráficos a la cara frontal diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 4634f0e67a..a43c7f1990 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6049,6 +6049,7 @@ mark-style Japanese Japanilainen @msg `{GRAPHICS}` must be an array `{GRAPHICS}` on oltava taulukko @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiikat sijoitetaan objektityypeille Taso, Pursota, Pyöräytä ja Täytä ilmalla @msg Revolve maps graphics onto its side: map them onto the front Pyöräytä sijoittaa grafiikat kylkeensä: sijoita ne etupuolelle +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekti {_1}: Täytä ilmalla -tehosteen takapuoli ottaa grafiikoita vain, kun Molemmat puolet ja Pääty ovat käytössä @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiikat ovat liian monimutkaisia tälle pinnalle: yksinkertaista symbolien kuvitusta tai pienennä Segmentit-arvoa @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` hyväksyy enintään {MAX_GRAPHICS} grafiikkaa @msg A plane has one face: map its graphics onto the front Tasolla on yksi puoli: sijoita sen grafiikat etupuolelle diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 72ab16b430..b6a666f4d1 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5722,6 +5722,7 @@ lighting Light Lumière @msg `{GRAPHICS}` must be an array `{GRAPHICS}` doit être un tableau @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Les graphiques s'appliquent aux types d'objet Plan, Extrusion, Révolution et Gonfler @msg Revolve maps graphics onto its side: map them onto the front Révolution applique les graphiques sur sa face latérale : appliquez-les sur la face avant +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objet {_1} : l’arrière de Gonfler n’accepte des graphiques qu’avec Deux côtés et Fermeture activés @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Les graphiques sont trop complexes pour cette surface : simplifiez l'illustration des symboles ou réduisez Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accepte au plus {MAX_GRAPHICS} graphiques @msg A plane has one face: map its graphics onto the front Un plan n'a qu'une face : appliquez ses graphiques sur la face avant diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 198d9b740c..99c831f667 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8190,6 +8190,7 @@ antiAlias Sharp शार्प @msg `{GRAPHICS}` must be an array `{GRAPHICS}` एक ऐरे होना चाहिए @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types ग्राफ़िक्स समतल, एक्सट्रूड, रिवॉल्व और फुलाएँ ऑब्जेक्ट प्रकारों पर लगते हैं @msg Revolve maps graphics onto its side: map them onto the front रिवॉल्व ग्राफ़िक्स को अपनी बगल वाली सतह पर लगाता है: उन्हें सामने वाले फ़ेस पर लगाएँ +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on ऑब्जेक्ट {_1}: फुलाएँ का पिछला फ़ेस ग्राफ़िक्स तभी लेता है जब दोनों तरफ़ और कैप चालू हों @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments ग्राफ़िक्स इस सतह के लिए बहुत जटिल हैं: सिंबल्स के आर्ट को सरल बनाएँ या सेगमेंट कम करें @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` अधिकतम {MAX_GRAPHICS} ग्राफ़िक्स लेता है @msg A plane has one face: map its graphics onto the front समतल का एक ही फ़ेस होता है: उसके ग्राफ़िक्स को सामने वाले फ़ेस पर लगाएँ diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a0182d1f0f..ce9870eb87 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6138,6 +6138,7 @@ imageTrace Outline Körvonal @msg `{GRAPHICS}` must be an array a `{GRAPHICS}` értéke tömb kell legyen @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types A grafikák a Sík, a Kihúzás, a Forgatás tengely körül és a Felfújás objektumtípusra kerülnek @msg Revolve maps graphics onto its side: map them onto the front A Forgatás tengely körül a grafikákat a palástjára helyezi: az elülső oldalra helyezze őket +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on {_1} objektum: a Felfújás hátoldala csak a Mindkét oldal és a Zárólap bekapcsolásával fogad grafikát @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments A grafikák túl összetettek ehhez a felülethez: egyszerűsítse a szimbólumok rajzát, vagy csökkentse a Szakaszok értékét @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics a `{GRAPHICS}` legfeljebb {MAX_GRAPHICS} grafikát fogad @msg A plane has one face: map its graphics onto the front A síknak egy oldala van: a grafikáit az elülső oldalra helyezze diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8616ae9c25..2cf2c5020a 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5769,6 +5769,7 @@ lighting Light Luce @msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve essere un array @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Le grafiche si applicano ai tipi di oggetto Piano, Estrusione, Rivoluzione e Gonfia @msg Revolve maps graphics onto its side: map them onto the front Rivoluzione applica le grafiche sul suo lato: applicatele sulla faccia anteriore +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on oggetto {_1}: il retro di Gonfia accetta grafiche solo con Entrambi i lati e Chiusura attivi @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Le grafiche sono troppo complesse per questa superficie: semplificate il disegno dei simboli o riducete Segmenti @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accetta al massimo {MAX_GRAPHICS} grafiche @msg A plane has one face: map its graphics onto the front Un piano ha una sola faccia: applicate le sue grafiche sulla faccia anteriore diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index cdfe627f57..5c2d2e8948 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5813,6 +5813,7 @@ lighting Light ライト @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます Graphics map onto the Plane, Extrude, Revolve and Inflate object types. グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます。 @msg Revolve maps graphics onto its side: map them onto the front 回転体はグラフィックを側面にマッピングします。前面にマッピングしてください +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on オブジェクト {_1}: 「膨張」の背面にグラフィックをマッピングするには「両面」と「キャップ」をオンにしてください @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments グラフィックがこのサーフェスには複雑すぎます。シンボルのアートを単純化するか、分割数を減らしてください @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` に指定できるグラフィックは {MAX_GRAPHICS} 個までです @msg A plane has one face: map its graphics onto the front 平面には面が 1 つしかありません。グラフィックは前面にマッピングしてください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index a02a2ffd30..ad71f6d901 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -7514,6 +7514,7 @@ font-technology Variable ცვლადი @msg `{GRAPHICS}` must be an array `{GRAPHICS}` უნდა იყოს მასივი @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types გრაფიკა თავსდება ობიექტის ტიპებზე „სიბრტყე“, „ამოწევა“, „ბრუნვა“ და „გაბერვა“ @msg Revolve maps graphics onto its side: map them onto the front ბრუნვა გრაფიკას თავის გვერდით ზედაპირზე ათავსებს: განათავსეთ ისინი წინა მხარეზე +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on ობიექტი {_1}: გაბერვის უკანა მხარე გრაფიკას იღებს მხოლოდ ჩართული „ორივე მხარე“ და „თავსახური“ პარამეტრებით @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments გრაფიკა ზედმეტად რთულია ამ ზედაპირისთვის: გაამარტივეთ სიმბოლოების ნახატი ან შეამცირეთ სეგმენტები @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` იღებს მაქსიმუმ {MAX_GRAPHICS} გრაფიკას @msg A plane has one face: map its graphics onto the front სიბრტყეს ერთი მხარე აქვს: მისი გრაფიკა წინა მხარეზე განათავსეთ diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 213ef60172..e1148a76e0 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5731,6 +5731,7 @@ lighting Light 광원 @msg `{GRAPHICS}` must be an array `{GRAPHICS}`은(는) 배열이어야 합니다 @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 그래픽은 평면, 돌출, 회전체, 부풀리기 개체 유형에 매핑됩니다 @msg Revolve maps graphics onto its side: map them onto the front 회전체는 그래픽을 옆면에 매핑합니다. 앞면에 매핑하십시오 +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 개체 {_1}: 부풀리기의 뒷면에 그래픽을 매핑하려면 양면과 캡을 켜세요 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 그래픽이 이 표면에 비해 너무 복잡합니다. 심볼의 아트를 단순화하거나 세그먼트를 줄이십시오 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}`에는 그래픽을 최대 {MAX_GRAPHICS}개까지 넣을 수 있습니다 @msg A plane has one face: map its graphics onto the front 평면에는 면이 하나뿐입니다. 그래픽을 앞면에 매핑하십시오 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 5f7cc834ce..f81a5d07ac 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -7908,6 +7908,7 @@ mark-style Japanese Japans @msg Graphics map onto planar faces: use the Extrude or Plane object type Illustraties worden op platte vlakken geplaatst: gebruik het objecttype Extruderen of Vlak @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Illustraties worden op de objecttypen Vlak, Extruderen, Draaien en Opblazen geplaatst @msg Revolve maps graphics onto its side: map them onto the front Draaien plaatst illustraties op de zijkant: plaats ze op de voorkant +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on object {_1}: de achterkant van Opblazen neemt alleen afbeeldingen aan met Beide zijden en Dop ingeschakeld @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments De illustraties zijn te complex voor dit oppervlak: vereenvoudig de illustraties van de symbolen of verlaag Segmenten @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` neemt maximaal {MAX_GRAPHICS} illustraties op @msg A plane has one face: map its graphics onto the front Een vlak heeft één zijde: plaats de illustraties ervan op de voorkant diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 7130db0392..3aae706a4b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5984,6 +5984,7 @@ mark-style Japanese Japońskie @msg `{GRAPHICS}` must be an array `{GRAPHICS}` musi być tablicą @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiki są nakładane na obiekty typu Płaszczyzna, Wyciągnięcie, Obrót i Nadmuchanie @msg Revolve maps graphics onto its side: map them onto the front Obrót nakłada grafiki na swoją powierzchnię boczną: umieść je na przedniej stronie +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on obiekt {_1}: tył Nadmuchania przyjmuje grafiki tylko przy włączonych opcjach Obie strony i Zakończenie @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiki są zbyt złożone dla tej powierzchni: uprość rysunki symboli lub zmniejsz Segmenty @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` przyjmuje najwyżej {MAX_GRAPHICS} grafik @msg A plane has one face: map its graphics onto the front Płaszczyzna ma jedną stronę: umieść jej grafiki na przedniej stronie diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 9ff4493250..938e74605b 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -6105,6 +6105,7 @@ mark-style Japanese Japonesas @msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve ser uma matriz @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Os gráficos são mapeados nos tipos de objeto Plano, Extrusão, Revolver e Inflar @msg Revolve maps graphics onto its side: map them onto the front Revolver mapeia os gráficos na sua lateral: mapeie-os na face frontal +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objeto {_1}: o verso de Inflar recebe gráficos apenas com Ambos os Lados e Tampa ativados @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Os gráficos são complexos demais para esta superfície: simplifique a arte dos símbolos ou reduza Segmentos @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` aceita no máximo {MAX_GRAPHICS} gráficos @msg A plane has one face: map its graphics onto the front Um plano tem uma única face: mapeie seus gráficos na face frontal diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 21a7cf7af1..b6fd9ade6f 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5767,6 +5767,7 @@ lighting Light Свет @msg `{GRAPHICS}` must be an array `{GRAPHICS}` должен быть массивом @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графика наносится на объекты типов «Плоскость», «Выдавливание», «Вращение» и «Надувание» @msg Revolve maps graphics onto its side: map them onto the front «Вращение» наносит графику на свою боковую поверхность: размещайте её на передней стороне +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on объект {_1}: задняя сторона «Надувания» принимает графику только при включённых параметрах «С обеих сторон» и «Торцы» @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графика слишком сложна для этой поверхности: упростите иллюстрации символов или уменьшите «Сегменты» @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` принимает не более {MAX_GRAPHICS} графических элементов @msg A plane has one face: map its graphics onto the front У плоскости одна сторона: размещайте её графику на передней стороне diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 53c8b2a9dc..5d19bb0562 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5630,6 +5630,7 @@ lighting Light Ljus @msg `{GRAPHICS}` must be an array `{GRAPHICS}` måste vara en matris @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp @msg Revolve maps graphics onto its side: map them onto the front Rotera runt axel placerar grafik på sin mantelyta: placera den på framsidan +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekt {_1}: baksidan av Blås upp tar emot grafik bara när Båda sidor och Lock är på @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiken är för komplex för den här ytan: förenkla symbolernas teckning eller minska Segment @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tar högst {MAX_GRAPHICS} grafiker @msg A plane has one face: map its graphics onto the front Ett plan har en sida: placera dess grafik på framsidan diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index b632e5cac3..b11b4676ef 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2772,6 +2772,28 @@ fn three_d_refusals_translate_with_their_values() { assert_eq!(message(de(), &errors[1].0), "ungültige Parameter für `effect.apply`: Licht: intensity muss eine Zahl von 0 bis 100 sein"); } +/// Map Graphic's refusal of Inflate's back while Both sides or Cap is off shows in every +/// complete-message language, with the object's number as given. +#[test] +fn inflate_back_refusal_translates_in_every_complete_catalog() { + use serde_json::json; + let mut s = vectorcraft_engine::Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap(); + let mark = s.execute("path.create", &json!({"d": "M300 300L310 300L310 320L300 320Z"})).unwrap()["id"].clone(); + s.execute("threeD.addGraphic", &json!({"name": "Mark", "ids": [mark]})).unwrap(); + let id = s.execute("path.create", &json!({"d": "M100 100L200 100L200 200L100 200Z"})).unwrap()["id"].as_u64().unwrap(); + s.execute("effect.apply", &json!({"effect": "threeD.inflate", "item": null, "params": {}})).unwrap(); + let e = s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id]})).unwrap_err().to_string(); + let english = "Inflate's back takes graphics with Both sides and Cap on"; + assert!(e.ends_with(&format!("object {id}: {english}")), "{e}"); + assert_eq!(message(Lang::EN, &e), e); + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + let shown = message(lang, &e); + assert!(!shown.contains(english) && shown.contains(&id.to_string()) && shown.contains("`threeD.mapGraphic`"), "{code}: {e} -> {shown}"); + } +} + /// A value a message quotes is a name and is shown as written, even when a catalog row translates /// the same text: a symbol called Rotate stays Rotate while the effect's name is translated. #[test] diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 6a0254cb9f..7867dd5f2f 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5474,6 +5474,7 @@ lighting Light Işık @msg `{GRAPHICS}` must be an array `{GRAPHICS}` bir dizi olmalıdır @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafikler Düzlem, Ekstrüzyon, Döndür ve Şişir nesne türlerine eşlenir @msg Revolve maps graphics onto its side: map them onto the front Döndür grafikleri yan yüzeyine eşler: onları ön yüze eşle +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on nesne {_1}: Şişir efektinin arka yüzü yalnızca Her iki taraf ve Kapak açıkken grafik alır @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikler bu yüzey için çok karmaşık: sembollerin resmini basitleştir veya Segmentler değerini azalt @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` en fazla {MAX_GRAPHICS} grafik alır @msg A plane has one face: map its graphics onto the front Bir düzlemin tek yüzü vardır: grafiklerini ön yüze eşle diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 44c176f2c0..b1a36df896 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5749,6 +5749,7 @@ lighting Light Світло @msg `{GRAPHICS}` must be an array `{GRAPHICS}` має бути масивом @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графіка наноситься на об’єкти типів «Площина», «Видавлювання», «Обертання» та «Надування» @msg Revolve maps graphics onto its side: map them onto the front «Обертання» наносить графіку на свою бічну поверхню: розміщуйте її на передній стороні +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on об’єкт {_1}: задній бік «Надування» приймає графіку лише з увімкненими параметрами «З обох боків» і «Торці» @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графіка надто складна для цієї поверхні: спростіть ілюстрації символів або зменште «Сегменти» @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` приймає не більше {MAX_GRAPHICS} графічних елементів @msg A plane has one face: map its graphics onto the front Площина має одну сторону: розміщуйте її графіку на передній стороні diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 8b2a49afc3..07b6c6b51b 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5550,6 +5550,7 @@ theme Appearance Giao diện @msg `{GRAPHICS}` must be an array `{GRAPHICS}` phải là một mảng @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Đồ họa được đặt lên các loại đối tượng Mặt phẳng, Kéo dài, Xoay tròn và Phình @msg Revolve maps graphics onto its side: map them onto the front Xoay tròn đặt đồ họa lên mặt bên của nó: hãy đặt chúng lên mặt trước +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on đối tượng {_1}: mặt sau của Phình chỉ nhận đồ họa khi bật Cả hai mặt và Nắp @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Đồ họa quá phức tạp cho bề mặt này: hãy đơn giản hóa hình vẽ của các ký hiệu hoặc giảm Đoạn @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nhận tối đa {MAX_GRAPHICS} đồ họa @msg A plane has one face: map its graphics onto the front Mặt phẳng chỉ có một mặt: hãy đặt đồ họa của nó lên mặt trước diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 542eaf60d8..ebc782b2de 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6024,6 +6024,7 @@ lighting Light 光源 @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 图形映射到平面、突出、回转和膨胀对象类型上 Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 图形映射到平面、突出、回转和膨胀对象类型上。 @msg Revolve maps graphics onto its side: map them onto the front 回转将图形映射到其侧面:请将图形映射到正面 +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 对象 {_1}:只有打开“双面”和“封口”后,膨胀的背面才能贴图 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 图形对此表面过于复杂:请简化符号的图稿或减少分段数 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 个图形 @msg A plane has one face: map its graphics onto the front 平面只有一个面:请将其图形映射到正面 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index ccaa45c48a..4fb593e175 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -5860,6 +5860,7 @@ lighting Light 光源 @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型 Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型。 @msg Revolve maps graphics onto its side: map them onto the front 迴轉會將圖形對應到其側面:請將圖形對應到正面 +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 物件 {_1}:只有開啟「雙面」和「封口」後,膨脹的背面才能對應圖形 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 圖形對此表面過於複雜:請簡化符號的圖稿或減少分段數 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 個圖形 @msg A plane has one face: map its graphics onto the front 平面只有一個面:請將其圖形對應到正面 From 3f23c67afefb0a19024187725061b8b507f6224c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 08:03:58 -0800 Subject: [PATCH 03/16] 3D: graphics on Inflate cover cells around a hole A cell of Inflate's front or back that held a whole hole, or a piece with more than 128 corners, was drawn as one polygon without the art points graphics need, so a graphic crossing it left a gap there. With graphics mapped, such a cell is now cut into triangles with its holes bridged, keeping the corners along its border that neighboring cells share, and each triangle carries its art points. All such cells of one surface share one work budget, and the cut stops as soon as it passes that budget. A cell whose pieces have more than 4,096 corners, or a surface past the budget, is refused as too complex. --- crates/three-d/src/mesh.rs | 42 +++++++++++++--- crates/three-d/src/mesh/tests.rs | 30 ++++++++++++ crates/three-d/src/solid.rs | 4 +- crates/three-d/src/solid/inflate.rs | 48 ++++++++++++++++-- crates/three-d/src/solid/tests.rs | 75 +++++++++++++++++++++++++++++ 5 files changed, 187 insertions(+), 12 deletions(-) diff --git a/crates/three-d/src/mesh.rs b/crates/three-d/src/mesh.rs index cd9623191c..fc01b76785 100644 --- a/crates/three-d/src/mesh.rs +++ b/crates/three-d/src/mesh.rs @@ -8,7 +8,7 @@ //! turned plane) are cut into triangles: each hole is joined to its outline by a bridge, then the //! outline is cut by ear clipping. -use vectorcraft_geom::{FillRule, PathData, Rect}; +use vectorcraft_geom::{FillRule, PathData, Point, Rect}; use crate::solid::{Face3, Keep, extrude_faces, inflate_faces, plane_faces}; use crate::{Extrude, Facet, Inflate, Revolve, V3, View}; @@ -211,6 +211,12 @@ fn spend(work: &mut usize, steps: usize) -> Result<(), String> { /// The triangles covering one face: `contours` (outlines one way round, holes the other) on the /// plane across `normal` (its Newell normal). fn triangulate(contours: &[Vec], normal: V3, work: &mut usize) -> Result, String> { + triangulate_keeping(contours, normal, work, false) +} + +/// [`triangulate`], keeping the corners that lie straight between their neighbors as triangle +/// corners when `keep_straight` is set. +fn triangulate_keeping(contours: &[Vec], normal: V3, work: &mut usize, keep_straight: bool) -> Result, String> { // Cut the face on the coordinate plane it is least slanted to, turned so outlines run // counterclockwise. let (ax, ay, az) = (normal.0.abs(), normal.1.abs(), normal.2.abs()); @@ -281,11 +287,30 @@ fn triangulate(contours: &[Vec], normal: V3, work: &mut usize) -> Result], work: &mut usize, budget: usize) -> Option> { + let contours: Vec> = rings.iter().map(|r| r.iter().map(|q| V3(q.x, q.y, 0.0)).collect()).collect(); + // Counted up from MAX_WORK less the budget, the cut's own checks stop it at the budget. + let start = MAX_WORK - budget.min(MAX_WORK); + let mut spent = start.saturating_add(*work); + let triangles = triangulate_keeping(&contours, V3(0.0, 0.0, 1.0), &mut spent, true); + *work = spent.saturating_sub(start); + let triangles = triangles.ok()?; + let triangles = triangles.into_iter().map(|t| t.map(|v| Point::new(v.0, v.1))); + Some(triangles.filter(|[a, b, c]| (*b - *a).cross(*c - *a) > 0.0).collect()) +} + /// Do segments `a`–`b` and `c`–`d` cross (touching at a shared end does not count)? fn crosses(a: (f64, f64), b: (f64, f64), c: (f64, f64), d: (f64, f64)) -> bool { let same = |p: (f64, f64), q: (f64, f64)| (p.0 - q.0).hypot(p.1 - q.1) < 1e-9; @@ -350,9 +375,10 @@ fn bridge(ring: Vec, hole: &[Corner], others: &[Vec], work: &mut } /// Cut `ring` (counterclockwise, possibly joined to its holes by bridges) into triangles by ear -/// clipping. A corner in line with its neighbors goes without a triangle. If no ear is left (a -/// ring that crosses itself), the rest is cut as a fan. -fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize) -> Result<(), String> { +/// clipping. A corner in line with its neighbors goes without a triangle, unless `keep_straight` +/// is set and it lies straight between them: it then stays a corner of the triangles beside it. If +/// no ear is left (a ring that crosses itself), the rest is cut as a fan. +fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize, keep_straight: bool) -> Result<(), String> { let n = ring.len(); if n < 3 { return Ok(()); @@ -368,8 +394,10 @@ fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize) -> Result<(), let turn = cross(pa, pb, pc); let scale = (pb.x - pa.x).hypot(pb.y - pa.y) * (pc.x - pb.x).hypot(pc.y - pb.y); let mut ear = false; - let drop = turn.abs() <= 1e-12 * scale.max(1e-300); - if !drop && turn > 0.0 { + let flat = turn.abs() <= 1e-12 * scale.max(1e-300); + let straight = keep_straight && flat && (pb.x - pa.x) * (pc.x - pb.x) + (pb.y - pa.y) * (pc.y - pb.y) > 0.0; + let drop = flat && !straight; + if !flat && turn > 0.0 { spend(work, left)?; ear = true; let mut k = next[c]; diff --git a/crates/three-d/src/mesh/tests.rs b/crates/three-d/src/mesh/tests.rs index 76f9b04ecc..3866565d34 100644 --- a/crates/three-d/src/mesh/tests.rs +++ b/crates/three-d/src/mesh/tests.rs @@ -173,6 +173,36 @@ fn a_bridge_through_another_corner_touches_it() { assert!(!super::touches((5.0, 1.0), (0.0, 0.0), (10.0, 0.0))); } +#[test] +fn flat_triangles_keep_corners_that_lie_along_an_edge() { + // A square with a hole, its edges carrying corners midway, as a cell shares with its finer + // neighbors: every corner is a corner of some triangle, and the triangles cover the face. + let p = |x: f64, y: f64| Point::new(x, y); + let outline = vec![p(5.0, 0.0), p(10.0, 0.0), p(10.0, 5.0), p(10.0, 10.0), p(5.0, 10.0), p(0.0, 10.0), p(0.0, 5.0), p(0.0, 0.0)]; + let hole = vec![p(1.0, 4.0), p(1.0, 6.0), p(2.0, 6.0), p(2.0, 4.0)]; + let mut work = 0; + let triangles = flat_triangles(&[outline.clone(), hole], &mut work, usize::MAX).unwrap(); + let area = |t: &[Point; 3]| ((t[1].x - t[0].x) * (t[2].y - t[0].y) - (t[1].y - t[0].y) * (t[2].x - t[0].x)) / 2.0; + assert!(triangles.iter().all(|t| area(t) > 0.0)); + assert!((triangles.iter().map(area).sum::() - 98.0).abs() < 1e-9); + for q in &outline { + assert!(triangles.iter().any(|t| t.contains(q)), "{q:?} is no triangle's corner"); + } + assert!(work > 0); +} + +#[test] +fn flat_triangles_stop_at_their_budget() { + let p = |x: f64, y: f64| Point::new(x, y); + let outline = vec![p(0.0, 0.0), p(10.0, 0.0), p(10.0, 10.0), p(0.0, 10.0)]; + let hole = vec![p(1.0, 4.0), p(1.0, 6.0), p(2.0, 6.0), p(2.0, 4.0)]; + let mut all = 0; + assert!(flat_triangles(&[outline.clone(), hole.clone()], &mut all, usize::MAX).is_some()); + let mut work = 0; + assert!(flat_triangles(&[outline, hole], &mut work, all - 1).is_none()); + assert!(work >= all, "{work} of {all}"); +} + #[test] fn a_beveled_extrusion_stays_closed() { let mut b = BezPath::new(); diff --git a/crates/three-d/src/solid.rs b/crates/three-d/src/solid.rs index a66e72af1c..428acca547 100644 --- a/crates/three-d/src/solid.rs +++ b/crates/three-d/src/solid.rs @@ -29,10 +29,10 @@ use build::{Camera, cuts, edge_distance, newell, section}; pub(crate) use build::{Face3, Keep, extrude_faces, plane_faces}; pub use build::{extrude, plane}; pub use face_map::{FaceMap, extrude_face_map, plane_face_map}; -#[cfg(test)] -use inflate::GRID_WORK; pub(crate) use inflate::inflate_faces; #[cfg(test)] +use inflate::{FLAT_BUDGET, FLAT_WORK, GRID_WORK, MAX_FLAT_CORNERS, MAX_FLAT_WORK}; +#[cfg(test)] pub(crate) use inflate::{INFLATED, PUFFED, SOLVE_FIRST}; pub use inflate::{inflate, inflate_each, inflate_together}; #[cfg(test)] diff --git a/crates/three-d/src/solid/inflate.rs b/crates/three-d/src/solid/inflate.rs index 5b3c883211..812cf88a42 100644 --- a/crates/three-d/src/solid/inflate.rs +++ b/crates/three-d/src/solid/inflate.rs @@ -196,6 +196,28 @@ thread_local! { pub(crate) static INFLATED: std::cell::Cell = const { std::cell::Cell::new(0) }; /// The grid work of the last solid this thread inflated in full, for the tests. pub(super) static GRID_WORK: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// The work of cutting cells with holes for graphics in the last solid this thread inflated + /// in full, for the tests. + pub(super) static FLAT_WORK: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// The work the next solids of this thread may take cutting cells with holes for graphics, + /// for the tests. + pub(super) static FLAT_BUDGET: std::cell::Cell = const { std::cell::Cell::new(MAX_FLAT_WORK) }; +} + +/// Most work one inflated surface may take cutting the cells graphics are mapped onto that +/// [`cell_triangles`] can't take (a hole inside the cell, or a ring of more corners), all its +/// cells together ([`crate::mesh::flat_triangles`]). +pub(super) const MAX_FLAT_WORK: usize = 1 << 26; + +/// Most corners the pieces of one such cell may have. +pub(super) const MAX_FLAT_CORNERS: usize = 4096; + +/// The work cutting cells with holes for graphics may take. +fn flat_budget() -> usize { + #[cfg(test)] + return FLAT_BUDGET.with(std::cell::Cell::get); + #[cfg(not(test))] + MAX_FLAT_WORK } /// Marks the facet the builder `b` added after it held `before` facets, if it added one, as a piece @@ -278,6 +300,8 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee // builds the topology of every outline ring near its cell, so a self-crossing outline cost its // crossings again in every cell it spans. Past it, cells take their clipped pieces. let material_left = std::cell::Cell::new(MAX_MATERIAL_SEGMENTS); + // The work of cutting cells with holes for graphics, all the cells together ([`MAX_FLAT_WORK`]). + let mut flat_work = 0usize; // Every ring's bounds, and the crossings of the last few rows the cells' centres lie on (a // row of cells has at most seven, at its three levels). let ring_bounds: Vec> = @@ -432,9 +456,25 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee // the front or back: each triangle then carries where its corners lie in the // art's plane. let smoothed = height > 0.0 && smooth; - if (smoothed || o.map_surface) - && let Some(triangles) = cell_triangles(&pieces) - { + let triangles = match (smoothed || o.map_surface).then(|| cell_triangles(&pieces)) { + // A cell graphics are mapped onto that the quick cut can't take (a hole + // inside it, or a ring of more corners) is cut with its holes, against one + // budget for the whole surface. Drawn whole instead, its piece would show + // no graphics. + Some(None) if o.map_surface => { + if pieces.iter().map(Vec::len).fold(0usize, usize::saturating_add) > MAX_FLAT_CORNERS { + return Err(TOO_COMPLEX_SURFACE.into()); + } + let budget = flat_budget(); + let holed = crate::mesh::flat_triangles(&pieces, &mut flat_work, budget); + if flat_work > budget { + return Err(TOO_COMPLEX_SURFACE.into()); + } + Some(holed.ok_or_else(|| TOO_COMPLEX_SURFACE.to_string())?) + } + quick => quick.flatten(), + }; + if let Some(triangles) = triangles { let order = if flat { Order::Last } else { Order::Depth }; for points in triangles { let front = points.map(|q| camera.place(q, half + lift(q))); @@ -550,6 +590,8 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee } #[cfg(test)] GRID_WORK.with(|w| w.set(edges.work())); + #[cfg(test)] + FLAT_WORK.with(|w| w.set(flat_work)); if edges.spent() { return Err(TOO_COMPLEX_SURFACE.into()); } diff --git a/crates/three-d/src/solid/tests.rs b/crates/three-d/src/solid/tests.rs index 0f527d968d..4e1a7f3247 100644 --- a/crates/three-d/src/solid/tests.rs +++ b/crates/three-d/src/solid/tests.rs @@ -464,6 +464,81 @@ fn inflate_marks_where_each_piece_lies_in_the_art_for_graphics() { assert!(on(Inflate::default(), behind).iter().all(|f| f.membrane != Some(PlanarFace::Back))); } +/// A square 0.3 pt across with its corner at the lattice point `(qx, qy)` of the grid of a +/// 100 pt shape, offset 0.1 pt: it lies inside one quarter cell of that grid. +fn speck(qx: f64, qy: f64) -> BezPath { + let unit = 100.0 / 48.0 / 4.0; + square(qx * unit + 0.1, qy * unit + 0.1, 0.3) +} + +/// The area of the pieces marked for graphics on `face`. +fn mapped_area(f: &[Facet], face: PlanarFace) -> f64 { + f.iter().filter(|f| f.membrane == Some(face)).map(|f| signed_area(&f.contours[0]).abs()).sum() +} + +/// A hole inside one cell of the surface's grid leaves that cell's piece with a hole in it: +/// graphics still map onto the rest of the cell, front and back, and the hole stays open. +#[test] +fn inflate_maps_graphics_around_a_hole_inside_one_cell() { + let mut b = square(0.0, 0.0, 100.0); + b.extend(speck(96.0, 96.0)); + let (p, r) = shape(&b); + let o = Inflate { map_surface: true, both_sides: true, ..Inflate::default() }; + let f = inflate(&p, FillRule::EvenOdd, r, o, front()).unwrap(); + let mapped = mapped_area(&f, PlanarFace::Front); + assert!(close(mapped, 100.0 * 100.0 - 0.3 * 0.3, 1e-3), "{mapped}"); + let f = inflate(&p, FillRule::EvenOdd, r, o, View { rotation_y: 180.0, ..front() }).unwrap(); + let mapped = mapped_area(&f, PlanarFace::Back); + assert!(close(mapped, 100.0 * 100.0 - 0.3 * 0.3, 1e-3), "{mapped}"); +} + +/// The cells graphics are mapped onto that need their holes cut out share one budget for the +/// whole surface: past it the surface is refused, however little each cell takes. +#[test] +fn inflate_cuts_holed_cells_for_graphics_within_one_budget() { + let mut b = square(0.0, 0.0, 100.0); + for i in 0..8 { + for j in 0..8 { + b.extend(speck(20.0 + 20.0 * i as f64, 20.0 + 20.0 * j as f64)); + } + } + let (p, r) = shape(&b); + let o = Inflate { map_surface: true, ..Inflate::default() }; + let f = inflate(&p, FillRule::EvenOdd, r, o, front()).unwrap(); + assert!(close(mapped_area(&f, PlanarFace::Front), 100.0 * 100.0 - 64.0 * 0.3 * 0.3, 1e-3)); + let all = FLAT_WORK.with(std::cell::Cell::get); + assert!(all > 0); + // Half the work all 64 cells took is far more than any one of them takes. + FLAT_BUDGET.with(|w| w.set(all / 2)); + let half = inflate(&p, FillRule::EvenOdd, r, o, front()); + FLAT_BUDGET.with(|w| w.set(MAX_FLAT_WORK)); + assert_eq!(half.err().as_deref(), Some(TOO_COMPLEX_SOLID)); + // The art draws without graphics as before. + assert!(inflate(&p, FillRule::EvenOdd, r, Inflate::default(), front()).is_ok()); +} + +/// A cell graphics are mapped onto whose pieces have more corners than one cut may take refuses +/// the surface rather than drawing that cell without its graphics. +#[test] +fn inflate_refuses_graphics_on_a_cell_with_too_many_corners() { + let mut b = square(0.0, 0.0, 100.0); + let unit = 100.0 / 48.0 / 4.0; + let c = Point::new(96.5 * unit, 96.5 * unit); + let n = MAX_FLAT_CORNERS + 10; + let mut ring = BezPath::new(); + for k in 0..n { + let a = -std::f64::consts::TAU * k as f64 / n as f64; + let q = (c.x + 0.2 * a.cos(), c.y + 0.2 * a.sin()); + if k == 0 { ring.move_to(q) } else { ring.line_to(q) } + } + ring.close_path(); + b.extend(ring); + let (p, r) = shape(&b); + let mapped = inflate(&p, FillRule::EvenOdd, r, Inflate { map_surface: true, ..Inflate::default() }, front()); + assert_eq!(mapped.err().as_deref(), Some(TOO_COMPLEX_SOLID)); + assert!(inflate(&p, FillRule::EvenOdd, r, Inflate::default(), front()).is_ok()); +} + #[test] fn malformed_and_degenerate_input_is_bounded() { let (p, b) = shape(&square(0.0, 0.0, 100.0)); From f725dd8caaf61b25fbc246b1986066b376cab769 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 09:16:05 -0800 Subject: [PATCH 04/16] 3D: a wireframe is not refused for graphics it does not draw Extrude & Bevel, Inflate and Rotate in wireframe mode draw the faces' edges with no graphics, but the graphics' art was still checked against its limits, and Inflate still built its puffed surface with the graphics on it, so a wireframe could be refused as too complex. Neither check runs in wireframe mode now, as Revolve already skips them. --- crates/effects/src/solids.rs | 8 ++++--- crates/effects/src/solids/tests_graphics.rs | 25 +++++++++++++++++++++ docs/mcp.md | 3 ++- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/crates/effects/src/solids.rs b/crates/effects/src/solids.rs index 548b89ec39..767322769f 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -309,7 +309,8 @@ pub fn validate_solid_in(doc: Option<&Document>, n: &Node, id: &str, p: &Value) /// Inflate or Rotate, as drawn, or a new one after its other effects when it has none. fn validate_solid_for(doc: Option<&Document>, n: &Node, id: &str, p: &Value, at: (Option, Option)) -> Result<(), String> { validate_solid_params(id, p)?; - if let Some(doc) = doc { + // In wireframe mode the edges are drawn with no graphics, and their art is not checked. + if let Some(doc) = doc.filter(|_| !wireframe::wireframe_params(id, p)) { graphics::validate_symbols(doc, p)?; } let label = label_of(id); @@ -362,10 +363,11 @@ fn check_cast(id: &str, p: &Value, shapes: &[Profile]) -> Result<(), String> { /// past their limits on the front and puffed back of the solids of `shapes`: their art, or the /// parts they draw on its pieces ([`graphics::surface_parts`]), or when the solids can't be built /// with their pieces carrying the graphics. They are built as the art builds them -/// ([`surfaces_with`]). Without `doc` nothing is drawn, and nothing is checked. +/// ([`surfaces_with`]). Without `doc` nothing is drawn, and nothing is checked. In wireframe mode no +/// graphics are drawn, and none are checked. fn check_membrane_graphics(doc: Option<&Document>, n: &Node, id: &str, p: &Value, shapes: &[Profile]) -> Result<(), String> { let Some(doc) = doc else { return Ok(()) }; - if id != INFLATE || mapped_graphics(p).is_empty() { + if id != INFLATE || wireframe::wireframe_params(id, p) || mapped_graphics(p).is_empty() { return Ok(()); } for face in PlanarFace::ALL { diff --git a/crates/effects/src/solids/tests_graphics.rs b/crates/effects/src/solids/tests_graphics.rs index 0729ddf2ba..45fbb1c489 100644 --- a/crates/effects/src/solids/tests_graphics.rs +++ b/crates/effects/src/solids/tests_graphics.rs @@ -463,6 +463,31 @@ fn the_symbol_check_counts_what_the_view_draws() { assert!(validate_three_d_in(Some(&dense_document(true)), &n, EXTRUDE, &flat).is_ok()); } +#[test] +fn a_wireframe_is_not_refused_for_graphics_it_does_not_draw() { + let check = |d: &Document, id: &str, mut p: Value, wire: bool| { + if wire { + p["render"] = json!({"mode": "wireframe"}); + } + validate_three_d_in(Some(d), &object(id, p.clone()), id, &p) + }; + // The straight 30,000-sided polygon at 1000% fits the symbol limit, but cut into pieces on + // Inflate's puffed front it is too complex. + let straight = dense_document(false); + let big = json!({"perspectiveAngle": 0.0, "graphics": [{"symbol": "Dense", "scale": 1000.0}]}); + assert!(validate_symbols(&straight, &big).is_ok()); + let e = check(&straight, INFLATE, big.clone(), false).unwrap_err(); + assert!(e.contains("too complex"), "{e}"); + // Two copies of the curved one under a perspective are past the symbol limit on Extrude & Bevel. + let curved = dense_document(true); + let two = json!({"perspectiveAngle": 60.0, "graphics": [{"symbol": "Dense"}, {"symbol": "Dense", "face": "back"}]}); + let e = check(&curved, EXTRUDE, two.clone(), false).unwrap_err(); + assert!(e.contains("too complex"), "{e}"); + // A wireframe draws the faces' edges and no graphics, so neither is checked. + assert_eq!(check(&straight, INFLATE, big, true), Ok(())); + assert_eq!(check(&curved, EXTRUDE, two, true), Ok(())); +} + #[test] fn a_plane_and_a_hollow_solid() { let d = document(); diff --git a/docs/mcp.md b/docs/mcp.md index a53da0fc79..a425ad2e9f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -4244,7 +4244,8 @@ joins the edges, so with such an effect its paths can differ from the drawn ones draw the edges, and `effect.expandAppearance` keeps them as paths. Past 1,000,000 edges the source path is drawn, as it is for a solid past its limits. A `render` that is not an object, a key other than `mode`, another mode, and `render` on Extrude & Bevel (Classic), Revolve (Classic) or Rotate (Classic) are refused before the document -changes. See [three-d.md](three-d.md#3d-and-materials-panel). +changes. In wireframe mode the graphics' art is not checked against the graphics limits, so art too complex for the +shaded surface does not refuse the wireframe. See [three-d.md](three-d.md#3d-and-materials-panel). ```json {"name":"run_command","arguments":{"command":"effect.setParams","params":{"index":0,"item":null,"params":{"render":{"mode":"wireframe"}}}}} From 30f852b62bb23e35bf7b7e6a37da60327943dcbf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 18:13:55 -0800 Subject: [PATCH 05/16] 3D: an Inflate frame places no handles when a fill's solid fails When a later fill of an Inflate object could not be built, or the solids together passed the face limit, the graphic frame kept the facets of the solids built before it and showed graphic handles, while the art drew its source path. The frame now places no handle in that case. A stroke left out past its limits still places none of its own. --- crates/effects/src/solids.rs | 10 ++++++---- crates/effects/src/solids/tests.rs | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/crates/effects/src/solids.rs b/crates/effects/src/solids.rs index 07b10dfada..8ffcb1cef4 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -2412,11 +2412,13 @@ fn frame_of(doc: Option<&Document>, n: &Node, item: Option, pick: &Pick<' let (parts, bounds) = solid_parts(&shapes, b); if fx.id == INFLATE { // Inflate's graphics lie on its puffed front and back: the pieces the viewer sees place - // their handles. Solids that can't be built place none. + // their handles. A stroke left out places none of its own. When a fill's solid can't be + // built, or the solids together pass the limit, the art draws its source and no piece + // places a handle. let built: Vec = built_solids_cast(INFLATE, &p, &parts, bounds, MAX_OBJECT_FACES, false, true) - .filter_map(|r| r.ok().flatten()) - .flat_map(|(f, _)| f) - .collect(); + .collect::, String>>() + .map(|solids| solids.into_iter().flatten().flat_map(|(f, _)| f).collect()) + .unwrap_or_default(); return Some(graphics::GraphicFrame::inflated(bounds, graphics::MembraneFrame::of(&built))); } let options = extrude_options(&p); diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index 986e575689..d2ad2cb0cc 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -1206,6 +1206,33 @@ fn a_groups_solids_together_past_the_limit_draw_the_source() { assert_eq!(three_d_wireframe_in(None, &past), Err(vectorcraft_three_d::TOO_COMPLEX_SOLID.to_string())); } +/// An Inflate group whose second member's fill is past the limits draws its source art, and its +/// frame places no graphic handle on the first member's puff. +#[test] +fn an_inflate_frame_places_no_handle_when_a_fill_is_past_the_limits() { + let mut b = BezPath::new(); + b.move_to((0.0, 0.0)); + b.line_to((40_000.0, 0.0)); + b.line_to((40_000.0, 40_000.0)); + b.line_to((0.0, 40_000.0)); + b.close_path(); + let square = Node::path(NodeId(1), PathData::from_bezpath(&b), Appearance::basic(Paint::solid(RED), Paint::None, 0.0)); + let view = json!({"rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0}); + let group = |members: Vec| { + let mut g = Node::group(NodeId(9999), members.into_iter().map(Arc::new).collect()); + g.appearance.effects.push(fx(INFLATE, view.clone())); + g + }; + let center = MappedGraphic::from_value(&json!({"symbol": "Mark"})).unwrap(); + // The square alone builds, and the graphic's handle sits on its puff. + let alone = group(vec![square.clone()]); + assert!(graphic_frame(None, &alone, None).unwrap().handle(¢er).is_some()); + // 70,000 corners: more points than a fill's solid takes. + let past = group(vec![square, polygon_node(2, 70_000)]); + assert!(solid_art(&past).is_none(), "the source art draws"); + assert!(graphic_frame(None, &past, None).unwrap().handle(¢er).is_none()); +} + /// A fill and strokes whose solids each fit, but not all of them together, draw the source art, /// and the strokes after the one past the limit are not left out to make room. #[test] From 63d02a2568bb2ab74b0f8d15ae3580c6f0a73186 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 18:42:33 -0800 Subject: [PATCH 06/16] 3D: a drag over overlapping Inflate pieces maps through the nearer one Where two pieces of Inflate's puffed front or back overlap on the page, a handle drag picked the piece whose center was nearer, so a tilted piece hidden at the pointer could take the drag and move the graphic to the wrong offset. Each piece now keeps its plane, and the pointer maps through the piece that is nearest at that point. --- crates/effects/src/solids/graphics.rs | 29 ++++++++++++++------- crates/effects/src/solids/tests_graphics.rs | 24 +++++++++++++++++ 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/crates/effects/src/solids/graphics.rs b/crates/effects/src/solids/graphics.rs index 1d7e4e8d45..03ae75a927 100644 --- a/crates/effects/src/solids/graphics.rs +++ b/crates/effects/src/solids/graphics.rs @@ -28,7 +28,7 @@ use vectorcraft_doc::color::{BlendMode, Paint}; use vectorcraft_doc::{Appearance, AppearanceItem, Document, FillLayer, Node, NodeId, NodeKind, Symbol}; use vectorcraft_geom::kurbo::{CubicBez, ParamCurve, PathEl, Shape}; use vectorcraft_geom::{Affine, BezPath, FillRule, PathData, Point, Rect, SubPath, Vec2}; -use vectorcraft_three_d::{FaceMap, Facet, PlanarFace}; +use vectorcraft_three_d::{DepthPlane, FaceMap, Facet, PlanarFace}; /// The effect parameter that holds the graphics. pub const GRAPHICS: &str = "graphics"; @@ -1017,8 +1017,8 @@ pub struct GraphicFrame { /// The pieces of Inflate's front and puffed back that show their outside to the viewer, as the /// graphics are drawn on them ([`surface_parts`]): each piece's face, its corners in the art's plane -/// (offsets from the center of the object's bounds) and on the page, and its depth (larger is -/// nearer). +/// (offsets from the center of the object's bounds) and on the page, its depth (larger is nearer) +/// and its plane, for its depth at a point of the page. #[derive(Clone, Debug, Default, PartialEq)] pub struct MembraneFrame { pieces: Vec, @@ -1030,6 +1030,15 @@ struct MembranePiece { uv: [Point; 3], page: [Point; 3], depth: f64, + plane: Option, +} + +impl MembranePiece { + /// The piece's depth at page point `p`: its plane's depth there, or its own depth when it has + /// no plane or the plane gives none. + fn depth_at(&self, p: Point) -> f64 { + self.plane.and_then(|plane| plane.depth_at(p)).unwrap_or(self.depth) + } } impl MembraneFrame { @@ -1043,15 +1052,15 @@ impl MembraneFrame { let cell = f.surface.as_ref().filter(|c| c.outward)?; let uv = <[Point; 3]>::try_from(cell.uv.as_slice()).ok()?; let page = <[Point; 3]>::try_from(cell.page.as_slice()).ok()?; - Some(MembranePiece { face, uv, page, depth: f.depth }) + Some(MembranePiece { face, uv, page, depth: f.depth, plane: f.plane }) }) .collect(); Self { pieces } } /// Point `p` of `face` in the art's plane mapped onto the page, or with `from_page` a page point - /// mapped into the art's plane, through the nearest piece of that face that holds it. `None` - /// when no piece the viewer sees holds it. + /// mapped into the art's plane, through the piece of that face that holds it and is nearest at + /// that point of the page. `None` when no piece the viewer sees holds it. fn map(&self, face: PlanarFace, p: Point, from_page: bool) -> Option { let inside = |t: &[Point; 3], q: Point| { let side = |a: Point, b: Point| (b - a).cross(q - a); @@ -1061,11 +1070,13 @@ impl MembraneFrame { let mut best: Option<(Point, f64)> = None; for piece in self.pieces.iter().filter(|piece| piece.face == face) { let (from, to) = if from_page { (&piece.page, &piece.uv) } else { (&piece.uv, &piece.page) }; - if !inside(from, p) || best.is_some_and(|(_, depth)| depth >= piece.depth) { + if !inside(from, p) { continue; } - if let Some(q) = triangle_map(from, to).map(|m| m * p).filter(|q| q.is_finite()) { - best = Some((q, piece.depth)); + let Some(q) = triangle_map(from, to).map(|m| m * p).filter(|q| q.is_finite()) else { continue }; + let depth = piece.depth_at(if from_page { p } else { q }); + if best.is_none_or(|(_, nearest)| depth > nearest) { + best = Some((q, depth)); } } best.map(|(q, _)| q) diff --git a/crates/effects/src/solids/tests_graphics.rs b/crates/effects/src/solids/tests_graphics.rs index 45fbb1c489..2fe175a4aa 100644 --- a/crates/effects/src/solids/tests_graphics.rs +++ b/crates/effects/src/solids/tests_graphics.rs @@ -1032,3 +1032,27 @@ fn an_inflate_frame_puts_the_handle_on_the_puff_and_reads_it_back() { let (x, y) = frame.offset_at(PlanarFace::Back, page).unwrap(); assert!((x - 15.0).abs() < 1e-6 && (y - 5.0).abs() < 1e-6, "{x} {y}"); } + +/// Where two pieces of an Inflate face overlap on the page, a point maps through the piece nearer +/// at that point, though the other is nearer at its center. +#[test] +fn overlapping_inflate_pieces_map_a_point_through_the_one_nearer_there() { + let page = [Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(10.0, 20.0)]; + let piece = |shift: f64, depth: f64, normal: [f64; 3], offset: f64| MembranePiece { + face: PlanarFace::Front, + uv: page.map(|p| p + Vec2::new(shift, 0.0)), + page, + depth, + plane: Some(DepthPlane { normal, offset, center: Point::ORIGIN, eye: None }), + }; + // The tilted piece is nearer at its center (depth 10) but at depth 0 where x is 10; the flat + // one lies at depth 5 everywhere. + let tilted = piece(0.0, 10.0, [1.0, 0.0, 1.0], 10.0); + let flat = piece(100.0, 5.0, [0.0, 0.0, 1.0], 5.0); + let frame = GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces: vec![tilted, flat] }); + let (x, y) = frame.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).unwrap(); + assert!((x - 110.0).abs() < 1e-6 && (y - 5.0).abs() < 1e-6, "{x} {y}"); + // Near the tilted piece's left corner it is the nearer one. + let (x, _) = frame.offset_at(PlanarFace::Front, Point::new(2.0, 0.5)).unwrap(); + assert!((x - 2.0).abs() < 1e-6, "{x}"); +} From f190b81896d5854451b81c4bddb441dcd29eaa97 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 18:42:33 -0800 Subject: [PATCH 07/16] 3D: the Materials tab builds the graphics frame once per edit While the Materials tab was open, the artboard built the selected object's graphics frame on every frame it drew, which for Inflate means building its whole solid. The frame is now kept until the document changes, and an object without mapped graphics builds none. --- crates/ui-egui/src/panels/tests_three_d.rs | 31 ++++++++++++++++++++++ crates/ui-egui/src/panels/three_d.rs | 31 +++++++++++++++++++--- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index f06994c1dc..f3b860afed 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -624,6 +624,8 @@ fn a_graphics_handle_drags_it_over_its_face_in_one_undo_step() { let n = std::sync::Arc::make_mut(&mut st.doc).node_mut(id).unwrap(); n.appearance.effects[0].visible = false; n.appearance.effects.push(vectorcraft_effects::new_effect("threeD.extrude", &json!({})).unwrap()); + // An edit moves the revision, as a command's does. + st.revision += 1; } let mut shown = true; ctx.run_ui(egui::RawInput::default(), |ui| { @@ -639,6 +641,35 @@ fn a_graphics_handle_drags_it_over_its_face_in_one_undo_step() { assert!(!frame(&mut app, vec![button(target, true)])); } +/// The frame the graphics' handles are placed on is built once for each revision of the document, +/// and not at all for an object without graphics. +#[test] +fn the_graphics_frame_is_built_once_for_each_revision() { + type Cached = (super::FrameKey, Option>); + let (mut app, ctx) = materials_app(); + let cached = |ctx: &egui::Context| ctx.data(|m| m.get_temp::(super::frame_cache_id())).and_then(|(_, frame)| frame); + let handles = |app: &VectorcraftApp| { + let mut shown = false; + ctx.run_ui(egui::RawInput::default(), |ui| { + crate::panels::set_pstate(ui.ctx(), super::DRAWN, Some(super::root_pass(ui.ctx()))); + shown = super::graphic_handles(app, ui.ctx()).is_some(); + }) + .textures_delta + .clear(); + shown + }; + assert!(!handles(&app)); + assert!(cached(&ctx).is_none(), "no graphics, no frame"); + app.run("threeD.mapGraphic", json!({"symbol": "Graphic"})).unwrap(); + assert!(handles(&app)); + let first = cached(&ctx).unwrap(); + assert!(handles(&app)); + assert!(std::sync::Arc::ptr_eq(&first, &cached(&ctx).unwrap()), "the same revision reuses the frame"); + app.run("threeD.mapGraphic", json!({"symbol": "Graphic"})).unwrap(); + assert!(handles(&app)); + assert!(!std::sync::Arc::ptr_eq(&first, &cached(&ctx).unwrap()), "an edit builds it again"); +} + /// One frame of the artboard's graphic handles over an 800 × 600 canvas with `events`: whether the /// handles took the pointer. fn handles_frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) -> bool { diff --git a/crates/ui-egui/src/panels/three_d.rs b/crates/ui-egui/src/panels/three_d.rs index be7731daf5..db47e73ac4 100644 --- a/crates/ui-egui/src/panels/three_d.rs +++ b/crates/ui-egui/src/panels/three_d.rs @@ -8,6 +8,8 @@ //! adds the selected objects that have a 3D effect to Asset Export as 3D assets (`assets.add3D`) //! and shows that panel with their assets selected. +use std::sync::Arc; + use egui::Ui; use serde_json::{Map, Value, json}; use vectorcraft_doc::{Effect, Node, NodeId, NodeKind}; @@ -392,7 +394,7 @@ fn materials_open(ctx: &egui::Context) -> bool { /// What [`graphic_handles`] gives: the object's frame, its graphics, and each seen graphic's index /// and page point. -type Handles = (vectorcraft_effects::GraphicFrame, Vec, Vec<(usize, vectorcraft_geom::Point)>); +type Handles = (Arc, Vec, Vec<(usize, vectorcraft_geom::Point)>); /// The handles of the graphics mapped onto the first selected object, while the Materials tab is /// open: each graphic's index, its face and where its center lands on the page, for the graphics @@ -410,8 +412,6 @@ fn graphic_handles(app: &VectorcraftApp, ctx: &egui::Context) -> Option if t.item.is_some_and(|k| n.appearance.items.get(k).is_none_or(|it| !it.visible())) { return None; } - // The frame of the effect whose graphics are listed: none while that effect is hidden. - let frame = vectorcraft_effects::graphic_frame_at(Some(&st.doc), n, t.item, t.index)?; // A geometry effect after the 3D effect of any selected object moves or bends its drawn // graphics away from their places in the frame: no handles, so a drag does not put a graphic // away from the pointer. @@ -420,15 +420,40 @@ fn graphic_handles(app: &VectorcraftApp, ctx: &egui::Context) -> Option return None; } let list = vectorcraft_effects::mapped_graphics(&vectorcraft_effects::merged_params(&t.effect, &t.params)); + // Without graphics there are no handles, and no frame is built. + if list.is_empty() { + return None; + } // Selected objects with different graphics show no handles: a drag sends the whole list. let graphics_of = |t: Target| vectorcraft_effects::mapped_graphics(&vectorcraft_effects::merged_params(&t.effect, &t.params)); if st.selection.objects.iter().skip(1).filter_map(|id| find(st.doc.node(*id)?)).any(|o| graphics_of(o) != list) { return None; } + // The frame of the effect whose graphics are listed: none while that effect is hidden. It is + // built once for each revision of the document, not on every frame the panel draws. + let key: FrameKey = (st.uid, st.revision, n.id.0, t.item, t.index); + let cached = ctx.data(|m| m.get_temp::<(FrameKey, Option>)>(frame_cache_id())); + let frame = match cached { + Some((k, frame)) if k == key => frame, + _ => { + let frame = vectorcraft_effects::graphic_frame_at(Some(&st.doc), n, t.item, t.index).map(Arc::new); + ctx.data_mut(|m| m.insert_temp(frame_cache_id(), (key, frame.clone()))); + frame + } + }?; let handles = list.iter().enumerate().filter_map(|(i, g)| frame.handle(g).filter(|(_, seen)| *seen).map(|(p, _)| (i, p))).collect(); Some((frame, list, handles)) } +/// What the cached frame of [`graphic_handles`] was built for: the document's uid and revision, the +/// object's id, and the fill or stroke and index of its 3D effect. +type FrameKey = (u64, u64, u64, Option, usize); + +/// Temp-memory key of the frame [`graphic_handles`] last built. +fn frame_cache_id() -> egui::Id { + egui::Id::unique("three-d-graphic-frame") +} + /// Temp-memory key of a drag of a graphic's handle on the artboard. fn handle_drag_id() -> egui::Id { egui::Id::unique("three-d-graphic-handle-drag") From 48a708dc0ffa56018396a054898806d5e62f776b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 18:53:09 -0800 Subject: [PATCH 08/16] 3D: Inflate faces that carry graphics keep their colored-light underlay Under colored lights with smooth shading, a face of Inflate's front or back that carries part of a mapped graphic is drawn as a group of the face and those parts. The underlay that closes the seams between faces did not take such a group, so the whole run was drawn without it and hairline gaps could show between triangles. Such a face now takes its facet's underlay and stays in the order with its parts. --- crates/effects/src/lighting.rs | 13 +++++++++++-- crates/effects/src/solids/tests.rs | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/crates/effects/src/lighting.rs b/crates/effects/src/lighting.rs index e62e34b55e..7f7f1099e3 100644 --- a/crates/effects/src/lighting.rs +++ b/crates/effects/src/lighting.rs @@ -173,11 +173,20 @@ pub(crate) fn footprint(path: &vectorcraft_geom::BezPath, seam: f64) -> vectorcr /// footprints. Where two facets' antialiased edges meet, the underlay fills what they leave /// uncovered with the neighbors' own colors, so the background does not show through. `None` unless /// every face is a facet a surface draws: a path filled and stroked by its seam, or a facet composed -/// in a clip of its footprint, neither with an opacity mask. +/// in a clip of its footprint, neither with an opacity mask. A face drawn with the parts of Inflate's +/// graphics on it, a group of the facet and those parts, takes its facet's underlay and stays in the +/// order with its parts, which are cut to the facet's outline, so the clip keeps them. pub(crate) fn sealed(id: vectorcraft_doc::NodeId, faces: &[std::sync::Arc]) -> Option { use std::sync::Arc; use vectorcraft_doc::{Node, NodeKind}; - let (clip, mut underlay) = underlay(id, faces)?; + let facets: Vec> = faces + .iter() + .map(|face| match &face.kind { + NodeKind::Group { children, clip: false } if face.extras().mask.is_none() => children.first().cloned(), + _ => Some(face.clone()), + }) + .collect::>()?; + let (clip, mut underlay) = underlay(id, &facets)?; underlay.extend(faces.iter().cloned()); Some(Node::new(id, NodeKind::Group { children: vec![Arc::new(clip), Arc::new(Node::group(id, underlay))], clip: true })) } diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index d2ad2cb0cc..c4a33a76a2 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -587,6 +587,30 @@ fn drawn_face_bounds(f: &Node) -> Rect { } } +/// Under a colored light, an Inflate in a solid color with a graphic on its front lies over an +/// underlay of its faces, the faces that carry parts of the graphic included. +#[test] +fn a_colored_inflate_with_a_graphic_lies_over_an_underlay_of_its_faces() { + let mut d = Document::new(1000.0, 1000.0); + let mark = Node::path( + NodeId(0), + vectorcraft_geom::shapes::rectangle(Rect::new(500.0, 500.0, 510.0, 510.0)), + Appearance::basic(Paint::solid(BLUE), Paint::None, 0.0), + ); + d.symbols.push(vectorcraft_doc::Symbol { dynamic: false, name: "Mark".into(), art: Arc::new(mark) }); + let square = vectorcraft_geom::shapes::rectangle(Rect::new(0.0, 0.0, 100.0, 100.0)); + let mut n = Node::path(NodeId(7), square, Appearance::basic(Paint::solid(RED), Paint::None, 0.0)); + let p = json!({"rotationX": -20, "rotationY": -30, "rotationZ": 0, "lights": [{"color": "#ff8080"}], "graphics": [{"symbol": "Mark", "scale": 300.0}]}); + n.appearance.effects.push(fx(INFLATE, p)); + let art = solid_art_in(Some(&d), &n).unwrap(); + let order = art.children().unwrap()[0].children().unwrap(); + let faces: Vec> = order.iter().flat_map(unsealed).collect(); + assert!(faces.len() > order.len(), "the faces lie over an underlay"); + let carrying = faces.iter().filter(|f| matches!(f.kind, NodeKind::Group { clip: false, .. })).count(); + assert!(carrying > 0, "faces carry parts of the graphic"); + assert!(order.iter().all(|run| !Arc::ptr_eq(&unsealed(run)[0], run)), "every face is in a sealed run"); +} + /// Under a light that is not white, a solid-color fill and a solid-color stroke, plain, dashed or /// with a width profile, draw their faces in one order, the faces of both solids in the order of /// their depths where they overlap, in Inflate and in Extrude & Bevel, with and without perspective From 5d262e2f6eb71907c9bc9548488669fc437896a9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 23:34:23 -0800 Subject: [PATCH 09/16] i18n: French catalog row the merge of main split The merge of main joined the source and translation of the "graphics are too complex for this surface" message without a tab, so bundled_catalogs_are_consistent rejected fr.tsv. The row now matches main's. The merge also kept the old "Plane, Extrude and Revolve" message row, whose source string the branch replaced; it has been removed. --- crates/ui-egui/src/i18n/fr.tsv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3069219a0f..b70ee1c079 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5815,10 +5815,9 @@ lighting Light Lumière @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` doit être un nombre de {lo} à {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` doit être un tableau @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Les graphiques s’appliquent aux types d’objet Plan, Extrusion, Révolution et Gonfler -@msg Graphics map onto the Plane, Extrude and Revolve object types Les graphiques s’appliquent aux types d’objet Plan, Extrusion et Révolution @msg Revolve maps graphics onto its side: map them onto the front Révolution applique les graphiques sur sa face latérale : appliquez-les sur la face avant @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objet {_1} : l’arrière de Gonfler n’accepte des graphiques qu’avec Deux côtés et Fermeture activés -@msg The graphics are too complex for this surface: simplify the symbols' art or reduce SegmentsLes graphiques sont trop complexes pour cette surface : simplifiez l’illustration des symboles ou réduisez Segments +@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Les graphiques sont trop complexes pour cette surface : simplifiez l’illustration des symboles ou réduisez Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accepte au plus {MAX_GRAPHICS} graphiques @msg A plane has one face: map its graphics onto the front Un plan n’a qu’une face : appliquez ses graphiques sur la face avant @msg The graphics are too complex: simplify the symbols' art Les graphiques sont trop complexes : simplifiez l’illustration des symboles From f4d7260c620306380f7c310bb4a4029d0f5eef5e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 23:41:52 -0800 Subject: [PATCH 10/16] i18n: no-break space before the colon in the French Inflate back refusal french_catalog_uses_nonbreaking_prose_punctuation requires a no-break space before a colon in French prose. The row for the Inflate back refusal had an ordinary space. --- crates/ui-egui/src/i18n/fr.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index b70ee1c079..3e7a7ad55a 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5816,7 +5816,7 @@ lighting Light Lumière @msg `{GRAPHICS}` must be an array `{GRAPHICS}` doit être un tableau @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Les graphiques s’appliquent aux types d’objet Plan, Extrusion, Révolution et Gonfler @msg Revolve maps graphics onto its side: map them onto the front Révolution applique les graphiques sur sa face latérale : appliquez-les sur la face avant -@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objet {_1} : l’arrière de Gonfler n’accepte des graphiques qu’avec Deux côtés et Fermeture activés +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objet {_1} : l’arrière de Gonfler n’accepte des graphiques qu’avec Deux côtés et Fermeture activés @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Les graphiques sont trop complexes pour cette surface : simplifiez l’illustration des symboles ou réduisez Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accepte au plus {MAX_GRAPHICS} graphiques @msg A plane has one face: map its graphics onto the front Un plan n’a qu’une face : appliquez ses graphiques sur la face avant From f2376b05f7a095c25479c11ed6553e224f0ae2a8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 00:13:32 -0800 Subject: [PATCH 11/16] 3D: Inflate graphics keep membrane corners on an ear's new edge With corners kept along a cell's edges, ear clipping could still take an ear whose new edge ran through kept corners, leaving them off every triangle and the triangles beside them flat. Such an ear is now passed over. docs/three-d.md now says that a membrane cell that cannot be cut into triangles makes the object draw without its graphics, and commands refuse them. --- crates/three-d/src/mesh.rs | 5 +++++ crates/three-d/src/mesh/tests.rs | 14 ++++++++++++++ docs/three-d.md | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/three-d/src/mesh.rs b/crates/three-d/src/mesh.rs index d0ce362f1e..fbc5546d18 100644 --- a/crates/three-d/src/mesh.rs +++ b/crates/three-d/src/mesh.rs @@ -408,6 +408,11 @@ fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize, keep_straight ear = false; break; } + // A kept corner on the ear's new edge would be left off every triangle. + if keep_straight && touches((p.x, p.y), (pc.x, pc.y), (pa.x, pa.y)) { + ear = false; + break; + } k = next[k]; } } diff --git a/crates/three-d/src/mesh/tests.rs b/crates/three-d/src/mesh/tests.rs index a4db1d77fb..9980e900d1 100644 --- a/crates/three-d/src/mesh/tests.rs +++ b/crates/three-d/src/mesh/tests.rs @@ -191,6 +191,20 @@ fn flat_triangles_keep_corners_that_lie_along_an_edge() { assert!(work > 0); } +#[test] +fn flat_triangles_keep_corners_on_the_edge_an_ear_would_cut() { + // The first ear's new edge runs along the bottom, through its two middle corners. + let p = |x: f64, y: f64| Point::new(x, y); + let outline = vec![p(0.0, 3.0), p(0.0, 0.0), p(1.0, 0.0), p(2.0, 0.0), p(3.0, 0.0)]; + let mut work = 0; + let triangles = flat_triangles(std::slice::from_ref(&outline), &mut work, usize::MAX).unwrap(); + let area = |t: &[Point; 3]| ((t[1].x - t[0].x) * (t[2].y - t[0].y) - (t[1].y - t[0].y) * (t[2].x - t[0].x)) / 2.0; + assert!((triangles.iter().map(area).sum::() - 4.5).abs() < 1e-9); + for q in &outline { + assert!(triangles.iter().any(|t| t.contains(q)), "{q:?} is no triangle's corner"); + } +} + #[test] fn flat_triangles_stop_at_their_budget() { let p = |x: f64, y: f64| Point::new(x, y); diff --git a/docs/three-d.md b/docs/three-d.md index 45531ad4df..d01b6ab6de 100644 --- a/docs/three-d.md +++ b/docs/three-d.md @@ -508,7 +508,8 @@ These rules are VectorCraft's own: not drawn); it reads the right way round from behind, and Twist and Taper turn and shrink its graphics with it. The membrane is cut into triangles, and each one draws the part of the graphic that falls on it, shaded as that triangle is shaded and drawn only where the surface's outside faces the viewer; nearer triangles drawn - after it cover it. A cell of the membrane that cannot be cut into triangles takes no graphic. Every solid of + after it cover it. When a cell of the membrane cannot be cut into triangles, the object draws without its + graphics and commands refuse them, as when the triangles take more faces than a 3D effect draws. Every solid of the object (a fill's, and a stroke's outline) carries the graphics. The handle sits on the point of the puffed face above the graphic's center, and only where the viewer sees that face. The cutting into straight pieces, the seam strokes and the limits below are those of Revolve; when the triangles take more faces than a 3D From 8f47eaa23f53f3fcbe8d697ae6945d6cd8286af3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 00:20:01 -0800 Subject: [PATCH 12/16] 3D: no Inflate graphic handle where a nearer facet covers it A graphic's handle on Inflate's front or back was placed through the nearest piece of its own face only, so a nearer piece of the other face, a side or a back cap could hide a handle that still showed and could be dragged. The handle and the offset read from the page are now left out where a facet drawn over that point of the page covers it: one clearly nearer there, or one drawn last (a cap turned toward the viewer), unless the piece is itself drawn last after it. --- crates/effects/src/solids/graphics.rs | 87 +++++++++++++++++---- crates/effects/src/solids/tests_graphics.rs | 53 ++++++++++++- 2 files changed, 123 insertions(+), 17 deletions(-) diff --git a/crates/effects/src/solids/graphics.rs b/crates/effects/src/solids/graphics.rs index 03ae75a927..2ef74b1b10 100644 --- a/crates/effects/src/solids/graphics.rs +++ b/crates/effects/src/solids/graphics.rs @@ -1018,10 +1018,41 @@ pub struct GraphicFrame { /// The pieces of Inflate's front and puffed back that show their outside to the viewer, as the /// graphics are drawn on them ([`surface_parts`]): each piece's face, its corners in the art's plane /// (offsets from the center of the object's bounds) and on the page, its depth (larger is nearer) -/// and its plane, for its depth at a point of the page. +/// and its plane, for its depth at a point of the page. The other facets the viewer sees (the +/// sides, and pieces that show the surface's inside) are kept as `covers`, for where they hide +/// a piece. #[derive(Clone, Debug, Default, PartialEq)] pub struct MembraneFrame { pieces: Vec, + covers: Vec, +} + +/// A facet that can hide a piece of Inflate's front or back: its contours on the page (nonzero +/// winding), its depth, its plane and its place among the solid's facets. +#[derive(Clone, Debug, PartialEq)] +struct Cover { + contours: Vec>, + depth: f64, + plane: Option, + index: usize, +} + +impl Cover { + /// Does the facet hold page point `p`? + fn holds(&self, p: Point) -> bool { + let mut winding = 0i32; + for c in &self.contours { + for (a, b) in c.iter().zip(c.iter().cycle().skip(1)).take(c.len()) { + let side = (*b - *a).cross(p - *a); + if a.y <= p.y && b.y > p.y && side > 0.0 { + winding += 1; + } else if a.y > p.y && b.y <= p.y && side < 0.0 { + winding -= 1; + } + } + } + winding != 0 + } } #[derive(Clone, Debug, PartialEq)] @@ -1031,6 +1062,9 @@ struct MembranePiece { page: [Point; 3], depth: f64, plane: Option, + /// The piece's place among the solid's facets: of two facets drawn last, the later one is drawn + /// over the other. + index: usize, } impl MembranePiece { @@ -1043,31 +1077,35 @@ impl MembranePiece { impl MembraneFrame { /// The pieces of `facets` that carry where they lie in the art's plane and show the outside of - /// Inflate's front or back. + /// Inflate's front or back, and the other facets not turned away from the viewer as covers. pub(super) fn of<'a>(facets: impl IntoIterator) -> Self { - let pieces = facets - .into_iter() - .filter_map(|f| { - let face = f.membrane?; - let cell = f.surface.as_ref().filter(|c| c.outward)?; + let (mut pieces, mut covers) = (Vec::new(), Vec::new()); + for (index, f) in facets.into_iter().enumerate() { + let piece = f.membrane.zip(f.surface.as_ref().filter(|c| c.outward)).and_then(|(face, cell)| { let uv = <[Point; 3]>::try_from(cell.uv.as_slice()).ok()?; let page = <[Point; 3]>::try_from(cell.page.as_slice()).ok()?; - Some(MembranePiece { face, uv, page, depth: f.depth, plane: f.plane }) - }) - .collect(); - Self { pieces } + Some(MembranePiece { face, uv, page, depth: f.depth, plane: f.plane, index }) + }); + match piece { + Some(piece) => pieces.push(piece), + None if !f.away => covers.push(Cover { contours: f.contours.clone(), depth: f.depth, plane: f.plane, index }), + None => {} + } + } + Self { pieces, covers } } /// Point `p` of `face` in the art's plane mapped onto the page, or with `from_page` a page point /// mapped into the art's plane, through the piece of that face that holds it and is nearest at - /// that point of the page. `None` when no piece the viewer sees holds it. + /// that point of the page. `None` when no piece the viewer sees holds it, or when a nearer piece + /// of the other face or a nearer cover hides that point of the page. fn map(&self, face: PlanarFace, p: Point, from_page: bool) -> Option { let inside = |t: &[Point; 3], q: Point| { let side = |a: Point, b: Point| (b - a).cross(q - a); let s = [side(t[0], t[1]), side(t[1], t[2]), side(t[2], t[0])]; s.iter().all(|v| *v >= -1e-9) || s.iter().all(|v| *v <= 1e-9) }; - let mut best: Option<(Point, f64)> = None; + let mut best: Option<(Point, f64, &MembranePiece)> = None; for piece in self.pieces.iter().filter(|piece| piece.face == face) { let (from, to) = if from_page { (&piece.page, &piece.uv) } else { (&piece.uv, &piece.page) }; if !inside(from, p) { @@ -1075,11 +1113,28 @@ impl MembraneFrame { } let Some(q) = triangle_map(from, to).map(|m| m * p).filter(|q| q.is_finite()) else { continue }; let depth = piece.depth_at(if from_page { p } else { q }); - if best.is_none_or(|(_, nearest)| depth > nearest) { - best = Some((q, depth)); + if best.is_none_or(|(_, nearest, _)| depth > nearest) { + best = Some((q, depth, piece)); } } - best.map(|(q, _)| q) + let (q, depth, shown) = best?; + let at = if from_page { p } else { q }; + // A facet drawn last (depth `f64::MAX`) is drawn over every other one, and over another + // drawn last before it. Otherwise, where the front, the back and the sides meet, they give + // the same depth there, and only a facet clearly nearer covers. + let hides = |raw: f64, there: f64, index: usize| match (raw == f64::MAX, shown.depth == f64::MAX) { + (true, true) => index > shown.index, + (true, false) => true, + (false, true) => false, + (false, false) => there > depth + 1e-6 * depth.abs().max(1.0), + }; + let covered = self + .pieces + .iter() + .filter(|piece| piece.face != face) + .any(|piece| inside(&piece.page, at) && hides(piece.depth, piece.depth_at(at), piece.index)) + || self.covers.iter().any(|c| c.holds(at) && hides(c.depth, c.plane.and_then(|plane| plane.depth_at(at)).unwrap_or(c.depth), c.index)); + (!covered).then_some(q) } } diff --git a/crates/effects/src/solids/tests_graphics.rs b/crates/effects/src/solids/tests_graphics.rs index 2fe175a4aa..1873156469 100644 --- a/crates/effects/src/solids/tests_graphics.rs +++ b/crates/effects/src/solids/tests_graphics.rs @@ -1044,15 +1044,66 @@ fn overlapping_inflate_pieces_map_a_point_through_the_one_nearer_there() { page, depth, plane: Some(DepthPlane { normal, offset, center: Point::ORIGIN, eye: None }), + index: 0, }; // The tilted piece is nearer at its center (depth 10) but at depth 0 where x is 10; the flat // one lies at depth 5 everywhere. let tilted = piece(0.0, 10.0, [1.0, 0.0, 1.0], 10.0); let flat = piece(100.0, 5.0, [0.0, 0.0, 1.0], 5.0); - let frame = GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces: vec![tilted, flat] }); + let frame = GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces: vec![tilted, flat], covers: vec![] }); let (x, y) = frame.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).unwrap(); assert!((x - 110.0).abs() < 1e-6 && (y - 5.0).abs() < 1e-6, "{x} {y}"); // Near the tilted piece's left corner it is the nearer one. let (x, _) = frame.offset_at(PlanarFace::Front, Point::new(2.0, 0.5)).unwrap(); assert!((x - 2.0).abs() < 1e-6, "{x}"); } + +/// A graphic on Inflate's back has no handle where a nearer piece of the front covers its center +/// on the page, and the back has no offset there; where the back is nearer, it has both. +#[test] +fn an_inflate_back_graphic_covered_by_a_nearer_front_piece_has_no_handle() { + let page = [Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(10.0, 20.0)]; + let piece = |face: PlanarFace, depth: f64| MembranePiece { face, uv: page, page, depth, plane: None, index: 0 }; + let frame = |front: f64, back: f64| { + let pieces = vec![piece(PlanarFace::Front, front), piece(PlanarFace::Back, back)]; + GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces, covers: vec![] }) + }; + let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "back", "x": -10.0, "y": 5.0})).unwrap(); + let covered = frame(10.0, 5.0); + assert!(covered.handle(&g).is_none()); + assert!(covered.offset_at(PlanarFace::Back, Point::new(10.0, 5.0)).is_none()); + assert!(covered.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).is_some()); + let seen = frame(5.0, 10.0); + let (at, _) = seen.handle(&g).unwrap(); + assert!((at.x - 10.0).abs() < 1e-6 && (at.y - 5.0).abs() < 1e-6, "{at:?}"); + assert!(seen.offset_at(PlanarFace::Back, Point::new(10.0, 5.0)).is_some()); +} + +/// A nearer side facet that covers a graphic's center on Inflate's front hides its handle; one +/// behind the front, or beside the center, leaves it. A facet drawn last (a back cap) hides it +/// whatever its plane's depth, unless the front piece is drawn last too, after it. +#[test] +fn an_inflate_graphic_covered_by_a_nearer_side_has_no_handle() { + let page = [Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(10.0, 20.0)]; + let front = |depth: f64, index: usize| MembranePiece { face: PlanarFace::Front, uv: page, page, depth, plane: None, index }; + let side = |x0: f64, depth: f64, index: usize| Cover { + contours: vec![vec![Point::new(x0, 0.0), Point::new(x0 + 4.0, 0.0), Point::new(x0 + 4.0, 20.0), Point::new(x0, 20.0)]], + depth, + // A plane behind the front, as a back cap's is. + plane: Some(DepthPlane { normal: [0.0, 0.0, 1.0], offset: 1.0, center: Point::ORIGIN, eye: None }), + index, + }; + let frame = |piece: MembranePiece, cover: Cover| { + GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces: vec![piece], covers: vec![cover] }) + }; + let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "front", "x": 10.0, "y": 5.0})).unwrap(); + let mut nearer = side(8.0, 10.0, 1); + nearer.plane = None; + assert!(frame(front(5.0, 0), nearer.clone()).handle(&g).is_none()); + assert!(frame(front(5.0, 0), nearer).offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).is_none()); + assert!(frame(front(5.0, 0), side(8.0, 10.0, 1)).handle(&g).is_some()); + assert!(frame(front(5.0, 0), side(14.0, 10.0, 1)).handle(&g).is_some()); + assert!(frame(front(5.0, 0), side(8.0, f64::MAX, 1)).handle(&g).is_none()); + assert!(frame(front(f64::MAX, 0), side(8.0, f64::MAX, 1)).handle(&g).is_none()); + assert!(frame(front(f64::MAX, 2), side(8.0, f64::MAX, 1)).handle(&g).is_some()); +} From 227b6b9984faec2686b46ed6825a10fb09cf41fd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 01:05:46 -0800 Subject: [PATCH 13/16] 3D: no Inflate graphic handle where a nearer piece of its own face covers it Where two pieces of an Inflate face overlap on the page, a graphic's center mapped through the farther piece had a handle at a point the nearer piece covers, and that point read back as a different offset. Every other piece now counts as a cover, of either face. A piece drawn last is chosen over the others by draw order, as the cover check orders them, so two overlapping pieces drawn last map through the later one. --- crates/effects/src/solids/graphics.rs | 16 ++++++++++++---- crates/effects/src/solids/tests_graphics.rs | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/crates/effects/src/solids/graphics.rs b/crates/effects/src/solids/graphics.rs index 2ef74b1b10..ad0c802728 100644 --- a/crates/effects/src/solids/graphics.rs +++ b/crates/effects/src/solids/graphics.rs @@ -1097,8 +1097,8 @@ impl MembraneFrame { /// Point `p` of `face` in the art's plane mapped onto the page, or with `from_page` a page point /// mapped into the art's plane, through the piece of that face that holds it and is nearest at - /// that point of the page. `None` when no piece the viewer sees holds it, or when a nearer piece - /// of the other face or a nearer cover hides that point of the page. + /// that point of the page. `None` when no piece the viewer sees holds it, or when another nearer + /// piece, of either face, or a nearer cover hides that point of the page. fn map(&self, face: PlanarFace, p: Point, from_page: bool) -> Option { let inside = |t: &[Point; 3], q: Point| { let side = |a: Point, b: Point| (b - a).cross(q - a); @@ -1113,7 +1113,15 @@ impl MembraneFrame { } let Some(q) = triangle_map(from, to).map(|m| m * p).filter(|q| q.is_finite()) else { continue }; let depth = piece.depth_at(if from_page { p } else { q }); - if best.is_none_or(|(_, nearest, _)| depth > nearest) { + // A piece drawn last is drawn over every other one, and the later of two drawn last is + // drawn over the other, whatever their planes' depths. + let over = |(_, nearest, other): (Point, f64, &MembranePiece)| match (piece.depth == f64::MAX, other.depth == f64::MAX) { + (true, true) => piece.index > other.index, + (true, false) => true, + (false, true) => false, + (false, false) => depth > nearest, + }; + if best.is_none_or(over) { best = Some((q, depth, piece)); } } @@ -1131,7 +1139,7 @@ impl MembraneFrame { let covered = self .pieces .iter() - .filter(|piece| piece.face != face) + .filter(|piece| !std::ptr::eq(*piece, shown)) .any(|piece| inside(&piece.page, at) && hides(piece.depth, piece.depth_at(at), piece.index)) || self.covers.iter().any(|c| c.holds(at) && hides(c.depth, c.plane.and_then(|plane| plane.depth_at(at)).unwrap_or(c.depth), c.index)); (!covered).then_some(q) diff --git a/crates/effects/src/solids/tests_graphics.rs b/crates/effects/src/solids/tests_graphics.rs index 1873156469..ca3ba46d59 100644 --- a/crates/effects/src/solids/tests_graphics.rs +++ b/crates/effects/src/solids/tests_graphics.rs @@ -1056,6 +1056,24 @@ fn overlapping_inflate_pieces_map_a_point_through_the_one_nearer_there() { // Near the tilted piece's left corner it is the nearer one. let (x, _) = frame.offset_at(PlanarFace::Front, Point::new(2.0, 0.5)).unwrap(); assert!((x - 2.0).abs() < 1e-6, "{x}"); + // A graphic's center has a handle only where its own piece is the nearer one, and the handle + // maps back to the same offset. + let mark = |x: f64, y: f64| MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "front", "x": x, "y": y})).unwrap(); + assert!(frame.handle(&mark(10.0, 5.0)).is_none()); + for (x, y) in [(2.0, 0.5), (110.0, 5.0)] { + let (at, _) = frame.handle(&mark(x, y)).unwrap(); + let (bx, by) = frame.offset_at(PlanarFace::Front, at).unwrap(); + assert!((bx - x).abs() < 1e-6 && (by - y).abs() < 1e-6, "{x} {y}: {bx} {by}"); + } + // Of two overlapping pieces drawn last, the later one is drawn over the other, though the + // earlier one's plane is nearer. + let last = |shift: f64, offset: f64, index: usize| MembranePiece { index, ..piece(shift, f64::MAX, [0.0, 0.0, 1.0], offset) }; + let pieces = vec![last(0.0, 10.0, 0), last(100.0, 0.0, 1)]; + let frame = GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces, covers: vec![] }); + let (x, _) = frame.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).unwrap(); + assert!((x - 110.0).abs() < 1e-6, "{x}"); + assert!(frame.handle(&mark(10.0, 5.0)).is_none()); + assert!(frame.handle(&mark(110.0, 5.0)).is_some()); } /// A graphic on Inflate's back has no handle where a nearer piece of the front covers its center From 4a5931641addd00d3632bb2b5c37208b41989a39 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 05:02:42 -0800 Subject: [PATCH 14/16] 3D: test that Inflate graphics pass over an ear whose new edge runs through a dent Adds a test for a ring whose first ear's new edge runs through a dent's corner: the ear is passed over, so no triangle edge runs through a corner of the ring. --- crates/three-d/src/mesh/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/three-d/src/mesh/tests.rs b/crates/three-d/src/mesh/tests.rs index 9980e900d1..d17101f66e 100644 --- a/crates/three-d/src/mesh/tests.rs +++ b/crates/three-d/src/mesh/tests.rs @@ -205,6 +205,24 @@ fn flat_triangles_keep_corners_on_the_edge_an_ear_would_cut() { } } +#[test] +fn flat_triangles_pass_over_an_ear_whose_new_edge_runs_through_a_dent() { + // The first ear's new edge, from (0, 4) to (4, 0), runs through the dent's corner at (2, 2). + let p = |x: f64, y: f64| Point::new(x, y); + let outline = vec![p(0.0, 0.0), p(4.0, 0.0), p(4.0, 4.0), p(2.0, 2.0), p(0.0, 4.0)]; + let mut work = 0; + let triangles = flat_triangles(std::slice::from_ref(&outline), &mut work, usize::MAX).unwrap(); + let area = |t: &[Point; 3]| ((t[1].x - t[0].x) * (t[2].y - t[0].y) - (t[1].y - t[0].y) * (t[2].x - t[0].x)) / 2.0; + assert!((triangles.iter().map(area).sum::() - 12.0).abs() < 1e-9); + for t in &triangles { + for (a, b) in [(t[0], t[1]), (t[1], t[2]), (t[2], t[0])] { + for q in &outline { + assert!(!super::touches((q.x, q.y), (a.x, a.y), (b.x, b.y)), "{q:?} lies inside the edge {a:?} to {b:?}"); + } + } + } +} + #[test] fn flat_triangles_stop_at_their_budget() { let p = |x: f64, y: f64| Point::new(x, y); From 3056ebe9f9b88603179e8db20c89e476d09164b3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 13:34:55 -0800 Subject: [PATCH 15/16] i18n: Inflate's refusal of graphics on a side is translated The refusal "Inflate maps graphics onto its front and back, not onto a side" gets an @msg row in each of the 24 complete-message catalogs, next to the Revolve row, so three_d_refusals_are_translated_in_every_complete_catalog passes. --- crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + 24 files changed, 24 insertions(+) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 604bbb9028..bd34511544 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6755,6 +6755,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` ha de ser una matriu @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Els gràfics s’apliquen als tipus d’objecte Pla, Extrusió, Revolució i Infla @msg Revolve maps graphics onto its side: map them onto the front Revoluciona aplica els gràfics al seu lateral: aplica’ls a la cara davantera +@msg Inflate maps graphics onto its front and back, not onto a side Infla aplica els gràfics a la cara davantera i a la posterior, no a un lateral @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on l’objecte {_1}: la cara posterior d’Infla només admet gràfics amb Tots dos costats i Tapa activats @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Els gràfics són massa complexos per a aquesta superfície: simplifica la il·lustració dels símbols o redueix Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admet com a màxim {MAX_GRAPHICS} gràfics diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 941b4da68a..538575924b 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6550,6 +6550,7 @@ mark-style Japanese Japonské @msg `{GRAPHICS}` must be an array `{GRAPHICS}` musí být pole @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafika se mapuje na typy objektu Rovina, Vysunutí, Rotační těleso a Nafouknutí @msg Revolve maps graphics onto its side: map them onto the front Rotační těleso mapuje grafiku na svůj bok: umístěte ji na přední stranu +@msg Inflate maps graphics onto its front and back, not onto a side Nafouknutí mapuje grafiku na přední a zadní stranu, ne na bok @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekt {_1}: zadní strana Nafouknutí přijímá grafiku jen se zapnutými volbami Obě strany a Uzávěr @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafika je pro tento povrch příliš složitá: zjednodušte kresbu symbolů nebo snižte Segmenty @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` přijímá nejvýše {MAX_GRAPHICS} grafik diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 789dcc430f..9f03515356 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -438,6 +438,7 @@ liquify-list-end {0}, {1} {0} og {1} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` skal være et array @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik kortlægges på objekttyperne Plan, Ekstrudér, Omdrej og Pust op @msg Revolve maps graphics onto its side: map them onto the front Omdrej kortlægger grafik på siden: kortlæg den på forsiden +@msg Inflate maps graphics onto its front and back, not onto a side Pust op kortlægger grafik på forsiden og bagsiden, ikke på en side @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objektet {_1}: bagsiden af Pust op tager kun imod grafik, når Begge sider og Kappe er slået til @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikken er for kompleks til denne overflade: forenkl symbolernes grafik, eller reducér Segmenter @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tager højst {MAX_GRAPHICS} grafikelementer diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index b0d5cff68c..7ff48b2d14 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6118,6 +6118,7 @@ lighting Light Licht @msg `{GRAPHICS}` must be an array `{GRAPHICS}` muss ein Array sein @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiken werden auf die Objekttypen Ebene, Extrudieren, Kreiseln und Aufblasen abgebildet @msg Revolve maps graphics onto its side: map them onto the front Kreiseln bildet Grafiken auf seiner Mantelfläche ab: Bilden Sie sie auf der Vorderseite ab +@msg Inflate maps graphics onto its front and back, not onto a side Aufblasen bildet Grafiken auf der Vorder- und Rückseite ab, nicht auf einer Seitenfläche @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on Objekt {_1}: Die Rückseite von „Aufblasen“ nimmt Grafiken nur mit aktivierten Optionen „Beidseitig“ und „Deckflächen“ auf @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Die Grafiken sind für diese Oberfläche zu komplex: Vereinfachen Sie das Bildmaterial der Symbole oder verringern Sie Segmente @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nimmt höchstens {MAX_GRAPHICS} Grafiken auf diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 0166d82d30..e97c2cee65 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5938,6 +5938,7 @@ variable-list-end {0}, {1} {0} και {1} @msg `{GRAPHICS}` must be an array το `{GRAPHICS}` πρέπει να είναι πίνακας @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Τα γραφικά αντιστοιχίζονται στους τύπους αντικειμένου Επίπεδο, Εξώθηση, Περιστροφή γύρω από άξονα και Φούσκωμα @msg Revolve maps graphics onto its side: map them onto the front Η Περιστροφή γύρω από άξονα αντιστοιχίζει τα γραφικά στην πλευρική της επιφάνεια: αντιστοιχίστε τα στην μπροστινή όψη +@msg Inflate maps graphics onto its front and back, not onto a side Το Φούσκωμα αντιστοιχίζει τα γραφικά στην μπροστινή και την πίσω όψη, όχι σε πλευρική επιφάνεια @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on το αντικείμενο {_1}: η πίσω όψη του Φουσκώματος δέχεται γραφικά μόνο με ενεργά τα Και οι δύο πλευρές και Κλείσιμο άκρου @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Τα γραφικά είναι πολύ σύνθετα για αυτή την επιφάνεια: απλοποιήστε το σχέδιο των συμβόλων ή μειώστε τα Τμήματα @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics το `{GRAPHICS}` δέχεται το πολύ {MAX_GRAPHICS} γραφικά diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index d52a76a65d..62578b6492 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -6523,6 +6523,7 @@ mark-style Japanese Japonesas @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar Graphics map onto the Plane, Extrude, Revolve and Inflate object types. Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar. @msg Revolve maps graphics onto its side: map them onto the front Revolución asigna los gráficos a su lateral: asígnelos a la cara frontal +@msg Inflate maps graphics onto its front and back, not onto a side Inflar asigna los gráficos a la cara frontal y a la posterior, no a un lateral @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on el objeto {_1}: la cara posterior de Inflar admite gráficos solo con Ambos lados y Tapa activados @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Los gráficos son demasiado complejos para esta superficie: simplifique la ilustración de los símbolos o reduzca Segmentos @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admite como máximo {MAX_GRAPHICS} gráficos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index c04fbd953c..395ba3d006 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6455,6 +6455,7 @@ mark-style Japanese Japanilainen @msg `{GRAPHICS}` must be an array `{GRAPHICS}` on oltava taulukko @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiikat sijoitetaan objektityypeille Taso, Pursota, Pyöräytä ja Täytä ilmalla @msg Revolve maps graphics onto its side: map them onto the front Pyöräytä sijoittaa grafiikat kylkeensä: sijoita ne etupuolelle +@msg Inflate maps graphics onto its front and back, not onto a side Täytä ilmalla sijoittaa grafiikat etu- ja takapuolelle, ei kylkeen @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekti {_1}: Täytä ilmalla -tehosteen takapuoli ottaa grafiikoita vain, kun Molemmat puolet ja Pääty ovat käytössä @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiikat ovat liian monimutkaisia tälle pinnalle: yksinkertaista symbolien kuvitusta tai pienennä Segmentit-arvoa @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` hyväksyy enintään {MAX_GRAPHICS} grafiikkaa diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 01e15553dd..1dad86223b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -6118,6 +6118,7 @@ lighting Light Lumière @msg `{GRAPHICS}` must be an array `{GRAPHICS}` doit être un tableau @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Les graphiques s’appliquent aux types d’objet Plan, Extrusion, Révolution et Gonfler @msg Revolve maps graphics onto its side: map them onto the front Révolution applique les graphiques sur sa face latérale : appliquez-les sur la face avant +@msg Inflate maps graphics onto its front and back, not onto a side Gonfler applique les graphiques sur la face avant et l’arrière, pas sur une face latérale @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objet {_1} : l’arrière de Gonfler n’accepte des graphiques qu’avec Deux côtés et Fermeture activés @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Les graphiques sont trop complexes pour cette surface : simplifiez l’illustration des symboles ou réduisez Segments @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accepte au plus {MAX_GRAPHICS} graphiques diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 36bfd90eb2..9d26d3b333 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8647,6 +8647,7 @@ liquify-list-end {0}, {1} {0} और {1} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` एक ऐरे होना चाहिए @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types ग्राफ़िक्स समतल, एक्सट्रूड, रिवॉल्व और फुलाएँ ऑब्जेक्ट प्रकारों पर लगते हैं @msg Revolve maps graphics onto its side: map them onto the front रिवॉल्व ग्राफ़िक्स को अपनी बगल वाली सतह पर लगाता है: उन्हें सामने वाले फ़ेस पर लगाएँ +@msg Inflate maps graphics onto its front and back, not onto a side फुलाएँ ग्राफ़िक्स को सामने और पिछले फ़ेस पर लगाता है, बगल वाली सतह पर नहीं @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on ऑब्जेक्ट {_1}: फुलाएँ का पिछला फ़ेस ग्राफ़िक्स तभी लेता है जब दोनों तरफ़ और कैप चालू हों @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments ग्राफ़िक्स इस सतह के लिए बहुत जटिल हैं: सिंबल्स के आर्ट को सरल बनाएँ या सेगमेंट कम करें @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` अधिकतम {MAX_GRAPHICS} ग्राफ़िक्स लेता है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 798ca1697d..61d314847b 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6534,6 +6534,7 @@ variable-list-end {0}, {1} {0} és {1} @msg `{GRAPHICS}` must be an array a `{GRAPHICS}` értéke tömb kell legyen @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types A grafikák a Sík, a Kihúzás, a Forgatás tengely körül és a Felfújás objektumtípusra kerülnek @msg Revolve maps graphics onto its side: map them onto the front A Forgatás tengely körül a grafikákat a palástjára helyezi: az elülső oldalra helyezze őket +@msg Inflate maps graphics onto its front and back, not onto a side A Felfújás a grafikákat az elülső és a hátoldalra helyezi, nem az oldalára @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on {_1} objektum: a Felfújás hátoldala csak a Mindkét oldal és a Zárólap bekapcsolásával fogad grafikát @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments A grafikák túl összetettek ehhez a felülethez: egyszerűsítse a szimbólumok rajzát, vagy csökkentse a Szakaszok értékét @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics a `{GRAPHICS}` legfeljebb {MAX_GRAPHICS} grafikát fogad diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 1483c97f4a..698bc5d21c 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6165,6 +6165,7 @@ lighting Light Luce @msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve essere un array @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Le grafiche si applicano ai tipi di oggetto Piano, Estrusione, Rivoluzione e Gonfia @msg Revolve maps graphics onto its side: map them onto the front Rivoluzione applica le grafiche sul suo lato: applicatele sulla faccia anteriore +@msg Inflate maps graphics onto its front and back, not onto a side Gonfia applica le grafiche sulla faccia anteriore e sul retro, non su un lato @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on oggetto {_1}: il retro di Gonfia accetta grafiche solo con Entrambi i lati e Chiusura attivi @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Le grafiche sono troppo complesse per questa superficie: semplificate il disegno dei simboli o riducete Segmenti @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accetta al massimo {MAX_GRAPHICS} grafiche diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d4abe69ee5..35f58aa08f 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -6215,6 +6215,7 @@ lighting Light ライト @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます Graphics map onto the Plane, Extrude, Revolve and Inflate object types. グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます。 @msg Revolve maps graphics onto its side: map them onto the front 回転体はグラフィックを側面にマッピングします。前面にマッピングしてください +@msg Inflate maps graphics onto its front and back, not onto a side 膨張はグラフィックを前面と背面にマッピングします。側面にはマッピングできません @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on オブジェクト {_1}: 「膨張」の背面にグラフィックをマッピングするには「両面」と「キャップ」をオンにしてください @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments グラフィックがこのサーフェスには複雑すぎます。シンボルのアートを単純化するか、分割数を減らしてください @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` に指定できるグラフィックは {MAX_GRAPHICS} 個までです diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d03d46435f..f747fddad7 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -7902,6 +7902,7 @@ font-technology Variable ცვლადი @msg `{GRAPHICS}` must be an array `{GRAPHICS}` უნდა იყოს მასივი @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types გრაფიკა თავსდება ობიექტის ტიპებზე „სიბრტყე“, „ამოწევა“, „ბრუნვა“ და „გაბერვა“ @msg Revolve maps graphics onto its side: map them onto the front ბრუნვა გრაფიკას თავის გვერდით ზედაპირზე ათავსებს: განათავსეთ ისინი წინა მხარეზე +@msg Inflate maps graphics onto its front and back, not onto a side გაბერვა გრაფიკას წინა და უკანა მხარეზე ათავსებს და არა გვერდით ზედაპირზე @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on ობიექტი {_1}: გაბერვის უკანა მხარე გრაფიკას იღებს მხოლოდ ჩართული „ორივე მხარე“ და „თავსახური“ პარამეტრებით @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments გრაფიკა ზედმეტად რთულია ამ ზედაპირისთვის: გაამარტივეთ სიმბოლოების ნახატი ან შეამცირეთ სეგმენტები @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` იღებს მაქსიმუმ {MAX_GRAPHICS} გრაფიკას diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 363de4c969..637a06d4c3 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6135,6 +6135,7 @@ lighting Light 광원 @msg `{GRAPHICS}` must be an array `{GRAPHICS}`은(는) 배열이어야 합니다 @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 그래픽은 평면, 돌출, 회전체, 부풀리기 개체 유형에 매핑됩니다 @msg Revolve maps graphics onto its side: map them onto the front 회전체는 그래픽을 옆면에 매핑합니다. 앞면에 매핑하십시오 +@msg Inflate maps graphics onto its front and back, not onto a side 부풀리기는 그래픽을 앞면과 뒷면에 매핑하며 옆면에는 매핑하지 않습니다 @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 개체 {_1}: 부풀리기의 뒷면에 그래픽을 매핑하려면 양면과 캡을 켜세요 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 그래픽이 이 표면에 비해 너무 복잡합니다. 심볼의 아트를 단순화하거나 세그먼트를 줄이십시오 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}`에는 그래픽을 최대 {MAX_GRAPHICS}개까지 넣을 수 있습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index b13e066e49..68377c6b2d 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8306,6 +8306,7 @@ mark-style Japanese Japans @msg Graphics map onto planar faces: use the Extrude or Plane object type Illustraties worden op platte vlakken geplaatst: gebruik het objecttype Extruderen of Vlak @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Illustraties worden op de objecttypen Vlak, Extruderen, Draaien en Opblazen geplaatst @msg Revolve maps graphics onto its side: map them onto the front Draaien plaatst illustraties op de zijkant: plaats ze op de voorkant +@msg Inflate maps graphics onto its front and back, not onto a side Opblazen plaatst illustraties op de voorkant en de achterkant, niet op een zijkant @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on object {_1}: de achterkant van Opblazen neemt alleen afbeeldingen aan met Beide zijden en Dop ingeschakeld @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments De illustraties zijn te complex voor dit oppervlak: vereenvoudig de illustraties van de symbolen of verlaag Segmenten @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` neemt maximaal {MAX_GRAPHICS} illustraties op diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 4d5c25d727..97f6a8151e 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -6374,6 +6374,7 @@ mark-style Japanese Japońskie @msg `{GRAPHICS}` must be an array `{GRAPHICS}` musi być tablicą @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiki są nakładane na obiekty typu Płaszczyzna, Wyciągnięcie, Obrót i Nadmuchanie @msg Revolve maps graphics onto its side: map them onto the front Obrót nakłada grafiki na swoją powierzchnię boczną: umieść je na przedniej stronie +@msg Inflate maps graphics onto its front and back, not onto a side Nadmuchanie nakłada grafiki na przednią i tylną stronę, a nie na powierzchnię boczną @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on obiekt {_1}: tył Nadmuchania przyjmuje grafiki tylko przy włączonych opcjach Obie strony i Zakończenie @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiki są zbyt złożone dla tej powierzchni: uprość kompozycje symboli lub zmniejsz Segmenty @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` przyjmuje najwyżej {MAX_GRAPHICS} grafik diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 4aba908498..fe75a942a8 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -6500,6 +6500,7 @@ mark-style Japanese Japonesas @msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve ser uma matriz @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Os gráficos são mapeados nos tipos de objeto Plano, Extrusão, Revolver e Inflar @msg Revolve maps graphics onto its side: map them onto the front Revolver mapeia os gráficos na sua lateral: mapeie-os na face frontal +@msg Inflate maps graphics onto its front and back, not onto a side Inflar mapeia os gráficos na face frontal e no verso, não em uma lateral @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objeto {_1}: o verso de Inflar recebe gráficos apenas com Ambos os Lados e Tampa ativados @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Os gráficos são complexos demais para esta superfície: simplifique a arte dos símbolos ou reduza Segmentos @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` aceita no máximo {MAX_GRAPHICS} gráficos diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 2e236f1827..79219217e3 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6162,6 +6162,7 @@ lighting Light Свет @msg `{GRAPHICS}` must be an array `{GRAPHICS}` должен быть массивом @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графика наносится на объекты типов «Плоскость», «Выдавливание», «Вращение» и «Надувание» @msg Revolve maps graphics onto its side: map them onto the front «Вращение» наносит графику на свою боковую поверхность: размещайте её на передней стороне +@msg Inflate maps graphics onto its front and back, not onto a side «Надувание» наносит графику на переднюю и заднюю стороны, а не на боковую поверхность @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on объект {_1}: задняя сторона «Надувания» принимает графику только при включённых параметрах «С обеих сторон» и «Торцы» @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графика слишком сложна для этой поверхности: упростите иллюстрации символов или уменьшите «Сегменты» @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` принимает не более {MAX_GRAPHICS} графических элементов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 0a0ebced8f..d4d8354258 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6036,6 +6036,7 @@ lighting Light Ljus @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp Graphics map onto the Plane, Extrude, Revolve and Inflate object types. Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp. @msg Revolve maps graphics onto its side: map them onto the front Rotera runt axel placerar grafik på sin mantelyta: placera den på framsidan +@msg Inflate maps graphics onto its front and back, not onto a side Blås upp placerar grafik på framsidan och baksidan, inte på en sida @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekt {_1}: baksidan av Blås upp tar emot grafik bara när Båda sidor och Lock är på @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiken är för komplex för den här ytan: förenkla symbolernas teckning eller minska Segment @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tar högst {MAX_GRAPHICS} grafiker diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d5e33ac203..a059b476eb 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5860,6 +5860,7 @@ lighting Light Işık @msg `{GRAPHICS}` must be an array `{GRAPHICS}` bir dizi olmalıdır @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafikler Düzlem, Ekstrüzyon, Eksen Etrafında Döndür ve Şişir nesne türlerine eşlenir @msg Revolve maps graphics onto its side: map them onto the front Eksen Etrafında Döndür grafikleri yan yüzeyine eşler: onları ön yüze eşle +@msg Inflate maps graphics onto its front and back, not onto a side Şişir grafikleri ön ve arka yüze eşler, yan yüze eşlemez @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on nesne {_1}: Şişir efektinin arka yüzü yalnızca Her iki taraf ve Kapak açıkken grafik alır @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikler bu yüzey için çok karmaşık: sembollerin resmini basitleştir veya Segmentler değerini azalt @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` en fazla {MAX_GRAPHICS} grafik alır diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index bfc0e4bb75..229f71a8de 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6145,6 +6145,7 @@ lighting Light Світло @msg `{GRAPHICS}` must be an array `{GRAPHICS}` має бути масивом @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графіка наноситься на об’єкти типів «Площина», «Видавлювання», «Обертання» та «Надування» @msg Revolve maps graphics onto its side: map them onto the front «Обертання» наносить графіку на свою бічну поверхню: розміщуйте її на передній стороні +@msg Inflate maps graphics onto its front and back, not onto a side «Надування» наносить графіку на передній і задній боки, а не на бічну поверхню @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on об’єкт {_1}: задній бік «Надування» приймає графіку лише з увімкненими параметрами «З обох боків» і «Торці» @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графіка надто складна для цієї поверхні: спростіть ілюстрації символів або зменште «Сегменти» @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` приймає не більше {MAX_GRAPHICS} графічних елементів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 5b84157a6c..3e08dddb09 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5958,6 +5958,7 @@ liquify-list-end {0}, {1} {0} và {1} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` phải là một mảng @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Đồ họa được đặt lên các loại đối tượng Mặt phẳng, Kéo dài, Xoay tròn và Phình @msg Revolve maps graphics onto its side: map them onto the front Xoay tròn đặt đồ họa lên mặt bên của nó: hãy đặt chúng lên mặt trước +@msg Inflate maps graphics onto its front and back, not onto a side Phình đặt đồ họa lên mặt trước và mặt sau, không đặt lên mặt bên @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on đối tượng {_1}: mặt sau của Phình chỉ nhận đồ họa khi bật Cả hai mặt và Nắp @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Đồ họa quá phức tạp cho bề mặt này: hãy đơn giản hóa hình vẽ của các ký hiệu hoặc giảm Đoạn @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nhận tối đa {MAX_GRAPHICS} đồ họa diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d28e8a698f..24ebfbae21 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6416,6 +6416,7 @@ lighting Light 光源 @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 图形映射到平面、突出、回转和膨胀对象类型上 Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 图形映射到平面、突出、回转和膨胀对象类型上。 @msg Revolve maps graphics onto its side: map them onto the front 回转将图形映射到其侧面:请将图形映射到正面 +@msg Inflate maps graphics onto its front and back, not onto a side 膨胀将图形映射到正面和背面,不映射到侧面 @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 对象 {_1}:只有打开“双面”和“封口”后,膨胀的背面才能贴图 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 图形对此表面过于复杂:请简化符号的图稿或减少分段数 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 个图形 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 9627f43344..4f8cea925c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6264,6 +6264,7 @@ lighting Light 光源 @msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型 Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型。 @msg Revolve maps graphics onto its side: map them onto the front 迴轉會將圖形對應到其側面:請將圖形對應到正面 +@msg Inflate maps graphics onto its front and back, not onto a side 膨脹會將圖形對應到正面和背面,不會對應到側面 @msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 物件 {_1}:只有開啟「雙面」和「封口」後,膨脹的背面才能對應圖形 @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 圖形對此表面過於複雜:請簡化符號的圖稿或減少分段數 @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 個圖形 From a744960076b46ddd8ddbfaa3542803cdb0d2f016 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 07:06:11 -0800 Subject: [PATCH 16/16] i18n: Indonesian rows for Inflate graphics messages --- crates/ui-egui/src/i18n/id.tsv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index bf1867a7c6..befdcef979 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -341,8 +341,10 @@ @msg `{GRAPHICS}` face must be front, back or side face `{GRAPHICS}` harus front, back, atau side @msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} `{GRAPHICS}` harus berupa angka dari {lo} sampai {hi} @msg `{GRAPHICS}` must be an array `{GRAPHICS}` harus berupa larik -@msg Graphics map onto the Plane, Extrude and Revolve object types Grafis dipetakan ke jenis objek Plane, Extrude, dan Revolve +@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafis dipetakan ke jenis objek Bidang, Ekstrusi, Revolusi, dan Gelembungkan @msg Revolve maps graphics onto its side: map them onto the front Revolusi memetakan grafis ke sisinya: petakan ke bagian depan +@msg Inflate maps graphics onto its front and back, not onto a side Gelembungkan memetakan grafis ke bagian depan dan belakangnya, bukan ke sisi +@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objek {_1}: bagian belakang Gelembungkan hanya menerima grafis saat Kedua sisi dan Ujung diaktifkan @msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafis terlalu rumit untuk permukaan ini: sederhanakan karya simbol atau kurangi Segmen @msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` menerima paling banyak {MAX_GRAPHICS} grafis @msg A plane has one face: map its graphics onto the front Bidang memiliki satu sisi: petakan grafisnya ke bagian depan