The test counter in RingFinder::reach now counts one entry per read in the compaction loop. docs/three-d.md says that past the limit a face that can go next still goes, and the first face left by depth goes next only when none can.
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.
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.
- 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.