In Render Settings > Rendered, Revolve on a group or layer drew its
shaded faces and reported "Revolve renders on a single object only".
Revolve on a fill or stroke did the same. Extrude & Bevel, Inflate and
Rotate already draw an image in both cases.
- On a group, every member's surface is swept about the shared axis
into one mesh list and drawn as one image, with the shadow plane
placed from every member that casts. A member that is not an opaque
solid color in Normal blending, or that sits in a group with an
opacity mask or a blending mode, keeps the shaded faces and reports
why, as the other effects do. The painted bounds of the group are the
image's rectangle.
- On a fill or stroke, that paint's surface is drawn as its own image
under the effects after its Revolve, as Extrude & Bevel, Inflate and
Rotate draw a rendered fill or stroke.
- When a group's members, or the clipping groups, blends and symbol
instances in it, can't be revolved, a rendered Revolve on the group
reports the reason in the status bar and the command's warning.
- The object, fill and stroke paths share one helper for the image, so
the eligibility checks and the shadow plane are the same in each.
Docs: docs/mcp.md, docs/three-d.md, docs/target-app-parity.md.
With unchanged settings OK closes the dialog before the document, history and object checks run (crates/ui-egui/src/panels/three_d/raster.rs:147), so docs/mcp.md and docs/three-d.md now say the refusals apply when there are changes.
A canceled undo group, or a canceled undo scope that put back an earlier
snapshot, now advances the document's history restore count, as Undo
and Redo do. The same steps can make an equal object with the same id
again after such a cancel, so Raster Settings, Placement Options and
Create Object Mosaic ask to be reopened. A scope canceled without an
edit puts back the same snapshot and does not count.
Raster Settings OK also refuses while a tool edit computed on another
thread is pending, since running the command would apply that edit
first, after the targets were checked.
When the objects the dialog opened on render again, OK clears their
earlier fallback warning from the status bar while it still shows it,
unless a selected object still gives that warning; the selection's
first other warning takes its place.
Raster Settings opened with the selected objects' render settings, but
OK applied the edited values to whatever was selected at OK time. An
object selected while the dialog was open took settings it was never
shown.
OK now sets the objects selected when the dialog opened. When the
document is no longer the active one, was reverted, had an Undo or
Redo, or one of those objects was changed, deleted, locked or hidden,
OK keeps the dialog open with the reason.
Canceling a 3D and Materials drag, or dragging back to where it began,
rolled the preview back but left its rendered fallback warning in the
status bar, describing settings the document no longer had. The
rollback now clears that warning while the status line still holds it
and shows the restored selection's own warning instead. A warning shown
before the drag began, or a newer status message, is kept.
docs/three-d.md now scopes the painter's algorithm note to shaded vector
faces; a Rendered image is drawn with a depth buffer.
The shaded faces show the first light's shadow, and Render Settings ›
Rendered draws the shadows of every light with an Intensity above 0.
The Shadows table, its notes, the differences list, the effects summary,
docs/mcp.md and the shadow params text of Extrude & Bevel, Revolve,
Inflate and Rotate now say which mode they describe.
A new test checks that PNG export gives the pixels the canvas draws at
export quality, and that the rendered image has as many pixels as the
shaded faces' bounds times the resolution over 72, rounded up as a
raster effect's image is.
A rendered Extrude & Bevel, Rotate or Revolve followed by a visible
geometry effect that reshapes paths but not images, such as Pucker &
Bloat or Roughen, now draws and measures the shaded faces so the later
effect still applies, and the status bar reports why. Transform, Warp
and raster effects keep the rendered image.
The progress line now says the metallic-roughness shading applies with
Shading on and outside Wireframe mode, and that USD export writes
metallic only when it is not the default 0. The 3D page says the
material does not change Wireframe edges and still exports.
- 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.
Graphics map onto Inflate's puffed front and back (#7767), so the
unbuilt list no longer names graphics on Inflate and the Graphics
sentence names Inflate's faces. The 3D (Classic) effects export as
meshes through Asset Export (#6168, #7852), so only Turntable stays
named as unbuilt there.
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.