mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 21:17:48 +00:00
Merge pull request #7154 from dotCooCoo/fix/3d-walls-depth-sort
3D: fill walls and dashed or profiled strokes draw in depth order where they overlap
This commit is contained in:
@@ -1191,6 +1191,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Extrude & Bevel and Inflate treat strokes as outlined: each visible stroke builds a solid from its outline in its own paint beside the top fill's ([three-d.md](three-d.md#fills-and-strokes)).
|
||||
- A 3D effect on one fill or stroke ([the help page](https://helpx.adobe.com/illustrator/using/effects.html)) leaves the object's other fills and strokes drawn with the path's or compound path's fill rule, so an even-odd compound path keeps its holes in them; this holds for Extrude & Bevel, Inflate, Rotate and Revolve, and for the Classic Extrude & Bevel, Rotate and Revolve. Tests: `solids::tests::a_fill_or_stroke_without_the_effect_keeps_the_even_odd_hole`, `revolve::tests::a_fill_without_the_revolve_keeps_the_even_odd_hole`.
|
||||
- With caps and opaque paint, Extrude & Bevel (both kinds) and Inflate draw each side face of the fill's solid before the faces of the same object's strokes that overlap it (strokes on closed paths without dashes, a width profile or a brush, in a solid color or an opaque gradient), so the stroke's walls cover the fill's walls at concave corners instead of showing stripes of the fill. Tests: `solids::tests::a_fills_walls_are_drawn_before_the_stroke_faces_over_them`, `solids::tests::the_draw_order_moves_a_fill_wall_before_the_stroke_faces_it_overlaps`, `solid::tests::facets_tell_the_sides_from_the_ends_and_the_faces_turned_away`.
|
||||
- When the fill and strokes are at full opacity with Normal blending, under a stroke that leaves parts of the fill's edge uncovered (dashed, with a width profile or a brush, on an open subpath, or in a paint that may show through), Extrude & Bevel (both kinds) and Inflate cut each stroke face that passes through a face of the fill's solid, or of another of the shape's strokes, where their depths meet, and draw the faces of the shape's fill and strokes that overlap in the order of their depths where they overlap, instead of by the depths of their centers. Inflate orders a plain stroke the same way, since its fill can rise in front of the stroke. The fill no longer paints over a nearer dash, and a dash's end no longer covers the fill wall in front of it; a fill wall in a gap between dashes stays visible. The same order applies inside a group member's own opacity mask or blending mode, to a gradient with transparent stops under a colored light with graphics on its caps, and to Inflate in gradients under a colored light. Tests: `solids::tests::fill_walls_and_strokes_that_leave_gaps_draw_in_the_order_of_their_depths_where_they_overlap`, `solids::tests::local_order_puts_overlapping_fill_walls_and_stroke_faces_in_depth_order`, `solids::tests::a_stroke_face_through_a_fill_wall_is_cut_where_their_depths_meet`, `solids::tests::a_masked_members_fill_and_stroke_faces_go_in_one_order`, `solids::tests::a_colored_inflate_in_gradients_draws_its_faces_in_one_order`, `solids::tests::a_depth_cycle_keeps_the_cap_last`, `solids::graphics::tests::a_transparent_gradient_with_a_graphic_keeps_the_shared_face_order`.
|
||||
- Extrude & Bevel, Inflate and Rotate apply to type: it makes a solid of its glyph outlines, painted with its own fills and strokes or, when it has none, its characters' colour (the first run's), and stays type, so editing the text reshapes the solid (#4715).
|
||||
- Extrude & Bevel, Inflate and Rotate (Effect › 3D and Materials): live effects in the `three-d` crate with depth, twist, taper, solid or hollow caps, five original bevel shapes (width, height, repeat, spacing, inside, both sides), Inflate's volume, both sides, twist, taper and cap, Rotate's turned fills and strokes, Position presets, the rotation and light gizmos, SVG/PDF vector output and Expand Appearance; one 3D effect per object; covered by geometry, effect, canvas-versus-export, command and dialog tests ([three-d.md](three-d.md)).
|
||||
- Extrude & Bevel and Inflate build detailed shapes: each solid takes up to 65,536 outline points and 163,840 faces (VectorCraft's own limits, was 2,048 points and 32,768 faces), counted before any point is sampled; when the faces do not fit, every curve takes fewer pieces, down to 4. A closed path of 2,000 curves extrudes with a bevel and inflates, and paths of 5,000 and 10,000 curves build at the default settings (`crates/three-d/src/solid/tests_limits.rs`).
|
||||
|
||||
+19
-7
@@ -117,11 +117,20 @@ The rest is our reading:
|
||||
each side face of the fill's solid that is turned toward the viewer is drawn before every face of the same
|
||||
shape's strokes, turned toward the viewer, whose bounds overlap it, so the stroke's walls cover the fill's walls
|
||||
at concave corners. This applies to strokes on closed paths without dashes, a width profile or a brush, painted
|
||||
with a solid color or a gradient without transparent stops; with other strokes, and without caps, the faces keep
|
||||
their depth order. Otherwise
|
||||
each solid is drawn on its own with its opacity and blending, the lower item's first. With a light that is not
|
||||
white, each solid is also drawn on its own when one of them is a puffed, shaded Inflate surface in a solid color
|
||||
(drawn as one composite) or is painted with a gradient that has transparent stops (drawn with an opacity mask).
|
||||
with a solid color or a gradient without transparent stops, under Extrude & Bevel (both kinds). Under Inflate
|
||||
the fill can rise in front of such a stroke, so it is drawn like the other strokes. Other strokes (dashed, with a
|
||||
width profile or a brush, on an open subpath, or in a paint that may show through) leave parts of the fill's edge
|
||||
uncovered, such as the gaps between dashes. Each face of such a stroke that passes through a face of the fill's
|
||||
solid, or through a face of another of the shape's strokes, where the two overlap in the drawing is cut where
|
||||
their depths meet, and the faces of the shape's fill and strokes that overlap are drawn in the order of their
|
||||
depths where they overlap, with caps on or off. A fill wall in a gap stays in its own depth order. Inflate's
|
||||
curved surfaces follow this only as closely as their flat facets do. A solid painted with a gradient that has
|
||||
transparent stops under a light that is not white is drawn with an opacity mask: its faces keep their places in
|
||||
this order, in runs that each carry the mask, and so do its graphics. A member of a 3D group with its own opacity
|
||||
mask or blending mode draws its fill's and strokes' faces in this order inside that mask or blending mode when
|
||||
they are opaque with Normal blending. Otherwise each solid is drawn on its own with its opacity and blending, the
|
||||
lower item's first. With a light that is not white, each solid is also drawn on its own when one of them is a
|
||||
puffed, shaded Inflate surface in a solid color (drawn as one composite).
|
||||
- The solids turn, twist and taper about the center of the bounds of all their shapes, Inflate's grid covers
|
||||
those bounds, and with Perspective one eye sees every solid. A stroke too narrow to hold a point of Inflate's
|
||||
grid stays flat.
|
||||
@@ -150,8 +159,11 @@ them all. The members stay editable: moving or editing one reshapes the solids.
|
||||
inside the 3D group applies to the solids of that group's members together. An opacity mask on
|
||||
a member masks its solids, and one on a group inside the 3D group masks the solids of that group's members
|
||||
together. The mask stays where it is on the page; it does not turn with the solids. A disabled mask is ignored.
|
||||
- When a member, or a group inside the 3D group, has an opacity mask or a blending mode other than Normal, each
|
||||
solid is drawn on its own, the backmost member's first, as when a solid is transparent.
|
||||
- When a member, or a group inside the 3D group, has an opacity mask or a blending mode other than Normal, the
|
||||
members' faces are not drawn in one shared order. Each member whose fills and strokes are opaque with Normal
|
||||
blending draws their faces in one order of its own inside its masks and blending modes, as described under
|
||||
[Fills and strokes](#fills-and-strokes). Otherwise each solid is drawn on its own, the backmost member's first, as
|
||||
when a solid is transparent.
|
||||
- When every solid is opaque, all members' faces are drawn in one back-to-front order; otherwise each solid is drawn
|
||||
on its own, the backmost member's first.
|
||||
- Hidden members and guides are left out. A group holding a live object other than a blend (an envelope, a mesh, a
|
||||
|
||||
Reference in New Issue
Block a user