Commit Graph
4 Commits
Author SHA1 Message Date
dotCooCoo a3ba3eeb38 Merge main into fix/3d-shadow-builds-once 2026-11-14 09:52:39 -08:00
dotCooCoo 1b268a725e 3D: a render with a shadow builds each solid once
With Shadows on, Extrude & Bevel, Inflate, Rotate and Revolve built
every solid twice: once for the art and again for the shadow. The build
that draws a solid now also keeps the faces its shadow is cast from and
the projection they were built with, and the shadow is cast from them.
The art and the shadow are unchanged.

- three-d: the solid builder can keep the projected facets and the
  view-space faces together (`Keep::Both`); `extrude_shadowed`,
  `plane_shadowed`, `inflate_shadowed` and `revolve_shadowed` return
  both, and `ShadowCaster::add_solid` adds the kept faces. Revolve's
  sweep draws the surface and keeps the shadow's faces in one pass; a
  shadow past its limits still gives the same error while the surface
  draws.
- effects: the solids drawn hand their faces to the shadow. A stroke's
  solid left out of the art is still built for the shadow alone, as
  before.

Tests compare each solid and its shadow with the two built apart, to
the bit, and count the solids built for a shadowed object.
2026-11-13 21:48:53 -08:00
dotCooCoo d64ba43e50 3D: Inflate with no volume solves each puff only when its solid is taken
At a Volume of 0 % no shape puffs, so the eye does not depend on the
other shapes. Each shape's membrane is now solved as its solid is taken,
and a caller that stops at the object's face limit solves none of the
shapes after it. With any volume every puff is still solved first, since
the highest one places the eye, and the solids are unchanged bit for bit.

The shadow no longer builds the solid of a fully transparent fill or
stroke: its puff still places the eye, and at 0 % volume it is not
solved either.
2026-11-13 21:17:21 -08:00
dotCooCoo 73c7c7511b 3D and Materials: shadows behind or below the object, with Distance and Bounds
Revolve, Extrude & Bevel, Inflate and Rotate take a Shadows switch on the
Lighting tab, with Position (Behind Object or Below Object), Distance from
Object (0 to 100%) and Shadow Bounds (10 to 400%), saved in the effect as
shadow, shadowPosition, shadowDistance and shadowBounds.

With shadows on, the first light casts a hard-edged vector shadow of the
solid: every face of every solid of the object projected along the light
onto a plane behind the object (square to the view) or below it (square to
its own vertical axis and turned with it), filled black with the nonzero
rule at 50% times the opacity of the art that casts it, in that art's
blending mode, and drawn behind the solids. Distance moves the plane away
by a share of the object's largest size; Bounds ends the plane at a square
about the foot of the object's center, four times that size across at
100%. No shadow is drawn while Shading is off, when the first light's
intensity is 0, or when it does not reach the plane. A member's opacity
mask and blending mode apply to the part of the shadow it casts. A shadow
is cast from at most 327,680 faces; past that, commands are refused and a
loaded file draws the source path. The canvas, SVG and PDF exports draw the
shadow, and Expand Appearance keeps it as a path. Values out of range are
refused before the document changes.

Docs: docs/three-d.md, docs/mcp.md, docs/effects-parity.md and the
docs/target-app-parity.md evidence list.
2026-11-11 17:50:33 -08:00