-include ../cprogs.make
+#include ../cprogs.make
M4INCS= parts.i4
default: $(CPROGS) for-test-ui
all: default lpages layers extras
for-test-ui: ours.dgram-bot.segcmap subseg2display \
- ui-plan-bot.ppm
+ ui-plan-bot.ppm ours.graph.c
layers: $(LAYERS)
lpages: $(LPAGES)
-sDEVICE=ppmraw -r72 -g595x842 \
-sOutputFile=$@.new $< && mv -f $@.new $@
+ours.graph.c: extractgraph ours.dgram-bot.p0.segenco.ps
+ ./$^ $o
+# Strictly, this is wrong as it only uses layer 0. When we have more
+# layers, should put them all in same segenco specially for extractgraph
+
ours-l%.ps: ours.d4 layout
./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
$conf{MaxTolerDist}= 0.2;
$conf{MinClearAngle}= 5.0;
$conf{MaxTolerAngle}= 0.5;
-$conf{LayerKinds}= ''; # comma-separated list
+$conf{LayerKinds}= ','; # comma-separated list as for split /\,/, ..., -1;
our @nodes;
# $nodes[$nodenum]{X}
# $nodes[$nodenum]{LayerMin}
# $nodes[$nodenum]{LayerMax}
+sub comment ($) {
+ print "/* $_[0] */\n";
+}
+
+sub sqr ($) { return $_[0]*$_[0]; }
+
sub find_node (@) {
my ($l,$x,$y,$a) = @_;
my ($any_outside_tol);
}
}
if ($any_outside_clear) {
- } else if ($any_outside_toler) {
+ } elsif ($any_outside_toler) {
die "$l,$x,$y,$a vs. $node->{LayerMin}..$node->{LayerMax}".
- ",$node->{X},$node->{Y},$node->{A}";
+ ",$node->{X},$node->{Y},$node->{A}".
+ " at <> line $node->{LineNum} and";
} else {
if ($diff{Layer} < 0) { $node->{LayerMin}= $l }
if ($diff{Layer} > 0) { $node->{LayerMax}= $l }
- return ($node,$back);
+ comment("nodulated ex.#$ni/$back $l,$x,$y,$a");
+ return ($ni,$back);
}
}
$node= { X => $x, Y => $y, A => $a,
- LayerMin => $l, LayerMax => $l };
+ LayerMin => $l, LayerMax => $l, LineNum => $. };
push @nodes, $node;
- return ($node,0);
+ comment("nodulated new#$ni/0 $l,$x,$y,$a");
+ return ($#nodes,0);
}
while (<>) {
next unless $1 eq 'segmentpart';
die unless m/^\%L segmentpart ([A-Za-z_]*)(\d+) (\S+) ([-.eE0-9 ]+)$/;
($layerkind, $level, $subsegspec, $numbers) = ($1,$2,$3,$4);
- next unless grep { $layerkind eq $_ } split /\,/, $conf{LayerKinds};
+ next unless grep { $layerkind eq $_ } split /\,/, $conf{LayerKinds}, -1;
@numbers = map { $_ + 0 } split / /, $numbers;
+ $dist= shift @numbers;
+ @numbers == 6 or die;
for ($pti=0; $pti<2; $pti++) {
($node[$pti], $back[$pti])=
- find_node($level, $numbers[($i*3)..($i*3+2)]);
+ find_node($level, @numbers[($i*3)..($i*3+2)]);
}
}
- ($pts[0]{X}, $pts[0]{Y}, $pts[0]{A},
- $pts[1]{X}, $pts[1]{Y}, $pts[1]{A}) =
- $node[0]
-
-
-(\w+(?:(?:\/([A-Za-z]+)(\d+))?)?)
+# ($pts[0]{X}, $pts[0]{Y}, $pts[0]{A},
+# $pts[1]{X}, $pts[1]{Y}, $pts[1]{A}) =
+# $node[0]
+
+#(\w+(?:(?:\/([A-Za-z]+)(\d+))?)?)