Skip to content

Using Path2D for stroke not fill? #333

Answered by cleemesser
BarbaraWebb asked this question in Q&A
Discussion options

You must be logged in to vote

@BarbaraWebb The PR has been accepted, so the next release of ipycanvas (version 0.13.3) should support your use case. Here is an example that I was thinking of using for the documentation.

Using Path2D

You can define a Path2D given an SVG path. Note that once the path is created, it is read only, you cannot dynamically change the path value. ipycanvas does not (yet) support Path2D methods like Path2D.move_to, draw_line, etc.
Using the Path2D class is very useful and efficient when you want to reuse the same path multiple times. Path2D objects may be stroked or filled.

See https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths for documentation about SVG paths.

  • Path2D(value):
    Cr…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@cleemesser
Comment options

@martinRenou
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by martinRenou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants