Skip to content

Stroke control, computed path data, and referenced clip paths #332

Closed

Description

@LeadcodeDev

Part of #326. Batch 3 — depends on #327 and #328.

Rustmotion has roughly fourteen drawing primitives against about twenty for Canvas and fifteen for SVG, so the count is not the problem. ClipPath::Path and Polygon already exist, mix-blend-mode exists, shape: {path: {data}} accepts arbitrary path data, and filter/backdrop-filter carry a deterministic noise. What is missing is narrow, and it is what stops those primitives from composing into the shapes the reference reels build.

Owned files

  • crates/rustmotion-components/src/shape.rs
  • crates/rustmotion-core/src/schema/video.rs (Stroke)
  • crates/rustmotion-core/src/css/style.rs (ClipPath node-reference variant only)

Do NOT write: engine/deps.rs (#328 owns the resolver this calls), expr/** (#327).

Deliverables

  1. Stroke control on an arbitrary path. dash, dash_offset (animatable), line_cap and line_join exist only on arrow, connector and line today. Move them onto Stroke so shape.path gets them too.

  2. path.data accepts an expression. This is what turns a gem into twenty-four triangular facets computed from eight outline points, an inner ring and an offset centre, each tinted by its angle to a light. Without it, procedural geometry stays impossible whatever else lands.

  3. clip-path may reference another node's path. The reference reel's cracking stone is one gem drawn twice, each half clipped by a path following the crack, so the two halves separate along a coherent break. A rectangular overflow: hidden cannot express that and ClipPath::Path alone cannot either, because the crack is a node with its own animation.

Acceptance

  • A for-each over 24 facets with computed data and computed fill renders a shaded gem
  • A dashed arbitrary path animates its dash_offset into a draw-on
  • Two shapes clipped by the same referenced crack path separate without a seam

Activity

  1. self-assigned this
    on Sep 25, 2026
  2. changed the title [-]WS-6 audio: a synthesised score on the visuals' clock[/-] [+]WS-7 primitives: stroke control, computed path data, referenced clip paths[/+] on Sep 25, 2026
  3. changed the title [-]WS-7 primitives: stroke control, computed path data, referenced clip paths[/-] [+]Stroke control, computed path data, and referenced clip paths[/+] on Sep 25, 2026
  4. LeadcodeDev commented on Sep 26, 2026

    @LeadcodeDev
    OwnerAuthor

    Two of the three acceptance criteria landed at 187cf7c (#340):

    • computed data and computed fill in a for-each — the ${...} marker dialect in shape.rs
    • stroke.dash_offset as a Computed<f32> resolved per frame (resolve_dash_offset, shape.rs:87), plus stroke-linecap / stroke-linejoin (schema/video.rs:1099)

    The third — two shapes clipped by the same referenced crack path — did not. ClipPath::NodePath is declared and serialized (css/style.rs:1607) and its own doc comment says resolving it is the paint pipeline's job. That job was never done, and #339 measures the wider fault: no ClipPath variant is read by anything, NodePath included. Remainder tracked there rather than kept open here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions