chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a54641e
)
distort-stl: works now but needs to do something about lines
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 7 Jan 2018 20:21:44 +0000
(20:21 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 7 Jan 2018 20:21:44 +0000
(20:21 +0000)
distort-stl
patch
|
blob
|
history
diff --git
a/distort-stl
b/distort-stl
index da9b4aef89e4fa65ef756d14ed4cb0a7877dafd9..4820e03104d51485c3d7b00a9b3f945aa1f05961 100755
(executable)
--- a/
distort-stl
+++ b/
distort-stl
@@
-29,13
+29,13
@@
sub shift_arg () {
scalar shift @ARGV;
}
scalar shift @ARGV;
}
-sub pointmap_
distortion
{
+sub pointmap_
project_cylinder
{
my ($x,$y,$z) = @_;
my $radius = shift_arg;
my ($x,$y,$z) = @_;
my $radius = shift_arg;
- my $r = $
y + $radius
;
+ my $r = $
radius - $y
;
my $theta = $x / $radius;
my $theta = $x / $radius;
- return ($r *
cos
($theta),
-
$r * sin
($theta),
+ return ($r *
sin
($theta),
+
-$r * cos
($theta),
$z);
}
$z);
}
@@
-62,7
+62,8
@@
while (<I>) {
my @xyz = split /\s+/, $_;
while (@ARGV) {
my $op = shift_arg;
my @xyz = split /\s+/, $_;
while (@ARGV) {
my $op = shift_arg;
- @xyz = &{ $::{"pointmap_$op"} }( @xyz );
+ $op =~ y/-/_/;
+ @xyz = &{ ${*::}{"pointmap_$op"} }( @xyz );
}
@xyz = map { sprintf "%.18g", $_ } @xyz;
$_ = "$lhs@xyz\n";
}
@xyz = map { sprintf "%.18g", $_ } @xyz;
$_ = "$lhs@xyz\n";