Skip to content

Commit

Permalink
0.61
Browse files Browse the repository at this point in the history
  • Loading branch information
creaktive committed Jul 19, 2003
1 parent fdd43c3 commit 74c8696
Show file tree
Hide file tree
Showing 8 changed files with 33,387 additions and 33 deletions.
37 changes: 18 additions & 19 deletions acftools.pl
Expand Up @@ -28,22 +28,21 @@
use File::Spec::Functions;

use vars qw($VERSION);
$VERSION = '0.6';
$VERSION = '0.61';
use constant DEFS => 'defs';
use constant LIB => 'lib';

BEGIN { $0 = $^X unless $^X =~ m%(^|[/\\])(perl)|(perl.exe)$%i }
use FindBin;
use FindBin qw($RealBin $RealScript);

use Getopt::Long;
use IO::Handle;
STDERR->autoflush (1);

use Time::HiRes qw(gettimeofday);
use vars qw($pbart);
$pbart = 0;
use vars qw($pbar);
$pbar = 0;

use lib catfile (dirname ($FindBin::RealScript), LIB);
use lib catfile ($RealBin, LIB);
use XPlane::Convert::ACFgen;
use XPlane::Convert::ACFparse;
use XPlane::Convert::AC3Dgen;
Expand Down Expand Up @@ -103,7 +102,8 @@
} else {
$ext = 1;
}
$def = catfile ($FindBin::RealBin, DEFS, $def) unless -f $def;
$def .= '.def' unless $def =~ /\.def$/i;
$def = catfile ($RealBin, DEFS, $def) unless -f $def;


if ($ext && $acf) {
Expand Down Expand Up @@ -151,9 +151,9 @@
}
} else {
print STDERR <<USAGE
Usage: $FindBin::RealScript <commands> [parameters]
Usage: $RealScript <commands> [parameters]
o Commands:
-extract DEF : extract TXT from ACF
-extract [DEF] : extract TXT from ACF (opt: using DEF definition)
-generate : generate ACF from TXT
-merge : merge body from AC3D file to TXT
o Parameters:
Expand All @@ -175,16 +175,16 @@
* "generate" doesn't need DEF at all (it is implicit in TXT)
* If file to be created already exists backup is made automatically.
o Examples:
$FindBin::RealScript --extract=ACF700.def --acffile="F-22 Raptor.acf"
$RealScript --extract=ACF700 --acffile="F-22 Raptor.acf"
(extract 'F-22 Raptor.txt' from 'F-22 Raptor.acf')
$FindBin::RealScript -e -acf "F-22 Raptor.acf"
$RealScript -e -acf "F-22 Raptor.acf"
(same as above)
$FindBin::RealScript -me -ac3d ladar.ac -txt "F-22 Raptor.txt"
$RealScript -me -ac3d ladar.ac -txt "F-22 Raptor.txt"
(merge *single* 3D body from 'ladar.ac' to 'F-22 Raptor.txt')
$FindBin::RealScript -g -txt "F-22 Raptor.txt"
$RealScript -g -txt "F-22 Raptor.txt"
(reverse operation; generate 'F-22 Raptor.acf' from 'F-22 Raptor.txt')
USAGE
;
Expand Down Expand Up @@ -329,13 +329,12 @@ sub leave {

sub progress {
my ($total, $now) = @_;
my $time = scalar gettimeofday;
if ($time - $pbart >= 0.01) {
my $prc = (100 * $now) / $total;
my $bar = '=' x int ($prc / 2);
printf STDERR "(%-50s) %6.2f%% complete\r", $bar, $prc;
my $prc = (100 * $now) / $total;
my $sbar = int ($prc / 2);
if ($sbar != $pbar) {
printf STDERR "(%-50s) %6.2f%% complete\r", ('=' x $sbar), $prc;
$pbar = $sbar;
}
$pbart = $time;
return;
}

Expand Down
2 changes: 2 additions & 0 deletions data/airfoil.lst
Expand Up @@ -63,3 +63,5 @@ delta.afl goe09k.dat
# SS1.acf
MV 3211 HS.afl goe09k.dat

# F14.acf
Flat Platef14hstab.afl goe09k.dat
7 changes: 7 additions & 0 deletions docs/ChangeLog.txt
Expand Up @@ -22,3 +22,10 @@ v0.6
- made some error messages more clear
- updated author's mail & official site URL
- added contrib/*.bat contribution by Marcelo M. Marques
v0.61
- fixed 7.40 "is_left" misc. wing attribute
(7.00 also had it, but it was undocumented until 7.40)
- removed dumb & unnecessary Time::HiRes dependency
- ACFTools can now run from PATH
- minor docs/help fixes
- added models/Seabee.ac model by Tracy Walker sample
20 changes: 11 additions & 9 deletions docs/README.txt
@@ -1,5 +1,5 @@
##############################################################################
[ACFTools v0.6] Set of tools to play with ACF files outside of Plane-Maker
[ACFTools v0.61] Set of tools to play with ACF files outside of Plane-Maker
Perl script and modules coded by Stanislaw Pusep <stas@sysd.org>
Site of this and another X-Plane projects of mine: http://xplane.sysd.org/

Expand All @@ -11,7 +11,7 @@ Allows you to:

Usage: acftools.exe <commands> [parameters]
o Commands:
-extract DEF : extract TXT from ACF
-extract [DEF] : extract TXT from ACF (opt: using DEF definition)
-generate : generate ACF from TXT
-merge : merge body from AC3D file to TXT
o Parameters:
Expand All @@ -22,7 +22,7 @@ Usage: acftools.exe <commands> [parameters]
-noac3d : DO NOT generate AC3D
-(min|max)body N: write all bodies in specified range to AC3D
-force LIST : force extraction of bodies LIST (comma-separated N)
-normalize N : normalize wings to N vert/surface (N>=2 or no wings!
-normalize N : normalize wings to N vert/surface (N>=2 or no wings!)
o Notes:
* You can use abbreviations of commands/parameters (-gen or even -g
instead of -generate).
Expand All @@ -33,7 +33,7 @@ Usage: acftools.exe <commands> [parameters]
* "generate" doesn't need DEF at all (it is implicit in TXT)
* If file to be created already exists backup is made automatically.
o Examples:
acftools.exe --extract=ACF700.def --acffile="F-22 Raptor.acf"
acftools.exe --extract=ACF700 --acffile="F-22 Raptor.acf"
(extract 'F-22 Raptor.txt' from 'F-22 Raptor.acf')

acftools.exe -e -acf "F-22 Raptor.acf"
Expand All @@ -46,15 +46,17 @@ Usage: acftools.exe <commands> [parameters]
(reverse operation; generate 'F-22 Raptor.acf' from 'F-22 Raptor.txt')


Why AC3D?
=========
Why AC3D (http://www.ac3d.org/)?
================================

You'd better ask "why not?". First of all AC3D can import/export many
different formats like AutoCAD DXF, 3D Studio, Milkshape, and OBJ
between others. Second, AC3D is small and lightweight. Full installation
has below 7 Mb. And finally, AC3D has all editing resources you will ever
need. I only see 2 problems with AC3D: it's shareware and it is for Intel
machines, not Apple.
has below 7 Mb. Third, AC3D format is supported by 'Progressive Fans'
(http://www.terra.es/personal3/atoniman/) so I can view my models directly
from Total Commander (http://www.ghisler.com/). And finally, AC3D has all
editing resources you will ever need. I only see 2 problems with AC3D:
it's shareware and it is for Intel machines, not Apple.


Tips & Tricks:
Expand Down
12 changes: 10 additions & 2 deletions lib/XPlane/Convert/AC3Dgen.pm
Expand Up @@ -109,6 +109,8 @@ sub AC3Dgen {
}

push @{$ver[$part]}, [@v];
} elsif ($lval =~ /_is_left\[(\d+)\]/) {
wparm (\@wng, $1, 'is_left', $rval);
}
}
close TXT;
Expand Down Expand Up @@ -159,7 +161,7 @@ sub AC3Dgen {
print STDERR "\n", '#'x78, "\n",
"No airfoil definitions found for:\n\n";
foreach my $fail (sort { lc $a cmp lc $b} keys %fails) {
printf STDERR "%s\n", $fail;
printf STDERR "'%s'\n", $fail;
}
print STDERR "\nPlease describe them in 'airfoil.lst' file found in 'data' sub-directory.\n",
'#'x78, "\n";
Expand Down Expand Up @@ -188,9 +190,15 @@ EOH

$wing{arm} = $arm[$ind];
$wing{filehandle} = \*AC3D;
$wing{is_right} = $ind % 2;
$wing{material} = 0;

if (defined $wing{is_left}) {
$wing{is_right} = $wing{is_left} ? 0 : 1;
delete $wing{is_left};
} else {
$wing{is_right} = $ind % 2;
}

# left vstab
$wing{dihed} = 180 - $wing{dihed} if $ind == 18;

Expand Down
3 changes: 2 additions & 1 deletion lib/XPlane/GetFoil.pm
Expand Up @@ -28,13 +28,14 @@ use strict;
use Exporter;
use vars qw(@ISA @EXPORT);

use FindBin qw($RealBin);
use File::Basename;
use File::Spec::Functions;

@ISA = qw(Exporter);
@EXPORT = qw(getfoil);

use constant DATA => 'data';
use constant DATA => catfile ($RealBin, 'data');
use constant SPEC => 'airfoil.lst';


Expand Down
5 changes: 3 additions & 2 deletions models/README.txt
Expand Up @@ -3,7 +3,7 @@ Useful template and just sample models.
Templates:

* 'fusepipe.ac' is the first thing Plane-Maker creates for you. Do whatever
you want with it in AC3D, and then import to ACF.
you want with it in AC3D, and then import to ACF. (this one has 20 sections!)
(always remember to not to add nor delete vertices/surfaces!)
* 'wheel.ac' 1x1x1 cylinder that you can rescale to desired size and make
aircraft tires. Useful until ACFTools get "gear extractor" feature :)
Expand All @@ -13,7 +13,8 @@ Samples:
* '747.ac' - Boeing 747-400 from 'Aircraft/Heavy Metal'
* 'Columbia.ac' - Columbia 400 from 'Aircraft/General Aviation'
(pay attention to propeller blades :)
* 'Seabee.ac' - Republic RC-3 "Superbee" (model by Tracy Walker)
* 'SpaceShipOne.ac' - two-in-one: 'White Knight' with attached
'Space Ship One' from 'Aircraft/Space Ships'
'Space Ship One' from 'Aircraft/Space Ships' (model by Curt Boyll)

NOTE: you CAN'T import parts from samples to ACF as they are optimized!

0 comments on commit 74c8696

Please sign in to comment.