mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-24 18:32:23 +00:00
Merge pull request #7021 from dotCooCoo/feat/3d-custom-bevels
3D: Extrude & Bevel takes custom bevel shapes drawn as open paths
This commit is contained in:
@@ -253,6 +253,7 @@ fn with_stores(mut h: Headless) -> Headless {
|
||||
prefs_dir::attach_pdf_preset_store(&mut h.session);
|
||||
prefs_dir::attach_custom_dictionary(&mut h.session);
|
||||
prefs_dir::attach_arrowheads(&mut h.session);
|
||||
prefs_dir::attach_bevels(&mut h.session);
|
||||
h
|
||||
}
|
||||
|
||||
|
||||
@@ -567,6 +567,8 @@ fn main() -> std::process::ExitCode {
|
||||
prefs_dir::attach_custom_dictionary(&mut app.session);
|
||||
// The custom arrowheads, kept in their own file next to the preferences.
|
||||
prefs_dir::attach_arrowheads(&mut app.session);
|
||||
// The custom bevels, kept in their own file next to the preferences.
|
||||
prefs_dir::attach_bevels(&mut app.session);
|
||||
// Fit the window to its monitor, or put it back where it was (still hidden).
|
||||
let winit_window = cc.winit_window().cloned();
|
||||
if let Some(w) = &winit_window {
|
||||
|
||||
@@ -122,6 +122,14 @@ pub fn attach_arrowheads(session: &mut vectorcraft_engine::Session) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Keep the custom bevels (`threeD.bevels.edit`) in the `Bevels.vectorcraft` file next to the
|
||||
/// settings, and list the bevels it holds.
|
||||
pub fn attach_bevels(session: &mut vectorcraft_engine::Session) {
|
||||
if let Some(path) = store_dir(vectorcraft_engine::cmd::bevels::FILE_NAME) {
|
||||
session.attach_bevels_file(path.to_string_lossy().to_string());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -191,7 +191,7 @@ pub fn effect_catalog() -> Vec<EffectInfo> {
|
||||
EXTRUDE,
|
||||
"Extrude & Bevel…",
|
||||
&["Effect", "3D and Materials"],
|
||||
"{depth: pt (0..2000, 50), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none), bevelWidth: pt (0..1000, 4), bevelHeight: pt (0..1000, 4), bevelRepeat: integer (1..32, 1), bevelSpace: % (0..90, 0; flat between repeats), bevelInside: bool (false: added around the shape; true: carved into it), bevelBothSides: bool (false), 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, and how much it blurs the shadow), 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 shadow, black at 50% times the art's opacity, hard-edged at the first light's softness 0 and blurred above it), 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 caps and the side, see threeD.mapGraphic: symbol: name of a document symbol, face: front|back|side (front; the back reads left to right as seen from behind; side is the walls and bevels), x: pt (0; the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on the side from the middle of the side unrolled flat, along the outline, clockwise from its top), y: pt (0; on the side from the front toward the back), scale: % (1..10000, 100; of the symbol's own size), rotation: degrees (-360..360, 0; counterclockwise); drawn turned, foreshortened and shaded with the face and clipped to it: on a cap of a solid object only, and on the side of a solid or hollow object wrapped around it and drawn only where its outside faces the viewer), render: object ({mode: shaded}; mode: shaded|wireframe, as Revolve's)}. The front face is the art, extruded backwards about the centre of its bounds; painted with the top fill (else the top stroke).",
|
||||
"{depth: pt (0..2000, 50), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none; or custom, a bevel of the user's own drawn by bevelProfile), bevelWidth: pt (0..1000, 4), bevelHeight: pt (0..1000, 4), bevelRepeat: integer (1..32, 1), bevelSpace: % (0..90, 0; flat between repeats), bevelInside: bool (false: added around the shape; true: carved into it), bevelBothSides: bool (false), bevelName: string (a custom bevel's name), bevelProfile: [[x, y], …] (a custom bevel's 2 to 64 points, shares 0..1 of the width and height from [0, 0] at the cap's edge to [1, 1] at the side wall, joined by straight lines; effect.apply and effect.setParams also take bevel {custom: name}, a bevel of the bevels file (threeD.bevels.list), and store it as bevel custom with its bevelName and bevelProfile), 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, and how much it blurs the shadow), 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 shadow, black at 50% times the art's opacity, hard-edged at the first light's softness 0 and blurred above it), 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 caps and the side, see threeD.mapGraphic: symbol: name of a document symbol, face: front|back|side (front; the back reads left to right as seen from behind; side is the walls and bevels), x: pt (0; the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on the side from the middle of the side unrolled flat, along the outline, clockwise from its top), y: pt (0; on the side from the front toward the back), scale: % (1..10000, 100; of the symbol's own size), rotation: degrees (-360..360, 0; counterclockwise); drawn turned, foreshortened and shaded with the face and clipped to it: on a cap of a solid object only, and on the side of a solid or hollow object wrapped around it and drawn only where its outside faces the viewer), render: object ({mode: shaded}; mode: shaded|wireframe, as Revolve's)}. The front face is the art, extruded backwards about the centre of its bounds; painted with the top fill (else the top stroke).",
|
||||
json!({"depth":50.0,"twist":0.0,"taper":100.0,"cap":true,"bevel":"none","bevelWidth":4.0,"bevelHeight":4.0,"bevelRepeat":1,"bevelSpace":0.0,"bevelInside":false,"bevelBothSides":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":[],"render":{"mode":"shaded"}}),
|
||||
),
|
||||
g(
|
||||
@@ -212,7 +212,7 @@ pub fn effect_catalog() -> Vec<EffectInfo> {
|
||||
CLASSIC_EXTRUDE,
|
||||
"Extrude & Bevel (Classic)…",
|
||||
&["Effect", "3D and Materials", "3D (Classic)"],
|
||||
"{depth: pt (0..2000, 50), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none), bevelHeight: pt (1..100, 4; the bevel is as wide as it is tall), bevelInside: bool (false: added around the shape; true: carved into it), 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), surface: wireframe|none|diffuse|plastic (plastic; wireframe draws the edges of every face, hidden ones included, and fills none; none keeps the paint unlit; diffuse lights the faces softly; plastic adds a glossy highlight), lights: null or array of 1..10 objects (intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, behind: bool; overrides the single-light fields; the lights add up; color and softness are not used), 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, 100), ambient: % (0..100, 50; Ambient Light, every face whichever way it faces), highlightIntensity: % (0..100, 60; plastic only), highlightSize: % (0..100, 90; 100 broad, 0 a small spot; plastic only), blendSteps: integer (1..256, 25; how many levels the shading and the highlight are rounded to), shadingColor: black|custom|none|blackOverprint (black; the color the faces darken toward; none keeps the paint and adds only the highlight; blackOverprint keeps the paint and draws the shading over it as overprinting black, on the black plate, with no highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), preserveSpotColors: bool (false; a color linked to a spot or global swatch stays a tint of that swatch, lighter where the highlight is, with black multiplied and overprinting where the faces darken, so a spot color keeps its plate; it does nothing while shadingColor is custom, and with blackOverprint every face keeps its paint and swatch link whether it is on or off), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others), mapArt: array of 0..64 objects ([]; Map Art, see threeD.mapArt: surface: integer (1..100000; the numbered surface, one map for a surface), symbol: name of a document symbol, x: pt (-1000000..1000000, 0; the offset of the art's center from the center of the surface laid out flat), y: pt (-1000000..1000000, 0), scaleX: % (1..10000, 100; of the symbol's own width), scaleY: % (1..10000, 100), rotation: degrees (-360..360, 0; counterclockwise); the surfaces are numbered through the object's solids in the order they are built: each solid's front cap and back cap (none on a hollow solid, cap false), then each side wall from corner to corner of the outline, then the bevel above each wall; a map past the object's surfaces draws nothing; wireframe draws no mapped art), mapShade: bool (false; Shade Artwork: the mapped art takes the tone and highlight of its face), mapInvisible: bool (false; Invisible Geometry: with at least one map, only the mapped art is drawn)}. The front face is the art, extruded backwards about the center of its bounds; a solid is built for the top fill and for each stroke, each in its own paint. The defaults, the surface numbering and the limits are VectorCraft's own.",
|
||||
"{depth: pt (0..2000, 50), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none; or custom, a bevel of the user's own drawn by bevelProfile), bevelHeight: pt (1..100, 4; the bevel is as wide as it is tall), bevelInside: bool (false: added around the shape; true: carved into it), bevelName: string (a custom bevel's name), bevelProfile: [[x, y], …] (a custom bevel's points, as for threeD.extrude; bevel {custom: name} takes a bevel of the bevels file), 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), surface: wireframe|none|diffuse|plastic (plastic; wireframe draws the edges of every face, hidden ones included, and fills none; none keeps the paint unlit; diffuse lights the faces softly; plastic adds a glossy highlight), lights: null or array of 1..10 objects (intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, behind: bool; overrides the single-light fields; the lights add up; color and softness are not used), 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, 100), ambient: % (0..100, 50; Ambient Light, every face whichever way it faces), highlightIntensity: % (0..100, 60; plastic only), highlightSize: % (0..100, 90; 100 broad, 0 a small spot; plastic only), blendSteps: integer (1..256, 25; how many levels the shading and the highlight are rounded to), shadingColor: black|custom|none|blackOverprint (black; the color the faces darken toward; none keeps the paint and adds only the highlight; blackOverprint keeps the paint and draws the shading over it as overprinting black, on the black plate, with no highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), preserveSpotColors: bool (false; a color linked to a spot or global swatch stays a tint of that swatch, lighter where the highlight is, with black multiplied and overprinting where the faces darken, so a spot color keeps its plate; it does nothing while shadingColor is custom, and with blackOverprint every face keeps its paint and swatch link whether it is on or off), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others), mapArt: array of 0..64 objects ([]; Map Art, see threeD.mapArt: surface: integer (1..100000; the numbered surface, one map for a surface), symbol: name of a document symbol, x: pt (-1000000..1000000, 0; the offset of the art's center from the center of the surface laid out flat), y: pt (-1000000..1000000, 0), scaleX: % (1..10000, 100; of the symbol's own width), scaleY: % (1..10000, 100), rotation: degrees (-360..360, 0; counterclockwise); the surfaces are numbered through the object's solids in the order they are built: each solid's front cap and back cap (none on a hollow solid, cap false), then each side wall from corner to corner of the outline, then the bevel above each wall; a map past the object's surfaces draws nothing; wireframe draws no mapped art), mapShade: bool (false; Shade Artwork: the mapped art takes the tone and highlight of its face), mapInvisible: bool (false; Invisible Geometry: with at least one map, only the mapped art is drawn)}. The front face is the art, extruded backwards about the center of its bounds; a solid is built for the top fill and for each stroke, each in its own paint. The defaults, the surface numbering and the limits are VectorCraft's own.",
|
||||
json!({"depth":50.0,"cap":true,"bevel":"none","bevelHeight":4.0,"bevelInside":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"surface":"plastic","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":100.0,"ambient":50.0,"highlightIntensity":60.0,"highlightSize":90.0,"blendSteps":25,"shadingColor":"black","shadingCustom":"#000000","preserveSpotColors":false,"drawHiddenFaces":false,"mapArt":[],"mapShade":false,"mapInvisible":false}),
|
||||
),
|
||||
g(
|
||||
|
||||
@@ -97,11 +97,11 @@ pub use revolve::{
|
||||
CLASSIC_REVOLVE, REVOLVE, has_revolve, is_revolve, revolve_art, revolve_art_in, revolve_options, validate_revolve, validate_revolve_in,
|
||||
};
|
||||
pub use solids::{
|
||||
CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, GRAPHICS, GraphicFrame, INFLATE, MAX_GRAPHICS, MappedGraphic, MeshGraphics, RENDER, RENDER_MODES,
|
||||
ROTATE, ROTATE_SURFACES, ROTATION_PRESETS, SHADING_COLORS, SOLIDS, SolidMesh, THREE_D_TYPES, classic_extrude_options, classic_shading,
|
||||
extrude_options, graphic_bounds, graphic_frame, graphic_symbols, has_solid, inflate_options, is_classic_three_d, is_three_d, mapped_graphics,
|
||||
mesh_graphics_art, missing_symbol, names_graphic_symbol, rename_graphic_symbol, rename_graphic_symbol_in, renders_wireframe, solid_art,
|
||||
solid_art_in, takes_graphics, three_d_meshes, three_d_meshes_in, three_d_meshes_of, three_d_meshes_of_in, three_d_params_as,
|
||||
BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, GRAPHICS, GraphicFrame, INFLATE, MAX_GRAPHICS, MappedGraphic, MeshGraphics,
|
||||
RENDER, RENDER_MODES, ROTATE, ROTATE_SURFACES, ROTATION_PRESETS, SHADING_COLORS, SOLIDS, SolidMesh, THREE_D_TYPES, classic_extrude_options,
|
||||
classic_shading, extrude_options, graphic_bounds, graphic_frame, graphic_symbols, has_solid, inflate_options, is_classic_three_d, is_three_d,
|
||||
mapped_graphics, mesh_graphics_art, missing_symbol, names_graphic_symbol, rename_graphic_symbol, rename_graphic_symbol_in, renders_wireframe,
|
||||
solid_art, solid_art_in, takes_graphics, three_d_meshes, three_d_meshes_in, three_d_meshes_of, three_d_meshes_of_in, three_d_params_as,
|
||||
three_d_wireframe_in, validate_solid, validate_solid_in, validate_three_d, validate_three_d_at, validate_three_d_at_in, validate_three_d_in,
|
||||
validate_three_d_params, view_options, with_graphic,
|
||||
};
|
||||
@@ -116,8 +116,8 @@ pub use solids::{
|
||||
pub use stylize::{ScribbleSetting, scribble_setting_id, scribble_settings};
|
||||
pub use svg_filter::SVG_FILTER;
|
||||
pub use trap::TRAP;
|
||||
pub use vectorcraft_three_d::Mesh;
|
||||
pub use vectorcraft_three_d::PlanarFace;
|
||||
pub use vectorcraft_three_d::{BevelProfile, Mesh};
|
||||
pub use warp::{WARP_NET, WarpNet, WarpStyle, map_version, warp_point, warp_version};
|
||||
|
||||
mod catalog;
|
||||
|
||||
@@ -8,7 +8,7 @@ use vectorcraft_doc::{Appearance, AppearanceItem, Document, Effect, Node, NodeId
|
||||
use vectorcraft_geom::{BezPath, FillRule, PathData, Point, Rect, Vec2};
|
||||
use vectorcraft_pathops::BoolOp;
|
||||
use vectorcraft_three_d::{
|
||||
Bevel, BevelShape, DepthPlane, Extrude, Facet, Inflate, MAX_OBJECT_FACES, Mesh, MeshedSolid, PlanarFace, SolidFaces, View,
|
||||
Bevel, BevelProfile, BevelShape, DepthPlane, Extrude, Facet, Inflate, MAX_OBJECT_FACES, Mesh, MeshedSolid, PlanarFace, SolidFaces, View,
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -72,7 +72,9 @@ pub const THREE_D_TYPES: [(&str, &str); 4] = [("plane", ROTATE), ("extrude", EXT
|
||||
/// The parameters of 3D effect `to` for an effect `from` with `params`, as switching the object
|
||||
/// type keeps them: every setting `to` takes keeps its value from `params` (the defaults of `from`
|
||||
/// under them), each rotation angle wrapped into -180° to 180° when `to` is not Revolve, and the
|
||||
/// settings only `to` takes start at their defaults. Settings `to` does not take are dropped.
|
||||
/// settings only `to` takes start at their defaults. Settings `to` does not take are dropped; a
|
||||
/// custom bevel's name and points ([`BEVEL_NAME`], [`BEVEL_PROFILE`]) go with `bevel` when `to`
|
||||
/// takes one.
|
||||
pub fn three_d_params_as(from: &str, params: &Value, to: &str) -> Value {
|
||||
let current = crate::merged_params(from, params);
|
||||
let mut out = crate::default_params(to).and_then(|v| v.as_object().cloned()).unwrap_or_default();
|
||||
@@ -81,6 +83,13 @@ pub fn three_d_params_as(from: &str, params: &Value, to: &str) -> Value {
|
||||
value.clone_from(v);
|
||||
}
|
||||
}
|
||||
if out.contains_key("bevel") {
|
||||
for key in [BEVEL_NAME, BEVEL_PROFILE] {
|
||||
if let Some(v) = current.get(key).filter(|v| !v.is_null()) {
|
||||
out.insert(key.into(), v.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
if to != crate::REVOLVE {
|
||||
for key in ["rotationX", "rotationY", "rotationZ"] {
|
||||
if let Some(a) = out.get(key).and_then(Value::as_f64).filter(|a| !(-180.0..=180.0).contains(a)) {
|
||||
@@ -168,14 +177,66 @@ pub fn view_options(p: &Value) -> View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Extrude & Bevel's parameters. `bevel` is `"none"` or a [`BevelShape`] id.
|
||||
/// The custom bevel's name parameter: the name the bevels file gave it, kept for the menus.
|
||||
pub const BEVEL_NAME: &str = "bevelName";
|
||||
/// The custom bevel's points parameter: `[[across, down], …]`, shares of the bevel's width and
|
||||
/// height from the cap's edge `[0, 0]` to the side wall `[1, 1]` (a copy of the bevel's path, so
|
||||
/// the document draws it without the bevels file).
|
||||
pub const BEVEL_PROFILE: &str = "bevelProfile";
|
||||
|
||||
/// The points of `v`, a [`BEVEL_PROFILE`] value; `None` unless it is an array of `[x, y]` number
|
||||
/// pairs that make a [`BevelProfile`].
|
||||
fn bevel_profile(v: &Value) -> Option<BevelProfile> {
|
||||
let list = v.as_array().filter(|a| a.len() <= BevelProfile::MAX_POINTS)?;
|
||||
let pts: Option<Vec<(f64, f64)>> = list
|
||||
.iter()
|
||||
.map(|pt| match pt.as_array().map(Vec::as_slice) {
|
||||
Some([x, y]) => Some((x.as_f64()?, y.as_f64()?)),
|
||||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
BevelProfile::new(&pts?)
|
||||
}
|
||||
|
||||
/// The bevel shape of parameters `p`: `bevel` `"none"` (none), a built-in [`BevelShape`] id, or
|
||||
/// `"custom"` with its points in [`BEVEL_PROFILE`] (none when they do not make a profile).
|
||||
pub(crate) fn bevel_shape(p: &Value) -> Option<BevelShape> {
|
||||
match text(p, "bevel", "none") {
|
||||
"custom" => p.get(BEVEL_PROFILE).and_then(bevel_profile).map(BevelShape::Custom),
|
||||
id => BevelShape::parse(id),
|
||||
}
|
||||
}
|
||||
|
||||
/// Check the custom bevel parameters of `p`: `bevel` `"custom"` needs [`BEVEL_PROFILE`], whose
|
||||
/// points, when given, must make a profile, and [`BEVEL_NAME`] is a string.
|
||||
fn validate_bevel(p: &Value) -> Result<(), String> {
|
||||
let most = BevelProfile::MAX_POINTS;
|
||||
if let Some(v) = p.get(BEVEL_PROFILE)
|
||||
&& !v.is_null()
|
||||
&& bevel_profile(v).is_none()
|
||||
{
|
||||
return Err(format!(
|
||||
"{BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall)"
|
||||
));
|
||||
}
|
||||
if text(p, "bevel", "none") == "custom" && p.get(BEVEL_PROFILE).is_none_or(Value::is_null) {
|
||||
return Err(format!("bevel custom needs {BEVEL_PROFILE}, the bevel's points"));
|
||||
}
|
||||
if p.get(BEVEL_NAME).is_some_and(|v| !v.is_string() && !v.is_null()) {
|
||||
return Err(format!("{BEVEL_NAME} must be a string"));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Extrude & Bevel's parameters. `bevel` is `"none"`, a [`BevelShape`] id, or `"custom"` with
|
||||
/// its points in [`BEVEL_PROFILE`].
|
||||
pub fn extrude_options(p: &Value) -> Extrude {
|
||||
Extrude {
|
||||
depth: num(p, "depth", 50.0),
|
||||
twist: num(p, "twist", 0.0),
|
||||
taper: num(p, "taper", 100.0) / 100.0,
|
||||
cap: flag(p, "cap", true),
|
||||
bevel: BevelShape::parse(text(p, "bevel", "none")).map(|shape| Bevel {
|
||||
bevel: bevel_shape(p).map(|shape| Bevel {
|
||||
shape,
|
||||
width: num(p, "bevelWidth", 4.0),
|
||||
height: num(p, "bevelHeight", 4.0),
|
||||
@@ -351,12 +412,12 @@ fn validate_solid_params(id: &str, p: &Value) -> Result<(), String> {
|
||||
graphics::validate(id, p)?;
|
||||
wireframe::validate_render(id, p)?;
|
||||
if let Some(v) = p.get("bevel")
|
||||
&& !v.as_str().is_some_and(|s| s == "none" || BevelShape::parse(s).is_some())
|
||||
&& !v.as_str().is_some_and(|s| s == "none" || s == "custom" || BevelShape::parse(s).is_some())
|
||||
{
|
||||
let names: Vec<_> = BevelShape::ALL.iter().map(|b| b.id()).collect();
|
||||
return Err(format!("bevel must be none or one of {}", names.join(", ")));
|
||||
return Err(format!("bevel must be none or one of {}, or custom with {BEVEL_PROFILE}", names.join(", ")));
|
||||
}
|
||||
Ok(())
|
||||
validate_bevel(p)
|
||||
}
|
||||
|
||||
/// The name an error gives 3D effect `id`.
|
||||
|
||||
@@ -7,7 +7,7 @@ use serde_json::Value;
|
||||
use vectorcraft_doc::color::{BlendMode, Color, Paint};
|
||||
use vectorcraft_doc::{Appearance, AppearanceItem, FillLayer, Node};
|
||||
use vectorcraft_geom::Rect;
|
||||
use vectorcraft_three_d::{Bevel, BevelShape, ClassicShading, ClassicSurface, Extrude, Facet, Light};
|
||||
use vectorcraft_three_d::{Bevel, ClassicShading, ClassicSurface, Extrude, Facet, Light};
|
||||
|
||||
use super::graphics::map_art::{self, MapArt, MapBudget, SolidLayout};
|
||||
use crate::util::{flag, num, text};
|
||||
@@ -44,13 +44,7 @@ pub fn classic_extrude_options(p: &Value) -> Extrude {
|
||||
Extrude {
|
||||
depth: num(p, "depth", 50.0),
|
||||
cap: flag(p, "cap", true),
|
||||
bevel: BevelShape::parse(text(p, "bevel", "none")).map(|shape| Bevel {
|
||||
shape,
|
||||
width: height,
|
||||
height,
|
||||
inside: flag(p, "bevelInside", false),
|
||||
..Bevel::default()
|
||||
}),
|
||||
bevel: super::bevel_shape(p).map(|shape| Bevel { shape, width: height, height, inside: flag(p, "bevelInside", false), ..Bevel::default() }),
|
||||
hidden: flag(p, "drawHiddenFaces", false) || classic_shading(p).surface == ClassicSurface::Wireframe,
|
||||
// The numbered surfaces are laid out only for an effect that maps art onto them.
|
||||
map_surfaces: !map_art::surface_maps(p).is_empty(),
|
||||
@@ -119,9 +113,15 @@ const FLAGS: [&str; 7] = ["cap", "bevelInside", "lightBehind", "drawHiddenFaces"
|
||||
/// Check Extrude & Bevel (Classic)'s parameters `p` (its defaults filled in): every key is one of
|
||||
/// its parameters, numbers are in range, flags are true or false, `surface`, `shadingColor` and
|
||||
/// `shadingCustom` name a surface, a shading color and a #rrggbb color, and `mapArt` holds valid
|
||||
/// maps.
|
||||
/// maps. A custom bevel's name and points ([`super::BEVEL_NAME`], [`super::BEVEL_PROFILE`]) are
|
||||
/// parameters too, checked with Extrude & Bevel's.
|
||||
pub fn validate(p: &Value) -> Result<(), String> {
|
||||
validate_classic(CLASSIC_EXTRUDE, p, &RANGES, &FLAGS)?;
|
||||
let mut rest = p.clone();
|
||||
if let Some(m) = rest.as_object_mut() {
|
||||
m.remove(super::BEVEL_NAME);
|
||||
m.remove(super::BEVEL_PROFILE);
|
||||
}
|
||||
validate_classic(CLASSIC_EXTRUDE, &rest, &RANGES, &FLAGS)?;
|
||||
map_art::validate(CLASSIC_EXTRUDE, p)
|
||||
}
|
||||
|
||||
|
||||
@@ -1594,6 +1594,58 @@ fn parameters_are_validated_and_lengths_scale_with_the_object() {
|
||||
assert!(extrude_options(&json!({})).bevel.is_none());
|
||||
}
|
||||
|
||||
/// `bevel` custom draws the points of `bevelProfile` in both Extrude & Bevels, with the other bevel
|
||||
/// settings; bad points, a custom bevel without points and a name that is not a string are refused.
|
||||
#[test]
|
||||
fn custom_bevels_draw_their_points_and_bad_points_are_refused() {
|
||||
let n = square_node();
|
||||
let notch = json!([[0, 0], [0.2, 0.6], [0.7, 0.4], [1, 1]]);
|
||||
let custom = json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch, "bevelWidth": 10, "bevelRepeat": 2, "bevelBothSides": true});
|
||||
let b = extrude_options(&custom).bevel.unwrap();
|
||||
assert!(matches!(b.shape, BevelShape::Custom(_)));
|
||||
assert_eq!((b.width, b.repeat, b.both_sides), (10.0, 2, true));
|
||||
let points: Vec<(f64, f64)> = match b.shape {
|
||||
BevelShape::Custom(p) => p.points().collect(),
|
||||
_ => vec![],
|
||||
};
|
||||
assert_eq!(points.len(), 4);
|
||||
assert!((points[2].0 - 0.7).abs() < 1e-4 && (points[2].1 - 0.4).abs() < 1e-4, "{points:?}");
|
||||
assert!(matches!(classic_extrude_options(&custom).bevel.map(|b| b.shape), Some(BevelShape::Custom(_))));
|
||||
for id in [EXTRUDE, CLASSIC_EXTRUDE] {
|
||||
let classic_params = json!({"bevel": "classic", "bevelHeight": 10});
|
||||
let custom_params = json!({"bevel": "custom", "bevelProfile": notch, "bevelHeight": 10, "bevelName": "Notch"});
|
||||
assert!(validate_solid(&n, id, &custom_params).is_ok(), "{id}");
|
||||
let art = |p: &Value| {
|
||||
let mut n = square_node();
|
||||
n.appearance.effects.push(fx(id, p.clone()));
|
||||
solid_art(&n).unwrap()
|
||||
};
|
||||
assert_ne!(art(&classic_params), art(&custom_params), "{id}");
|
||||
for (bad, err) in [
|
||||
(json!({"bevel": "custom"}), "bevel custom needs bevelProfile"),
|
||||
(json!({"bevel": "custom", "bevelProfile": [[0, 0]]}), "bevelProfile must be 2 to 64"),
|
||||
(json!({"bevel": "custom", "bevelProfile": [[0.1, 0], [1, 1]]}), "bevelProfile must be 2 to 64"),
|
||||
(json!({"bevel": "custom", "bevelProfile": [[0, 0], [2, 0.5], [1, 1]]}), "bevelProfile must be 2 to 64"),
|
||||
(json!({"bevel": "custom", "bevelProfile": [[0, 0], ["a", 0.5], [1, 1]]}), "bevelProfile must be 2 to 64"),
|
||||
(json!({"bevel": "custom", "bevelProfile": "0,0 1,1"}), "bevelProfile must be 2 to 64"),
|
||||
(json!({"bevel": "custom", "bevelProfile": notch, "bevelName": 3}), "bevelName must be a string"),
|
||||
] {
|
||||
let e = validate_solid(&n, id, &bad).unwrap_err();
|
||||
assert!(e.contains(err), "{id} {bad}: {e}");
|
||||
}
|
||||
}
|
||||
// A loaded file whose points do not make a profile draws no bevel.
|
||||
assert!(extrude_options(&json!({"bevel": "custom", "bevelProfile": [[0, 0]]})).bevel.is_none());
|
||||
// Changing the type keeps the custom bevel where the new effect takes a bevel, and drops it
|
||||
// where it does not.
|
||||
let classic = three_d_params_as(EXTRUDE, &custom, CLASSIC_EXTRUDE);
|
||||
assert_eq!((&classic["bevel"], &classic[BEVEL_NAME], &classic[BEVEL_PROFILE]), (&json!("custom"), &json!("Notch"), ¬ch));
|
||||
assert!(validate_solid(&n, CLASSIC_EXTRUDE, &classic).is_ok());
|
||||
assert_eq!(three_d_params_as(CLASSIC_EXTRUDE, &classic, EXTRUDE)[BEVEL_PROFILE], notch);
|
||||
let inflate = three_d_params_as(EXTRUDE, &custom, INFLATE);
|
||||
assert!(inflate.get(BEVEL_PROFILE).is_none() && inflate.get(BEVEL_NAME).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inflate_reads_twist_taper_and_cap() {
|
||||
let o = inflate_options(&json!({"twist": 90, "taper": 40, "cap": false}));
|
||||
|
||||
@@ -8,6 +8,7 @@ pub mod arrowheads;
|
||||
mod artboardalign;
|
||||
mod assets;
|
||||
mod attributes;
|
||||
pub mod bevels;
|
||||
pub mod brushlib;
|
||||
mod brushsym;
|
||||
mod buildcmds;
|
||||
@@ -321,6 +322,7 @@ pub fn command_specs() -> &'static [CommandSpec] {
|
||||
v.extend(draw2::specs());
|
||||
v.extend(xform::specs());
|
||||
v.extend(effectcmd::specs());
|
||||
v.extend(bevels::specs());
|
||||
v.extend(wireframe::specs());
|
||||
v.extend(pathops::specs());
|
||||
v.extend(compoundshape::specs());
|
||||
|
||||
@@ -378,13 +378,14 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
fn same_file(a: &str, b: &str) -> bool {
|
||||
pub(super) fn same_file(a: &str, b: &str) -> bool {
|
||||
let canon = |p: &str| std::fs::canonicalize(p).unwrap_or_else(|_| std::path::PathBuf::from(p));
|
||||
std::path::Path::new(a) == std::path::Path::new(b) || canon(a) == canon(b)
|
||||
}
|
||||
|
||||
/// The document in the arrowheads file at `path`; `None` when there is no file.
|
||||
fn read(path: &str) -> std::result::Result<Option<Document>, String> {
|
||||
/// The document in the arrowheads file at `path` (or another such file of the user's, as the
|
||||
/// bevels file); `None` when there is no file.
|
||||
pub(super) fn read(path: &str) -> std::result::Result<Option<Document>, String> {
|
||||
let size = match std::fs::metadata(path) {
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => return Ok(None),
|
||||
Err(e) => return Err(format!("{path}: {e}")),
|
||||
@@ -412,13 +413,13 @@ fn skipped(s: &Session) -> Vec<Value> {
|
||||
/// The arrowheads file at `path` checked for reading against the automation roots in force: an agent
|
||||
/// confined to read roots reaches the file only inside them. The error names the file by its file
|
||||
/// name outside them.
|
||||
fn may_reach(path: &str) -> Result<()> {
|
||||
pub(super) fn may_reach(path: &str) -> Result<()> {
|
||||
crate::file_access::check_read(path).map_err(|e| super::fileio::naming_in_error(EngineError::Other(e), path))
|
||||
}
|
||||
|
||||
/// `msg`, an error about the arrowheads file at `path`, as the request being served may see it: the
|
||||
/// file named whole inside the read roots, else by its file name.
|
||||
fn shown_error(msg: &str, path: Option<&str>) -> String {
|
||||
pub(super) fn shown_error(msg: &str, path: Option<&str>) -> String {
|
||||
let Some(path) = path else { return msg.to_string() };
|
||||
match super::fileio::naming_in_error(EngineError::Other(msg.to_string()), path) {
|
||||
EngineError::Other(m) => m,
|
||||
|
||||
@@ -0,0 +1,378 @@
|
||||
//! Custom bevels for Extrude & Bevel and Extrude & Bevel (Classic). The bevels file is a native
|
||||
//! document kept next to the preferences ([`Session::attach_bevels_file`]). Each of its symbols
|
||||
//! whose art is one open path is one bevel, listed by the symbol's name after the built-in shapes
|
||||
//! in the Bevel Shape menus. The path runs from its first anchor, at the cap's edge, to its last,
|
||||
//! at the side wall: across the page is across the bevel's width and down the page is along its
|
||||
//! height, whichever way the path is drawn, and points past its ends are held to them. Curves are
|
||||
//! cut into straight lines, at most [`BevelProfile::MAX_POINTS`] points in all. Saving the file
|
||||
//! reloads the bevels. An effect that uses a custom bevel carries a copy of its points
|
||||
//! (`bevelProfile`), so its document draws it anywhere.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_color::{Color, Paint};
|
||||
use vectorcraft_doc::{Appearance, Document, Node, NodeId, NodeKind, Symbol};
|
||||
use vectorcraft_geom::{Affine, PathData, PathEl, Point, SubPath};
|
||||
use vectorcraft_render::effects::{BEVEL_NAME, BEVEL_PROFILE, BevelProfile};
|
||||
|
||||
use super::arrowheads::{may_reach, read, same_file, shown_error};
|
||||
use super::{CommandSpec, Result, Session, always, bad, cmd};
|
||||
|
||||
/// The bevels file's name, in the folder of the preferences.
|
||||
pub const FILE_NAME: &str = "Bevels.vectorcraft";
|
||||
/// The most bevels read from the file; symbols past it are skipped.
|
||||
pub const MAX_BEVELS: usize = 256;
|
||||
/// The most anchors a bevel's path may have; a symbol past it is skipped.
|
||||
pub const MAX_ANCHORS: usize = 4096;
|
||||
/// The most points a bevel's path is cut into before it is simplified; a symbol past it is skipped.
|
||||
pub const MAX_LINE_POINTS: usize = 8192;
|
||||
/// The most point-to-line distances simplifying the bevels of one file may measure; a symbol that
|
||||
/// needs more than is left is skipped as too detailed.
|
||||
pub const MAX_SIMPLIFY_WORK: u64 = 40_000_000;
|
||||
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
vec![
|
||||
cmd!(
|
||||
query "threeD.bevels.list",
|
||||
"Bevels",
|
||||
[],
|
||||
None,
|
||||
"{} → {bevels: [{name (effect.apply and effect.setParams take Extrude & Bevel's and Extrude & Bevel (Classic)'s `bevel` as {custom: name}), points: [[x, y]…] (shares of the bevel's width and height from the cap's edge [0, 0] to the side wall [1, 1])}], file: the bevels file's path or null (no file here, as on the web), skipped: [{name, reason}] symbols of the file that are not bevels, error: why the file could not be read, or null} the custom bevels, listed after the built-in shapes in the Bevel Shape menus",
|
||||
always,
|
||||
list
|
||||
),
|
||||
cmd!(
|
||||
"threeD.bevels.edit",
|
||||
"Edit Bevels",
|
||||
[],
|
||||
None,
|
||||
"{} open the bevels file (a native document next to the preferences; created first with one example bevel when it is missing). Each symbol in it whose art is one open path is one custom bevel named after the symbol: the path runs from its first anchor at the cap's edge to its last at the side wall, across the page across the bevel's width and down the page along its height. Saving the file reloads the bevels → {path, created: whether the file was made now}",
|
||||
has_file,
|
||||
edit
|
||||
),
|
||||
cmd!(
|
||||
"threeD.bevels.reload",
|
||||
"Reload Bevels",
|
||||
[],
|
||||
None,
|
||||
"{} read the bevels file again (a save of it from VectorCraft does this already) → {count, skipped: [{name, reason}]}",
|
||||
has_file,
|
||||
reload
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
/// A custom bevel: its name and its points, (share of the width, share of the height).
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct CustomBevel {
|
||||
pub name: String,
|
||||
pub points: Vec<(f64, f64)>,
|
||||
}
|
||||
|
||||
impl CustomBevel {
|
||||
/// The points as `bevelProfile` holds them.
|
||||
pub fn profile_json(&self) -> Value {
|
||||
json!(self.points.iter().map(|&(x, y)| [x, y]).collect::<Vec<_>>())
|
||||
}
|
||||
}
|
||||
|
||||
/// The custom bevels read from the bevels file.
|
||||
#[derive(Default)]
|
||||
pub struct Bevels {
|
||||
path: Option<String>,
|
||||
bevels: Vec<Arc<CustomBevel>>,
|
||||
skipped: Vec<(String, String)>,
|
||||
error: Option<String>,
|
||||
}
|
||||
|
||||
impl Bevels {
|
||||
/// The bevels file's path; `None` without one (the web, runs without preferences).
|
||||
pub fn path(&self) -> Option<&str> {
|
||||
self.path.as_deref()
|
||||
}
|
||||
/// The bevels, in the order of the file's symbols.
|
||||
pub fn bevels(&self) -> &[Arc<CustomBevel>] {
|
||||
&self.bevels
|
||||
}
|
||||
/// Bevel `name`.
|
||||
pub fn get(&self, name: &str) -> Option<Arc<CustomBevel>> {
|
||||
self.bevels.iter().find(|b| b.name == name).cloned()
|
||||
}
|
||||
fn set(&mut self, read: Read) {
|
||||
(self.bevels, self.skipped) = (read.bevels.into_iter().map(Arc::new).collect(), read.skipped);
|
||||
self.error = None;
|
||||
}
|
||||
}
|
||||
|
||||
/// The bevels a document holds, and the symbols that are not bevels with the reason.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Read {
|
||||
pub bevels: Vec<CustomBevel>,
|
||||
pub skipped: Vec<(String, String)>,
|
||||
}
|
||||
|
||||
/// The bevels of document `doc`: one per symbol, up to [`MAX_BEVELS`] (see the module docs).
|
||||
pub fn bevels_of(doc: &Document) -> Read {
|
||||
bevels_within(doc, MAX_SIMPLIFY_WORK)
|
||||
}
|
||||
|
||||
/// [`bevels_of`] with `work` point-to-line distances to simplify the paths with.
|
||||
pub fn bevels_within(doc: &Document, mut work: u64) -> Read {
|
||||
let mut out = Read::default();
|
||||
for (i, sym) in doc.symbols.iter().enumerate() {
|
||||
if i >= MAX_BEVELS {
|
||||
out.skipped.push((sym.name.clone(), format!("only the first {MAX_BEVELS} symbols are read")));
|
||||
continue;
|
||||
}
|
||||
if out.bevels.iter().any(|b| b.name == sym.name) {
|
||||
out.skipped.push((sym.name.clone(), "another symbol has this name".into()));
|
||||
continue;
|
||||
}
|
||||
match points_of(&sym.art, &mut work) {
|
||||
Ok(points) => out.bevels.push(CustomBevel { name: sym.name.clone(), points }),
|
||||
Err(why) => out.skipped.push((sym.name.clone(), why.into())),
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The one open path of art `n`: `n` itself, or the one member of groups that hold one member each.
|
||||
fn open_path(n: &Node) -> Option<&PathData> {
|
||||
match &n.kind {
|
||||
NodeKind::Path { path, guide: false, .. } if path.subpaths.len() == 1 && !path.subpaths[0].closed => Some(path),
|
||||
NodeKind::Group { children, clip: false } if children.len() == 1 => open_path(&children[0]),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// The profile points of a bevel symbol's art `n` (see the module docs), simplified within `work`
|
||||
/// point-to-line distances, which it uses up.
|
||||
fn points_of(n: &Node, work: &mut u64) -> std::result::Result<Vec<(f64, f64)>, &'static str> {
|
||||
let path = open_path(n).ok_or("its art is not one open path")?;
|
||||
if path.anchor_count() > MAX_ANCHORS {
|
||||
return Err("its path has too many anchors for a bevel");
|
||||
}
|
||||
let mut line: Vec<Point> = vec![];
|
||||
let tolerance = path.bounds().map_or(1.0, |b| b.width().hypot(b.height()) / 2000.0).max(1e-9);
|
||||
// One segment at a time, so a path past the limit stops being cut at the segment that passes it.
|
||||
let mut at: Option<Point> = None;
|
||||
for &el in path.to_bezpath().elements() {
|
||||
if line.len() > MAX_LINE_POINTS {
|
||||
return Err("its path is too detailed for a bevel");
|
||||
}
|
||||
match (el, at) {
|
||||
(PathEl::MoveTo(p), _) => line.push(p),
|
||||
(_, Some(start)) => vectorcraft_geom::flatten([PathEl::MoveTo(start), el], tolerance, |e| {
|
||||
if let PathEl::LineTo(p) = e {
|
||||
line.push(p);
|
||||
}
|
||||
}),
|
||||
(_, None) => {}
|
||||
}
|
||||
at = el.end_point().or(at);
|
||||
}
|
||||
if line.len() > MAX_LINE_POINTS {
|
||||
return Err("its path is too detailed for a bevel");
|
||||
}
|
||||
let (Some(&first), Some(&last)) = (line.first(), line.last()) else { return Err("its path has no length") };
|
||||
let (dx, dy) = (last.x - first.x, last.y - first.y);
|
||||
let size = path.bounds().map_or(0.0, |b| b.width().hypot(b.height()));
|
||||
if !(dx.abs() > size * 1e-6 && dy.abs() > size * 1e-6 && size.is_finite()) {
|
||||
return Err("its ends are not apart both across and down");
|
||||
}
|
||||
let mut pts: Vec<(f64, f64)> = line.iter().map(|p| (((p.x - first.x) / dx).clamp(0.0, 1.0), ((p.y - first.y) / dy).clamp(0.0, 1.0))).collect();
|
||||
pts.dedup_by(|a, b| (a.0 - b.0).abs() < 1e-9 && (a.1 - b.1).abs() < 1e-9);
|
||||
if pts.len() < 2 {
|
||||
return Err("its ends are not apart both across and down");
|
||||
}
|
||||
// The ends map to the corners exactly.
|
||||
let last = pts.len() - 1;
|
||||
(pts[0], pts[last]) = ((0.0, 0.0), (1.0, 1.0));
|
||||
let pts = simplified(&pts, work).ok_or("its path is too detailed for a bevel")?;
|
||||
BevelProfile::new(&pts).ok_or("its path is too detailed for a bevel")?;
|
||||
Ok(pts)
|
||||
}
|
||||
|
||||
/// `pts` with the fewest points the Ramer-Douglas-Peucker rule keeps at a tolerance (from a
|
||||
/// thousandth of the bevel, doubled until they fit) that leaves at most
|
||||
/// [`BevelProfile::MAX_POINTS`]. The first and last points are always kept. `None` when that
|
||||
/// measures more point-to-line distances than `work` has left.
|
||||
fn simplified(pts: &[(f64, f64)], work: &mut u64) -> Option<Vec<(f64, f64)>> {
|
||||
let mut eps = 1e-3;
|
||||
loop {
|
||||
let out = rdp(pts, eps, work)?;
|
||||
if out.len() <= BevelProfile::MAX_POINTS || eps > 2.0 {
|
||||
return Some(out);
|
||||
}
|
||||
eps *= 2.0;
|
||||
}
|
||||
}
|
||||
|
||||
/// The points of `pts` Ramer-Douglas-Peucker keeps at tolerance `eps`; `None` when that measures
|
||||
/// more point-to-line distances than `work` has left.
|
||||
fn rdp(pts: &[(f64, f64)], eps: f64, work: &mut u64) -> Option<Vec<(f64, f64)>> {
|
||||
if pts.len() < 3 {
|
||||
return Some(pts.to_vec());
|
||||
}
|
||||
let mut keep = vec![false; pts.len()];
|
||||
keep[0] = true;
|
||||
keep[pts.len() - 1] = true;
|
||||
let mut stack = vec![(0, pts.len() - 1)];
|
||||
while let Some((a, b)) = stack.pop() {
|
||||
*work = work.checked_sub((b - a).saturating_sub(1) as u64)?;
|
||||
let (p, q) = (pts[a], pts[b]);
|
||||
let (vx, vy) = (q.0 - p.0, q.1 - p.1);
|
||||
let len = vx.hypot(vy);
|
||||
let far = (a + 1..b)
|
||||
.map(|i| {
|
||||
let (wx, wy) = (pts[i].0 - p.0, pts[i].1 - p.1);
|
||||
let d = if len > 0.0 { (vx * wy - vy * wx).abs() / len } else { wx.hypot(wy) };
|
||||
(i, d)
|
||||
})
|
||||
.fold(None, |best: Option<(usize, f64)>, (i, d)| if best.is_none_or(|(_, bd)| d > bd) { Some((i, d)) } else { best });
|
||||
if let Some((i, d)) = far
|
||||
&& d > eps
|
||||
{
|
||||
keep[i] = true;
|
||||
stack.push((a, i));
|
||||
stack.push((i, b));
|
||||
}
|
||||
}
|
||||
Some(pts.iter().zip(keep).filter_map(|(p, k)| k.then_some(*p)).collect())
|
||||
}
|
||||
|
||||
/// The document a missing bevels file starts as: one example bevel, a chamfer with a notch.
|
||||
pub fn starter() -> Document {
|
||||
let mut doc = Document::new(612.0, 792.0);
|
||||
doc.title = "Bevels".into();
|
||||
let name = "Example Bevel";
|
||||
let pts = [Point::new(0.0, 0.0), Point::new(10.0, 40.0), Point::new(55.0, 30.0), Point::new(100.0, 100.0)];
|
||||
let art =
|
||||
Node::path(NodeId(0), PathData::single(SubPath::polyline(&pts, false)), Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0));
|
||||
let art = doc.reid(&art);
|
||||
doc.symbols.push(Symbol { name: name.into(), art: Arc::new(art), dynamic: false });
|
||||
let id = doc.alloc_id();
|
||||
let instance = Node::new(id, NodeKind::SymbolInstance { symbol: name.into(), xf: Affine::translate((256.0, 346.0)) });
|
||||
let layer = doc.layers.first().map(|l| l.id);
|
||||
let _ = doc.insert(layer, 0, instance);
|
||||
doc
|
||||
}
|
||||
|
||||
impl Session {
|
||||
/// Keep the custom bevels in the file at `path` and read the bevels it holds (none while it is
|
||||
/// missing; an unreadable file is reported by `threeD.bevels.list`).
|
||||
pub fn attach_bevels_file(&mut self, path: String) {
|
||||
self.bevels.path = Some(path);
|
||||
self.reload_bevels();
|
||||
}
|
||||
|
||||
/// Read the bevels file again.
|
||||
fn reload_bevels(&mut self) {
|
||||
let Some(path) = self.bevels.path.clone() else { return };
|
||||
match read(&path) {
|
||||
Ok(Some(doc)) => self.bevels.set(bevels_of(&doc)),
|
||||
Ok(None) => self.bevels.set(Read::default()),
|
||||
Err(e) => {
|
||||
self.bevels.set(Read::default());
|
||||
self.bevels.error = Some(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A document was saved to `path`: when that is the bevels file, its bevels are read back from
|
||||
/// what was written.
|
||||
pub(crate) fn bevels_saved(&mut self, path: &str) {
|
||||
if self.bevels.path.as_deref().is_some_and(|b| same_file(b, path)) {
|
||||
self.reload_bevels();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The command parameter that holds the points a custom bevel given by name had when the command
|
||||
/// ran. The journal records it, so a replay draws the same bevel after the bevels file changes or
|
||||
/// loses that name.
|
||||
pub const SAVED_BEVEL: &str = "savedBevel";
|
||||
|
||||
/// `params` of an effect with `bevel` given as `{custom: name}`: the bevel of the bevels file named
|
||||
/// so, stored as `bevel` `"custom"` with its `bevelName` and `bevelProfile`. The command's
|
||||
/// [`SAVED_BEVEL`] points (`p`), when given, are used in place of the file's, and the points used
|
||||
/// join the journal entry as [`SAVED_BEVEL`]. Other values are left for the effect to check.
|
||||
pub(crate) fn resolve_custom(s: &mut Session, p: &Value, params: &mut Value, cmd: &str) -> Result<()> {
|
||||
let Some(Value::Object(o)) = params.get("bevel") else { return Ok(()) };
|
||||
let name = match (o.len(), o.get("custom")) {
|
||||
(1, Some(Value::String(name))) => name.clone(),
|
||||
_ => return Err(bad(cmd, "bevel: give a shape id, or {custom: name} for a bevel of the bevels file (threeD.bevels.list)")),
|
||||
};
|
||||
let points = match p.get(SAVED_BEVEL).filter(|v| !v.is_null()) {
|
||||
Some(saved) => saved.clone(),
|
||||
None => s.bevels.get(&name).ok_or_else(|| bad(cmd, format!("no custom bevel {name} (see threeD.bevels.list)")))?.profile_json(),
|
||||
};
|
||||
s.note_journal(SAVED_BEVEL, points.clone());
|
||||
params["bevel"] = json!("custom");
|
||||
params[BEVEL_NAME] = json!(name);
|
||||
params[BEVEL_PROFILE] = points;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn has_file(s: &Session) -> std::result::Result<(), String> {
|
||||
if s.bevels.path.is_some() { Ok(()) } else { Err("no bevels file here".into()) }
|
||||
}
|
||||
|
||||
fn skipped(s: &Session) -> Vec<Value> {
|
||||
s.bevels.skipped.iter().map(|(name, reason)| json!({"name": name, "reason": reason})).collect()
|
||||
}
|
||||
|
||||
fn list(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
let bevels: Vec<Value> = s.bevels.bevels.iter().map(|b| json!({"name": b.name, "points": b.profile_json()})).collect();
|
||||
// Under automation read roots, a file outside them is not shown and its error names it by its file name.
|
||||
let path = s.bevels.path.as_deref();
|
||||
let file = path.filter(|p| crate::file_access::check_read(p).is_ok());
|
||||
let error = s.bevels.error.as_deref().map(|e| shown_error(e, path));
|
||||
Ok(json!({"bevels": bevels, "file": file, "skipped": skipped(s), "error": error}))
|
||||
}
|
||||
|
||||
fn reload(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
const C: &str = "threeD.bevels.reload";
|
||||
if let Some(path) = &s.bevels.path {
|
||||
may_reach(path)?;
|
||||
}
|
||||
s.reload_bevels();
|
||||
if let Some(e) = &s.bevels.error {
|
||||
return Err(bad(C, e.clone()));
|
||||
}
|
||||
Ok(json!({"count": s.bevels.bevels.len(), "skipped": skipped(s)}))
|
||||
}
|
||||
|
||||
fn edit(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
const C: &str = "threeD.bevels.edit";
|
||||
let path = s.bevels.path.clone().ok_or_else(|| bad(C, "no bevels file here"))?;
|
||||
// Checked before anything is made, brought to the front or opened.
|
||||
may_reach(&path)?;
|
||||
if let Some(dir) = std::path::Path::new(&path).parent() {
|
||||
let dir = dir.to_string_lossy();
|
||||
std::fs::create_dir_all(&*dir).map_err(|e| super::fileio::naming_in_error(bad(C, format!("{dir}: {e}")), &dir))?;
|
||||
}
|
||||
// Made only when no file is there, also when another run makes one at the same moment.
|
||||
let bytes = vectorcraft_format::save_file(&starter());
|
||||
let created = match crate::file_access::unconfined(|| super::fileio::write_new_file(&path, &bytes)) {
|
||||
Ok(()) => true,
|
||||
Err(_) if std::path::Path::new(&path).exists() => false,
|
||||
Err(e) => return Err(bad(C, e.to_string())),
|
||||
};
|
||||
if created {
|
||||
s.reload_bevels();
|
||||
}
|
||||
// Already open: that document comes to the front.
|
||||
let open = s.documents().iter().position(|st| st.path.as_deref().is_some_and(|p| same_file(p, &path)));
|
||||
match open {
|
||||
Some(i) => {
|
||||
s.set_active(i);
|
||||
}
|
||||
None => {
|
||||
// Opened in the request's own scope, so the document keeps the roots it was opened under.
|
||||
s.execute("document.open", &json!({ "path": path }))?;
|
||||
}
|
||||
}
|
||||
Ok(json!({"path": path, "created": created}))
|
||||
}
|
||||
@@ -52,7 +52,7 @@ fn effect_specs() -> Vec<CommandSpec> {
|
||||
"Apply Effect",
|
||||
[],
|
||||
None,
|
||||
"{effect: id (see effect.list, e.g. \"stylize.dropShadow\", \"distort.roughen\", \"warp.arc\", or \"plugin.<id>\" for an installed effect plug-in), params?: {…} (missing keys take the dialog defaults), item?: appearance item index|null (apply to that fill/stroke only; omitted: the Appearance panel's active item, else the whole object), ids?|id?: [..] (layers too), target?: \"object\"|\"contents\" (contents: the objects inside groups and layers), aligned?: bool (item is a row of the first target's stack: each other target gets the effect on its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, a row of the art's stack: docs/mcp.md)} append a live effect to each selected object's appearance (a group's or layer's apply to its members as one piece: one combined shadow; a Pathfinder effect, which combines a group's contents, groups several loose selected objects first, in the same undo step); the art of a graph design in a graph series is left out, and objects that are all such art are an error (docs/mcp.md) → {ids, index, item, grouped?}",
|
||||
"{effect: id (see effect.list, e.g. \"stylize.dropShadow\", \"distort.roughen\", \"warp.arc\", or \"plugin.<id>\" for an installed effect plug-in), params?: {…} (missing keys take the dialog defaults), item?: appearance item index|null (apply to that fill/stroke only; omitted: the Appearance panel's active item, else the whole object), ids?|id?: [..] (layers too), target?: \"object\"|\"contents\" (contents: the objects inside groups and layers), aligned?: bool (item is a row of the first target's stack: each other target gets the effect on its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, a row of the art's stack: docs/mcp.md), savedBevel?: [[x, y]…] (with params bevel {custom: name}: the custom bevel's points, used in place of the bevels file's; the journal records them so a replay draws the same bevel after the file changes)} append a live effect to each selected object's appearance (a group's or layer's apply to its members as one piece: one combined shadow; a Pathfinder effect, which combines a group's contents, groups several loose selected objects first, in the same undo step); the art of a graph design in a graph series is left out, and objects that are all such art are an error (docs/mcp.md) → {ids, index, item, grouped?}",
|
||||
has_doc,
|
||||
apply
|
||||
),
|
||||
@@ -79,7 +79,7 @@ fn effect_specs() -> Vec<CommandSpec> {
|
||||
"Effect Options",
|
||||
[],
|
||||
None,
|
||||
"{index: int, params?: {…} (merged into the current parameters), warpStyle?: string (an existing Warp style suffix, e.g. arc or flag; changes only an applied Warp in place; params are checked against the new style), threeDType?: plane|extrude|revolve|inflate (the 3D and Materials panel's object type: changes only an applied 3D effect in place into Rotate, Extrude & Bevel, Revolve or Inflate; the settings the new effect also takes keep their values, rotation angles wrapped into -180..180 outside Revolve, and the others start at its defaults; params then merge into the new effect's; the type the effect already has, with nothing else given, changes nothing and records no undo step), visible?: bool (any other value but null is refused, when a step plays too), item?: appearance item index|null (as effect.remove), ids?|id?: [..], target?: \"object\"|\"contents\", aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, rows of the art's stack: docs/mcp.md)} → {ids}",
|
||||
"{index: int, params?: {…} (merged into the current parameters), warpStyle?: string (an existing Warp style suffix, e.g. arc or flag; changes only an applied Warp in place; params are checked against the new style), threeDType?: plane|extrude|revolve|inflate (the 3D and Materials panel's object type: changes only an applied 3D effect in place into Rotate, Extrude & Bevel, Revolve or Inflate; the settings the new effect also takes keep their values, rotation angles wrapped into -180..180 outside Revolve, and the others start at its defaults; params then merge into the new effect's; the type the effect already has, with nothing else given, changes nothing and records no undo step), visible?: bool (any other value but null is refused, when a step plays too), item?: appearance item index|null (as effect.remove), ids?|id?: [..], target?: \"object\"|\"contents\", aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, rows of the art's stack: docs/mcp.md), savedBevel?: [[x, y]…] (as effect.apply)} → {ids}",
|
||||
has_doc,
|
||||
set_params
|
||||
),
|
||||
@@ -496,6 +496,10 @@ pub(crate) fn apply(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if texture_load_effect(id) {
|
||||
load_texture(&mut params, C)?;
|
||||
}
|
||||
// A custom bevel by name takes a copy of its points from the bevels file.
|
||||
if bevel_effect(id) {
|
||||
super::bevels::resolve_custom(s, p, &mut params, C)?;
|
||||
}
|
||||
// An SVG filter needs its <filter> element, and is named by its id.
|
||||
if id == effects::SVG_FILTER {
|
||||
let xml = params.get("xml").and_then(Value::as_str).ok_or_else(|| bad(C, "give `xml`, one SVG <filter> element"))?;
|
||||
@@ -818,6 +822,9 @@ pub(crate) fn set_params(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if edited.iter().any(|e| texture_load_effect(e)) {
|
||||
load_texture(&mut params, C)?;
|
||||
}
|
||||
if edited.iter().any(|e| bevel_effect(e)) || kind == Some(effects::EXTRUDE) {
|
||||
super::bevels::resolve_custom(s, p, &mut params, C)?;
|
||||
}
|
||||
let targets = effect_targets(s, p, item, index, C)?;
|
||||
// The type each 3D effect already has, with nothing else to change, is no edit (and is not
|
||||
// checked again).
|
||||
@@ -910,6 +917,12 @@ pub(crate) fn set_params(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Ok(json!({ "ids": ids_json(&ids) }))
|
||||
}
|
||||
|
||||
/// Does effect `id` take a `bevel` (Extrude & Bevel, Extrude & Bevel (Classic)), which may be a
|
||||
/// custom bevel given by name?
|
||||
fn bevel_effect(id: &str) -> bool {
|
||||
id == effects::EXTRUDE || id == effects::CLASSIC_EXTRUDE
|
||||
}
|
||||
|
||||
/// Does merging `params` into Pathfinder effect `e` leave it drawing as it does: the same Pathfinder
|
||||
/// Options ([`effects::PathfinderEffectOptions`], so an effect saved without them and given their
|
||||
/// defaults is unchanged), each option given equal to the one it stores (a precision that Scale
|
||||
|
||||
@@ -1193,7 +1193,8 @@ impl SaveJob {
|
||||
}
|
||||
// The other open documents that place this one show the new version.
|
||||
let written = self.plan.path.clone().filter(|_| matches!(self.plan.format.id, "vectorcraft" | "template"));
|
||||
// A save of the arrowheads file lists its heads in the arrowhead menus.
|
||||
// A save of the arrowheads file lists its heads in the arrowhead menus, and one of the
|
||||
// bevels file its bevels in the Bevel Shape menus.
|
||||
let native = self.plan.format.id == "vectorcraft";
|
||||
if let Some(st) = s.document_mut(uid) {
|
||||
self.finish(st);
|
||||
@@ -1204,6 +1205,7 @@ impl SaveJob {
|
||||
if let Some(path) = written {
|
||||
if native {
|
||||
s.arrowheads_saved(&path);
|
||||
s.bevels_saved(&path);
|
||||
}
|
||||
crate::cmd::links::refresh_placed(s, uid, &path);
|
||||
}
|
||||
|
||||
@@ -582,8 +582,9 @@ fn check_effect_types(id: &str, effect: &str, params: &Value) -> Result<()> {
|
||||
/// `lightElevation`) and Scribble `variation` are numbers, an Outline Stroke's `width` is a number
|
||||
/// and a Gaussian Blur's `linear` is true or false. A Pathfinder effect's `precision` is a number and
|
||||
/// its `removeRedundantPoints` and `removeUnpainted` are true or false. A Glass, Texturizer or Rough
|
||||
/// Pastels `textureImage`, an SVG filter's `name` and `xml`, a Warp's `version` and the `style` of
|
||||
/// Crop Marks have checks of their own; they aren't listed.
|
||||
/// Pastels `textureImage`, an SVG filter's `name` and `xml`, a Warp's `version`, the `style` of Crop
|
||||
/// Marks and an Extrude & Bevel's custom `bevelName` and `bevelProfile` have checks of their own;
|
||||
/// they aren't listed.
|
||||
pub(crate) fn undefaulted_type(effect: &str, key: &str) -> Option<Value> {
|
||||
use vectorcraft_render::effects;
|
||||
let number = || Some(Value::from(0.0));
|
||||
|
||||
@@ -746,5 +746,7 @@ pub(super) const DENIED: &[&str] = &[
|
||||
"stroke.arrowheads.edit",
|
||||
"stroke.arrowheads.list",
|
||||
"text.similarFonts",
|
||||
"threeD.bevels.edit",
|
||||
"threeD.bevels.list",
|
||||
"type.compositeFonts.set",
|
||||
];
|
||||
|
||||
@@ -164,6 +164,8 @@ pub struct Session {
|
||||
pub brush_libraries: cmd::brushlib::Libraries,
|
||||
/// The custom arrowheads of the arrowheads file (`stroke.arrowheads.*`); none without one.
|
||||
pub arrowheads: cmd::arrowheads::Arrowheads,
|
||||
/// The custom bevels of the bevels file (`threeD.bevels.*`); none without one.
|
||||
pub bevels: cmd::bevels::Bevels,
|
||||
/// The id each loaded library outside a request's read roots has been shown under, by its own id
|
||||
/// ([`cmd::swatchlib::concealed_library_ids`]), kept for the session.
|
||||
shown_library_ids: std::sync::Mutex<std::collections::BTreeMap<String, String>>,
|
||||
|
||||
@@ -90,6 +90,7 @@ impl Session {
|
||||
symbol_libraries: Default::default(),
|
||||
brush_libraries: Default::default(),
|
||||
arrowheads: Default::default(),
|
||||
bevels: Default::default(),
|
||||
shown_library_ids: Default::default(),
|
||||
libraries: Default::default(),
|
||||
pdf_preset_dir: None,
|
||||
|
||||
@@ -15,6 +15,7 @@ mod assets;
|
||||
mod assets_3d;
|
||||
mod attributes;
|
||||
mod bboxrotate;
|
||||
mod bevels;
|
||||
mod blendfidelity;
|
||||
mod blendopts;
|
||||
mod blendspine;
|
||||
|
||||
@@ -0,0 +1,394 @@
|
||||
//! Custom bevels (`cmd/bevels.rs`): bevels read from the bevels file's symbols, listed, set on
|
||||
//! Extrude & Bevel and Extrude & Bevel (Classic) by name, reloaded when the file is saved, and kept
|
||||
//! with the documents that use them.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_color::{Color, Paint};
|
||||
use vectorcraft_doc::{Appearance, Document, Node, Symbol};
|
||||
use vectorcraft_geom::{Anchor, PathData, Point, SubPath};
|
||||
use vectorcraft_render::effects;
|
||||
|
||||
use crate::cmd::bevels::{self, bevels_of};
|
||||
use crate::*;
|
||||
|
||||
fn line(pts: &[(f64, f64)], closed: bool) -> Node {
|
||||
let pts: Vec<Point> = pts.iter().map(|&(x, y)| Point::new(x, y)).collect();
|
||||
Node::path(NodeId(0), PathData::single(SubPath::polyline(&pts, closed)), Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0))
|
||||
}
|
||||
|
||||
fn add_symbol(d: &mut Document, name: &str, art: Node) {
|
||||
let art = d.reid(&art);
|
||||
d.symbols.push(Symbol { name: name.into(), art: Arc::new(art), dynamic: false });
|
||||
}
|
||||
|
||||
/// A folder of its own for test `name`, emptied.
|
||||
fn folder(name: &str) -> std::path::PathBuf {
|
||||
let dir = std::env::temp_dir().join(format!("vectorcraft-bevels-{name}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
dir
|
||||
}
|
||||
|
||||
fn close(a: (f64, f64), b: (f64, f64)) -> bool {
|
||||
(a.0 - b.0).abs() < 1e-9 && (a.1 - b.1).abs() < 1e-9
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn each_open_path_symbol_is_a_bevel_from_its_first_anchor_to_its_last() {
|
||||
let mut d = Document::new(100.0, 100.0);
|
||||
add_symbol(&mut d, "Notch", line(&[(0.0, 0.0), (20.0, 60.0), (70.0, 40.0), (100.0, 100.0)], false));
|
||||
// The same path mirrored across the page and drawn from the other side gives the same points.
|
||||
add_symbol(&mut d, "Mirrored", line(&[(300.0, 50.0), (280.0, 110.0), (230.0, 90.0), (200.0, 150.0)], false));
|
||||
// In a group of one, at another size.
|
||||
let small = line(&[(0.0, 0.0), (2.0, 6.0), (7.0, 4.0), (10.0, 10.0)], false);
|
||||
add_symbol(&mut d, "Grouped", Node::group(NodeId(0), vec![Arc::new(small)]));
|
||||
// Points past the ends are held to them.
|
||||
add_symbol(&mut d, "Overshoot", line(&[(0.0, 0.0), (-20.0, 50.0), (100.0, 120.0), (100.0, 100.0)], false));
|
||||
add_symbol(&mut d, "Closed", line(&[(0.0, 0.0), (10.0, 0.0), (10.0, 10.0)], true));
|
||||
let two = Node::group(NodeId(0), vec![Arc::new(line(&[(0.0, 0.0), (1.0, 1.0)], false)), Arc::new(line(&[(0.0, 0.0), (1.0, 1.0)], false))]);
|
||||
add_symbol(&mut d, "Two paths", two);
|
||||
add_symbol(&mut d, "Upright", line(&[(0.0, 0.0), (5.0, 50.0), (0.0, 100.0)], false));
|
||||
let dense: Vec<(f64, f64)> = (0..=bevels::MAX_ANCHORS).map(|i| (i as f64, i as f64)).collect();
|
||||
add_symbol(&mut d, "Dense", line(&dense, false));
|
||||
add_symbol(&mut d, "Notch", line(&[(0.0, 0.0), (1.0, 1.0)], false));
|
||||
let read = bevels_of(&d);
|
||||
let names: Vec<&str> = read.bevels.iter().map(|b| b.name.as_str()).collect();
|
||||
assert_eq!(names, ["Notch", "Mirrored", "Grouped", "Overshoot"]);
|
||||
let notch = [(0.0, 0.0), (0.2, 0.6), (0.7, 0.4), (1.0, 1.0)];
|
||||
for b in &read.bevels[..3] {
|
||||
assert_eq!(b.points.len(), 4, "{}", b.name);
|
||||
assert!(b.points.iter().zip(notch).all(|(&a, b)| close(a, b)), "{}: {:?}", b.name, b.points);
|
||||
}
|
||||
assert!(close(read.bevels[3].points[1], (0.0, 0.5)) && close(read.bevels[3].points[2], (1.0, 1.0)), "{:?}", read.bevels[3].points);
|
||||
let skipped: Vec<(&str, &str)> = read.skipped.iter().map(|(n, r)| (n.as_str(), r.as_str())).collect();
|
||||
assert_eq!(
|
||||
skipped,
|
||||
[
|
||||
("Closed", "its art is not one open path"),
|
||||
("Two paths", "its art is not one open path"),
|
||||
("Upright", "its ends are not apart both across and down"),
|
||||
("Dense", "its path has too many anchors for a bevel"),
|
||||
("Notch", "another symbol has this name"),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/// A curve is cut into straight lines, and a path of many points keeps the ones that matter, at
|
||||
/// most 64 in all, ends included.
|
||||
#[test]
|
||||
fn curves_and_long_paths_fit_in_the_points_a_bevel_holds() {
|
||||
let mut d = Document::new(100.0, 100.0);
|
||||
// A quarter circle from (0, 0) to (100, 100), bulging up and right.
|
||||
let k = 0.5523 * 100.0;
|
||||
let mut a = Anchor::corner(Point::new(0.0, 0.0));
|
||||
a.h_out = Point::new(k, 0.0);
|
||||
let mut b = Anchor::corner(Point::new(100.0, 100.0));
|
||||
b.h_in = Point::new(100.0, 100.0 - k);
|
||||
let arc = Node::path(NodeId(0), PathData::single(SubPath::new(vec![a, b], false)), Appearance::default());
|
||||
add_symbol(&mut d, "Arc", arc);
|
||||
let wavy: Vec<(f64, f64)> = (0..=3000).map(|i| (i as f64 / 30.0, i as f64 / 30.0 + 5.0 * (i as f64 / 50.0).sin())).collect();
|
||||
add_symbol(&mut d, "Wavy", line(&wavy, false));
|
||||
let read = bevels_of(&d);
|
||||
assert!(read.skipped.is_empty(), "{:?}", read.skipped);
|
||||
for b in &read.bevels {
|
||||
assert!((3..=effects::BevelProfile::MAX_POINTS).contains(&b.points.len()), "{}: {}", b.name, b.points.len());
|
||||
assert!(close(b.points[0], (0.0, 0.0)) && close(*b.points.last().unwrap(), (1.0, 1.0)), "{}", b.name);
|
||||
assert!(effects::BevelProfile::new(&b.points).is_some(), "{}", b.name);
|
||||
}
|
||||
// The arc's points lie on the circle: across first, then down.
|
||||
let arc = &read.bevels[0];
|
||||
assert!(arc.points.iter().all(|&(x, y)| (((x - 0.0).powi(2) + (y - 1.0).powi(2)).sqrt() - 1.0).abs() < 0.01), "{:?}", arc.points);
|
||||
}
|
||||
|
||||
/// A path of many tall curves, cut into more straight lines than a bevel's path may take, is
|
||||
/// skipped as too detailed.
|
||||
#[test]
|
||||
fn a_path_cut_into_too_many_lines_is_skipped() {
|
||||
let mut d = Document::new(100.0, 100.0);
|
||||
let anchors: Vec<Anchor> = (0..4000)
|
||||
.map(|i| {
|
||||
let p = Point::new(f64::from(i), f64::from(i) / 4.0);
|
||||
let swing = if i % 2 == 0 { 1000.0 } else { -1000.0 };
|
||||
let mut a = Anchor::corner(p);
|
||||
a.h_in = Point::new(p.x - 0.5, p.y - swing);
|
||||
a.h_out = Point::new(p.x + 0.5, p.y + swing);
|
||||
a
|
||||
})
|
||||
.collect();
|
||||
let wild = Node::path(NodeId(0), PathData::single(SubPath::new(anchors, false)), Appearance::default());
|
||||
add_symbol(&mut d, "Wild", wild);
|
||||
let read = bevels_of(&d);
|
||||
assert!(read.bevels.is_empty());
|
||||
assert_eq!(read.skipped, [("Wild".to_string(), "its path is too detailed for a bevel".to_string())]);
|
||||
}
|
||||
|
||||
/// Simplifying the paths of one file measures at most a fixed number of point-to-line distances:
|
||||
/// a path that needs more than are left is skipped as too detailed, and a short one still reads.
|
||||
#[test]
|
||||
fn simplifying_the_bevels_of_a_file_has_a_work_limit() {
|
||||
let mut d = Document::new(100.0, 100.0);
|
||||
let wavy: Vec<(f64, f64)> = (0..=3000).map(|i| (i as f64 / 30.0, i as f64 / 30.0 + 5.0 * (i as f64 / 50.0).sin())).collect();
|
||||
add_symbol(&mut d, "Wavy", line(&wavy, false));
|
||||
add_symbol(&mut d, "Notch", line(&[(0.0, 0.0), (20.0, 60.0), (70.0, 40.0), (100.0, 100.0)], false));
|
||||
let read = bevels::bevels_within(&d, 5_000);
|
||||
let names: Vec<&str> = read.bevels.iter().map(|b| b.name.as_str()).collect();
|
||||
assert_eq!(names, ["Notch"]);
|
||||
assert_eq!(read.skipped, [("Wavy".to_string(), "its path is too detailed for a bevel".to_string())]);
|
||||
assert_eq!(bevels_of(&d).bevels.len(), 2);
|
||||
}
|
||||
|
||||
fn rect(s: &mut Session, x: u32) -> NodeId {
|
||||
NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": 100, "width": 60, "height": 60})).unwrap()["id"].as_u64().unwrap())
|
||||
}
|
||||
|
||||
fn params(s: &Session, id: NodeId) -> Value {
|
||||
s.doc().unwrap().doc.node(id).unwrap().appearance.effects[0].params.clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_bevels_file_is_made_opened_and_reloaded_when_saved() {
|
||||
let dir = folder("edit");
|
||||
let file = dir.join(bevels::FILE_NAME).to_string_lossy().to_string();
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
|
||||
let id = rect(&mut s, 20);
|
||||
s.attach_bevels_file(file.clone());
|
||||
let list = s.execute("threeD.bevels.list", &json!({})).unwrap();
|
||||
assert_eq!((list["bevels"].as_array().unwrap().len(), list["file"].as_str()), (0, Some(file.as_str())));
|
||||
let apply = json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": {"bevel": {"custom": "Example Bevel"}}});
|
||||
assert!(s.execute("effect.apply", &apply).unwrap_err().to_string().contains("no custom bevel Example Bevel"));
|
||||
let r = s.execute("threeD.bevels.edit", &json!({})).unwrap();
|
||||
assert_eq!(r["created"], true);
|
||||
assert_eq!(s.doc().unwrap().path.as_deref(), Some(file.as_str()), "the file is the active document");
|
||||
let list = s.execute("threeD.bevels.list", &json!({})).unwrap();
|
||||
assert_eq!(list["bevels"][0]["name"], "Example Bevel");
|
||||
assert_eq!(list["bevels"][0]["points"].as_array().unwrap().len(), 4);
|
||||
// A second bevel drawn in the file is listed once the file is saved.
|
||||
let st = s.doc_mut().unwrap();
|
||||
add_symbol(Arc::make_mut(&mut st.doc), "Steps", line(&[(0.0, 0.0), (0.0, 50.0), (50.0, 50.0), (50.0, 100.0), (100.0, 100.0)], false));
|
||||
assert_eq!(s.execute("threeD.bevels.list", &json!({})).unwrap()["bevels"].as_array().unwrap().len(), 1);
|
||||
s.execute("document.save", &json!({})).unwrap();
|
||||
let list = s.execute("threeD.bevels.list", &json!({})).unwrap();
|
||||
let names: Vec<&str> = list["bevels"].as_array().unwrap().iter().filter_map(|b| b["name"].as_str()).collect();
|
||||
assert_eq!(names, ["Example Bevel", "Steps"]);
|
||||
assert_eq!(s.execute("threeD.bevels.reload", &json!({})).unwrap()["count"], 2);
|
||||
// Editing again brings the open file to the front, without making it anew.
|
||||
s.execute("document.activate", &json!({"index": 0})).unwrap();
|
||||
assert_eq!(s.execute("threeD.bevels.edit", &json!({})).unwrap()["created"], false);
|
||||
assert_eq!(s.documents().len(), 2);
|
||||
// The rectangle takes the bevel with a copy of its points, in both Extrude & Bevels.
|
||||
s.execute("document.activate", &json!({"index": 0})).unwrap();
|
||||
s.execute("effect.apply", &json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": {"bevel": {"custom": "Steps"}}})).unwrap();
|
||||
let p = params(&s, id);
|
||||
assert_eq!((p["bevel"].as_str(), p[effects::BEVEL_NAME].as_str()), (Some("custom"), Some("Steps")));
|
||||
assert_eq!(p[effects::BEVEL_PROFILE], json!([[0.0, 0.0], [0.0, 0.5], [0.5, 0.5], [0.5, 1.0], [1.0, 1.0]]));
|
||||
let set = |bevel: Value| json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevel": bevel}});
|
||||
s.execute("effect.setParams", &set(json!({"custom": "Example Bevel"}))).unwrap();
|
||||
assert_eq!(params(&s, id)[effects::BEVEL_NAME], "Example Bevel");
|
||||
for bad in [json!({"custom": 3}), json!({"custom": "Nope"}), json!({"name": "Steps"})] {
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
assert!(s.execute("effect.setParams", &set(bad.clone())).is_err(), "{bad}");
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo, "{bad}: no undo step");
|
||||
}
|
||||
let classic = rect(&mut s, 200);
|
||||
s.execute(
|
||||
"effect.apply",
|
||||
&json!({"effect": effects::CLASSIC_EXTRUDE, "ids": [classic.0], "item": null, "params": {"bevel": {"custom": "Steps"}}}),
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(params(&s, classic)[effects::BEVEL_NAME], "Steps");
|
||||
// A built-in shape again draws that shape.
|
||||
s.execute("effect.setParams", &set(json!("rounded"))).unwrap();
|
||||
assert!(matches!(effects::extrude_options(¶ms(&s, id)).bevel.map(|b| b.shape.id()), Some("rounded")));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// `effect.apply` and `effect.setParams` given a custom bevel by name record its points as
|
||||
/// `savedBevel`, so a replay draws that bevel after the bevels file no longer has it.
|
||||
#[test]
|
||||
fn a_replay_draws_the_custom_bevel_the_command_recorded() {
|
||||
let dir = folder("replay");
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
|
||||
let id = rect(&mut s, 20);
|
||||
s.attach_bevels_file(dir.join(bevels::FILE_NAME).to_string_lossy().to_string());
|
||||
s.execute("threeD.bevels.edit", &json!({})).unwrap();
|
||||
s.execute("document.activate", &json!({"index": 0})).unwrap();
|
||||
let apply = json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": {"bevel": {"custom": "Example Bevel"}}});
|
||||
s.execute("effect.apply", &apply).unwrap();
|
||||
let applied = params(&s, id);
|
||||
let (cmd, recorded) = s.journal.last().unwrap().clone();
|
||||
assert_eq!(cmd, "effect.apply");
|
||||
assert_eq!(recorded[bevels::SAVED_BEVEL], applied[effects::BEVEL_PROFILE]);
|
||||
let set = json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevel": {"custom": "Example Bevel"}, "bevelWidth": 9}});
|
||||
s.execute("effect.setParams", &set).unwrap();
|
||||
let edited = params(&s, id);
|
||||
let (_, set_recorded) = s.journal.last().unwrap().clone();
|
||||
assert_eq!(set_recorded[bevels::SAVED_BEVEL], applied[effects::BEVEL_PROFILE]);
|
||||
// The bevels file no longer has the bevel: by name it is refused, and the replays draw it.
|
||||
s.attach_bevels_file(dir.join("Other.vectorcraft").to_string_lossy().to_string());
|
||||
assert!(s.execute("effect.apply", &apply).is_err());
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert!(s.doc().unwrap().doc.node(id).unwrap().appearance.effects.is_empty());
|
||||
s.replay("effect.apply", &recorded).unwrap();
|
||||
assert_eq!(params(&s, id), applied);
|
||||
s.replay("effect.setParams", &set_recorded).unwrap();
|
||||
assert_eq!(params(&s, id), edited);
|
||||
// Points given with the name are used in place of the file's.
|
||||
let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]);
|
||||
let mut given = set.clone();
|
||||
given["savedBevel"] = notch.clone();
|
||||
s.execute("effect.setParams", &given).unwrap();
|
||||
assert_eq!((¶ms(&s, id)[effects::BEVEL_PROFILE], ¶ms(&s, id)[effects::BEVEL_NAME]), (¬ch, &json!("Example Bevel")));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_document_keeps_its_custom_bevels_without_the_bevels_file() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 300, "height": 300})).unwrap();
|
||||
let id = rect(&mut s, 100);
|
||||
let notch = json!([[0, 0], [0.2, 0.6], [0.7, 0.4], [1, 1]]);
|
||||
let custom = json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch, "bevelWidth": 12, "bevelHeight": 12});
|
||||
s.execute("effect.apply", &json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": custom})).unwrap();
|
||||
let ink = |s: &Session| {
|
||||
vectorcraft_render::Renderer::new().render(&s.doc().unwrap().doc, 300, 300, vectorcraft_geom::Affine::IDENTITY, &Default::default())
|
||||
};
|
||||
let with_bevel = ink(&s);
|
||||
// Saved and opened in a session that has no bevels file: the bevel is drawn the same.
|
||||
let saved = s.execute("document.export", &json!({"format": "vectorcraft"})).unwrap()["dataBase64"].clone();
|
||||
let mut o = Session::new();
|
||||
o.execute("document.open", &json!({"name": "a.vectorcraft", "dataBase64": saved})).unwrap();
|
||||
assert_eq!(params(&o, id)[effects::BEVEL_PROFILE], params(&s, id)[effects::BEVEL_PROFILE]);
|
||||
assert_eq!(ink(&o).pixels, with_bevel.pixels);
|
||||
// The classic chamfer draws differently.
|
||||
let set = json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevel": "classic"}});
|
||||
o.execute("effect.setParams", &set).unwrap();
|
||||
assert_ne!(ink(&o).pixels, with_bevel.pixels);
|
||||
o.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(ink(&o).pixels, with_bevel.pixels);
|
||||
// Points that do not make a bevel are refused before the document changes.
|
||||
let bad = json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevelProfile": [[0, 0], [0.5, 2], [1, 1]]}});
|
||||
assert!(o.execute("effect.setParams", &bad).unwrap_err().to_string().contains("bevelProfile must be"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn both_extrudes_take_a_custom_bevels_points_and_refuse_a_name_that_is_not_a_string() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 300, "height": 300})).unwrap();
|
||||
let notch = json!([[0, 0], [0.2, 0.6], [0.7, 0.4], [1, 1]]);
|
||||
for effect in [effects::EXTRUDE, effects::CLASSIC_EXTRUDE] {
|
||||
let id = rect(&mut s, 100);
|
||||
let apply = |name: Value| json!({"effect": effect, "ids": [id.0], "item": null, "params": {"bevel": "custom", "bevelName": name, "bevelProfile": notch}});
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
let e = s.execute("effect.apply", &apply(json!(3))).unwrap_err().to_string();
|
||||
assert!(e.contains("bevelName must be a string"), "{effect}: {e}");
|
||||
assert_eq!(s.doc().unwrap().doc, before, "{effect}");
|
||||
s.execute("effect.apply", &apply(json!("Notch"))).unwrap();
|
||||
assert_eq!((¶ms(&s, id)[effects::BEVEL_PROFILE], ¶ms(&s, id)[effects::BEVEL_NAME]), (¬ch, &json!("Notch")), "{effect}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn without_a_bevels_file_editing_is_refused_and_none_are_listed() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({})).unwrap();
|
||||
let list = s.execute("threeD.bevels.list", &json!({})).unwrap();
|
||||
assert_eq!((list["bevels"].as_array().unwrap().len(), &list["file"]), (0, &Value::Null));
|
||||
assert!(s.execute("threeD.bevels.edit", &json!({})).is_err());
|
||||
assert!(s.execute("threeD.bevels.reload", &json!({})).is_err());
|
||||
// A file that is not a document lists no bevels and says why.
|
||||
let dir = folder("unreadable");
|
||||
let file = dir.join(bevels::FILE_NAME);
|
||||
std::fs::write(&file, b"not a document").unwrap();
|
||||
s.attach_bevels_file(file.to_string_lossy().to_string());
|
||||
let list = s.execute("threeD.bevels.list", &json!({})).unwrap();
|
||||
assert!(list["error"].is_string(), "{list}");
|
||||
assert!(s.execute("threeD.bevels.reload", &json!({})).is_err());
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// Automation roots that grant reading `read` alone.
|
||||
fn read_roots(read: &[&std::path::Path]) -> Arc<crate::file_access::AutomationRoots> {
|
||||
crate::file_access::AutomationRoots::new(read, &[]).unwrap().unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_agent_outside_the_bevels_files_folder_sees_its_file_name_alone_and_cannot_reload_it() {
|
||||
let dir = folder("roots-list");
|
||||
let (prefs, other) = (dir.join("prefs"), dir.join("other"));
|
||||
std::fs::create_dir_all(&prefs).unwrap();
|
||||
std::fs::create_dir_all(&other).unwrap();
|
||||
let file = prefs.join(bevels::FILE_NAME);
|
||||
std::fs::write(&file, b"not a drawing").unwrap();
|
||||
let (file, prefs_text) = (file.to_string_lossy().to_string(), prefs.to_string_lossy().to_string());
|
||||
let mut s = Session::new();
|
||||
s.attach_bevels_file(file.clone());
|
||||
let (outside, inside) = (read_roots(&[&other]), read_roots(&[&prefs]));
|
||||
let list = crate::file_access::confine(Some(&outside), || s.execute("threeD.bevels.list", &json!({}))).unwrap();
|
||||
assert_eq!(list["file"], Value::Null, "{list}");
|
||||
let error = list["error"].as_str().unwrap();
|
||||
assert!(error.starts_with(bevels::FILE_NAME) && !error.contains(&prefs_text), "{error}");
|
||||
let list = crate::file_access::confine(Some(&inside), || s.execute("threeD.bevels.list", &json!({}))).unwrap();
|
||||
assert_eq!(list["file"].as_str(), Some(file.as_str()));
|
||||
assert!(list["error"].as_str().unwrap().starts_with(&file), "{list}");
|
||||
// A good file now: an agent outside the folder cannot have it read.
|
||||
std::fs::write(&file, vectorcraft_format::save_file(&bevels::starter())).unwrap();
|
||||
let e = crate::file_access::confine(Some(&outside), || s.execute("threeD.bevels.reload", &json!({}))).unwrap_err().to_string();
|
||||
assert!(e.contains("outside the read root") && e.ends_with(bevels::FILE_NAME) && !e.contains(&prefs_text), "{e}");
|
||||
let list = s.execute("threeD.bevels.list", &json!({})).unwrap();
|
||||
assert!(list["bevels"].as_array().unwrap().is_empty() && list["error"].is_string(), "not read again: {list}");
|
||||
let r = crate::file_access::confine(Some(&inside), || s.execute("threeD.bevels.reload", &json!({}))).unwrap();
|
||||
assert_eq!(r["count"], 1);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_agent_edits_the_bevels_file_only_inside_its_read_roots() {
|
||||
let dir = folder("roots-edit");
|
||||
let (prefs, other) = (dir.join("prefs"), dir.join("other"));
|
||||
std::fs::create_dir_all(&other).unwrap();
|
||||
let file = prefs.join(bevels::FILE_NAME).to_string_lossy().to_string();
|
||||
let prefs_text = prefs.to_string_lossy().to_string();
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
|
||||
s.attach_bevels_file(file.clone());
|
||||
let first_doc = s.doc().unwrap().uid;
|
||||
let outside = read_roots(&[&other]);
|
||||
let edit = |s: &mut Session, roots: &Arc<crate::file_access::AutomationRoots>| {
|
||||
crate::file_access::confine(Some(roots), || s.execute("threeD.bevels.edit", &json!({})))
|
||||
};
|
||||
// Refused before the folder or the file is made, or anything is opened.
|
||||
let e = edit(&mut s, &outside).unwrap_err().to_string();
|
||||
assert!(e.ends_with(bevels::FILE_NAME) && !e.contains(&prefs_text), "{e}");
|
||||
assert!(!prefs.exists(), "no folder made");
|
||||
assert_eq!((s.documents().len(), s.doc().unwrap().uid), (1, first_doc));
|
||||
// From the 3D and Materials panel (no roots), the file is made and opened.
|
||||
assert_eq!(s.execute("threeD.bevels.edit", &json!({})).unwrap()["created"], true);
|
||||
assert_eq!(s.documents().len(), 2);
|
||||
// Open already: still not brought to the front for an agent outside the folder.
|
||||
s.execute("document.activate", &json!({"index": 0})).unwrap();
|
||||
assert!(edit(&mut s, &outside).is_err());
|
||||
assert_eq!((s.documents().len(), s.doc().unwrap().uid), (2, first_doc));
|
||||
// Inside the read roots: opened under them, with its path.
|
||||
let inside = read_roots(&[&prefs]);
|
||||
let mut agent = Session::new();
|
||||
agent.attach_bevels_file(file.clone());
|
||||
let r = edit(&mut agent, &inside).unwrap();
|
||||
assert_eq!((r["path"].as_str(), &r["created"]), (Some(file.as_str()), &json!(false)));
|
||||
let st = agent.doc().unwrap();
|
||||
assert_eq!(st.path.as_deref(), Some(file.as_str()));
|
||||
assert!(st.opened_by.as_ref().is_some_and(|r| Arc::ptr_eq(r, &inside)), "opened under the agent's roots");
|
||||
// A missing file inside the roots is still made first.
|
||||
let fresh = dir.join("fresh").join(bevels::FILE_NAME).to_string_lossy().to_string();
|
||||
let mut agent = Session::new();
|
||||
agent.attach_bevels_file(fresh.clone());
|
||||
let r = edit(&mut agent, &read_roots(&[&dir])).unwrap();
|
||||
assert_eq!(r["created"], true);
|
||||
assert!(std::path::Path::new(&fresh).is_file());
|
||||
assert_eq!(agent.doc().unwrap().path.as_deref(), Some(fresh.as_str()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
@@ -707,12 +707,13 @@ fn an_effect_parameter_without_a_default_is_held_to_its_type() {
|
||||
use crate::cmd::params::undefaulted_type;
|
||||
use vectorcraft_render::effects::effect_catalog;
|
||||
// Read by checks of their own: a stored texture or a texture to load, an SVG filter and its axes, a Warp's
|
||||
// map and the style of Crop Marks.
|
||||
// map, the style of Crop Marks and a custom bevel's name and points.
|
||||
let own_check = |effect: &str, key: &str| match key {
|
||||
"textureImage" | "name" | "xml" => true,
|
||||
"axes" => effect == "svg.filter",
|
||||
"version" => effect.starts_with("warp."),
|
||||
"style" => effect == "cropMarks",
|
||||
"bevelName" | "bevelProfile" => matches!(effect, "threeD.extrude" | "threeD.classicExtrude"),
|
||||
_ => false,
|
||||
};
|
||||
let mut unlisted = vec![];
|
||||
|
||||
@@ -12,9 +12,9 @@ pub mod fold;
|
||||
mod solid;
|
||||
mod visibility;
|
||||
pub use solid::{
|
||||
Bevel, BevelShape, DepthPlane, Extrude, FaceMap, Facet, Inflate, MapCell, MeshFace, PlanarFace, SolidSurface, SurfaceKind, TOO_COMPLEX_SOLID,
|
||||
View, extrude, extrude_face_map, extrude_mesh_face, extrude_side_size, extrude_surfaces, inflate, inflate_each, inflate_together, plane,
|
||||
plane_face_map, plane_mesh_face,
|
||||
Bevel, BevelProfile, BevelShape, DepthPlane, Extrude, FaceMap, Facet, Inflate, MapCell, MeshFace, PlanarFace, SolidSurface, SurfaceKind,
|
||||
TOO_COMPLEX_SOLID, View, extrude, extrude_face_map, extrude_mesh_face, extrude_side_size, extrude_surfaces, inflate, inflate_each,
|
||||
inflate_together, plane, plane_face_map, plane_mesh_face,
|
||||
};
|
||||
pub use visibility::{VisibleFace, visible_faces};
|
||||
mod shading;
|
||||
|
||||
@@ -113,6 +113,8 @@ impl View {
|
||||
}
|
||||
|
||||
/// The shape of a bevel's cross-section, from the cap's edge (0) to the side wall (1).
|
||||
// A custom profile takes 258 bytes; an extrusion copies its bevel a few times.
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub enum BevelShape {
|
||||
/// A straight 45° chamfer when width and height are equal.
|
||||
@@ -126,11 +128,73 @@ pub enum BevelShape {
|
||||
Step,
|
||||
/// A convex then concave S curve.
|
||||
Ogee,
|
||||
/// A cross-section of the user's own, drawn as an open path ([`BevelProfile`]).
|
||||
Custom(BevelProfile),
|
||||
}
|
||||
|
||||
/// A custom bevel's cross-section: points from the cap's edge, (0, 0), to the side wall, (1, 1),
|
||||
/// each a (share of the width, share of the height) pair in 0..1, joined by straight lines. The
|
||||
/// shares are kept to 1/32,768 in a fixed array, so the profile is `Copy` like the built-in shapes.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct BevelProfile {
|
||||
points: [(u16, u16); BevelProfile::MAX_POINTS],
|
||||
len: u8,
|
||||
}
|
||||
|
||||
impl BevelProfile {
|
||||
/// The most points a profile holds.
|
||||
pub const MAX_POINTS: usize = 64;
|
||||
|
||||
/// A profile of `points`, or `None` unless there are 2 to [`Self::MAX_POINTS`] of them, every
|
||||
/// share is a number in 0..1, and they start at (0, 0) and end at (1, 1).
|
||||
pub fn new(points: &[(f64, f64)]) -> Option<Self> {
|
||||
const END: f64 = 1e-6;
|
||||
if !(2..=Self::MAX_POINTS).contains(&points.len()) || points.iter().any(|&(x, y)| !(0.0..=1.0).contains(&x) || !(0.0..=1.0).contains(&y)) {
|
||||
return None;
|
||||
}
|
||||
let (first, last) = (points[0], points[points.len() - 1]);
|
||||
if first.0 > END || first.1 > END || last.0 < 1.0 - END || last.1 < 1.0 - END {
|
||||
return None;
|
||||
}
|
||||
let mut out = Self { points: [(0, 0); Self::MAX_POINTS], len: points.len() as u8 };
|
||||
let share = |v: f64| (v * f64::from(Self::ONE)).round() as u16;
|
||||
for (slot, &(x, y)) in out.points.iter_mut().zip(points) {
|
||||
*slot = (share(x), share(y));
|
||||
}
|
||||
out.points[0] = (0, 0);
|
||||
out.points[points.len() - 1] = (Self::ONE, Self::ONE);
|
||||
Some(out)
|
||||
}
|
||||
|
||||
/// A whole share in the stored points: shares are kept to 1/32,768, so halves and quarters
|
||||
/// stay exact.
|
||||
const ONE: u16 = 1 << 15;
|
||||
|
||||
/// The points, as (share of the width, share of the height).
|
||||
pub fn points(&self) -> impl Iterator<Item = (f64, f64)> + '_ {
|
||||
let share = |v: u16| f64::from(v) / f64::from(Self::ONE);
|
||||
self.points[..usize::from(self.len)].iter().map(move |&(x, y)| (share(x), share(y)))
|
||||
}
|
||||
|
||||
/// The point at `s` (0..1), the points spread evenly along `s` and joined by straight lines.
|
||||
fn at(&self, s: f64) -> (f64, f64) {
|
||||
// A profile holds at least two points (`new`).
|
||||
let len = usize::from(self.len).max(2);
|
||||
let share = |v: u16| f64::from(v) / f64::from(Self::ONE);
|
||||
let k = s * (len - 1) as f64;
|
||||
let i = (k.floor() as usize).min(len - 2);
|
||||
let f = k - i as f64;
|
||||
let (a, b) = (self.points[i], self.points[i + 1]);
|
||||
let (ax, ay, bx, by) = (share(a.0), share(a.1), share(b.0), share(b.1));
|
||||
(ax + (bx - ax) * f, ay + (by - ay) * f)
|
||||
}
|
||||
}
|
||||
|
||||
impl BevelShape {
|
||||
/// The built-in shapes.
|
||||
pub const ALL: [BevelShape; 5] = [Self::Classic, Self::Rounded, Self::Cove, Self::Step, Self::Ogee];
|
||||
|
||||
/// The shape's parameter value; `custom` for a [`BevelShape::Custom`] one.
|
||||
pub fn id(self) -> &'static str {
|
||||
match self {
|
||||
Self::Classic => "classic",
|
||||
@@ -138,9 +202,11 @@ impl BevelShape {
|
||||
Self::Cove => "cove",
|
||||
Self::Step => "step",
|
||||
Self::Ogee => "ogee",
|
||||
Self::Custom(_) => "custom",
|
||||
}
|
||||
}
|
||||
|
||||
/// The built-in shape named `s`.
|
||||
pub fn parse(s: &str) -> Option<Self> {
|
||||
Self::ALL.into_iter().find(|b| b.id() == s)
|
||||
}
|
||||
@@ -150,6 +216,7 @@ impl BevelShape {
|
||||
let s = s.clamp(0.0, 1.0);
|
||||
let q = s * std::f64::consts::FRAC_PI_2;
|
||||
match self {
|
||||
Self::Custom(profile) => profile.at(s),
|
||||
Self::Classic => (s, s),
|
||||
Self::Rounded => (1.0 - q.cos(), q.sin()),
|
||||
Self::Cove => (q.sin(), 1.0 - q.cos()),
|
||||
@@ -177,6 +244,11 @@ impl BevelShape {
|
||||
match self {
|
||||
Self::Classic => vec![0.0, 1.0],
|
||||
Self::Step => vec![0.0, 0.25, 0.5, 0.75, 1.0],
|
||||
// Each of its points, where the straight lines between them turn.
|
||||
Self::Custom(profile) => {
|
||||
let last = (usize::from(profile.len) - 1) as f64;
|
||||
(0..usize::from(profile.len)).map(|i| i as f64 / last).collect()
|
||||
}
|
||||
_ => (0..=8).map(|i| f64::from(i) / 8.0).collect(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,6 +354,40 @@ fn bevel_shapes_repeats_and_both_sides_change_the_surface() {
|
||||
}
|
||||
}
|
||||
|
||||
/// A custom bevel's points are its cross-section, joined by straight lines: two points make the
|
||||
/// classic chamfer, and the step shape's points make the step shape's solid. Other points change
|
||||
/// the surface. A profile must run from (0, 0) to (1, 1) with every share in 0..1.
|
||||
#[test]
|
||||
fn custom_bevel_profiles_shape_the_bevel() {
|
||||
let (p, b) = shape(&square(0.0, 0.0, 100.0));
|
||||
let v = View { rotation_x: -20.0, rotation_y: 30.0, ..front() };
|
||||
let solid = |shape: BevelShape| {
|
||||
let bevel = Bevel { shape, width: 12.0, height: 12.0, repeat: 2, space: 0.2, both_sides: true, ..Bevel::default() };
|
||||
extrude(&p, FillRule::EvenOdd, b, Extrude { bevel: Some(bevel), ..Extrude::default() }, v).unwrap()
|
||||
};
|
||||
let custom = |pts: &[(f64, f64)]| BevelShape::Custom(BevelProfile::new(pts).unwrap());
|
||||
assert_eq!(solid(custom(&[(0.0, 0.0), (1.0, 1.0)])), solid(BevelShape::Classic));
|
||||
let step = [(0.0, 0.0), (0.0, 0.5), (0.5, 0.5), (0.5, 1.0), (1.0, 1.0)];
|
||||
assert_eq!(solid(custom(&step)), solid(BevelShape::Step));
|
||||
let notch = custom(&[(0.0, 0.0), (0.2, 0.6), (0.7, 0.4), (1.0, 1.0)]);
|
||||
assert_ne!(solid(notch), solid(BevelShape::Classic));
|
||||
assert_eq!(notch.id(), "custom");
|
||||
assert_eq!(BevelShape::parse("custom"), None);
|
||||
assert_eq!(notch.at(0.0), (0.0, 0.0));
|
||||
assert_eq!(notch.at(1.0), (1.0, 1.0));
|
||||
// The point a third of the way along is the second point, kept to 1/32,768.
|
||||
let (x, y) = notch.at(1.0 / 3.0);
|
||||
assert!(close(x, 0.2, 1e-4) && close(y, 0.6, 1e-4), "{x}, {y}");
|
||||
// Inside, the bevel carves the shape with the same points.
|
||||
let inside = Bevel { shape: notch, width: 12.0, height: 12.0, inside: true, ..Bevel::default() };
|
||||
assert!(extrude(&p, FillRule::EvenOdd, b, Extrude { bevel: Some(inside), ..Extrude::default() }, v).is_ok());
|
||||
let too_many = vec![(0.5, 0.5); BevelProfile::MAX_POINTS + 1];
|
||||
for bad in [&[(0.0, 0.0)][..], &[(0.1, 0.0), (1.0, 1.0)], &[(0.0, 0.0), (1.0, 0.9)], &[(0.0, 0.0), (1.2, 0.5), (1.0, 1.0)], &too_many] {
|
||||
assert_eq!(BevelProfile::new(bad), None, "{bad:?}");
|
||||
}
|
||||
assert!(BevelProfile::new(&[(0.0, 0.0), (f64::NAN, 0.5), (1.0, 1.0)]).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn holes_stay_holes_in_the_caps_and_get_walls_of_their_own() {
|
||||
let mut b = square(0.0, 0.0, 100.0);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
use egui::{Align2, FontId, Id, Pos2, Sense, Stroke, vec2};
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::Unit;
|
||||
use vectorcraft_effects::{CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, REVOLVE, ROTATION_PRESETS};
|
||||
use vectorcraft_effects::{BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, REVOLVE, ROTATION_PRESETS};
|
||||
|
||||
use crate::state::Dialog;
|
||||
use crate::theme::Tokens;
|
||||
@@ -233,11 +233,11 @@ fn solid_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, id: &
|
||||
} else if object && d.str("__tab") != "rotation" {
|
||||
let unit = app.session.general_unit();
|
||||
if id == CLASSIC_EXTRUDE {
|
||||
super::three_d_classic::object_controls(ui, d, unit);
|
||||
super::three_d_classic::object_controls(app, ui, d, unit);
|
||||
} else if id == CLASSIC_REVOLVE {
|
||||
super::three_d_classic::revolve_controls(ui, d, unit);
|
||||
} else if id == EXTRUDE {
|
||||
extrude_controls(ui, d, unit);
|
||||
extrude_controls(app, ui, d, unit);
|
||||
} else {
|
||||
heading(ui, tl!("Object"));
|
||||
number(ui, d, "depth", tl!("Depth"), (0.0, 2000.0), "", 1, Some(unit));
|
||||
@@ -252,8 +252,108 @@ fn solid_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, id: &
|
||||
}
|
||||
}
|
||||
|
||||
/// A Bevel Shape menu entry: (shown label, value, the custom bevel's name and points).
|
||||
pub(crate) type BevelChoice = (String, Value, Option<(String, Value)>);
|
||||
|
||||
/// The entries of [`bevel_choice`]'s menu for form `fields`, and how many are built in. The
|
||||
/// built-in labels are translated; custom bevels show their names as they are. The effect's own
|
||||
/// custom bevel, the panel's [`OWN_BEVEL`] else the form's, is listed unless the file lists it by
|
||||
/// name with the same points; while another entry has its label, " (document)" is added to it.
|
||||
pub(crate) fn bevel_options(app: &VectorcraftApp, fields: &serde_json::Map<String, Value>, effect: &str) -> (Vec<BevelChoice>, usize) {
|
||||
let mut options: Vec<BevelChoice> = super::effect::own_choices(effect, "bevel", false)
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|(label, value)| (tl!(label).to_string(), json!(value), None))
|
||||
.collect();
|
||||
let builtin = options.len();
|
||||
for b in app.session.bevels.bevels() {
|
||||
options.push((b.name.clone(), json!("custom"), Some((b.name.clone(), b.profile_json()))));
|
||||
}
|
||||
let custom = fields.get("bevel").and_then(Value::as_str) == Some("custom");
|
||||
let own = match fields.get(OWN_BEVEL).and_then(Value::as_array).map(Vec::as_slice) {
|
||||
Some([n, p]) => Some((n.as_str().unwrap_or_default().to_string(), p.clone())),
|
||||
_ => fields
|
||||
.get(BEVEL_PROFILE)
|
||||
.filter(|p| custom && !p.is_null())
|
||||
.map(|p| (fields.get(BEVEL_NAME).and_then(Value::as_str).unwrap_or_default().to_string(), p.clone())),
|
||||
};
|
||||
if let Some((n, p)) = own
|
||||
&& !options[builtin..].iter().any(|(_, _, c)| c.as_ref().is_some_and(|(cn, cp)| *cn == n && *cp == p))
|
||||
{
|
||||
let mut shown = if n.is_empty() { tl!("Custom").to_string() } else { n.clone() };
|
||||
// Each pass makes the label longer, so this ends once no entry has it.
|
||||
while options.iter().any(|(l, _, _)| *l == shown) {
|
||||
shown = crate::i18n::fmt(tl!("{name} (document)"), &[("name", &shown)]);
|
||||
}
|
||||
options.push((shown, json!("custom"), Some((n, p))));
|
||||
}
|
||||
(options, builtin)
|
||||
}
|
||||
|
||||
/// The form field where the 3D and Materials panel puts the first selected effect's custom bevel,
|
||||
/// `[name, points]`, so Bevel Shape lists it while a mixed selection unsets the shown bevel.
|
||||
pub(crate) const OWN_BEVEL: &str = "__ownBevel";
|
||||
|
||||
/// The Bevel Shape menu of Extrude & Bevel and Extrude & Bevel (Classic) (`effect`): None and the
|
||||
/// built-in shapes, then the custom bevels of the bevels file, and the effect's own custom bevel
|
||||
/// when the file does not list it (a document from elsewhere carries its points). Picking a
|
||||
/// custom bevel stores its name and a copy of its points. In the 3D and Materials panel, Edit
|
||||
/// Bevels… opens the bevels file (`__editBevels`, which the panel runs).
|
||||
pub(super) fn bevel_choice(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, effect: &str) {
|
||||
const KEY: &str = "bevel";
|
||||
let (options, builtin) = bevel_options(app, &d.fields, effect);
|
||||
let name = d.fields.get(BEVEL_NAME).and_then(Value::as_str).unwrap_or_default().to_string();
|
||||
let points = d.fields.get(BEVEL_PROFILE).filter(|v| !v.is_null()).cloned();
|
||||
let custom = d.fields.get(KEY).and_then(Value::as_str) == Some("custom");
|
||||
let is = |c: &Option<(String, Value)>| c.as_ref().is_some_and(|(n, p)| *n == name && Some(p) == points.as_ref());
|
||||
let default = vectorcraft_effects::default_params(effect).and_then(|p| p.get(KEY).cloned()).unwrap_or(Value::Null);
|
||||
let mixed = d.fields.get(KEY).is_some_and(Value::is_null);
|
||||
let value = d.fields.get(KEY).filter(|v| !v.is_null()).cloned().unwrap_or_else(|| default.clone());
|
||||
let current = if custom {
|
||||
options[builtin..].iter().position(|(_, _, c)| is(c)).map(|i| i + builtin)
|
||||
} else {
|
||||
options[..builtin].iter().position(|(_, v, _)| *v == value)
|
||||
};
|
||||
ui.horizontal(|ui| {
|
||||
ui.spacing_mut().item_spacing.x = 6.0;
|
||||
label(ui, tl!("Bevel Shape"));
|
||||
let labels: Vec<&str> = options.iter().map(|(l, _, _)| l.as_str()).collect();
|
||||
let shown = current.and_then(|i| labels.get(i)).copied().unwrap_or("");
|
||||
let width = VALUE_W + rail_width(ui) + 6.0;
|
||||
// Marked by index, not label: a custom bevel's name can match another entry's label.
|
||||
let picked = widgets::combo(ui, ("three-d-choice", KEY), shown, width, |ui| {
|
||||
let mut chosen = None;
|
||||
for (i, l) in labels.iter().enumerate() {
|
||||
if ui.add(egui::Button::selectable(current == Some(i), *l)).clicked() {
|
||||
chosen = Some(i);
|
||||
}
|
||||
}
|
||||
chosen
|
||||
});
|
||||
if let Some(k) = picked
|
||||
&& let Some((_, v, c)) = options.get(k)
|
||||
{
|
||||
d.fields.insert(KEY.into(), v.clone());
|
||||
if let Some((n, p)) = c {
|
||||
d.fields.insert(BEVEL_NAME.into(), json!(n));
|
||||
d.fields.insert(BEVEL_PROFILE.into(), p.clone());
|
||||
}
|
||||
}
|
||||
let default_label = options.iter().find(|(_, v, _)| *v == default).map_or("", |(l, _, _)| l.as_str());
|
||||
if reset_dot(ui, KEY, mixed || value != default, default_label) {
|
||||
d.fields.insert(KEY.into(), default.clone());
|
||||
}
|
||||
});
|
||||
if d.bool("__panel") {
|
||||
let enabled = app.session.bevels.path().is_some();
|
||||
if ui.add_enabled(enabled, egui::Button::new(tl!("Edit Bevels…"))).clicked() {
|
||||
d.fields.insert("__editBevels".into(), json!(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Extrude & Bevel's depth, twist, taper, cap and bevel.
|
||||
fn extrude_controls(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
fn extrude_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
heading(ui, tl!("Object"));
|
||||
number(ui, d, "depth", tl!("Depth"), (0.0, 2000.0), "", 1, Some(unit));
|
||||
number(ui, d, "twist", tl!("Twist"), (0.0, 360.0), "°", 1, None);
|
||||
@@ -261,9 +361,7 @@ fn extrude_controls(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
choice(ui, d, "cap", c3("Cap"), &[(json!(true), c3("Solid")), (json!(false), c3("Hollow"))]);
|
||||
ui.add_space(10.0);
|
||||
bevel_heading(ui, d);
|
||||
let shapes: Vec<(Value, &str)> =
|
||||
super::effect::own_choices(EXTRUDE, "bevel", false).unwrap_or_default().into_iter().map(|(label, value)| (json!(value), label)).collect();
|
||||
choice(ui, d, "bevel", tl!("Bevel Shape"), &shapes);
|
||||
bevel_choice(app, ui, d, EXTRUDE);
|
||||
ui.add_enabled_ui(d.str("bevel") != "none", |ui| {
|
||||
number(ui, d, "bevelWidth", tl!("Width"), (0.0, 1000.0), "", 1, Some(unit));
|
||||
number(ui, d, "bevelHeight", tl!("Height"), (0.0, 1000.0), "", 1, Some(unit));
|
||||
|
||||
@@ -13,15 +13,15 @@ use super::revolve::{c3, choice, heading, label, light_list, light_record, numbe
|
||||
use crate::state::Dialog;
|
||||
use crate::theme::Tokens;
|
||||
|
||||
/// Depth and cap, then the bevel: its shape, its height and whether it is added around the shape
|
||||
/// or carved into it.
|
||||
pub(super) fn object_controls(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
/// Depth and cap, then the bevel: its shape (a custom one included), its height and whether it is
|
||||
/// added around the shape or carved into it.
|
||||
pub(super) fn object_controls(app: &crate::VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
heading(ui, tl!("Object"));
|
||||
number(ui, d, "depth", tl!("Depth"), (0.0, 2000.0), "", 1, Some(unit));
|
||||
choice(ui, d, "cap", c3("Cap"), &[(json!(true), c3("Solid")), (json!(false), c3("Hollow"))]);
|
||||
ui.add_space(10.0);
|
||||
heading(ui, c3("Bevel"));
|
||||
choice(ui, d, "bevel", tl!("Bevel Shape"), &options("bevel"));
|
||||
super::revolve::bevel_choice(app, ui, d, CLASSIC_EXTRUDE);
|
||||
ui.add_enabled_ui(d.str("bevel") != "none", |ui| {
|
||||
number(ui, d, "bevelHeight", tl!("Height"), (1.0, 100.0), "", 1, Some(unit));
|
||||
toggle(ui, d, "bevelInside", tl!("Bevel Inside"), false);
|
||||
@@ -438,11 +438,6 @@ pub(super) fn surface_controls(ui: &mut egui::Ui, d: &mut Dialog) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The values of Extrude & Bevel (Classic)'s `key` as the dropdowns list them, (value, label).
|
||||
fn options(key: &str) -> Vec<(Value, &'static str)> {
|
||||
options_of(CLASSIC_EXTRUDE, key)
|
||||
}
|
||||
|
||||
/// The values of classic 3D effect `effect`'s `key` as the dropdowns list them, (value, label).
|
||||
fn options_of(effect: &str, key: &str) -> Vec<(Value, &'static str)> {
|
||||
super::effect::own_choices(effect, key, false).unwrap_or_default().into_iter().map(|(label, value)| (json!(value), label)).collect()
|
||||
|
||||
@@ -3142,6 +3142,11 @@ digits Malayalam Малаялам
|
||||
Edit Arrowheads Редактиране на върхове на стрелки
|
||||
Edit Arrowheads… Редактиране на върхове на стрелки…
|
||||
Reload Arrowheads Презареждане на върхове на стрелки
|
||||
Bevels Фаски
|
||||
Edit Bevels Редактиране на фаски
|
||||
Edit Bevels… Редактиране на фаски…
|
||||
{name} (document) {name} (документ)
|
||||
Reload Bevels Презареждане на фаски
|
||||
Reset Rotate View Нулиране на изгледа на завъртане
|
||||
Rotate View to Selection Завъртане на изгледа спрямо селекцията
|
||||
Reset the rows to the artwork's colors Нулиране на редовете към цветовете на илюстрацията
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4324,6 +4324,11 @@ theme Appearance Izgled
|
||||
Edit Arrowheads Uredi vrhove strelica
|
||||
Edit Arrowheads… Uredi vrhove strelica…
|
||||
Reload Arrowheads Ponovo učitaj vrhove strelica
|
||||
Bevels Zakošenja
|
||||
Edit Bevels Uredi zakošenja
|
||||
Edit Bevels… Uredi zakošenja…
|
||||
{name} (document) {name} (dokument)
|
||||
Reload Bevels Ponovo učitaj zakošenja
|
||||
Stroke Options Opcije poteza
|
||||
Width Profiles Profili širine
|
||||
Apply Graphic Style Primijeni grafički stil
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -3985,6 +3985,11 @@ digits Malayalam Malaiàlam
|
||||
Edit Arrowheads Edita les puntes de fletxa
|
||||
Edit Arrowheads… Edita les puntes de fletxa…
|
||||
Reload Arrowheads Torna a carregar les puntes de fletxa
|
||||
Bevels Bisells
|
||||
Edit Bevels Edita els bisells
|
||||
Edit Bevels… Edita els bisells…
|
||||
{name} (document) {name} (document)
|
||||
Reload Bevels Torna a carregar els bisells
|
||||
Reset Rotate View Restableix la rotació de la vista
|
||||
Reset Ruler Origin Restableix l’origen de les regles
|
||||
Reset the rows to the artwork's colors Restableix les files als colors de l’obra
|
||||
@@ -7264,7 +7269,10 @@ liquify-list-end {0}, {1} {0} i {1}
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) l’objecte no té cap efecte 3D (Extrudeix i bisella, Revoluciona, Infla o Gira)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` ha de ser un objecte que només contingui `mode`, amb el valor shaded o wireframe
|
||||
@msg its 3D effect builds no solid el seu efecte 3D no construeix cap sòlid
|
||||
@msg bevel must be none or one of {_1} bevel ha de ser none o un de {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel ha de ser none, un de {_1}, o custom amb {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom necessita {BEVEL_PROFILE}, els punts del bisell
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} ha de ser una cadena
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} ha de tenir de 2 a {most} punts [x, y], cada proporció entre 0 i 1, des de [0, 0] (la vora de la tapa) fins a [1, 1] (la paret lateral)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} no pot construir sòlids a partir d’aquesta il·lustració: les seves instàncies de símbol, fusions i grups de retall contenen massa objectes
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} no pot construir un sòlid a partir de la instància del símbol «{symbol}»: la il·lustració del símbol no està disponible
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: el traçat de retall és massa complex per retallar-hi la il·lustració
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4433,6 +4433,11 @@ theme Appearance Motiv
|
||||
Edit Arrowheads Upravit šipky
|
||||
Edit Arrowheads… Upravit šipky…
|
||||
Reload Arrowheads Znovu načíst šipky
|
||||
Bevels Zkosení
|
||||
Edit Bevels Upravit zkosení
|
||||
Edit Bevels… Upravit zkosení…
|
||||
{name} (document) {name} (dokument)
|
||||
Reload Bevels Znovu načíst zkosení
|
||||
Stroke Options Možnosti tahu
|
||||
Width Profiles Profily šířky
|
||||
Apply Graphic Style Použít grafický styl
|
||||
@@ -6854,7 +6859,10 @@ mark-style Japanese Japonské
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objekt nemá žádný 3D efekt (Vysunutí a zkosení, Rotační těleso, Nafouknutí ani Otočit)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` musí být objekt obsahující pouze `mode` s hodnotou shaded nebo wireframe
|
||||
@msg its 3D effect builds no solid jeho 3D efekt nevytváří žádné těleso
|
||||
@msg bevel must be none or one of {_1} bevel musí být none nebo jedno z {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel musí být none, jedno z {_1} nebo custom s {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom vyžaduje {BEVEL_PROFILE}, body zkosení
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} musí být řetězec
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} musí mít 2 až {most} bodů [x, y], každý podíl mezi 0 a 1, od [0, 0] (hrana čelní plochy) do [1, 1] (boční stěna)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} nemůže z této kresby vytvořit tělesa: její instance symbolů, prolnutí a ořezové skupiny obsahují příliš mnoho objektů
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} nemůže vytvořit těleso z instance symbolu „{symbol}“: kresba symbolu není k dispozici
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: ořezová cesta je příliš složitá na oříznutí kresby
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -432,7 +432,10 @@ liquify-list-end {0}, {1} {0} og {1}
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objektet har ingen 3D-effekt (Ekstrudér og facet, Omdrej, Pust op eller Rotér)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` skal være et objekt, der kun indeholder `mode` med værdien shaded eller wireframe
|
||||
@msg its 3D effect builds no solid dens 3D-effekt danner intet legeme
|
||||
@msg bevel must be none or one of {_1} bevel skal være none eller en af {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel skal være none, en af {_1} eller custom med {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom kræver {BEVEL_PROFILE}, facettens punkter
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} skal være en streng
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} skal være 2 til {most} punkter [x, y], hver andel mellem 0 og 1, fra [0, 0] (dækfladens kant) til [1, 1] (sidevæggen)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kan ikke danne legemer af denne grafik: dens symbolforekomster, blandinger og beskæringsgrupper indeholder for mange objekter
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kan ikke danne et legeme af forekomsten af symbolet "{symbol}": symbolets grafik er ikke tilgængelig
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: beskæringskurven er for kompleks til at skære grafikken med
|
||||
@@ -6887,6 +6890,11 @@ theme Appearance Udseende
|
||||
Edit Arrowheads Redigér pilespidser
|
||||
Edit Arrowheads… Redigér pilespidser…
|
||||
Reload Arrowheads Genindlæs pilespidser
|
||||
Bevels Facetter
|
||||
Edit Bevels Redigér facetter
|
||||
Edit Bevels… Redigér facetter…
|
||||
{name} (document) {name} (dokument)
|
||||
Reload Bevels Genindlæs facetter
|
||||
Stroke Options Konturindstillinger
|
||||
Width Profiles Breddeprofiler
|
||||
Apply Graphic Style Anvend grafikstil
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3210,6 +3210,11 @@ digits Malayalam Malayalam
|
||||
Edit Arrowheads Pfeilspitzen bearbeiten
|
||||
Edit Arrowheads… Pfeilspitzen bearbeiten…
|
||||
Reload Arrowheads Pfeilspitzen neu laden
|
||||
Bevels Abgeflachte Kanten
|
||||
Edit Bevels Abgeflachte Kanten bearbeiten
|
||||
Edit Bevels… Abgeflachte Kanten bearbeiten…
|
||||
{name} (document) {name} (Dokument)
|
||||
Reload Bevels Abgeflachte Kanten neu laden
|
||||
Rotate View Ansicht drehen
|
||||
Reset Rotate View Ansichtsdrehung zurücksetzen
|
||||
Rotate View to Selection Ansicht nach Auswahl drehen
|
||||
@@ -6420,7 +6425,10 @@ lighting Light Licht
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) das Objekt hat keinen 3D-Effekt (Extrudieren und abgeflachte Kante, Kreiseln, Aufblasen oder Drehen)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` muss ein Objekt sein, das nur `mode` mit dem Wert shaded oder wireframe enthält
|
||||
@msg its 3D effect builds no solid sein 3D-Effekt erzeugt keinen Körper
|
||||
@msg bevel must be none or one of {_1} bevel muss none oder einer der folgenden Werte sein: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel muss none, einer der Werte {_1} oder custom mit {BEVEL_PROFILE} sein
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom benötigt {BEVEL_PROFILE}, die Punkte der abgeflachten Kante
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} muss eine Zeichenfolge sein
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} muss 2 bis {most} Punkte [x, y] enthalten, jeder Anteil zwischen 0 und 1, von [0, 0] (Kante der Deckfläche) bis [1, 1] (Seitenwand)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kann aus diesem Bildmaterial keine Körper erstellen: Seine Symbolinstanzen, Angleichungen und Schnittgruppen enthalten zu viele Objekte
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kann keinen Körper aus der Instanz des Symbols „{symbol}“ erstellen: Das Bildmaterial des Symbols ist nicht verfügbar
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: Der Schnittpfad ist zu komplex, um das Bildmaterial damit zu beschneiden
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4068,6 +4068,11 @@ digits Malayalam Μαλαγιάλαμ
|
||||
Edit Arrowheads Επεξεργασία αιχμών βελών
|
||||
Edit Arrowheads… Επεξεργασία αιχμών βελών…
|
||||
Reload Arrowheads Επαναφόρτωση αιχμών βελών
|
||||
Bevels Λοξοτμήσεις
|
||||
Edit Bevels Επεξεργασία λοξοτμήσεων
|
||||
Edit Bevels… Επεξεργασία λοξοτμήσεων…
|
||||
{name} (document) {name} (έγγραφο)
|
||||
Reload Bevels Επαναφόρτωση λοξοτμήσεων
|
||||
Reset Rotate View Επαναφορά περιστροφής προβολής
|
||||
Rotate View to Selection Περιστροφή προβολής ως προς την επιλογή
|
||||
Reset the rows to the artwork's colors Επαναφορά γραμμών στα χρώματα του σχεδίου
|
||||
@@ -6237,7 +6242,10 @@ variable-list-end {0}, {1} {0} και {1}
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) το αντικείμενο δεν έχει εφέ 3D (Εξώθηση και λοξότμηση, Περιστροφή γύρω από άξονα, Φούσκωμα ή Περιστροφή)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe το `render` πρέπει να είναι αντικείμενο που περιέχει μόνο `mode`, με τιμή shaded ή wireframe
|
||||
@msg its 3D effect builds no solid το εφέ 3D του δεν δημιουργεί στερεό
|
||||
@msg bevel must be none or one of {_1} το bevel πρέπει να είναι none ή ένα από τα {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} το bevel πρέπει να είναι none, ένα από τα {_1} ή custom με {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points το bevel custom χρειάζεται το {BEVEL_PROFILE}, τα σημεία της λοξότμησης
|
||||
@msg {BEVEL_NAME} must be a string το {BEVEL_NAME} πρέπει να είναι συμβολοσειρά
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) το {BEVEL_PROFILE} πρέπει να έχει 2 έως {most} σημεία [x, y], κάθε αναλογία μεταξύ 0 και 1, από [0, 0] (η ακμή της ακραίας όψης) έως [1, 1] (το πλευρικό τοίχωμα)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: δεν μπορούν να δημιουργηθούν στερεά από αυτό το σχέδιο· οι παρουσίες συμβόλων, οι αναμείξεις και οι ομάδες αποκοπής του περιέχουν πάρα πολλά αντικείμενα
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: δεν μπορεί να δημιουργηθεί στερεό από την παρουσία του συμβόλου «{symbol}»· το σχέδιο του συμβόλου δεν είναι διαθέσιμο
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: η διαδρομή αποκοπής είναι πολύ σύνθετη για να κόψει το σχέδιο
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3248,6 +3248,11 @@ digits Malayalam Malayálam
|
||||
Edit Arrowheads Editar puntas de flecha
|
||||
Edit Arrowheads… Editar puntas de flecha…
|
||||
Reload Arrowheads Volver a cargar puntas de flecha
|
||||
Bevels Biseles
|
||||
Edit Bevels Editar biseles
|
||||
Edit Bevels… Editar biseles…
|
||||
{name} (document) {name} (documento)
|
||||
Reload Bevels Volver a cargar biseles
|
||||
Reset Rotate View Restablecer rotación de vista
|
||||
Rotate View to Selection Rotar vista según la selección
|
||||
Reset the rows to the artwork's colors Restablecer las filas a los colores de la ilustración
|
||||
@@ -6827,7 +6832,10 @@ mark-style Japanese Japonesas
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) el objeto no tiene ningún efecto 3D (Extrusión y biselado, Revolución, Inflar o Rotar)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` debe ser un objeto que solo contenga `mode`, con el valor shaded o wireframe
|
||||
@msg its 3D effect builds no solid su efecto 3D no construye ningún sólido
|
||||
@msg bevel must be none or one of {_1} bevel debe ser none o uno de estos: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel debe ser none, uno de estos: {_1}, o custom con {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom necesita {BEVEL_PROFILE}, los puntos del bisel
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} debe ser una cadena
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} debe tener de 2 a {most} puntos [x, y], cada proporción entre 0 y 1, desde [0, 0] (el borde de la tapa) hasta [1, 1] (la pared lateral)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} no puede construir sólidos a partir de esta ilustración: sus instancias de símbolo, fusiones y grupos de recorte contienen demasiados objetos
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} no puede construir un sólido a partir de la instancia del símbolo «{symbol}»: la ilustración del símbolo no está disponible
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: el trazado de recorte es demasiado complejo para recortar la ilustración
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4350,6 +4350,11 @@ theme Appearance Ulkoasu
|
||||
Edit Arrowheads Muokkaa nuolenkärkiä
|
||||
Edit Arrowheads… Muokkaa nuolenkärkiä…
|
||||
Reload Arrowheads Lataa nuolenkärjet uudelleen
|
||||
Bevels Viisteet
|
||||
Edit Bevels Muokkaa viisteitä
|
||||
Edit Bevels… Muokkaa viisteitä…
|
||||
{name} (document) {name} (asiakirja)
|
||||
Reload Bevels Lataa viisteet uudelleen
|
||||
Stroke Options Viivan asetukset
|
||||
Width Profiles Leveysprofiilit
|
||||
Apply Graphic Style Käytä grafiikkatyyliä
|
||||
@@ -6755,7 +6760,10 @@ mark-style Japanese Japanilainen
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objektilla ei ole 3D-tehostetta (Pursota ja viistä, Pyöräytä, Täytä ilmalla tai Kierrä)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` on oltava objekti, jossa on vain `mode` arvolla shaded tai wireframe
|
||||
@msg its 3D effect builds no solid sen 3D-tehoste ei muodosta kappaletta
|
||||
@msg bevel must be none or one of {_1} bevel-arvon on oltava none tai jokin seuraavista: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel-arvon on oltava none, jokin seuraavista: {_1}, tai custom yhdessä arvon {BEVEL_PROFILE} kanssa
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom tarvitsee arvon {BEVEL_PROFILE}, viisteen pisteet
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} on oltava merkkijono
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) arvossa {BEVEL_PROFILE} on oltava vähintään 2 ja enintään {most} pistettä [x, y], kukin osuus väliltä 0 ja 1, pisteestä [0, 0] (päätypinnan reuna) pisteeseen [1, 1] (sivuseinä)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} ei voi muodostaa kappaleita tästä kuvituksesta: sen symbolien esiintymät, sulautukset ja leikkausryhmät sisältävät liikaa objekteja
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} ei voi muodostaa kappaletta symbolin ”{symbol}” esiintymästä: symbolin kuvitus ei ole käytettävissä
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: leikkauspolku on liian monimutkainen kuvituksen leikkaamiseen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3236,6 +3236,11 @@ digits Malayalam Malayalam
|
||||
Edit Arrowheads Modifier les pointes de flèche
|
||||
Edit Arrowheads… Modifier les pointes de flèche…
|
||||
Reload Arrowheads Recharger les pointes de flèche
|
||||
Bevels Biseaux
|
||||
Edit Bevels Modifier les biseaux
|
||||
Edit Bevels… Modifier les biseaux…
|
||||
{name} (document) {name} (document)
|
||||
Reload Bevels Recharger les biseaux
|
||||
Reset Rotate View Réinitialiser la rotation de l’affichage
|
||||
Rotate View to Selection Faire pivoter l’affichage selon la sélection
|
||||
Reset the rows to the artwork's colors Réinitialiser les lignes avec les couleurs de l’illustration
|
||||
@@ -6419,7 +6424,10 @@ lighting Light Lumière
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) l’objet n’a aucun effet 3D (Extrusion et biseautage, Révolution, Gonfler ou Rotation)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` doit être un objet ne contenant que `mode`, avec la valeur shaded ou wireframe
|
||||
@msg its 3D effect builds no solid son effet 3D ne construit aucun volume
|
||||
@msg bevel must be none or one of {_1} bevel doit valoir none ou l’une de ces valeurs : {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel doit valoir none, l’une des valeurs {_1}, ou custom avec {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom nécessite {BEVEL_PROFILE}, les points du biseau
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} doit être une chaîne
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} doit contenir de 2 à {most} points [x, y], chaque proportion entre 0 et 1, de [0, 0] (le bord de la face) à [1, 1] (la paroi latérale)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} ne peut pas construire de volumes à partir de cette illustration : ses occurrences de symbole, dégradés de formes et groupes de découpe contiennent trop d’objets
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} ne peut pas construire de volume à partir de l’occurrence du symbole « {symbol} » : l’illustration du symbole n’est pas disponible
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1} : le tracé de découpe est trop complexe pour découper l’illustration
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4611,6 +4611,11 @@ arrowhead Feather पंख
|
||||
Edit Arrowheads एरोहेड्स संपादित करें
|
||||
Edit Arrowheads… एरोहेड्स संपादित करें…
|
||||
Reload Arrowheads एरोहेड्स फिर से लोड करें
|
||||
Bevels बेवल्स
|
||||
Edit Bevels बेवल्स संपादित करें
|
||||
Edit Bevels… बेवल्स संपादित करें…
|
||||
{name} (document) {name} (दस्तावेज़)
|
||||
Reload Bevels बेवल्स फिर से लोड करें
|
||||
Reset Rotate View व्यू घुमाएँ रीसेट करें
|
||||
Reset Ruler Origin रूलर ओरिजिन रीसेट करें
|
||||
Reset Symbol Instance सिंबल इंस्टेंस रीसेट करें
|
||||
@@ -9169,7 +9174,10 @@ liquify-list-end {0}, {1} {0} और {1}
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ऑब्जेक्ट पर कोई 3D इफ़ेक्ट नहीं है (एक्सट्रूडेड और बेवेल, रिवॉल्व, फुलाएँ या घुमाव)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` केवल `mode` वाला ऑब्जेक्ट होना चाहिए, जिसका मान shaded या wireframe हो
|
||||
@msg its 3D effect builds no solid इसका 3D इफ़ेक्ट कोई ठोस नहीं बनाता
|
||||
@msg bevel must be none or one of {_1} bevel को none या {_1} में से एक होना चाहिए
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel को none, {_1} में से एक, या {BEVEL_PROFILE} के साथ custom होना चाहिए
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom के लिए {BEVEL_PROFILE} चाहिए, यानी बेवल के बिंदु
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} एक स्ट्रिंग होना चाहिए
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} में 2 से {most} [x, y] बिंदु होने चाहिए, हर हिस्सा 0 और 1 के बीच, [0, 0] (सिरे की सतह का किनारा) से [1, 1] (बगल की दीवार) तक
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} इस आर्ट से ठोस नहीं बना सकता: इसके सिंबल इंस्टेंस, ब्लेंड और क्लिपिंग ग्रुप में बहुत अधिक ऑब्जेक्ट हैं
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} सिंबल "{symbol}" के इंस्टेंस से ठोस नहीं बना सकता: सिंबल का आर्ट उपलब्ध नहीं है
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: क्लिपिंग पाथ आर्ट को काटने के लिए बहुत जटिल है
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3824,6 +3824,11 @@ mark-style Japanese Japán
|
||||
Edit Arrowheads Nyílhegyek szerkesztése
|
||||
Edit Arrowheads… Nyílhegyek szerkesztése…
|
||||
Reload Arrowheads Nyílhegyek újratöltése
|
||||
Bevels Élletörések
|
||||
Edit Bevels Élletörések szerkesztése
|
||||
Edit Bevels… Élletörések szerkesztése…
|
||||
{name} (document) {name} (dokumentum)
|
||||
Reload Bevels Élletörések újratöltése
|
||||
Reset Rotate View Nézetforgatás visszaállítása
|
||||
Rotate View to Selection Nézet elforgatása a kijelöléshez
|
||||
Reset the rows to the artwork's colors Sorok visszaállítása a grafika színeire
|
||||
@@ -6839,7 +6844,10 @@ variable-list-end {0}, {1} {0} és {1}
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) az objektumnak nincs 3D effektusa (Kihúzás és élletörés, Forgatás tengely körül, Felfújás vagy Elforgatás)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe a `render` csak `mode` mezőt tartalmazó objektum lehet, shaded vagy wireframe értékkel
|
||||
@msg its 3D effect builds no solid a 3D effektusa nem hoz létre testet
|
||||
@msg bevel must be none or one of {_1} a bevel értéke none vagy ezek egyike lehet: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} a bevel értéke none, ezek egyike: {_1}, vagy custom lehet {BEVEL_PROFILE} megadásával
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points a bevel custom értékéhez {BEVEL_PROFILE} kell, az élletörés pontjai
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME}: karakterlánc kell
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE}: legalább 2 és legfeljebb {most} [x, y] pont kell, minden arány 0 és 1 között, [0, 0]-tól (a fedőlap éle) [1, 1]-ig (az oldalfal)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: ebből a rajzból nem hozható létre test: a szimbólumpéldányai, összemosásai és vágócsoportjai túl sok objektumot tartalmaznak
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: nem hozható létre test a(z) „{symbol}” szimbólum példányából: a szimbólum rajza nem érhető el
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: a vágóútvonal túl összetett a rajz kivágásához
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -314,7 +314,10 @@
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objek tidak memiliki efek 3D (Ekstrusi & bevel, Revolusi, Gelembungkan, atau Putar)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` harus berupa objek yang hanya berisi `mode`, bernilai shaded atau wireframe
|
||||
@msg its 3D effect builds no solid efek 3D-nya tidak membangun bentuk padat
|
||||
@msg bevel must be none or one of {_1} bevel harus none atau salah satu dari {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel harus none, salah satu dari {_1}, atau custom dengan {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom memerlukan {BEVEL_PROFILE}, yaitu titik-titik bevel
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} harus berupa string
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} harus berisi 2 sampai {most} titik [x, y], masing-masing bernilai antara 0 dan 1, dari [0, 0] (tepi tutup) hingga [1, 1] (dinding samping)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} tidak dapat membangun bentuk padat dari karya ini: instans simbol, blend, dan grup klipingnya berisi terlalu banyak objek
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} tidak dapat membangun bentuk padat dari instans simbol "{symbol}": karya simbol tidak tersedia
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: jalur kliping terlalu rumit untuk memotong karya
|
||||
@@ -4753,6 +4756,11 @@ theme Appearance Tampilan
|
||||
Edit Arrowheads Edit mata panah
|
||||
Edit Arrowheads… Edit mata panah…
|
||||
Reload Arrowheads Muat ulang mata panah
|
||||
Bevels Bentuk bevel
|
||||
Edit Bevels Edit bentuk bevel
|
||||
Edit Bevels… Edit bentuk bevel…
|
||||
{name} (document) {name} (dokumen)
|
||||
Reload Bevels Muat ulang bentuk bevel
|
||||
Stroke Options Opsi goresan
|
||||
Width Profiles Profil lebar
|
||||
Apply Graphic Style Terapkan gaya grafis
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3295,6 +3295,11 @@ digits Malayalam Malayalam
|
||||
Edit Arrowheads Modifica punte di freccia
|
||||
Edit Arrowheads… Modifica punte di freccia…
|
||||
Reload Arrowheads Ricarica punte di freccia
|
||||
Bevels Smussi
|
||||
Edit Bevels Modifica smussi
|
||||
Edit Bevels… Modifica smussi…
|
||||
{name} (document) {name} (documento)
|
||||
Reload Bevels Ricarica smussi
|
||||
Rotate View Ruota vista
|
||||
Reset Rotate View Reimposta rotazione vista
|
||||
Rotate View to Selection Ruota vista in base alla selezione
|
||||
@@ -6467,7 +6472,10 @@ lighting Light Luce
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) l'oggetto non ha alcun effetto 3D (Estrusione e smusso, Rivoluzione, Gonfia o Ruota)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` deve essere un oggetto che contiene solo `mode`, con valore shaded o wireframe
|
||||
@msg its 3D effect builds no solid il suo effetto 3D non costruisce alcun solido
|
||||
@msg bevel must be none or one of {_1} bevel deve essere none o uno dei seguenti: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel deve essere none, uno dei seguenti: {_1}, oppure custom con {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom richiede {BEVEL_PROFILE}, i punti dello smusso
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} deve essere una stringa
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} deve contenere da 2 a {most} punti [x, y], ogni proporzione tra 0 e 1, da [0, 0] (il bordo della faccia) a [1, 1] (la parete laterale)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} non può costruire solidi da questo disegno: le sue istanze di simbolo, fusioni e gruppi di ritaglio contengono troppi oggetti
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} non può costruire un solido dall'istanza del simbolo «{symbol}»: il disegno del simbolo non è disponibile
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: il tracciato di ritaglio è troppo complesso per ritagliare il disegno
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3270,6 +3270,11 @@ mark-style Japanese 日本式
|
||||
Edit Arrowheads 矢印を編集
|
||||
Edit Arrowheads… 矢印を編集…
|
||||
Reload Arrowheads 矢印を再読み込み
|
||||
Bevels ベベル一覧
|
||||
Edit Bevels ベベルを編集
|
||||
Edit Bevels… ベベルを編集…
|
||||
{name} (document) {name} (ドキュメント)
|
||||
Reload Bevels ベベルを再読み込み
|
||||
Reset the rows to the artwork's colors 行をアートワークのカラーにリセット
|
||||
Color Theme Picker カラーテーマピッカー
|
||||
Undo Changes 変更を取り消し
|
||||
@@ -6516,7 +6521,10 @@ lighting Light ライト
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) オブジェクトに 3D 効果 (押し出しとベベル、回転体、膨張、回転) がありません
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` は `mode` だけを持ち、その値が shaded または wireframe のオブジェクトにしてください
|
||||
@msg its 3D effect builds no solid 3D 効果からソリッドが作成されません
|
||||
@msg bevel must be none or one of {_1} bevel には none または {_1} のいずれかを指定してください
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel には none、{_1} のいずれか、または {BEVEL_PROFILE} を付けた custom を指定してください
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom にはベベルのポイントを表す {BEVEL_PROFILE} が必要です
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} は文字列にしてください
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} には 2 個から {most} 個の [x, y] ポイントを、各値を 0 から 1 までの割合として、[0, 0] (端面の縁) から [1, 1] (側面の壁) まで指定してください
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} はこのアートからソリッドを作成できません。シンボルインスタンス、ブレンド、クリッピンググループに含まれるオブジェクトが多すぎます
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} はシンボル「{symbol}」のインスタンスからソリッドを作成できません。シンボルのアートを使用できません
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: クリッピングパスが複雑すぎるため、アートを切り抜けません
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6170,6 +6170,11 @@ theme Appearance იერსახე
|
||||
Edit Arrowheads ისრის წვერების რედაქტირება
|
||||
Edit Arrowheads… ისრის წვერების რედაქტირება…
|
||||
Reload Arrowheads ისრის წვერების ხელახლა ჩატვირთვა
|
||||
Bevels წაკვეთები
|
||||
Edit Bevels წაკვეთების რედაქტირება
|
||||
Edit Bevels… წაკვეთების რედაქტირება…
|
||||
{name} (document) {name} (დოკუმენტი)
|
||||
Reload Bevels წაკვეთების ხელახლა ჩატვირთვა
|
||||
Stroke Options კონტურის პარამეტრები
|
||||
Width Profiles სიგანის პროფილები
|
||||
Apply Graphic Style გრაფიკული სტილის გამოყენება
|
||||
@@ -8177,7 +8182,10 @@ arrowhead Feather ბუმბული
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ობიექტს არ აქვს 3D ეფექტი (ამოწევა და წაკვეთა, ბრუნვა, გაბერვა ან შემობრუნება)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` უნდა იყოს ობიექტი, რომელიც შეიცავს მხოლოდ `mode`-ს, მნიშვნელობით shaded ან wireframe
|
||||
@msg its 3D effect builds no solid მისი 3D ეფექტი სხეულს არ ქმნის
|
||||
@msg bevel must be none or one of {_1} bevel უნდა იყოს none ან ერთ-ერთი: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel უნდა იყოს none, ერთ-ერთი: {_1}, ან custom და {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom მოითხოვს {BEVEL_PROFILE}, წაკვეთის წერტილები
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} უნდა იყოს სტრიქონი
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} უნდა შეიცავდეს 2-დან {most}-მდე [x, y] წერტილს, თითოეული წილი 0-სა და 1-ს შორის, [0, 0]-დან (ბოლო წახნაგის კიდე) [1, 1]-მდე (გვერდითი კედელი)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: ამ ნახატიდან სხეულების შექმნა შეუძლებელია: მისი სიმბოლოს ეგზემპლარები, გადასვლები და მომჭრელი ჯგუფები ზედმეტად ბევრ ობიექტს შეიცავს
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: სიმბოლოს „{symbol}“ ეგზემპლარიდან სხეულის შექმნა შეუძლებელია: სიმბოლოს ნახატი მიუწვდომელია
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: მომჭრელი ტრაექტორია ზედმეტად რთულია ნახატის მოსაჭრელად
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3259,6 +3259,11 @@ mark-style Japanese 일본식
|
||||
Edit Arrowheads 화살촉 편집
|
||||
Edit Arrowheads… 화살촉 편집…
|
||||
Reload Arrowheads 화살촉 다시 불러오기
|
||||
Bevels 베벨 목록
|
||||
Edit Bevels 베벨 편집
|
||||
Edit Bevels… 베벨 편집…
|
||||
{name} (document) {name}(문서)
|
||||
Reload Bevels 베벨 다시 불러오기
|
||||
Reset the rows to the artwork's colors 행을 아트웍 색상으로 재설정
|
||||
Color Theme Picker 색상 테마 피커
|
||||
Undo Changes 변경 내용 실행 취소
|
||||
@@ -6437,7 +6442,10 @@ lighting Light 광원
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 개체에 3D 효과(돌출 및 경사, 회전체, 부풀리기 또는 회전)가 없습니다
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render`는 값이 shaded 또는 wireframe인 `mode`만 있는 객체여야 합니다
|
||||
@msg its 3D effect builds no solid 3D 효과가 입체를 만들지 않습니다
|
||||
@msg bevel must be none or one of {_1} bevel은 none 또는 {_1} 중 하나여야 합니다
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel은 none, {_1} 중 하나 또는 {BEVEL_PROFILE}을(를) 함께 지정한 custom이어야 합니다
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom에는 베벨의 포인트인 {BEVEL_PROFILE}이(가) 필요합니다
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME}은(는) 문자열이어야 합니다
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE}은(는) 2개에서 {most}개의 [x, y] 포인트여야 하며, 각 값은 0과 1 사이의 비율이고 [0, 0](끝면의 가장자리)에서 [1, 1](옆면 벽)까지여야 합니다
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}은(는) 이 아트로 입체를 만들 수 없습니다. 심볼 인스턴스, 블렌드, 클리핑 그룹에 개체가 너무 많습니다
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}은(는) 심볼 “{symbol}”의 인스턴스로 입체를 만들 수 없습니다. 심볼의 아트를 사용할 수 없습니다
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: 클리핑 패스가 너무 복잡하여 아트를 자를 수 없습니다
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4758,6 +4758,11 @@ theme Appearance Vormgeving
|
||||
Edit Arrowheads Pijlpunten bewerken
|
||||
Edit Arrowheads… Pijlpunten bewerken…
|
||||
Reload Arrowheads Pijlpunten opnieuw laden
|
||||
Bevels Afschuiningen
|
||||
Edit Bevels Afschuiningen bewerken
|
||||
Edit Bevels… Afschuiningen bewerken…
|
||||
{name} (document) {name} (document)
|
||||
Reload Bevels Afschuiningen opnieuw laden
|
||||
Stroke Options Lijnopties
|
||||
Width Profiles Breedteprofielen
|
||||
Apply Graphic Style Grafische stijl toepassen
|
||||
@@ -8602,7 +8607,10 @@ mark-style Japanese Japans
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) het object heeft geen 3D-effect (Extruderen en afschuinen, Draaien, Opblazen of Roteren)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` moet een object zijn met alleen `mode`, ingesteld op shaded of wireframe
|
||||
@msg its 3D effect builds no solid het 3D-effect ervan maakt geen massief object
|
||||
@msg bevel must be none or one of {_1} bevel moet none of een van {_1} zijn
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel moet none, een van {_1} of custom met {BEVEL_PROFILE} zijn
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom heeft {BEVEL_PROFILE} nodig, de punten van de afschuining
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} moet een tekenreeks zijn
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} moet 2 tot {most} punten [x, y] bevatten, elk aandeel tussen 0 en 1, van [0, 0] (de rand van de bovenkant) tot [1, 1] (de zijwand)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kan van deze illustratie geen massieve objecten maken: de symboolinstanties, vermengingen en knipgroepen ervan bevatten te veel objecten
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kan geen massief object maken van de instantie van symbool "{symbol}": de illustratie van het symbool is niet beschikbaar
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: het knippad is te complex om de illustratie mee uit te knippen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4298,6 +4298,11 @@ theme Appearance Wygląd
|
||||
Edit Arrowheads Edytuj groty strzałek
|
||||
Edit Arrowheads… Edytuj groty strzałek…
|
||||
Reload Arrowheads Wczytaj ponownie groty strzałek
|
||||
Bevels Fazy
|
||||
Edit Bevels Edytuj fazy
|
||||
Edit Bevels… Edytuj fazy…
|
||||
{name} (document) {name} (dokument)
|
||||
Reload Bevels Wczytaj ponownie fazy
|
||||
Stroke Options Opcje obrysu
|
||||
Width Profiles Profile szerokości
|
||||
Apply Graphic Style Zastosuj styl graficzny
|
||||
@@ -6679,7 +6684,10 @@ mark-style Japanese Japońskie
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) obiekt nie ma efektu 3D (Wyciągnięcie i fazowanie, Obrót, Nadmuchanie ani Obróć)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` musi być obiektem zawierającym tylko `mode` o wartości shaded lub wireframe
|
||||
@msg its 3D effect builds no solid jego efekt 3D nie tworzy żadnej bryły
|
||||
@msg bevel must be none or one of {_1} bevel musi mieć wartość none lub jedną z: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel musi mieć wartość none, jedną z: {_1}, albo custom z {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom wymaga {BEVEL_PROFILE}, punktów fazy
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} musi być ciągiem znaków
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} musi zawierać od 2 do {most} punktów [x, y], każdy udział od 0 do 1, od [0, 0] (krawędź ściany czołowej) do [1, 1] (ściana boczna)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} nie może utworzyć brył z tej kompozycji: jej wystąpienia symboli, przejścia i grupy przycinające zawierają zbyt wiele obiektów
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} nie może utworzyć bryły z wystąpienia symbolu „{symbol}”: kompozycja symbolu jest niedostępna
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: ścieżka przycinająca jest zbyt złożona, aby przyciąć nią kompozycję
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2708,6 +2708,11 @@ digits Malayalam Malaiala
|
||||
Edit Arrowheads Editar Pontas de Seta
|
||||
Edit Arrowheads… Editar Pontas de Seta…
|
||||
Reload Arrowheads Recarregar Pontas de Seta
|
||||
Bevels Chanfros
|
||||
Edit Bevels Editar Chanfros
|
||||
Edit Bevels… Editar Chanfros…
|
||||
{name} (document) {name} (documento)
|
||||
Reload Bevels Recarregar Chanfros
|
||||
Rotate View Girar Visualização
|
||||
Reset Rotate View Redefinir Visualização Girada
|
||||
Rotate View to Selection Girar Visualização para a Seleção
|
||||
@@ -6802,7 +6807,10 @@ mark-style Japanese Japonesas
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) o objeto não tem efeito 3D (Extrusão e Bisel, Revolver, Inflar ou Girar)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` deve ser um objeto que contenha apenas `mode`, com o valor shaded ou wireframe
|
||||
@msg its 3D effect builds no solid seu efeito 3D não constrói nenhum sólido
|
||||
@msg bevel must be none or one of {_1} bevel deve ser none ou um de {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel deve ser none, um de {_1}, ou custom com {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom precisa de {BEVEL_PROFILE}, os pontos do chanfro
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} deve ser uma string
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} deve ter de 2 a {most} pontos [x, y], cada proporção entre 0 e 1, de [0, 0] (a borda da tampa) a [1, 1] (a parede lateral)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} não pode construir sólidos a partir desta arte: suas instâncias de símbolo, mesclagens e grupos de recorte contêm objetos demais
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} não pode construir um sólido a partir da instância do símbolo “{symbol}”: a arte do símbolo não está disponível
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: o caminho de recorte é complexo demais para recortar a arte
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3278,6 +3278,11 @@ digits Malayalam Малаялам
|
||||
Edit Arrowheads Редактировать стрелки
|
||||
Edit Arrowheads… Редактировать стрелки…
|
||||
Reload Arrowheads Перезагрузить стрелки
|
||||
Bevels Фаски
|
||||
Edit Bevels Редактировать фаски
|
||||
Edit Bevels… Редактировать фаски…
|
||||
{name} (document) {name} (документ)
|
||||
Reload Bevels Перезагрузить фаски
|
||||
Rotate View Повернуть вид
|
||||
Reset Rotate View Сбросить поворот вида
|
||||
Rotate View to Selection Повернуть вид по выделению
|
||||
@@ -6465,7 +6470,10 @@ lighting Light Свет
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) у объекта нет 3D-эффекта (Выдавливание и фаска, Вращение, Надувание или Повернуть)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` должен быть объектом только с полем `mode` со значением shaded или wireframe
|
||||
@msg its 3D effect builds no solid его 3D-эффект не строит тела
|
||||
@msg bevel must be none or one of {_1} bevel должен быть none или одним из: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel должен быть none, одним из: {_1}, или custom с {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points для bevel custom нужен {BEVEL_PROFILE}, точки фаски
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} должно быть строкой
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} должен содержать от 2 до {most} точек [x, y], каждая доля от 0 до 1, от [0, 0] (край торца) до [1, 1] (боковая стенка)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: нельзя построить тела из этой иллюстрации: её экземпляры символов, переходы и обтравочные группы содержат слишком много объектов
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: нельзя построить тело из экземпляра символа «{symbol}»: иллюстрация символа недоступна
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: обтравочный контур слишком сложен, чтобы обрезать им иллюстрацию
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3168,6 +3168,11 @@ digits Malayalam Malayalam
|
||||
Edit Arrowheads Redigera pilspetsar
|
||||
Edit Arrowheads… Redigera pilspetsar…
|
||||
Reload Arrowheads Läs in pilspetsar igen
|
||||
Bevels Fasningar
|
||||
Edit Bevels Redigera fasningar
|
||||
Edit Bevels… Redigera fasningar…
|
||||
{name} (document) {name} (dokument)
|
||||
Reload Bevels Läs in fasningar igen
|
||||
Reset Rotate View Återställ Rotera vy
|
||||
Rotate View to Selection Rotera vyn efter markeringen
|
||||
Reset the rows to the artwork's colors Återställ raderna till teckningens färger
|
||||
@@ -6332,7 +6337,10 @@ lighting Light Ljus
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objektet har ingen 3D-effekt (Extrudera och fasa, Rotera runt axel, Blås upp eller Rotera)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` måste vara ett objekt som bara innehåller `mode`, med värdet shaded eller wireframe
|
||||
@msg its 3D effect builds no solid dess 3D-effekt bygger ingen solid
|
||||
@msg bevel must be none or one of {_1} bevel måste vara none eller något av {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel måste vara none, något av {_1} eller custom med {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom kräver {BEVEL_PROFILE}, fasningens punkter
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} måste vara en sträng
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} måste vara 2 till {most} punkter [x, y], varje andel mellan 0 och 1, från [0, 0] (ändytans kant) till [1, 1] (sidoväggen)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kan inte bygga solider av den här teckningen: dess symbolinstanser, blandningar och urklippsgrupper innehåller för många objekt
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kan inte bygga en solid av instansen av symbolen ”{symbol}”: symbolens teckning är inte tillgänglig
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: urklippsbanan är för komplex för att klippa teckningen med
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4103,6 +4103,22 @@ fn three_d_refusals_translate_with_their_values() {
|
||||
(refuse(vectorcraft_effects::validate_three_d(&rect, CLASSIC_EXTRUDE, &json!({"depth": "deep"}))), "must be a number", vec!["`depth`"]),
|
||||
(refuse(vectorcraft_effects::validate_three_d(&instance, EXTRUDE, &json!({}))), "the symbol's art isn't available", vec!["Mine 7"]),
|
||||
(refuse(vectorcraft_effects::three_d_wireframe_in(None, &rect).map(drop)), "has no 3D effect", vec![]),
|
||||
(
|
||||
refuse(vectorcraft_effects::validate_three_d(&rect, EXTRUDE, &json!({"bevel": "wavy"}))),
|
||||
"or custom with",
|
||||
vec!["none", "classic", "custom", "bevelProfile"],
|
||||
),
|
||||
(
|
||||
refuse(vectorcraft_effects::validate_three_d(&rect, EXTRUDE, &json!({"bevel": "custom"}))),
|
||||
"the bevel's points",
|
||||
vec!["custom", "bevelProfile"],
|
||||
),
|
||||
(refuse(vectorcraft_effects::validate_three_d(&rect, CLASSIC_EXTRUDE, &json!({"bevelName": 3}))), "must be a string", vec!["bevelName"]),
|
||||
(
|
||||
refuse(vectorcraft_effects::validate_three_d(&rect, EXTRUDE, &json!({"bevel": "custom", "bevelProfile": [[0, 0]]}))),
|
||||
"each share between",
|
||||
vec!["bevelProfile", "[x, y]", "[0, 0]", "[1, 1]"],
|
||||
),
|
||||
];
|
||||
for (e, english, _) in &errors {
|
||||
assert!(e.starts_with("invalid parameters for `effect.apply`: ") && e.contains(english), "{e}");
|
||||
@@ -6558,7 +6574,8 @@ const NAMED_KEYS: &[(&str, &[&str])] = &[
|
||||
("axis must be \"vertical\", \"horizontal\" or an angle in degrees, not `{v}`", &["axis"]),
|
||||
("balance must be between 0 and 100", &["balance"]),
|
||||
("before must name a panel", &["before"]),
|
||||
("bevel must be none or one of {_1}", &["bevel", "none"]),
|
||||
("bevel custom needs {BEVEL_PROFILE}, the bevel's points", &["bevel", "custom"]),
|
||||
("bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE}", &["bevel", "none", "custom"]),
|
||||
("brightness must be dark|mediumDark|mediumLight|light", &["brightness", "dark", "mediumDark", "mediumLight", "light"]),
|
||||
("clip must be true or false", &["clip"]),
|
||||
("collapsed must be true or false", &["collapsed"]),
|
||||
|
||||
@@ -3013,6 +3013,11 @@ digits Malayalam Malayalam
|
||||
Edit Arrowheads Ok Uçlarını Düzenle
|
||||
Edit Arrowheads… Ok Uçlarını Düzenle…
|
||||
Reload Arrowheads Ok Uçlarını Yeniden Yükle
|
||||
Bevels Eğimler
|
||||
Edit Bevels Eğimleri Düzenle
|
||||
Edit Bevels… Eğimleri Düzenle…
|
||||
{name} (document) {name} (belge)
|
||||
Reload Bevels Eğimleri Yeniden Yükle
|
||||
Reset Rotate View Döndürme Görünümünü Sıfırla
|
||||
Rotate View to Selection Görünümü Seçime Döndür
|
||||
Reset the rows to the artwork's colors Satırları resmin renklerine göre sıfırlayın
|
||||
@@ -6158,7 +6163,10 @@ lighting Light Işık
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) nesnenin 3 boyutlu efekti yok (Ekstrüzyon ve Eğim, Eksen Etrafında Döndür, Şişir veya Döndür)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render`, yalnızca değeri shaded veya wireframe olan `mode` içeren bir nesne olmalıdır
|
||||
@msg its 3D effect builds no solid 3 boyutlu efekti hiçbir katı oluşturmuyor
|
||||
@msg bevel must be none or one of {_1} bevel, none veya {_1} değerlerinden biri olmalıdır
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel; none, {_1} değerlerinden biri veya {BEVEL_PROFILE} ile custom olmalıdır
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom için {BEVEL_PROFILE}, yani eğimin noktaları gerekir
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} bir dize olmalıdır
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE}, 2 ile {most} arasında [x, y] noktası olmalıdır; her oran 0 ile 1 arasında, [0, 0] (uç yüzeyin kenarı) ile [1, 1] (yan duvar) arasında
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} bu resimden katı oluşturamaz: sembol örnekleri, karışımları ve kırpma grupları çok fazla nesne içeriyor
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}, “{symbol}” sembolünün örneğinden katı oluşturamaz: sembolün resmi kullanılamıyor
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: kırpma yolu resmi kesmek için çok karmaşık
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3287,6 +3287,11 @@ digits Malayalam Малаялам
|
||||
Edit Arrowheads Редагувати стрілки
|
||||
Edit Arrowheads… Редагувати стрілки…
|
||||
Reload Arrowheads Перезавантажити стрілки
|
||||
Bevels Фаски
|
||||
Edit Bevels Редагувати фаски
|
||||
Edit Bevels… Редагувати фаски…
|
||||
{name} (document) {name} (документ)
|
||||
Reload Bevels Перезавантажити фаски
|
||||
Rotate View Повернути вид
|
||||
Reset Rotate View Скинути поворот виду
|
||||
Rotate View to Selection Повернути вид за виділенням
|
||||
@@ -6447,7 +6452,10 @@ lighting Light Світло
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) об’єкт не має 3D-ефекту (Видавлювання та фаска, Обертання, Надування або Повернути)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` має бути об’єктом лише з полем `mode` зі значенням shaded або wireframe
|
||||
@msg its 3D effect builds no solid його 3D-ефект не будує тіла
|
||||
@msg bevel must be none or one of {_1} bevel має бути none або одним з: {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel має бути none, одним з: {_1}, або custom з {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points для bevel custom потрібен {BEVEL_PROFILE}, точки фаски
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} має бути рядком
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} має містити від 2 до {most} точок [x, y], кожна частка від 0 до 1, від [0, 0] (край торця) до [1, 1] (бічна стінка)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: не вдається побудувати тіла з цієї ілюстрації: її екземпляри символів, переходи та відсічні групи містять забагато об’єктів
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: не вдається побудувати тіло з екземпляра символу «{symbol}»: ілюстрація символу недоступна
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: відсічний контур надто складний, щоб обрізати ним ілюстрацію
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3598,6 +3598,11 @@ mark-style Japanese Kiểu Nhật
|
||||
Edit Arrowheads Chỉnh sửa đầu mũi tên
|
||||
Edit Arrowheads… Chỉnh sửa đầu mũi tên…
|
||||
Reload Arrowheads Tải lại đầu mũi tên
|
||||
Bevels Các kiểu vát
|
||||
Edit Bevels Chỉnh sửa kiểu vát
|
||||
Edit Bevels… Chỉnh sửa kiểu vát…
|
||||
{name} (document) {name} (tài liệu)
|
||||
Reload Bevels Tải lại kiểu vát
|
||||
Rotate View Xoay chế độ xem
|
||||
Reset Rotate View Đặt lại xoay chế độ xem
|
||||
Rotate View to Selection Xoay chế độ xem theo vùng chọn
|
||||
@@ -6199,7 +6204,10 @@ liquify-list-end {0}, {1} {0} và {1}
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) đối tượng không có hiệu ứng 3D (Kéo dài & vát, Xoay tròn, Phình hoặc Xoay)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` phải là một đối tượng chỉ chứa `mode`, với giá trị shaded hoặc wireframe
|
||||
@msg its 3D effect builds no solid hiệu ứng 3D của nó không tạo ra khối nào
|
||||
@msg bevel must be none or one of {_1} bevel phải là none hoặc một trong {_1}
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel phải là none, một trong {_1}, hoặc custom kèm {BEVEL_PROFILE}
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom cần {BEVEL_PROFILE}, các điểm của kiểu vát
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} phải là một chuỗi
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} phải có từ 2 đến {most} điểm [x, y], mỗi tỷ lệ từ 0 đến 1, từ [0, 0] (cạnh của mặt đầu) đến [1, 1] (thành bên)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} không thể tạo khối từ hình vẽ này: các phiên bản ký hiệu, hòa trộn và nhóm cắt của nó chứa quá nhiều đối tượng
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} không thể tạo khối từ phiên bản của ký hiệu “{symbol}”: không có hình vẽ của ký hiệu
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}: đường dẫn cắt quá phức tạp để cắt hình vẽ
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3138,6 +3138,11 @@ digits Malayalam 马拉雅拉姆数字
|
||||
Edit Arrowheads 编辑箭头
|
||||
Edit Arrowheads… 编辑箭头…
|
||||
Reload Arrowheads 重新载入箭头
|
||||
Bevels 斜角列表
|
||||
Edit Bevels 编辑斜角
|
||||
Edit Bevels… 编辑斜角…
|
||||
{name} (document) {name} (文档)
|
||||
Reload Bevels 重新载入斜角
|
||||
Reset Rotate View 重置旋转视图
|
||||
Rotate View to Selection 按所选对象旋转视图
|
||||
Reset the rows to the artwork's colors 将各行重置为图稿的颜色
|
||||
@@ -6717,7 +6722,10 @@ lighting Light 光源
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 该对象没有 3D 效果(突出与斜角、回转、膨胀或旋转)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` 必须是只含 `mode` 的对象,值为 shaded 或 wireframe
|
||||
@msg its 3D effect builds no solid 其 3D 效果未生成任何实体
|
||||
@msg bevel must be none or one of {_1} bevel 必须是 none 或 {_1} 之一
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel 必须是 none、{_1} 之一,或带 {BEVEL_PROFILE} 的 custom
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom 需要 {BEVEL_PROFILE},即斜角的点
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} 必须是字符串
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} 必须是 2 到 {most} 个 [x, y] 点,每个比例在 0 到 1 之间,从 [0, 0](端面的边缘)到 [1, 1](侧壁)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}无法从此图稿生成实体:其符号实例、混合和剪切组包含的对象过多
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}无法从符号“{symbol}”的实例生成实体:该符号的图稿不可用
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}:剪切路径过于复杂,无法用来剪切图稿
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4584,6 +4584,11 @@ digits Malayalam 馬來亞拉姆數字
|
||||
Edit Arrowheads 編輯箭頭
|
||||
Edit Arrowheads… 編輯箭頭…
|
||||
Reload Arrowheads 重新載入箭頭
|
||||
Bevels 斜角清單
|
||||
Edit Bevels 編輯斜角
|
||||
Edit Bevels… 編輯斜角…
|
||||
{name} (document) {name} (文件)
|
||||
Reload Bevels 重新載入斜角
|
||||
Rotate View 旋轉檢視
|
||||
Reset Rotate View 重設旋轉檢視
|
||||
Rotate View to Selection 依選取範圍旋轉檢視
|
||||
@@ -6565,7 +6570,10 @@ lighting Light 光源
|
||||
@msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 此物件沒有 3D 效果 (突出與斜角、迴轉、膨脹或旋轉)
|
||||
@msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` 必須是只含 `mode` 的物件,值為 shaded 或 wireframe
|
||||
@msg its 3D effect builds no solid 其 3D 效果沒有產生任何實體
|
||||
@msg bevel must be none or one of {_1} bevel 必須是 none 或 {_1} 其中之一
|
||||
@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel 必須是 none、{_1} 其中之一,或帶有 {BEVEL_PROFILE} 的 custom
|
||||
@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom 需要 {BEVEL_PROFILE},也就是斜角的點
|
||||
@msg {BEVEL_NAME} must be a string {BEVEL_NAME} 必須是字串
|
||||
@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} 必須是 2 到 {most} 個 [x, y] 點,每個比例介於 0 和 1 之間,從 [0, 0](端面的邊緣)到 [1, 1](側壁)
|
||||
@msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}無法從此圖稿產生實體:其符號實例、漸變和剪裁群組包含的物件過多
|
||||
@msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}無法從符號「{symbol}」的實例產生實體:該符號的圖稿無法使用
|
||||
@msg {_1}: the clipping path is too complex to cut the art with {_1}:剪裁路徑過於複雜,無法用來剪裁圖稿
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -253,6 +253,128 @@ fn a_change_reaches_each_selected_3d_effect_and_no_other_effect() {
|
||||
assert_eq!(fx(c)[0].params, c_shadow);
|
||||
}
|
||||
|
||||
/// A custom bevel picked in the panel sends its name and points with `bevel`, to the effects that
|
||||
/// take a bevel only, and another custom bevel replaces them.
|
||||
#[test]
|
||||
fn a_custom_bevel_sends_its_name_and_points() {
|
||||
let mut app = app();
|
||||
let a = app.session.active().unwrap().selection.objects[0].0;
|
||||
set_type(&mut app, "extrude").unwrap();
|
||||
let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap();
|
||||
app.run("effect.apply", json!({"effect": "threeD.inflate", "item": null})).unwrap();
|
||||
app.run("select.set", json!({"ids": [a, b]})).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
let pick = |name: &str, points: Value| {
|
||||
Map::from_iter([
|
||||
("bevel".to_string(), json!("custom")),
|
||||
(vectorcraft_effects::BEVEL_NAME.to_string(), json!(name)),
|
||||
(vectorcraft_effects::BEVEL_PROFILE.to_string(), points),
|
||||
])
|
||||
};
|
||||
let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]);
|
||||
send(&mut app, &ctx, pick("Notch", notch.clone()), false);
|
||||
let fx = |app: &VectorcraftApp, id: u64| {
|
||||
app.session.active().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.effects[0].params.clone()
|
||||
};
|
||||
let p = fx(&app, a);
|
||||
assert_eq!(
|
||||
(&p["bevel"], &p[vectorcraft_effects::BEVEL_NAME], &p[vectorcraft_effects::BEVEL_PROFILE]),
|
||||
(&json!("custom"), &json!("Notch"), ¬ch)
|
||||
);
|
||||
assert!(fx(&app, b).get(vectorcraft_effects::BEVEL_PROFILE).is_none());
|
||||
let steps = json!([[0.0, 0.0], [0.0, 0.5], [0.5, 0.5], [0.5, 1.0], [1.0, 1.0]]);
|
||||
send(&mut app, &ctx, pick("Steps", steps.clone()), false);
|
||||
let p = fx(&app, a);
|
||||
assert_eq!((&p[vectorcraft_effects::BEVEL_NAME], &p[vectorcraft_effects::BEVEL_PROFILE]), (&json!("Steps"), &steps));
|
||||
}
|
||||
|
||||
/// With one Extrude & Bevel on a custom bevel and one without, picking that custom bevel sends its
|
||||
/// name and points too, though the form already held them, so both effects take it.
|
||||
#[test]
|
||||
fn a_custom_bevel_picked_for_a_mixed_selection_reaches_every_effect() {
|
||||
let mut app = app();
|
||||
let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]);
|
||||
let custom = json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch});
|
||||
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": custom})).unwrap();
|
||||
let a = app.session.active().unwrap().selection.objects[0].0;
|
||||
let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap();
|
||||
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null})).unwrap();
|
||||
app.run("select.set", json!({"ids": [a, b]})).unwrap();
|
||||
let mut fields = target(&app).map(|t| vectorcraft_effects::merged_params(&t.effect, &t.params)).unwrap().as_object().cloned().unwrap();
|
||||
super::mark_mixed(&app, &mut fields);
|
||||
assert_eq!((&fields["bevel"], &fields[vectorcraft_effects::BEVEL_NAME]), (&Value::Null, &json!("Notch")));
|
||||
let before = Value::Object(fields.clone());
|
||||
fields.insert("bevel".into(), json!("custom"));
|
||||
let changed = changed_settings(&before, &Value::Object(fields));
|
||||
assert_eq!(Value::Object(changed.clone()), json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch}));
|
||||
send(&mut app, &egui::Context::default(), changed, false);
|
||||
let st = app.session.active().unwrap();
|
||||
for id in [a, b] {
|
||||
let p = &st.doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.effects[0].params;
|
||||
assert_eq!((&p["bevel"], &p[vectorcraft_effects::BEVEL_PROFILE]), (&json!("custom"), ¬ch), "{id}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Two custom bevels the bevels file does not list: the mixed selection unsets the shown points,
|
||||
/// and Bevel Shape still lists the first effect's own bevel, which then reaches both effects.
|
||||
#[test]
|
||||
fn a_mixed_selection_still_lists_the_first_effects_own_custom_bevel() {
|
||||
use crate::dialogs::revolve::{OWN_BEVEL, bevel_options};
|
||||
let mut app = app();
|
||||
let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]);
|
||||
let steps = json!([[0.0, 0.0], [0.0, 0.5], [0.5, 0.5], [0.5, 1.0], [1.0, 1.0]]);
|
||||
let custom = |name: &str, points: &Value| json!({"bevel": "custom", "bevelName": name, "bevelProfile": points});
|
||||
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": custom("Notch", ¬ch)})).unwrap();
|
||||
let a = app.session.active().unwrap().selection.objects[0].0;
|
||||
let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap();
|
||||
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": custom("Steps", &steps)})).unwrap();
|
||||
app.run("select.set", json!({"ids": [a, b]})).unwrap();
|
||||
let mut fields = target(&app).map(|t| vectorcraft_effects::merged_params(&t.effect, &t.params)).unwrap().as_object().cloned().unwrap();
|
||||
let own = super::own_bevel(&fields).unwrap();
|
||||
super::mark_mixed(&app, &mut fields);
|
||||
assert_eq!(fields[vectorcraft_effects::BEVEL_PROFILE], Value::Null);
|
||||
fields.insert(OWN_BEVEL.into(), own);
|
||||
let (options, builtin) = bevel_options(&app, &fields, "threeD.extrude");
|
||||
assert_eq!(options.len(), builtin + 1);
|
||||
let (label, value, picked) = options[builtin].clone();
|
||||
assert_eq!((label.as_str(), value), ("Notch", json!("custom")));
|
||||
let (name, points) = picked.unwrap();
|
||||
assert_eq!(points, notch);
|
||||
// Picking it sends the whole bevel to both effects.
|
||||
fields.remove(OWN_BEVEL);
|
||||
let before = Value::Object(fields.clone());
|
||||
fields.insert(vectorcraft_effects::BEVEL_NAME.into(), json!(name));
|
||||
fields.insert(vectorcraft_effects::BEVEL_PROFILE.into(), points);
|
||||
send(&mut app, &egui::Context::default(), changed_settings(&before, &Value::Object(fields)), false);
|
||||
let st = app.session.active().unwrap();
|
||||
for id in [a, b] {
|
||||
let p = &st.doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.effects[0].params;
|
||||
assert_eq!((&p[vectorcraft_effects::BEVEL_NAME], &p[vectorcraft_effects::BEVEL_PROFILE]), (&json!("Notch"), ¬ch), "{id}");
|
||||
}
|
||||
}
|
||||
|
||||
/// An effect's own custom bevel named like a bevel of the bevels file with other points is listed
|
||||
/// under its own label, so Bevel Shape does not show two entries of one name.
|
||||
#[test]
|
||||
fn an_own_custom_bevel_named_like_a_file_bevel_gets_its_own_label() {
|
||||
use crate::dialogs::revolve::bevel_options;
|
||||
let dir = std::env::temp_dir().join(format!("vectorcraft-ui-bevels-own-label-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let mut app = app();
|
||||
app.session.attach_bevels_file(dir.join(vectorcraft_engine::cmd::bevels::FILE_NAME).to_string_lossy().to_string());
|
||||
app.run("threeD.bevels.edit", json!({})).unwrap();
|
||||
let file = app.session.bevels.get("Example Bevel").unwrap().profile_json();
|
||||
let other = json!([[0.0, 0.0], [0.5, 0.5], [1.0, 1.0]]);
|
||||
assert_ne!(file, other);
|
||||
let fields = json!({"bevel": "custom", "bevelName": "Example Bevel", "bevelProfile": other}).as_object().cloned().unwrap();
|
||||
let (options, builtin) = bevel_options(&app, &fields, "threeD.extrude");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let labels: Vec<&str> = options[builtin..].iter().map(|(l, _, _)| l.as_str()).collect();
|
||||
assert_eq!(labels, ["Example Bevel", "Example Bevel (document)"]);
|
||||
assert_eq!(options[builtin + 1].2, Some(("Example Bevel".to_string(), other)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_panel_finds_a_3d_effect_on_a_fill() {
|
||||
let mut app = app();
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
use egui::Ui;
|
||||
use serde_json::{Map, Value, json};
|
||||
use vectorcraft_doc::{Effect, Node, NodeId, NodeKind};
|
||||
use vectorcraft_effects::{CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, THREE_D_TYPES, is_three_d};
|
||||
use vectorcraft_effects::{BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, THREE_D_TYPES, is_three_d};
|
||||
|
||||
use super::{live_run, pstate, set_pstate};
|
||||
use crate::VectorcraftApp;
|
||||
use crate::dialogs::revolve::OWN_BEVEL;
|
||||
use crate::dialogs::three_d_materials as materials;
|
||||
use crate::state::Dialog;
|
||||
use crate::theme::Tokens;
|
||||
@@ -155,9 +156,11 @@ pub(crate) fn send(app: &mut VectorcraftApp, ctx: &egui::Context, changed: Map<S
|
||||
.iter()
|
||||
.filter_map(|(id, t, same_lights)| {
|
||||
let takes = vectorcraft_effects::default_params(&t.effect).unwrap_or(Value::Null);
|
||||
// A custom bevel's name and points go with `bevel` to the effects that take one.
|
||||
let custom_bevel = |k: &str| (k == BEVEL_NAME || k == BEVEL_PROFILE) && takes.get("bevel").is_some();
|
||||
let params: Map<String, Value> = pending
|
||||
.iter()
|
||||
.filter(|(k, _)| takes.get(k.as_str()).is_some() && (k.as_str() != "lights" || *same_lights))
|
||||
.filter(|(k, _)| (takes.get(k.as_str()).is_some() || custom_bevel(k)) && (k.as_str() != "lights" || *same_lights))
|
||||
.map(|(k, v)| (k.clone(), v.clone()))
|
||||
.collect();
|
||||
(!params.is_empty())
|
||||
@@ -240,13 +243,19 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
}
|
||||
// The applied effect's settings in the dialog's form, with the controls' own state.
|
||||
let mut fields = vectorcraft_effects::merged_params(&t.effect, &t.params).as_object().cloned().unwrap_or_default();
|
||||
let own_bevel = own_bevel(&fields);
|
||||
mark_mixed(app, &mut fields);
|
||||
fields.extend(pstate::<Map<String, Value>>(&ctx, UI_STATE));
|
||||
fields.insert("__effect".into(), json!(t.effect));
|
||||
fields.insert("__panel".into(), json!(true));
|
||||
if let Some(own) = own_bevel {
|
||||
fields.insert(OWN_BEVEL.into(), own);
|
||||
}
|
||||
let mut d = Dialog { kind: ID.into(), fields };
|
||||
let before = crate::dialogs::form::params(&d);
|
||||
crate::dialogs::revolve::controls(app, ui, &mut d);
|
||||
d.fields.remove(OWN_BEVEL);
|
||||
let edit_bevels = d.fields.remove("__editBevels").is_some();
|
||||
let action = d.fields.remove(materials::ACTION).and_then(|v| materials::Action::from_value(&v));
|
||||
let state: Map<String, Value> = d
|
||||
.fields
|
||||
@@ -259,6 +268,14 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let changed = changed_settings(&before, &after);
|
||||
let dragging = ctx.input(|i| i.pointer.any_down());
|
||||
send(app, &ctx, changed, dragging);
|
||||
// Bevel Shape's Edit Bevels…: the bevels file opens as a document of its own.
|
||||
if edit_bevels {
|
||||
finish(app, &ctx);
|
||||
if let Err(e) = app.run("threeD.bevels.edit", json!({})) {
|
||||
app.ui.status = e;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if quick_actions_shown(&d) {
|
||||
ui.add_space(10.0);
|
||||
let t = Tokens::get(ui.ctx());
|
||||
@@ -581,10 +598,30 @@ pub(crate) fn mark_mixed(app: &VectorcraftApp, fields: &mut Map<String, Value>)
|
||||
}
|
||||
}
|
||||
|
||||
/// The custom bevel of an effect's settings `fields`, `[name, points]`, when its `bevel` is
|
||||
/// `"custom"` with points (the Bevel Shape menu lists it while a mixed selection unsets them).
|
||||
pub(crate) fn own_bevel(fields: &Map<String, Value>) -> Option<Value> {
|
||||
let points = fields.get(BEVEL_PROFILE).filter(|v| !v.is_null())?;
|
||||
let name = fields.get(BEVEL_NAME).and_then(Value::as_str).unwrap_or_default();
|
||||
(fields.get("bevel").and_then(Value::as_str) == Some("custom")).then(|| json!([name, points]))
|
||||
}
|
||||
|
||||
/// The settings whose values differ between `before` and `after`, with their values in `after`.
|
||||
/// A change to a custom bevel (`bevel` `"custom"`, its name or its points) sends all three, so an
|
||||
/// effect of a mixed selection that had none takes the whole bevel.
|
||||
pub(crate) fn changed_settings(before: &Value, after: &Value) -> Map<String, Value> {
|
||||
let Some(after) = after.as_object() else { return Map::new() };
|
||||
after.iter().filter(|(k, v)| before.get(k.as_str()) != Some(*v)).map(|(k, v)| (k.clone(), v.clone())).collect()
|
||||
let mut changed: Map<String, Value> =
|
||||
after.iter().filter(|(k, v)| before.get(k.as_str()) != Some(*v)).map(|(k, v)| (k.clone(), v.clone())).collect();
|
||||
let custom = ["bevel", BEVEL_NAME, BEVEL_PROFILE];
|
||||
if after.get("bevel").and_then(Value::as_str) == Some("custom") && custom.iter().any(|k| changed.contains_key(*k)) {
|
||||
for k in custom {
|
||||
if let Some(v) = after.get(k) {
|
||||
changed.insert(k.into(), v.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
changed
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -179,9 +179,9 @@ VectorCraft choices; an original approximation, never compared with another appl
|
||||
| Item | Ours |
|
||||
|---|---|
|
||||
| Revolve | initial: live, editable profile, rotation and light gizmos, default-on Cap with continuous curved rims that also closes a partial sweep's cut sides, smooth vector shading and round seam joins, overlapping faces drawn in the order of their depths where they overlap, SVG/PDF output, Expand Appearance ([revolve.md](revolve.md), #846) |
|
||||
| Extrude & Bevel, Inflate, Rotate | initial: live, round seam joins, depth, twist, taper, solid or hollow caps, five original bevel shapes, Inflate volume, both sides, twist, taper and cap, Rotate of every fill and stroke, groups and layers turned about one shared axis (#4506), contours that cross, touch or overlap merged first ([three-d.md](three-d.md)), Position presets, rotation and light gizmos, SVG/PDF output, Expand Appearance ([three-d.md](three-d.md)) |
|
||||
| Extrude & Bevel, Inflate, Rotate | initial: live, round seam joins, depth, twist, taper, solid or hollow caps, five original bevel shapes and custom bevels drawn as open paths in the bevels file ([add custom bevel paths](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/add-custom-bevel-paths.html), [three-d.md](three-d.md#custom-bevels)), Inflate volume, both sides, twist, taper and cap, Rotate of every fill and stroke, groups and layers turned about one shared axis (#4506), contours that cross, touch or overlap merged first ([three-d.md](three-d.md)), Position presets, rotation and light gizmos, SVG/PDF output, Expand Appearance ([three-d.md](three-d.md)) |
|
||||
| Materials panel, lighting, ray-traced render | Window › 3D and Materials panel with the object types (Plane, Extrude, Revolve, Inflate) and the Object, Rotation and Lighting settings of the applied effect, Render Settings › Wireframe, which draws the live effect as the edges of its faces, and Quick Actions › Expand as Wireframes ([three-d.md](three-d.md#3d-and-materials-panel)); one to ten directional lights with per-light Color (opaque RGB, white by default), Intensity, Rotation, Height, Softness and neutral Ambient Light, Revolve and colored Inflate use smooth vector shading; Extrude & Bevel and Rotate retain planar shading; original Standard, Diffuse, Top Left and Right lighting rigs; shadows behind or below the object from the first light, blurred by its Softness ([three-d.md](three-d.md#shadows)); the Materials tab's Graphics, document symbols mapped onto Extrude & Bevel's caps and onto a plane, moved with an artboard handle, and wrapped around Extrude & Bevel's walls and bevels and around Revolve's side ([three-d.md](three-d.md#graphics)); no base materials, graphics on Inflate, or ray tracing |
|
||||
| 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, round seam joins, Extrude Depth, Cap, five original bevel shapes with Height and Bevel Extent In or Out, Position presets and rotation gizmo, Perspective, Wireframe, No Shading, Diffuse and Plastic surfaces with one to ten lights, Light Intensity, Ambient Light, Highlight Intensity and Size, Blend Steps, Black, Custom, Black Overprint or no Shading Color ([Black Overprint](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=188)), Draw Hidden Faces ([create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/create-3d-objects.html)); Revolve (Classic) initial: live, round seam joins, Angle, Cap, Offset from the left or right edge, Position presets and rotation gizmo, Perspective, the same four surfaces, lights, highlight, Blend Steps and Shading Color, groups and layers revolved about one shared axis (same page); Rotate (Classic) initial: live, round seam joins, every fill and stroke turned as one plane, Position presets and rotation gizmo, Perspective, No Shading and Diffuse surfaces with lights, Ambient Light, Blend Steps and Shading Color ([rotate objects in 3D](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/rotate-objects-in-3d.html)); Preserve Spot Colors in all three, unavailable with a Custom Shading Color ([Preserve Spot Color](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260)); all three: a lighting sphere on the Lighting tab whose lights drag, move to the back or front, and are added at the front center or deleted down to one ([lighting options](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=272)); all three: the track cube (face, edge, Shift and ring drags, keyboard steps; [three-d.md](three-d.md#track-cube)); Map Art for Extrude & Bevel (Classic) and Revolve (Classic): one document symbol on each numbered surface, surface navigation with visible and hidden marks and a red outline on the artboard, move, scale and rotate on the surface laid out flat, Scale to Fit, Clear, Clear All, Shade Artwork, Invisible Geometry, kept by Expand Appearance and exports, `threeD.mapArt` ([map artwork to a 3D object](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=189)) |
|
||||
| 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, round seam joins, Extrude Depth, Cap, five original bevel shapes and the custom bevels with Height and Bevel Extent In or Out, Position presets and rotation gizmo, Perspective, Wireframe, No Shading, Diffuse and Plastic surfaces with one to ten lights, Light Intensity, Ambient Light, Highlight Intensity and Size, Blend Steps, Black, Custom, Black Overprint or no Shading Color ([Black Overprint](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=188)), Draw Hidden Faces ([create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/create-3d-objects.html)); Revolve (Classic) initial: live, round seam joins, Angle, Cap, Offset from the left or right edge, Position presets and rotation gizmo, Perspective, the same four surfaces, lights, highlight, Blend Steps and Shading Color, groups and layers revolved about one shared axis (same page); Rotate (Classic) initial: live, round seam joins, every fill and stroke turned as one plane, Position presets and rotation gizmo, Perspective, No Shading and Diffuse surfaces with lights, Ambient Light, Blend Steps and Shading Color ([rotate objects in 3D](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/rotate-objects-in-3d.html)); Preserve Spot Colors in all three, unavailable with a Custom Shading Color ([Preserve Spot Color](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260)); all three: a lighting sphere on the Lighting tab whose lights drag, move to the back or front, and are added at the front center or deleted down to one ([lighting options](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=272)); all three: the track cube (face, edge, Shift and ring drags, keyboard steps; [three-d.md](three-d.md#track-cube)); Map Art for Extrude & Bevel (Classic) and Revolve (Classic): one document symbol on each numbered surface, surface navigation with visible and hidden marks and a red outline on the artboard, move, scale and rotate on the surface laid out flat, Scale to Fit, Clear, Clear All, Shade Artwork, Invisible Geometry, kept by Expand Appearance and exports, `threeD.mapArt` ([map artwork to a 3D object](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=189)) |
|
||||
| Turntable (30.0 beta) | none |
|
||||
| Export 3D objects (OBJ, USDA, glTF) | initial: Asset Export's Export 3D Object, and the 3D and Materials panel's Export 3D Object button (which then shows Asset Export with the new assets selected, [three-d.md](three-d.md#3d-and-materials-panel)), collect 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`); graphics mapped onto a plane or Extrude & Bevel's caps are exported as PNG textures of those faces, flat and unlit; no graphics on Revolve's side, no materials and no shading ([3D export help](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/export-3d-vector-artwork.html)) |
|
||||
|
||||
|
||||
+37
-2
@@ -5230,7 +5230,7 @@ it, masks that member's solids ([three-d.md](three-d.md#groups)).
|
||||
`threeD.extrude`: `depth` (points, 0..2000, default 50), `twist` (degrees, 0..360, 0), `taper` (1..100%, 100),
|
||||
`cap` (true solid, false hollow), `bevel` (`none`, `classic`, `rounded`, `cove`, `step`, `ogee`), `bevelWidth`
|
||||
and `bevelHeight` (points, default 4), `bevelRepeat` (1..32), `bevelSpace` (0..90%), `bevelInside`,
|
||||
`bevelBothSides`. `threeD.inflate`: `depth` (points, default 0), `twist` (degrees, 0..360, 0), `taper` (1..100%, 100), `cap` (true
|
||||
`bevelBothSides`; `bevel` `custom` with `bevelName` and `bevelProfile` is a custom bevel (below). `threeD.inflate`: `depth` (points, default 0), `twist` (degrees, 0..360, 0), `taper` (1..100%, 100), `cap` (true
|
||||
solid, false open behind), `volume` (0..100%, default 50), `bothSides`.
|
||||
All three take `rotationX/Y/Z` (degrees, -180..180, default the Off-Axis Front position -21.88/-23.4/9.06),
|
||||
`perspectiveAngle` and the lighting parameters as Revolve. See [three-d.md](three-d.md) for the Position presets,
|
||||
@@ -5242,12 +5242,47 @@ points returns "The shape is too complex for a 3D effect", and one whose faces d
|
||||
has so many points across so many of its grid's cells that filling the grid would pass its work limit. `threeD.rotate`
|
||||
takes up to 65,536 points.
|
||||
|
||||
Custom bevels come from the bevels file, `Bevels.vectorcraft` next to the preferences (none on the web or in runs
|
||||
with `VECTORCRAFT_NO_PREFS`). `threeD.bevels.edit` (3D and Materials panel › Bevel Shape › Edit Bevels…) opens it,
|
||||
and first creates it with one example bevel when it is missing. Each symbol whose art is one open path is one bevel,
|
||||
named after the symbol and listed after the built-in shapes. These rules are VectorCraft's own: the path runs from its
|
||||
first anchor at the cap's edge to its last at the side wall, across the page across the bevel's width and down the
|
||||
page along its height, and curves are cut into straight lines of at most 64 points. The file is read when the app
|
||||
starts and again each time VectorCraft saves it; `threeD.bevels.reload` reads it again. A file larger than 64 MB is
|
||||
not read, at most 256 symbols are read, and a symbol that is not one open path, has more than 4,096 anchors, is cut
|
||||
into more than 8,192 straight lines, needs more point-to-line distances to simplify than are left of the 40,000,000
|
||||
the file may take, has ends that are not apart both across and down, or repeats an earlier name is
|
||||
listed in `skipped`. `threeD.bevels.list`
|
||||
returns each bevel's `name` and `points`, the `file` path, the `skipped` symbols and any read `error`.
|
||||
|
||||
Under automation read roots, the bevels file counts as a path the client did not give. `threeD.bevels.list` returns
|
||||
`file` as `null` when the file is outside the read roots, and its `error` names the file by its file name; the bevels,
|
||||
`skipped` and the reason stay. `threeD.bevels.edit` and `threeD.bevels.reload` refuse a file outside the read roots
|
||||
with the root-check error, naming the file by its file name: `edit` then makes no folder or file and neither opens the
|
||||
file nor brings it to the front, and `reload` does not read it. Inside the read roots, `edit` opens the file under the
|
||||
client's roots. The 3D and Materials panel's Edit Bevels… is not confined.
|
||||
|
||||
`threeD.extrude` and `threeD.classicExtrude` take `bevel: {"custom": name}` in `effect.apply` and `effect.setParams`,
|
||||
and store it as `bevel: "custom"` with `bevelName` and `bevelProfile`, a copy of the points (`[[x, y], …]`, 2 to 64
|
||||
shares 0..1 of the width and height from `[0, 0]` to `[1, 1]`), so the document draws the bevel without the file. An
|
||||
unknown name, `custom` without `bevelProfile`, points that do not run from `[0, 0]` to `[1, 1]` within 0..1, or a
|
||||
`bevelName` that is not a string is refused and the document is not changed. The command's journal entry records the
|
||||
points as `savedBevel`, and `savedBevel` given with `{"custom": name}` is used in place of the file's points, so a
|
||||
replay draws the same bevel after the file changes or drops the name. The help page
|
||||
[Add custom bevel paths](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/add-custom-bevel-paths.html)
|
||||
describes custom bevels drawn as open paths and kept as symbols in a bevels document.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"threeD.bevels.list","params":{}}}
|
||||
{"name":"run_command","arguments":{"command":"effect.apply","params":{"effect":"threeD.extrude","item":null,"params":{"bevel":{"custom":"Example Bevel"},"bevelWidth":8,"bevelHeight":8}}}}
|
||||
```
|
||||
|
||||
## Extrude & Bevel (Classic)
|
||||
|
||||
`effect.apply {effect: "threeD.classicExtrude", params: {...}, ids?, item?}` is Effect › 3D and Materials ›
|
||||
3D (Classic) › Extrude & Bevel (Classic)…. It builds the same solid as `threeD.extrude` and draws its faces with the
|
||||
classic surfaces. Parameters: `depth` (points, 0..2000, default 50), `cap` (true solid, false hollow), `bevel` (`none`,
|
||||
`classic`, `rounded`, `cove`, `step`, `ogee`), `bevelHeight` (points, 1..100, default 4; the bevel is as wide as it
|
||||
`classic`, `rounded`, `cove`, `step`, `ogee`, or a custom bevel as for `threeD.extrude`), `bevelHeight` (points, 1..100, default 4; the bevel is as wide as it
|
||||
is tall), `bevelInside` (false adds the bevel around the shape, true carves it into the shape), `rotationX/Y/Z` and
|
||||
`perspectiveAngle` as above, and the surface:
|
||||
|
||||
|
||||
+26
-3
@@ -106,7 +106,7 @@ object is where the art was.
|
||||
| Twist | 0° to 360°: the back face turned against the front, the walls following in slices. |
|
||||
| Taper | 1–100 %: the back face's size against the front's. Without a twist, each wall (and each bevel band) stays flat, so it is one face, not cut into slices. |
|
||||
| Cap | **Solid** closes the front and back; **Hollow** leaves them open, showing the insides of the walls. |
|
||||
| Bevel Shape | **None**, **Classic** (a straight chamfer), **Rounded** (convex quarter round), **Cove** (concave), **Step** (two steps) or **Ogee** (an S curve). Our own cross-sections. |
|
||||
| Bevel Shape | **None**, **Classic** (a straight chamfer), **Rounded** (convex quarter round), **Cove** (concave), **Step** (two steps) or **Ogee** (an S curve). Our own cross-sections. After them come the custom bevels ([Custom bevels](#custom-bevels)). |
|
||||
| Width, Height | How far the bevel reaches across the face and along the depth (0–1,000 pt each). The height is limited to the depth (half of it on each side with Bevel both sides). |
|
||||
| Repeat, Space | The cross-section repeated 1–32 times across the width, with a share (0–90 %) of the width flat between repeats. |
|
||||
| Bevel Inside | The bevel carved into the shape (the front face shrinks) instead of added around it (the walls stand outside the art). |
|
||||
@@ -118,6 +118,28 @@ sharp point with the bevel outside, a narrow notch with it inside) whose miter w
|
||||
cut square across instead; at the other corners the miter is limited to four times the width. A bevel wider than a
|
||||
narrow part of the shape folds over itself. Each facet has a seam ([Seams](#seams)).
|
||||
|
||||
### Custom bevels
|
||||
|
||||
The public [Add custom bevel paths](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/add-custom-bevel-paths.html)
|
||||
page describes a custom bevel as one open path saved as a symbol in a bevels document, then listed in the Bevel menu.
|
||||
VectorCraft keeps its custom bevels in `Bevels.vectorcraft`, a native document next to the preferences (none on the
|
||||
web or in runs with `VECTORCRAFT_NO_PREFS`). The layout below is VectorCraft's own.
|
||||
|
||||
- **Edit Bevels…** under Bevel Shape in the 3D and Materials panel (`threeD.bevels.edit`) opens the file, and first
|
||||
creates it with one example bevel when it is missing.
|
||||
- Each symbol whose art is one open path (alone or in groups of one member) is one bevel, named after the symbol and
|
||||
listed after the built-in shapes in the Bevel Shape menus of Extrude & Bevel and Extrude & Bevel (Classic).
|
||||
- The path runs from its first anchor, at the cap's edge, to its last, at the side wall. Across the page is across
|
||||
the bevel's width and down the page is along its height, whichever way the path is drawn. Points past its ends are
|
||||
held to them, curves are cut into straight lines, and a path is simplified to at most 64 points.
|
||||
- A custom bevel takes Width, Height, Repeat, Space, Bevel Inside and Bevel both sides like the built-in shapes.
|
||||
- The file is read when the app starts and again each time VectorCraft saves it; `threeD.bevels.reload` reads it
|
||||
again. A file larger than 64 MB is not read, at most 256 symbols are read, and a symbol that is not one open path,
|
||||
has more than 4,096 anchors, is cut into more than 8,192 straight lines, has ends that are not apart both across and down, or repeats an earlier name is listed
|
||||
in `skipped` by `threeD.bevels.list`.
|
||||
- An effect that uses a custom bevel keeps its name and a copy of its points, so the document draws it the same way
|
||||
without the bevels file.
|
||||
|
||||
## Inflate
|
||||
|
||||
The shape puffed out like a cushion: its outline stays where the art is and the surface rises towards the
|
||||
@@ -605,7 +627,7 @@ is VectorCraft's own.
|
||||
## Parameters (`effect.apply`, `effect.setParams`)
|
||||
|
||||
`threeD.extrude`: `depth`, `twist`, `taper` (%), `cap`, `bevel` (`none`, `classic`, `rounded`, `cove`, `step`,
|
||||
`ogee`), `bevelWidth`, `bevelHeight`, `bevelRepeat`, `bevelSpace` (%), `bevelInside`, `bevelBothSides`.
|
||||
`ogee`, or `custom` with `bevelName` and `bevelProfile`; `{custom: name}` takes a bevel of the bevels file), `bevelWidth`, `bevelHeight`, `bevelRepeat`, `bevelSpace` (%), `bevelInside`, `bevelBothSides`.
|
||||
`threeD.inflate`: `depth`, `volume` (%), `bothSides`. All three take the view and lighting parameters Revolve
|
||||
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).
|
||||
@@ -630,7 +652,8 @@ out, perspective). No Adobe software, assets, presets or bevel shapes were used.
|
||||
solid is built for ([Fills and strokes](#fills-and-strokes)), and only the first light casts a shadow
|
||||
([Shadows](#shadows)). Graphics map onto planar faces, Extrude & Bevel's side as one surface unrolled flat, and
|
||||
Revolve's side only ([Graphics](#graphics)).
|
||||
- The bevel shapes and their names are our own; custom bevel paths are not supported.
|
||||
- The bevel shapes and their names are our own. Custom bevels come from VectorCraft's own bevels file
|
||||
([Custom bevels](#custom-bevels)) and are cut into straight lines.
|
||||
- Visibility is a painter's algorithm: faces of a closed solid turned away are left out, and the rest are drawn
|
||||
back to front, with a flat cap or flat back turned toward the viewer drawn after all of them. Concave solids
|
||||
seen at steep angles can overlap wrongly; open (hollow) solids show both sides. Twisted walls and bevels are
|
||||
|
||||
Reference in New Issue
Block a user