Stencil
Lookup::repeat_slash (Real w, Real s, Real t)
{
-#if 0 /* TODO */
- vector<Offset> points;
- Real blotdiameter = 0.0;
-
- Offset p1 (0, 0);
- Offset p2 (w, w * s);
-
- return Lookup::round_filled_polygon (points, blotdiameter);
-#endif
- SCM wid = scm_from_double (w);
- SCM sl = scm_from_double (s);
- SCM thick = scm_from_double (t);
- SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"),
- wid, sl, thick, SCM_UNDEFINED);
+ Real x_width = sqrt ((t * t) + ((t / s) * (t / s)));
+ Real height = w * s;
+
+ SCM controls = scm_list_n (ly_symbol2scm ("moveto"),
+ scm_from_double (0),
+ scm_from_double (0),
+ ly_symbol2scm ("rlineto"),
+ scm_from_double (x_width),
+ scm_from_double (0),
+ ly_symbol2scm ("rlineto"),
+ scm_from_double (w),
+ scm_from_double (height),
+ ly_symbol2scm ("rlineto"),
+ scm_from_double (-x_width),
+ scm_from_double (0),
+ ly_symbol2scm ("closepath"),
+ SCM_UNDEFINED);
+
+ SCM slashnodot = scm_list_n (ly_symbol2scm ("path"),
+ scm_from_double (0),
+ ly_quote_scm (controls),
+ ly_quote_scm (ly_symbol2scm ("round")),
+ ly_quote_scm (ly_symbol2scm ("round")),
+ SCM_BOOL_T,
+ SCM_UNDEFINED);
Box b (Interval (0, w + sqrt (sqr (t / s) + sqr (t))),
Interval (0, w * s));
(- (/ (length points) 2) 1)
blot-diameter))
-(define (repeat-slash width slope beam-thickness)
- (define (euclidean-length x y)
- (sqrt (+ (* x x) (* y y))))
-
- (let ((x-width (euclidean-length beam-thickness (/ beam-thickness slope)))
- (height (* width slope)))
- (ly:format "~4l draw_repeat_slash"
- (list x-width width height))))
-
-
(define (round-filled-box left right bottom top blotdiam)
(let* ((halfblot (/ blotdiam 2))
(x (- halfblot left))
`(points . ,(string-join
(map offset->point (ly:list->offsets '() coords))))))
-(define (repeat-slash width slope thickness)
- (define (euclidean-length x y)
- (sqrt (+ (* x x) (* y y))))
- (let* ((x-width (euclidean-length thickness (/ thickness slope)))
- (height (* width slope)))
- (entity
- 'path ""
- '(fill . "currentColor")
- `(d . ,(ly:format "M0 0l~4f 0 ~4f ~4f ~4f 0z"
- x-width width (- height) (- x-width))))))
-
(define (resetcolor)
"</g>\n")