To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 225
224  |  226
Special: 
[DAT] (requires LDraw-compatible viewer)
Subject: 
Re: Noting gaps in parts sequences
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 22 Feb 1999 21:06:49 GMT
Viewed: 
1139 times
  
In lugnet.cad.dev, blisses@worldnet.att.net (Steve Bliss) writes:
[...]
A utility to create DAT files of these bricks from text strings would be
handy. Probably would be a very short Perl macro, since the bricks are
all the same name, with the alphanumeral appended before the .dat
extension.  Assuming Perl could increment the X position based on the
character's position in the string.  In BASIC, it would be

Sub Main(ByVal sMsg As String)
  Dim i As Integer

  For i = 1 to Len(sMsg)
     Print "1 16 " + Str$(i * 20) + " 0 0 1 0 0 0 1 0 0 0 1 3005-" _
           + LCase$(Mid$(sMsg, i, 1)) + ".dat"
  Next i
End Sub

... ignoring niceties such as centering the text, breaking it up into
multiple lines, etc.

Cool -- that's a neat and extremely low-effort way to get labels!  Here's one
way to write the program in Perl (also handling spaces and Æ=>AE):


$ cat datstart
#!/usr/local/bin/perl5 -w

my %brick = ( ' ' => "3005",
              'Æ' => "3005-AE",
              map {$_ => "3005-$_"} ('0'..'9', 'A'..'Z') );

print "0 @ARGV (needs work)\n",
      "0 File: {part number}.dat\n",
      "0 Author: {author name}\n",
      "0 Unofficial Element\n\n";

my @letters = map {$brick{uc($_)} || $brick{' '}} split(//, join(' ', @ARGV));

for my $I (0..$#letters)
{
   print "1 16 @{[$I*20]} 0 0 1 0 0 0 1 0 0 0 1 $letters[$I].dat\n";
}


$ datstart steve bliss
0 steve bliss (needs work)
0 File: {part number}.dat
0 Author: {author name}
0 Unofficial Element

1 16 0 0 0 1 0 0 0 1 0 0 0 1 3005-S.dat
1 16 20 0 0 1 0 0 0 1 0 0 0 1 3005-T.dat
1 16 40 0 0 1 0 0 0 1 0 0 0 1 3005-E.dat
1 16 60 0 0 1 0 0 0 1 0 0 0 1 3005-V.dat
1 16 80 0 0 1 0 0 0 1 0 0 0 1 3005-E.dat
1 16 100 0 0 1 0 0 0 1 0 0 0 1 3005.dat
1 16 120 0 0 1 0 0 0 1 0 0 0 1 3005-B.dat
1 16 140 0 0 1 0 0 0 1 0 0 0 1 3005-L.dat
1 16 160 0 0 1 0 0 0 1 0 0 0 1 3005-I.dat
1 16 180 0 0 1 0 0 0 1 0 0 0 1 3005-S.dat
1 16 200 0 0 1 0 0 0 1 0 0 0 1 3005-S.dat


If you wanted to use simplified mockup files, just use the header:

0 {Part Name} (needs work)
0 File: {part number}.dat
0 Author: {Author name}
0 Unofficial Element

If there's no obvious part number stamped on the part, you'd want to
coordinate with the part-numbering police squad to avoid mis-matches.

Oops, you're getting ahead of me.  :)  I just wanted to toss out a general
suggestion that I thought people might find useful.  I wish I could help do
some of the actual work toward this, but I'll have to leave it to someone who
understands the in's and out's better (assuming they find it useful, which
they may not).

--Todd



Message has 2 Replies:
  Re: Noting gaps in parts sequences
 
(...) '8' and '9' aren't currently defined. Also, don't forget to handle other undefined characters (maybe the above does this?) (...) Could {part number} and {author name} be turned into arguments, as well? Actually, if you have a generic app which (...) (25 years ago, 22-Feb-99, to lugnet.cad.dev)
  Re: Noting gaps in parts sequences
 
(...) Garrgh! Monkey-florkin spelling checker always converts 'I' to 'I' and won't let me fix it! >%^( --Todd (25 years ago, 22-Feb-99, to lugnet.cad.dev)

Message is in Reply To:
  Re: Noting gaps in parts sequences
 
(...) It hasn't been modeled yet because I wanted to get the other parts released without waiting for the oilcan. Then I got distracted. It will be a bit more challenging than the other tools, but now that I've got the LDAO Lathe, and have some (...) (25 years ago, 22-Feb-99, to lugnet.cad.dev)

9 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR