chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
distort-stl: debugging
[reprap-play.git]
/
distort-stl
diff --git
a/distort-stl
b/distort-stl
index 6dcd23ce3d79c72e02892efece297be2a8bd43b4..844344cdb0c1a1f09a80e3ea9fe61fa168507c36 100755
(executable)
--- a/
distort-stl
+++ b/
distort-stl
@@
-50,17
+50,18
@@
sub maybe_subdivide_triangle ($$$$) {
printf STDERR
"%11.6f,%11.6f,%11.6f / ".
"%11.6f,%11.6f,%11.6f / ".
printf STDERR
"%11.6f,%11.6f,%11.6f / ".
"%11.6f,%11.6f,%11.6f / ".
- "%11.6f,%11.6f,%11.6f ",
+ "%11.6f,%11.6f,%11.6f
%-40s
",
$t->[0][0], $t->[0][1], $t->[0][2],
$t->[1][0], $t->[1][1], $t->[1][2],
$t->[0][0], $t->[0][1], $t->[0][2],
$t->[1][0], $t->[1][1], $t->[1][2],
- $t->[2][0], $t->[2][1], $t->[2][2];
+ $t->[2][0], $t->[2][1], $t->[2][2],
+ $t->[3];
foreach my $ix (0..2) {
my $jx = ($ix+1) % 3;
my $kx = ($ix+2) % 3;
if ($edge_need_subdivide_fn->($t->[$ix], $t->[$jx])) {
printf STDERR
foreach my $ix (0..2) {
my $jx = ($ix+1) % 3;
my $kx = ($ix+2) % 3;
if ($edge_need_subdivide_fn->($t->[$ix], $t->[$jx])) {
printf STDERR
- " S i=%d j=%d k=%d
\n
",
+ " S i=%d j=%d k=%d ",
$ix, $jx, $kx;
my @midp;
foreach my $ci (0..2) {
$ix, $jx, $kx;
my @midp;
foreach my $ci (0..2) {
@@
-68,8
+69,14
@@
sub maybe_subdivide_triangle ($$$$) {
}
# triangle i-j-k, splitting edge i-m
# gives i-m-k, k-m-j
}
# triangle i-j-k, splitting edge i-m
# gives i-m-k, k-m-j
- my $n = [ @$t ]; $n->[$ix] = \@midp; unshift @$changed, $n;
- my $n = [ @$t ]; $n->[$jx] = \@midp; unshift @$changed, $n;
+ my $n = [ @$t ]; $n->[$ix] = \@midp; $n->[3] = "$t->[3]a$ix$jx";
+ unshift @$changed, $n;
+
+ my $n = [ @$t ]; $n->[$jx] = \@midp; $n->[3] = "$t->[3]b$ix$jx";
+ unshift @$changed, $n;
+ printf STDERR
+ " midp %11.6f,%11.6f,%11.6f\n",
+ @midp;
return;
}
}
return;
}
}
@@
-189,6
+196,7
@@
while (<I>) {
push @$triangle, \@xyz;
} elsif (m/^endloop/) {
die unless @$triangle == 3;
push @$triangle, \@xyz;
} elsif (m/^endloop/) {
die unless @$triangle == 3;
+ push @$triangle, $.;
push @$triangles, $triangle;
undef $triangle;
} elsif (m/^(?:solid|facet\s+normal|endfacet|endsolid)\s/) {
push @$triangles, $triangle;
undef $triangle;
} elsif (m/^(?:solid|facet\s+normal|endfacet|endsolid)\s/) {