LDraw.org Discussion Forums
Get flex out there - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Get flex out there (/thread-2696.html)

Pages: 1 2 3


Call for reviews Re: Get flex out there - Tim Gould - 2011-12-23

OK. Please review http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/22296.dat.

Once it's done I'll upload all the others. They'll all be as right or wrong as this one.

Tim


Other part families Re: Get flex out there - Tim Gould - 2012-01-01

What other parts need a similar treatment? I've already modded the code to deal with flexibile hose with

0 Technic Ribbed Hose XX Ribs

but it's easy to modify for other standardised parts.

Tim

PS. perl code below for anyone who wishes to do their own sets
Code:
use POSIX;
sub round {
    return(floor(0.5+$_[0]));
}

# Auto generation file prefix (suffix is length)
$fpre="79c";
$author="Timothy Gould [timgould]";
#Description prefix
$pdesc="Technic Ribbed Hose ";
#Description suffix
$ldesc=" Ribs";

@length=();
foreach $i (2..30) {
    push @length, round(10*$i/3.1)
}

# Length => Part number, Length => Part number, ...
%specno = (13=>71952);

foreach $l (@length)
{
    $id=sprintf("%02d",$l); # Ensure space for two characters (with 0)
    $tlen=sprintf("%2d",$l); # Ensure space for two characters (no 0)
    if (exists $specno{$l}) {
    # If there's a special name
    $fname=$specno{$l}.".dat";
    } else {
    # Otherwise
    $fname=$fpre.$id.".dat";
    }
    # Set the part description
    $partdesc="$pdesc$tlen$ldesc";

    print $fname." => ".$partdesc."\n";

    # Length of a segment
    $lseg=6.2;
    # Start segment (for centering)
    $sseg=($l-1)/2*$lseg;

    # Generate the body of the part
    $body="";
    # First segment
    $y=$sseg;
    $body=$body.sprintf("1 16 %.1f 0 0 0 1 0 1 0 0 0 0 -1 79.DAT\n", $y);
    # Middle segments
    foreach $i (1..($l-2)) {
    $y=$sseg-$i*$lseg;
    $body=$body.
        sprintf("1 16 %.1f 0 0 0 -1 0 1 0 0 0 0 1 80.DAT\n",$y);
    }
    # Last segment
    $y=-$sseg;
    $body=$body.sprintf("1 16 %.1f 0 0 0 -1 0 1 0 0 0 0 1 79.DAT\n",$y);

# Make the part text
$mask="0 $partdesc
0 Name: $fname
0 Author: $author
0 !LDRAW_ORG Unofficial_Part
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 BFC CERTIFY CCW

$body
";
# Write the part
    open(FIL,">$fname");
    print FIL $mask;
    close(FIL);
}

$no=$#length+1;
print "Generated $no parts\n";



Re: Get flex out there - Joshua Delahunty - 2013-04-16

Tim Gould Wrote:Ahhhh... with all the sense that entails.

Do you know more than these 3?

Tim

5L = 76307, 6L = 76279, 7L = 76289, ...

76307 should be 70859

70859 Outer cable for TECHNIC 40mm
47040 Outer cable 40mm, red
47042 Outer cable 40mm, blue
47420 Outer cable 40mm, yellow
51976 Outer cable 40mm, dark stone grey
76307 Outer cable 40mm, dark grey

76279 should be 70860 (76279 is Outer cable 48mm, black)

76289 should be 70861 (76289 is Outer cable 4mm, dark grey)

-- joshua