Skip to content

Latest commit

 

History

History
125 lines (112 loc) · 3.64 KB

nuts-bolts.md

File metadata and controls

125 lines (112 loc) · 3.64 KB

Nuts and Bolts


List of Functions

BoltProfile( ... )create profile
Bolt( profile )generate bolt
BoltPanelHole( profile )generate 2D holes for panel mounting
NutProfile( ... )create profile
Nut( profile )generate nut

BoltProfile( ... )

model user defined model name
shape = "hex" shape of head: "hex", "square" or "round"
feature = "none" feature on head: "none", "minus", "plus" or "hex"
shaftDiameter shaft diameter
length length, exclusing head
headDiameter head diameter
headThickness head thickness
return KVTree profile

Bolt( profile )

profilebolt profile to display

BoltPanelHole( profile )

profilebolt profile to generate panel holes for

NutProfile( ... )

model user defined model name
shape = "hex" shape of head: "hex", "square" or "round"
boltDiameter inside diameter
nutDiameter outside diameter
thickness thickness
returnKVTree profile

Nut( profile )

profilenut profile to display

Data Structure

type    : "bolt"
model   : "esV"
diameter: 5
length  : 20
head    = shape    : "hex"
          diameter : 10
          thickness: 3
          feature  : "none"
type        : "nut"
model       : "ella"
shape       : "hex"
boltDiameter: 5
nutDiameter : 8
thickness   : 3

Sample Code

photo

profile = BoltProfile(
    shape         = "hex",  // "hex" | "square" | "round" 
    feature       = "none", // "none" | "minus" | "plus" | "hex"
    shaftDiameter = 5,
    length        = 20,
    headDiameter  = 10,
    headThickness = 3 );
Bolt( profile );

translate( [0,-15,0] )
    linear_extrude( 3 )
    difference() {
        square( [10,10], center=true );
        BoltPanelHole( profile );
    }

translate( [30,0,0] ) {
                          featureVariation( "hex" );
    translate( [20,0,0] ) featureVariation( "square" );
    translate( [40,0,0] ) featureVariation( "round" );
}

translate( [0,-40,0] ) {
    nut1 = NutProfile( shape="hex",    boltDiameter=5, nutDiameter=8, thickness=3 );
    nut2 = NutProfile( shape="square", boltDiameter=5, nutDiameter=8, thickness=3 );
    nut3 = NutProfile( shape="round",  boltDiameter=5, nutDiameter=8, thickness=3 );
                          Nut( nut1 );
    translate( [10,0,0] ) Nut( nut2 );
    translate( [20,0,0] ) Nut( nut3 );
}

module featureVariation( shape ) {
    b1 = BoltProfile( shape=shape, shaftDiameter=3, length=15, headDiameter=6, headThickness=3 );
    Bolt( b1 );
    translate( [0,15,0] ) {
        b2 = BoltProfile( shape=shape, feature="minus", shaftDiameter=3, length=15, headDiameter=6, headThickness=3 );
        Bolt( b2 );
    }
    translate( [0,30,0] ) {
        b3 = BoltProfile( shape=shape, feature="plus", shaftDiameter=3, length=15, headDiameter=6, headThickness=3 );
        Bolt( b3 );
    }
    translate( [0,45,0] ) {
        b4 = BoltProfile( shape=shape, feature="hex", shaftDiameter=3, length=15, headDiameter=6, headThickness=3 );
        Bolt( b4 );
    }
}