dotsOnLines method
Implementation
OpSet dotsOnLines(List<Line> lines, FillerConfig config) {
final List<Op> ops = [];
final double gap = max(config.hachureGap!, 0.1);
final double fWeight = max(config.fillWeight!, 0.1);
final double ro = gap / 4;
for (final Line line in lines) {
final double length = line.length;
final double dl = length / gap;
final int count = dl.ceil() - 1;
final double off = length - (count * gap);
final double x = ((line.source.x + line.target.x) / 2) - (gap / 4);
final double minY = min(line.source.y, line.target.y);
for (int i = 0; i < count; i++) {
final double y = minY + off + (i * gap);
final double cx = config.drawConfig!.offset(x - ro, x + ro);
final double cy = config.drawConfig!.offset(y - ro, y + ro);
final OpSet el =
OpSetBuilder.ellipse(cx, cy, fWeight, fWeight, config.drawConfig!);
ops.addAll(el.ops!);
}
}
return OpSet(type: OpSetType.fillSketch, ops: ops);
}