Skip to content

Commit

Permalink
Clarify wording about provided algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasaglia committed Oct 18, 2024
1 parent 656ab8f commit 3e78ef3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs/specs/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,21 @@ All paths MUST be closed unless specified otherwise in the rendering instruction
When instructions call for an equality comparison between two values,
implementations MAY consider similar values to be equal to overcome numerical instability.

### Drawing Commands
### Bezier Conversions

This documents includes algorithms to convert parametric shapes into bezier curves.

Implementations MAY use different implementations than the algorithms provided here
but the output shape MUST be visually indistinguishable from the output of these algorithms.

Furthermore, when drawing individual shapes the stroke order and direction is not importand
but implementations of Trim Path MUST follow the stroke order as defined by these algorithms.

Drawing instructions will contain the following commands:

* _add vertex_: Adds a vertex to the bezier shape in global coordinates
* _set in tangent_: Sets the cubic tangent to the last added vertex, with coordinates relative to it. If omitted, tangents MUST be $(0, 0)$.
* _set out tangent_: Sets the cubic tangent from the last added vertex, with coordinates relative to it. If omitted, tangents MUST be $(0, 0)$.
* _lerp_: Linearly interpolates two points or scalars by a given amount.
* _Add vertex_: Adds a vertex to the bezier shape in global coordinates
* _Set in tangent_: Sets the cubic tangent to the last added vertex, with coordinates relative to it. If omitted, tangents MUST be $(0, 0)$.
* _Set out tangent_: Sets the cubic tangent from the last added vertex, with coordinates relative to it. If omitted, tangents MUST be $(0, 0)$.


### Approximating Ellipses with Cubic Bezier
Expand Down

0 comments on commit 3e78ef3

Please sign in to comment.