- Real height = slope * width;
- Real min_y = (0 <? height) - thick/2;
- Real max_y = (0 >? height) + thick/2;
-
-
-
- Box b (Interval (0, width),
- Interval (min_y, max_y));
-
-
- SCM at = scm_list_n (ly_symbol2scm ("beam"),
- gh_double2scm (width),
- gh_double2scm (slope),
- gh_double2scm (thick),
- SCM_UNDEFINED);
- return Molecule (b, at);
+ Box b;
+
+ Offset p;
+
+ p = Offset (0, thick / 2);
+ b.add_point (p);
+ p += Offset (1, -1) * (blot / 2);
+
+ SCM points = SCM_EOL;
+
+ points = scm_cons (scm_from_double (p[X_AXIS]),
+ scm_cons (scm_from_double (p[Y_AXIS]),
+ points));
+
+ p = Offset (0, -thick / 2);
+ b.add_point (p);
+ p += Offset (1, 1) * (blot / 2);
+
+ points = scm_cons (scm_from_double (p[X_AXIS]),
+ scm_cons (scm_from_double (p[Y_AXIS]),
+ points));
+
+ p = Offset (width, width * slope - thick / 2);
+ b.add_point (p);
+ p += Offset (-1, 1) * (blot / 2);
+
+ points = scm_cons (scm_from_double (p[X_AXIS]),
+ scm_cons (scm_from_double (p[Y_AXIS]),
+ points));
+
+ p = Offset (width, width * slope + thick / 2);
+ b.add_point (p);
+ p += Offset (-1, -1) * (blot / 2);
+
+ points = scm_cons (scm_from_double (p[X_AXIS]),
+ scm_cons (scm_from_double (p[Y_AXIS]),
+ points));
+
+ SCM expr = scm_list_n (ly_symbol2scm ("polygon"),
+ ly_quote_scm (points),
+ scm_from_double (blot),
+ SCM_BOOL_T,
+ SCM_UNDEFINED);
+
+ return Stencil (b, expr);