Rustdoc builds each doc test as its own crate, without the workspace's
`unsafe_code = "deny"` and without a library's `#![forbid(unsafe_code)]`,
so a doc test holding an `unsafe` block passed `cargo test --doc`.
- Every library root now carries `#![doc(test(attr(forbid(unsafe_code))))]`,
or `deny` in cad, eps and metafile, which rely on the workspace lint.
- `cargo xtask layers` reports a library whose doc tests are missing the
attribute, or use `deny` where the library forbids unsafe code.
- AGENTS.md names the rule next to the `unsafe` allowlist.
rings_cut_with_a_grid_give_the_triangles_cut_without_one now adds 1,200
rings drawn from a fixed seed: spiky rings, rings with whole-number
corners on slanted lines, rings with a corner midway along every edge,
stretched rings, rings scaled down by 1e-7 and rings far from the
origin. The test now fails when the grid's margin is 0, when the row
band is narrowed by the margin instead of widened, or when removed
corners are not skipped.
Cutting a face into triangles tested each candidate ear against every
corner left in the ring, so a cap with n corners took about n * n / 2
tests. An Extrude & Bevel with a Rounded bevel on an 18,204-corner
polygon spent most of its mesh time there.
Rings with more than 64 corners now sort their corners into a grid of
square cells, and an ear looks only at the corners in the cells its
triangle covers, widened by a margin well past the rounding of the
corner tests. Ears with an angle whose sine is below 1e-6 still test
every corner. The decision for each ear is the same, so the triangles
are the same as before.
Tests whose all() passed on an empty list now check the list's length or
that it is not empty:
- huge_circles_bridge_with_finite_anchors_or_are_refused (pathops bridge)
- smooth_rounds_corners (pathops ops): the four corners stay, smoothed
- a_held_rotation_turns_the_art_around_its_pin (tools ARAP): one point
per mesh vertex
- the_eraser_drag_area_matches_the_release_when_pressure_or_a_mode_starts_during_the_drag
(tools gesture): one released point per press
- every_effect_casts_a_shadow, inflate_cells_across_a_hole_edge_are_cut_to_the_shape,
a_plane_has_only_a_front_and_a_hollow_solid_none and
perspective_runs_0_to_160_degrees_with_the_eye_outside_the_object (three-d)
- a_file_two_branches_include_is_followed_from_the_shallower_one
(scriptcheck): one row per include line
- pens_pick_colors_and_widths (cad HP-GL): four widths
- junk_pressure_brushes_draw_finite_art (brush): all 12 cases draw
Round trips that hold by construction (parse finds the id in ALL) are
replaced with one saved name that must parse and one that must not:
follow_names_parse (pathops shared edge), the shape kinds (pathops
shapes), surfaces_parse_from_their_ids (three-d), the Quick Pen actions
(tools), names_parse_and_serialize_as_names (plugins) and the brush
variation modes, which also compare the serde names with the ids.
crop_keeps_an_instance_whose_art_reaches_the_region (cad) names the
entities written instead of checking that some were.
the_saved_engine_preference_is_found (app) pins the GPU choices the
preferences offer to the three the app reads.
timing_unite_1000_circles (pathops) gets an ignore reason and checks
that Unite gives one shape.
Each changed assertion fails when the code under test is broken (an id
renamed, a list emptied, a flush or instance dropped) and passes when it
is restored.
- The two-anchor ellipse test now expects the exact area of its two
cubics, 4/5 of the box (4800), instead of a 10% band around the true
ellipse that accepted handles moved 10 pt inward (4560).
- The abutting trace seam must sit within 0.05 px of the anti-aliased
edge at x = 10.4, so snapping it to a whole pixel fails.
- The straight-on shadow area is compared exactly with 10000: the
sampling grid has 1 pt2 cells and no sample on the square's edge.
- The pinned Pathfinder inputs now also get a point check: for Unite,
Minus Front, Minus Back, Intersect and Exclude, every grid point away
from an input edge must be inside the output exactly when the inputs
covering it say so, so the pins no longer rest on the sweep that
computed them alone.
- With Shadows on, every light with an intensity above 0 casts shadows on
the solid and on the shadow plane in the image, black at 50%, with each
light's Softness widening its edge; with Shadows off none does.
- Selection, Use Preview Bounds, Align, hit testing and snapping measure
the shaded faces without rasterizing. Painted bounds hold the whole
image, measured without rasterizing. Images are cached by their inputs.
- Expand Appearance and baking keep the rendered image; PDF export in a
CMYK document writes it as raster effects are written.
- Render Settings gains Raster Settings... (resolution and background),
built on the framework's parameter dialog; settings the selection holds
differently open blank and are kept. The menu checks a choice only when
every selected object has it.
- Tests for the clip matrix, coverage, depth order, the shading formula,
limits, work bounds, edge values, masks and Revolve's objects-only rule.
Docs: docs/three-d.md, docs/mcp.md, effect params text.
A Roughness or Metallic drag that returned to its starting value kept the
last preview in the document, and the release committed it. A drag back
to the start now restores the effect while held, and its release records
no undo step. A setting brought back during a drag that changes another
one is left in its stored form, and the Properties fields stand in for
`material` so an object that only writes out a left-out default is not a
change.
Docs: the material module notes that the drawn paint stops at 1 and that
the highlight is screened; docs/mcp.md says the BRDF applies in shaded
rendering and that USD's `inputs:metallic` is written only when Metallic
is not 0; docs/three-d.md says a mixed number is shown blank;
docs/effects-parity.md lists no base-material library.
Extrude & Bevel, Revolve, Inflate and Rotate take render.mode "rendered",
with quality (low, medium or high: 1, 2 x 2 or 3 x 3 samples a pixel),
resolution (null for Document Raster Effects Settings, or 1 to 2400 ppi)
and background (transparent or white). The effect then draws its solid
as one image made with craft-raster3d: a depth buffer, the effect's
lights in linear light with the material's roughness and metallic, and
shadow maps for each light, over the effect's vector shadow. The image
lies where the vector faces lie: each mesh point goes through the
projection the effect draws its faces with (MeshProjection).
The shaded faces are drawn instead, and the status bar and the
effect.apply and effect.setParams results carry a "warning", when the
image would pass 16,777,216 pixels at one sample a pixel, or when the
solid is painted with a gradient, a pattern, graphics, an opacity below
100% or a blending mode other than Normal, and for Revolve on a group or
on a fill or stroke. The warning check measures the image without
rasterizing it.
The 3D and Materials panel's Render Settings menu gains Rendered and Low,
Medium and High Quality. Each choice is one undo step for the selection,
and each object keeps its other render settings.
The effect-art cache now includes the document's raster resolution, so
changing Document Raster Effects Settings redraws rendered images.
Every craft-libs rev moves to 64383b59, which adds crates/raster3d.
Docs: docs/three-d.md, docs/mcp.md, docs/target-app-parity.md.
Extrude & Bevel, Revolve, Inflate and Rotate take a `material` parameter,
{roughness, metallic}, each a number from 0 to 1 (defaults 1 and 0). The
3D and Materials panel's Materials tab shows them under Properties as two
sliders; each change is one undo step for every selected 3D object. A
value the selected objects hold differently is shown blank with its reset
dot filled, and a typed or dragged value or a reset sets it on all of
them while each keeps its own value of the other property.
- The default material draws exactly as before and calls no BRDF.
- Any other material is shaded through craft-pbr with the glTF 2.0
metallic-roughness BRDF (Appendix B, with the separable Smith
visibility of B.3.2) for each light and a split-sum environment scaled
by Ambient Light. The reflected light is screened over each face as
vector gradient ramps; graphics on a side or on Inflate's faces lie
under it, and graphics on caps and the plane take the cap's mean
reflected light in their colors.
- Smoothed bevel bands take the normals they share at their edges and
draw as two triangles, so neighboring bands meet without a step, with
perspective and twist too. A bevel whose split bands would pass the
solid's face limit keeps one facet per band, so a material never makes
a solid that draws with the default material too complex. Wireframe
mode draws the same edges for every material.
- A gradient with transparent stops stays transparent: the faces are drawn
opaque under one mask of its coverage. A pattern surface takes no
highlight.
- glTF exports write roughnessFactor and metallicFactor, and USD exports
write inputs:roughness and inputs:metallic (when it is not 0). OBJ's
MTL writes neither, so parts of one color and picture share one OBJ
material as before.
- A material that is not an object, an unknown key, or a value that is not
a number from 0 to 1 is refused; the 3D (Classic) effects take none. A
loaded material that fails these rules draws as the default.
Docs: docs/three-d.md (Material properties; the Inflate graphics text is
corrected; the Properties are listed as built), README, docs/mcp.md,
docs/effects-parity.md, docs/target-app-parity.md, ROADMAP.
With a twist, a band cuts each edge into pieces whose cut corners lie on
the art's curve, but the smoothed mesh normals and the 60 degree crease
test were worked out on straight chords between the edge's corners. On
a curved outline the normals then described quads other than the faces
the mesh holds. The corner rule is now one function, cut_corner, which
curved_band and smoothed_rows both use, so each piece's smoothed normal
comes from the quad that is built. Straight and uncut edges are as
before.
The test a_twisted_round_bevels_smoothed_normals_follow_its_curved_pieces
checks that each smoothed corner of a twisted, rounded bevel on a circle
is the mean of the normals of the two faces that meet there, with and
without perspective.
curved_band took eight arguments once it gained the mesh's band data,
and an allow attribute silenced clippy's too_many_arguments lint. It now
takes the partner rings as one [a, b] array, and the allow attribute has
been removed.
With a twist, each edge of a band is cut into pieces, and the mesh gave
those pieces their flat face normals, so a rounded or custom bevel with
a twist was exported faceted. The smoothed normals are now worked out
for each piece of each edge, from the same pieces the band is cut into,
and every piece takes its own.
The test a_twisted_rounded_bevel_keeps_its_normals_smoothed_on_every_piece_of_a_cut_edge
checks that where the pieces of two bevel bands meet, the two bands
give each piece one normal.
Extrude & Bevel's caps, Rotate's plane and Inflate's front and back took
their texture coordinates in the bounds of each part's own rings, so a
part smaller than its object had its coordinates stretched to its own
extent and did not line up with the object's other parts. They now use
the bounds the solid is built with, which every part of one object
shares, as the Turn, Placing and Camera transforms already do.
The test the_parts_of_one_object_place_their_caps_and_planes_in_its_shared_bounds
builds a small part inside a larger object's bounds with each effect and
checks every front and back corner against the shared bounds.
Every mesh the 3D effects build now carries texture coordinates for
each corner and a part for each triangle (front, back, side, front
bevel, back bevel, end cap, cut side). Corners shared by two bands of
one bevel take the mean of the bands' normals unless the bevel turns
there by 60 degrees or more or a band lies flat toward the front or
back, and Inflate's puffed front and back keep the surface's own
normals. The vector facets do not change.
- Caps, Rotate's plane and Inflate's front and back map the art's
bounds; walls and bevels run u along each contour and v from the
front cap's edge to the back cap's; Revolve's side runs u around the
sweep and v along the profile.
- OBJ, glTF and USD write every corner's texture coordinates, not only
those of faces with mapped graphics.
- Mesh::join checks its index offsets, and joining or exporting a mesh
whose lists do not match or that holds a value that is not a number
is an error.
Docs: docs/three-d.md (3D meshes), docs/mcp.md, docs/effects-parity.md,
docs/target-app-parity.md.
A twist cut a beveled edge at points of the art's curve itself, while the
inset cap's edge eases its corners' miter offsets across the whole edge.
Where the art meets another edge at a sharp angle, the pieces next to the
cap drew a different curve from the cap's, leaving a gap of up to about
1.5 pt between them.
Each cut corner now takes the edge's corner offsets, eased across the
edge as the cap's edge eases them, and each piece follows the whole
edge's curve, so the pieces draw the cap's edge within the cap's
sampling tolerance, with and without perspective.
The tiny-circle test now also requires the solids to keep at least one
curve before it checks their control points.
Extrude & Bevel and Inflate drew several edges along the art's curves as
straight segments with a corner at every sample point, so Object > Expand
Appearance gave them corner anchors:
- The edges between two bevel steps and between two wall slices had no
outline. Every band now gets the outline of both its rings, and the two
faces that share a ring draw the same curves.
- A twist cut a wall's edge at points on the chord between two samples.
The cut corners now lie on the art's curve, and each piece follows its
own part of the curve, so the wall meets the cap along the cap's curve.
- Inflate's flat back, its side walls, and the cells of its front and
puffed back along the outline were polygons. They now follow the art's
curves, the cells within the sampling tolerance. The search for the
cells' edges along the outline stops after 4,194,304 edges per solid
(VectorCraft's own limit); the rest stay straight.
Visibility, depth order and face counts are still worked out on the
sampled polygons. Tests in crates/three-d/src/solid/tests_curves.rs.
The dialog keeps the lines it opened on as the command's ids, with the uid
of their document. OK changes those lines even when the selection changes
while the dialog is open, and changes nothing once another document is the
active one.
The split flap raster test now requires a flap at both samples: the right
flap at both, or the left flap's inner part at the near sample and its
outer part at the far one.
Set Fold Angle… (Object › Plug-ins › Packaging Tools) gives the selected
fold lines their own fold angle, from -180° to 180°, in place of their
role's 90° away from or toward the print, to the millionth of a degree;
reset: true takes it away. The angle is kept in the line's data under
vc-fold-angle, which native files and SVG with Preserve Editing keep and
plain SVG export leaves out of the path's attributes. A line keeps its
angle when it is given another role. The Fold Lines panel shows a Fold
Angle field for the selected lines it can change, empty when they
differ, and a Reset button.
- addon.packaging.setFoldAngle is one undo step, none when nothing
changes, and is dimmed while the selection holds no Crease, Partial Cut
or Perforation line that is neither locked nor hidden. An angle stored
as other text for the same number counts as unchanged.
- addon.packaging.roles also returns foldLines, foldAngle, ownAngles and
storedAngles for the lines Set Fold Angle can change, which are none
while nothing is selected.
- A hinge folds at the angle of the line with the most length in it,
counting a line the planar map splits into pieces whole and a line's
subpaths on top of each other once; among lines of equal length the
lowest id wins, in any line order. Before, it took the role of its
longest piece, so a hinge whose lines have different roles can now
fold the other way when a split line is the longer one.
- Fold Preview: a panel folded flat onto another (180°) is drawn behind
that panel's printed side, and at -180° in front of it; a flap folded
back over a folded panel lies between it and the panel before; a 0°
hinge keeps its panel level with its parent. Panels in one plane keep
their order when the panels they fold from are seen edge on, and a
panel that comes round onto another's plane lies on the side it came
from. Only panels in one plane stack by these rules; panels in
different planes go by depth, so folds a hair short of flat stay in
order wherever the blank lies in the document. The stack is worked out
from the blank's largest panel whichever panel the window folds about,
so a double-click on another panel moves the blank without changing
which panel shows. Panels that 90° folds bring into one plane, such as
a carton's closing flaps, now stack by these rules too.
- Set Fold Angle…'s dialog keeps the angle within -180° to 180° as it is
typed, as the panel's field does. Both show every decimal place the
angle has. ui.menuDialog opens the dialog for
addon.packaging.setFoldAngle, and gives the command's reason while
the selection holds no line it can change.
- Set Fold Angle skips a locked or hidden path of a compound path that is
named by id or selected without its compound. addon.packaging.setRole
(Make Cut Line and the other Make ... Line items) now skips it too;
before, it changed the whole compound.
- Folding: a hinge whose middle falls in a cutout turns its panel by the
side its parent lies on next to the hinge's own pieces, not by a point
anywhere inside the parent, which folded a panel the wrong way when
the parent also ran on past the hinge.
Docs: docs/mcp.md (Fold angles), ROADMAP.
- When any solid's mapped art passes the shared limits, every solid in
the effect draws without its mapped art, so Invisible Geometry hides
all of them or none.
- A revolved group lists its surfaces with the members' shared curve
sampling, and an extruded group lists none past the faces of one
object.
- Commands refuse art on walls, bevels and Revolve's side whose curves,
cut into straight pieces at the map's scale and placed about the
surface's center, pass 400,000 points. Caps are not counted.
- Each contour's bounds test counts as a cut, in Map Art and in the side
graphics.
- On a facet whose curved edge bows out of its cell, the art reaches the
whole facet.
- A bevel as deep as the solid leaves no walls, and its bevels take the
numbers after the caps.
- Surfaces past the face limit are refused as the side is.
- threeD.mapArt keeps a deleted symbol only while the request leaves
`symbol` out.
The canvas faces and the exported side mesh each worked out where a
side quad's four corners lie on the unrolled surface. Both now call
surface_corners, so the two keep the same corner order and formula.
The side surfaces were measured along the traced outline, so with a bevel
added around the shape each wall's art was stretched by the bevel's width
at both ends. Walls are now measured on the ring at the walls' inset, and
a bevel band takes the length of the wall below it. Docs: docs/three-d.md,
docs/mcp.md.