How to use clip-path with SVG
You can clip shapes with a mask to hide parts of the shape you don’t want to see. This ornament is the same as we drew on the first day, except it has a motif on its side defined as a polyline. By default, the polyline wouldn’t match the edge of the circle. Without clipping, this motif would look like this:
We use clip-path here to ensure the motif fits perfectly on the ornament. The clip-path is defined in the definitions section.
Here we define a clipPath
with an id. The content of this clip-path is a circle that matches the size of our ornament. Then we use it to clip the polyline, by setting its clip-path
property.