-(define (path thick commands)
- (define (convert-path-exps exps)
- (if (pair? exps)
- (let*
- ((head (car exps))
- (rest (cdr exps))
- (arity
- (cond
- ((memq head '(rmoveto rlineto lineto moveto)) 2)
- ((memq head '(rcurveto curveto)) 6)
- (else 1)))
- (args (take rest arity))
- (svg-head (assoc-get head '((rmoveto . m)
- (rcurveto . c)
- (curveto . C)
- (moveto . M)
- (lineto . L)
- (rlineto . l))
- ""))
- )
-
- (cons (format "~a~a "
- svg-head (number-list->point args)
- )
- (convert-path-exps (drop rest arity))))
- '()))
-
- (entity 'path ""
- `(stroke-width . ,thick)
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- '(stroke . "currentColor")
- '(fill . "none")
- `(d . ,(string-join (convert-path-exps commands) " "))))
-