To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 14923
14922  |  14924
Subject: 
Re: Previous step color scaling
Newsgroups: 
lugnet.cad
Date: 
Wed, 17 Oct 2007 13:37:08 GMT
Viewed: 
7583 times
  
In lugnet.cad, Travis Cobbs wrote:
   If you have access to a *nix machine, or have installed the appropriate cygwin components on a Windows box, the following script should take a bunch of step files spit out from MLCad and insert the appropriate PREL3P commands in.

#! /bin/sh

prevfile=''
for thisfile in $*; do
    if [ "$prevfile" = "" ]; then
        echo 0 !PREL3P -ldconfig normal.ldr > faded.$thisfile
        cat $thisfile >> faded.$thisfile
    else
        echo 0 !PREL3P +codes none > faded.$thisfile
        echo 0 !PREL3P -ldconfig faded.ldr >> faded.$thisfile
        cat $prevfile >> faded.$thisfile
        echo 0 !PREL3P -ldconfig normal.ldr >> faded.$thisfile
        diff $prevfile $thisfile | egrep ^\> | cut -c3- >> faded.$thisfile
    fi
    prevfile=$thisfile
done

Example usage:

./fadesteps.sh CAR*.ldr

I tried the script out in Windows using cygwin, and it seems to work. Some observations:
  • Until prel3p 1.3 is released by Jim, I can’t be sure it works.
  • The output is a mixture of DOS and Unix line endings. The files generated by MLCAD have DOS line endings, and the extra lines added by the script have Unix line endings. LDView doesn’t have a problem with this, but prel3p might. In cygwin, this can be corrected by adding | unix2dos at the end of each echo command (right before the > or >>). The output files are then in pure DOS format.
  • The script would be a lot more useful if it actually included the prel3p execution as part of the script so that the output files were really faded, instead of just having prel3p meta-statements inside.
  • On that note, adding an LDView command line to the script would likely also be useful, assuming you want to use LDView to generate the step images.
I think prel3p 1.3 needs to be released before the script can be updated to automate things further.

--Travis



Message has 2 Replies:
  Re: Previous step color scaling
 
Here's a slightly tweaked version that seems to work OK with paths and filenames containing spaces: #! /bin/sh prevfile='' for thisfile in "$@"; do if "$prevfile" = "" ; then echo 0 !PREL3P -ldconfig normal.ldr > "faded.$thisfile" cat "$thisfile" >> (...) (17 years ago, 17-Oct-07, to lugnet.cad, FTX)
  Re: Previous step color scaling
 
And how can one create building instructions without access to a *nix machine (what is that anyway :-) and no cygwin components on a Windows PC? I am desperately looking for a way to create smooth building step images top view for a very large (...) (17 years ago, 30-Oct-07, to lugnet.cad, FTX)

Message is in Reply To:
  Re: Previous step color scaling
 
(...) If you have access to a *nix machine, or have installed the appropriate cygwin components on a Windows box, the following script should take a bunch of step files spit out from MLCad and insert the appropriate PREL3P commands in. #! /bin/sh (...) (17 years ago, 17-Oct-07, to lugnet.cad, FTX)

34 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