Where overlapping faces of a solid are put in the order of their depths
(local_order, also Revolve's surface_order) and some lie in front of
one another in a ring, no order draws them all correctly. When the sort
could draw no face next, it drew the first face left by depth, whether
or not that face was part of a ring. A face that is only in front of a
ring's face, and comes before the ring by depth, was then drawn under
it: dashed strokes on bars that overlap in a ring, extruded as a 3D
group, had whole wall panels drawn over their dashes.
The sort now follows the faces that go before the first face left back,
among the faces that come before the next face drawn last, to a ring
that waits for no other of them (Tarjan's algorithm on the pairs
reversed, stopped at the first component completed). That ring gives up
its own face that comes first in the order of their depths, and the
faces left are looked at afresh, since they may be a smaller ring or
none. Only pairs of a ring, and pairs with a face drawn last, are then
drawn the wrong way round. A face drawn last (a cap) still follows
every face before it.
Cost and memory:
- Comparing pairs and looking for rings share MAX_LOCAL_CHECKS steps:
every face and pair looked at takes a step, and a face's list of the
faces before it is charged before it is read. Past the limit the
first face left by depth goes next, as before.
- A first face left that waits only for the next face drawn last, or
faces after it, goes next with no search and no step: each face keeps
a count of the faces not drawn before it that come before the face
drawn last.
- The search goes on from where it stopped, less the group that gave
up a face, so rings apart or one behind the other take a few steps a
face. A ring that is still a ring after it gives up a face is walked
again, so a large ring can cost about the square of its faces.
- The pairs are held as two u32 (8 bytes), dropped once each face's
list of the faces after it is made; both kinds of list are one array
of 4 bytes a pair. The lists of the faces before each face take a
step a pair to make, not taken from the limit, and are made only when
the room left is at least a quarter of the pairs, so making them
costs no more than four times the room left. A solid whose comparing
leaves less breaks its rings at the first face left by depth.
draw_order, cut_stroke_faces and in_one_order are unchanged.
Tests (solids::tests):
- a_face_in_front_of_a_cycle_waits_for_it: [0, 2, 3, 1] where the
first face by depth gave [3, 0, 2, 1]; with a cap, it stays last.
- the_faces_left_are_looked_at_afresh_after_each_face_released,
the_ring_released_waits_for_no_face_outside_it,
a_ring_is_looked_for_before_the_next_face_drawn_last.
- breaking_a_ring_draws_no_more_pairs_wrong_than_the_first_face_by_depth:
6,000 random sets (up to 30 faces, pairs shuffled and repeated, up to
four faces drawn last), each held to the order worked out plainly.
- breaking_rings_stops_at_its_room,
breaking_rings_takes_a_few_steps_a_face_but_for_a_ring_of_many_pairs:
the steps are counted, not timed, and bounded from above.
- a_face_that_waits_only_for_the_face_drawn_last_costs_no_search:
1,000 such faces before a ring take no search.
- the_lists_for_rings_are_made_only_with_room_for_a_quarter_of_the_pairs.
- a_list_longer_than_the_room_left_is_not_read: the entries read are
counted where they are read, and stay within the room.
- a_depth_cycle_keeps_the_cap_last is unchanged and passes.
With no ring looked for, the ring tests fail; without the skip or the
room for the lists, their tests fail.
Docs: docs/three-d.md, docs/revolve.md, docs/effects-parity.md,
docs/target-app-parity.md.
Part of #7023.
Look::takes let a glyph filled only join a run whose glyphs were also
stroked, so after mode 2 text a mode 0 glyph took the run's stroke:
`2 Tr (B) Tj 0 Tr (C) Tj` came in as "BC" stroked throughout. A glyph
now joins only a run drawn alike (fill, stroke, overprints), so a glyph
filled only starts a run of its own and takes a stroke only when the
matched-stroke path (#8039) strokes it.
flush_stroke no longer strokes a whole run in place: a whole run goes
through the split and join code, so fill and stroke rendering glyph by
glyph still builds one stroked run.
A Swatch Options rename of the spot color base keeps it the base, also
as a command.batch step, and so do an Undo and a Redo of the rename.
Deleting the swatch or its color group, merging it into another, making
it a process color or closing its document ends the link, so a later
spot color of the same name does not become the base until it is chosen
again. The base keeps the color it showed.
A batch's Activate Document, New, Open, Close and Move Document steps
are followed, so steps in another document leave the link alone. When
the swatch goes in a way the panel does not follow, the link waits for
an Undo or Redo, and the next other command ends it.
A PDF/X-4 export wrote xmp:ModifyDate and xmp:CreateDate in its XMP
metadata but no xmp:MetadataDate. The PDF/X-4 metadata edit now adds
xmp:MetadataDate next to xmp:ModifyDate, with the same value, and grows
the stream's /Length to match. When the export dates the file as modified
later, post::modification_date already rewrites every xmp:MetadataDate,
so the two dates stay equal.
PDF/X-1a, PDF/X-3, PDF/A and plain PDF exports are unchanged.
A fill and a stroke at the same opacity below 1 were joined into one
type object whose opacity then applies to both together, losing the
darker overlap the file composites. stroke_filled now takes a stroke
only when the fill and the stroke are opaque.
An upright glyph filled and stroked was kept as an outline for the
reshaped-outline fallback while upright glyphs filled only were not;
it is no longer kept either, so such a line can't come in as the
outlines of its stroked glyphs alone.
Docs: the #8015 entries say what is left (translucent type, and a TJ
that starts a new line part way through).
With Transparency off, Optimize to File Size's Auto Select counts the
colors of the pixels blended over the matte, which are the colors the
file is written with, so art whose blended pixels need more than 256
colors starts with JPEG instead of GIF.
Object › Rasterize… showed Anti Alias and Background as text fields
holding the command's values. They are now dropdowns of the values
object.rasterize takes: None, Art Optimized and Type Optimized, and
White and Transparent. Create Gradient Mesh… shows Appearance (Flat,
To Center, To Edge) and grid Repeat Options shows Grid Type the same
way. A value the dialog does not list is shown and sent unchanged.
Catalog rows are added for the labels that had none.
Part of #8020, part of #7991.
- The steps of a live blend are written as drawn art: copies of key
objects with text wrap options no longer write those options again.
The keys keep theirs on the hidden lines and the blend keeps its own.
- The record holds Specified Distance as a 32-bit float, which the
reader reads back as its shortest decimal. The writer now compares the
blend with that distance, so a distance typed in another unit (10 mm
is 28.346456... pt) is written live when it lays out as many steps.
- blend_steps_settled has unit tests for each of its cases.
- blends_write_the_same_bytes_again checks that every blend is written
live both times.
- Comments name the blend plugin's XP line by its constant.
- docs/target-app-parity.md lists live blends in the .ai editing copy;
a line in docs/file-format-parity.md is wrapped like the rest.
Tests: a_live_blends_steps_carry_no_text_wrap_options,
a_blend_spaced_in_millimeters_is_written_live,
steps_settle_unless_rounding_can_change_their_count.