- 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 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.
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.
With corners kept along a cell's edges, ear clipping could still take an ear whose new edge ran through kept corners, leaving them off every triangle and the triangles beside them flat. Such an ear is now passed over. docs/three-d.md now says that a membrane cell that cannot be cut into triangles makes the object draw without its graphics, and commands refuse them.
Under colored lights, a solid-color Inflate surface drew each facet over
its underlay as a fill and then a same-color round seam stroke. At a
partly covered edge pixel the two coverages add up past the facet's real
coverage, so a turned Inflate's near facets bled into the facets behind
them by up to 5 levels against the same art drawn at 3x and averaged down.
- lighting::seamed_fill turns a facet that is one closed polygon with an
area and no crossing edges into one path: the facet and the outer
outline of its round seam (lighting::footprint). solid_surface fills
that path once per channel. Other facets keep a fill and a seam stroke.
The 2 pt underlay, the surface clip and the channel groups are as
before.
- three_d_light_color::turned_colored_inflate_facets_and_seams_cover_their_edges_once
checks Inflate at X 50, Y 35 in an opaque fill: at most one channel
sample more than 3 levels off, by at most 4, and no alpha off.
- docs/three-d.md (Seams) and docs/target-app-parity.md describe it.
Under a colored lightColor or a lights list, Revolve drew each face of a
solid-color or gradient surface on its own, so where two faces'
antialiased edges met, pixels inside the surface let the background
through at 1:1.
- The faces now lie over an underlay of themselves under one clip to
their outline, as colored Inflate's facets do (lighting::sealed, split
into lighting::underlay and sealed). The surface's opacity and blending
mode apply once, to the sealed surface.
- In a group, each run of one member's faces in the shared depth order
takes its own underlay; a translucent member's run keeps its opacity,
blending mode and mask on the sealed run.
- A face with a part of a mapped graphic gives its face to the underlay
and keeps the part right after it.
- Faces in a gradient with transparent stops carry its opacity mask and
are drawn as before. Revolve (Classic) is unchanged.
- The paint-copy budget counts the underlay in validation and drawing.
Docs: docs/three-d.md (Seams), docs/target-app-parity.md.
The panel's Export 3D Object button chose the objects to export in panel
code and passed their ids to assets.add3D, which on the same selection
refused every object when one had no 3D effect. Passing ids also skipped
the refusal while a part of a dynamic symbol instance's art is selected,
and a group whose 3D effect is on its fill or stroke enabled the button
and then failed.
assets.add3D without ids now leaves out the selected objects without a
3D effect it exports, a group or layer whose 3D effect is on a fill or
stroke, and an object inside another selected 3D object; a path of a
compound path counts as the compound path. Objects given in ids are
still refused. exports_three_d in vectorcraft-effects tells whether an
object has such an effect without building its meshes. The button runs
the command on the selection and is available only while a selected
object passes that check.