Skip to content

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

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

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