}
if (started) printf("EndSplineSet\n");
}
-
+
+/*
+ * To vary the weight of Bedstead, we just vary the thickness of
+ * vertical strokes. More precisely, we pretend that the weight
+ * variation is achieved by moving the rising edges of the output
+ * waveform of the SAA5050. This is implemented by moving all left
+ * edges left and right. The code below only handles cases where we
+ * don't run out of slack in horizontal lines, which limits weight to
+ * the range (-50 * SCALE) < weight < (25 * SCALE).
+ */
+static int weight = 0 * SCALE;
+
+static void
+adjust_weight()
+{
+ int i;
+ point *p;
+
+ for (i = 0; i < nextpoint; i++) {
+ p = &points[i];
+ if (p->next == NULL) continue;
+ assert(p->prev != NULL);
+ /* Move left-edge points horizontally */
+ if (p->prev->v.y <= p->v.y && p->v.y <= p->next->v.y)
+ p->v.x -= weight;
+ /* Move top inner corner points along NE/SW diagonal */
+ if (p->prev->v.y < p->v.y && p->v.y > p->next->v.y &&
+ p->prev->v.x > p->v.x && p->v.x > p->next->v.x) {
+ p->v.x -= weight/2;
+ p->v.y -= weight/2;
+ }
+ /* Move bottom inner corner points along NW/SE diagonal */
+ if (p->prev->v.y > p->v.y && p->v.y < p->next->v.y &&
+ p->prev->v.x < p->v.x && p->v.x < p->next->v.x) {
+ p->v.x -= weight/2;
+ p->v.y += weight/2;
+ }
+ }
+}
+
static void
blackpixel(int x, int y, int bl, int br, int tr, int tl)
{
}
}
clean_path();
+ adjust_weight();
emit_path();
}