Mark DiVecchio's O-Gauge Train Layouts

1992 Layout Page

2006 Layout Page

2009 Layout Page

P&LE Postcards by Howard Fogg 

Plasticville Buildings

Portable Layout Page

Train Clubs

Bing Track

Remote Train Control Program

YouTube Channel

OOK Radio Support

Technical Videos

3D Prints for my Layout

More RTC Videos

ADPCM - Playing clips from .mth sound files

White Tower Restaurant
3D Printer Project

RFID Train Detection


P&LE Locomotive Shop - McKees Rocks, PA

This Page last updated on .

(For more 3D prints, click here)
The sign is available on Thingiverse where you can customize it and create an stl file which can be sent to one of the on-line 3D print shops : https://www.thingiverse.com/thing:2312384 .
The P&LE logo is at:  https://www.thingiverse.com/thing:2468652

 My O scale model train layout represents the section of the Pittsburgh & Lake Erie Railroad between McKees Rocks and Youngstown. This wall section (stretcher bond brick pattern) will let you assemble a background flat of the McKees Rocks Locomotive Shop. This is version 2.1. Uses the OpenSCAD program.

This postcard is from the Howard Fogg P&LE series:




OpenSCAD program:  https://www.thingiverse.com/thing:2312384

I had to compress it lengthwise from 17 sections to 7 sections and I had to abbreviate the railroad name.

The OpenSCAD source code is below or you can download it from Thingiverse using the link above.

Prototype Photos

Many photos on the Internet, for example this one by D.W. Davidson, undated:

https://www.flickr.com/photos/dwdavidson/4880853220

This photo shows a much different scene than the Fogg painting. The Shops building is now gone.

I learned from a member of the NYC Historical Society that the round unfaded oval of bricks on each end of the prototype originally had a "New York Central System" logo. The P&LE was a wholly owned subsidiary of the NYC. That logo was removed when the P&LE was given its independence as the NYC and Pennsy were merged to form the Penn Central. In my alternate universe, the P&LE put their logo on the shops as the P&LE ran independently until 1992.

Here is a photo which shows the NYC logo (23 Feb 1974 - from my collection):

Unknown date:


Here is a complete wall section as shown in OpenSCAD:

Of course, you can change around any of the options and values to get all kinds of different walls and brick sizes.

The 3/8" bedding (space between the bricks) may be too small to see when printed in HO or N scale. The wall itself might be too thin for a good print - O & G scale walls should be solid enough to print.

The representation of the white paint and the lettering should not be printed (select "no" for show_white_banner_and_name). They will have to be painted on the final objects.

The glass block windows should be separately printed in a transparent or white PLA and could be back lighted. To print just the glass block windows, select "no" for all show options except select "yes" for show_glassblockwindow.

You will need 9 high wall sections and 8 short wall sections. You can get a high wall section by selecting "yes" for all show options except for show_glassblockwindow and show_white_banner_and_name. This should give you a wall with side relief (double wythe), cornice, roof flashing and foundation. There should be an opening for the glass block windows with a sill (rowlock brick pattern) underneath and a concrete header block above.

For the short wall section, turn off the side relief, roof, and cornice. Change the number of brick courses to 106 (down from 140).

Of course, you can change around any of the options and values to get all kinds of different walls and brick sizes.

Uses Build Plate from the Thingiverse library.

Original development using OpenSCAD 2015.03-3 then moved to 2017.01.20

I've printed (for O scale) and assembled the Shops. I made 4 tall sections and 3 short sections (rather than the 17 total on the original). In order to fit on my printer bed, I had to print each section in two pieces. The walls were spray painted in a red that looks like brick. The windows were printed in white PLA.

The name right now is letters printed on paper and attached to the building using double-sided tape. It follows the contour of the layers of brick. Someday (famous last words) I hope to spray paint the white on the bricks and use large decal letters. This font is close to the font used on the prototype but does not match exactly. I'll have to try to find out what font the P&LE used (maybe an NYC font?).

Assembled with model airplane cement which seems to work really well on PLA.

Individual 3D printed pieces of the walls

These photos don't look exactly square because of my poor photograpy skills. These walls were all painted in a red brick color

Tall wall, top section:

Cornice and corbels done as well as my abilities permitted. Individual bricks to scale.

Standard Brick Size in United States
In the United States, modern standard bricks are (controlled by American Society for Testing and Materials i.e. ASTM) about 8 × 3 5/8  × 2 1/4 inches (203 × 92 × 57 mm). The more commonly used is the modular brick 7 5/8  × 3 5/8  × 2 1/4 inches (194 × 92 × 57 mm). This modular brick of 7 5/8 with a 3/8 mortar joint eases the calculation of the number of bricks in a given run.” – Wikipedia


Tall wall, bottom section:

I painted the footing a concrete color. I printed the header over the window in black.


Short wall, top section:




Short wall, bottom section:


Window

I don't have a good photo of the window. The window is made up of what appear to be 6" x 6" glass blocks. The center of the window is some kind of vent which I painted black.

P&LE Logo

This is the P&LE logo. On my O scale model, a good size turned out to be 100mm in diameter. The 3D object was derived using the surface() OpenSCAD command along with a png version of the logo as found on the Internet. I created it as a 50mm circle originally so if you want a 100mm version, you will have to scale it up 200% in your slicer.

I used the 'cut' command in Slic3r to remove the background of the OpenSCAD stl file. I then created a 100mm background circle.

I printed the background using yellow PLA and I printed the rest of the logo in black PLA. That way, I didn't have to paint it.

To use this in N, HO or G scale, you will have to scale appropriately.

I've added the P&LE logo to Thingiverse here:  https://www.thingiverse.com/thing:2468652

Source code for letters "P&LERR" (print with black PLA):

$fn=48;
//
difference() {
    translate([0,0,5])
        scale([0.1, 0.1, 0.025])
            surface(file = "P&LE Logo 1000.png", center = true, invert = true);
    translate([0,0,2.5])
        cube([100,100,0.2],center=true);
}
translate([-1.5,0,2])
    cylinder(h=2, r=47, center=true);

Source code for yellow background (print with yellow PLA):
$fn=48 * 1;
cylinder(h=1, d=47, center=true);

On my Layout

In front of the building is my fleet of P&LE diesel engines. All MTH (SW-1500, 2x GP-7, GP38-2, and U28B).

The name right now is letters printed on paper and attached to the building using double-sided tape. It follows the contour of the layers of brick. Someday (famous last words) I hope to spray paint the white on the bricks and use large decal letters. This font is close to the font used on the prototype but does not match exactly. I'll have to try to find out what font the P&LE used (maybe an NYC font?).

I didn't mention earlier but the glass block windows were printed using white PLA. They could be backlit someday.

The P&LE logo is available for 3D printing on Thingiverse:




Source Code for the P&LE Locomotive Shops High Wall Section:


//
// Customizable P&LE McKees Rocks Shops High Wall Section
// Mark DiVecchio
// July 2017 V2.1
// Original development using OpenSCAD 2015.03-3
// then moved to 2017.01.20
//
// This SCAD script is licensed under a
// Creative Commons Attribution-NonCommercial 3.0 Unported License.
//
// V2.0 - added a support structure to give the wall some thickness.
// support structure includes holes for backlighting wiring
// V2.1 - support structure was useless. I removed it
//
/*
My model train layout represents the section of the Pittsburgh & Lake Erie Railroad
between McKees Rocks and Youngstown. This wall section will let you assemble a background
flat of the McKees Rocks Locomotive Shops. Many photos on the Internet, example:

https://www.flickr.com/photos/dwdavidson/4880853220

The representation of the white paint and the lettering should be not printed (turn off
show_white_banner_and_name). They will have to be painted on the final objects.

The glass block windows should be separately printed in a transparent PLA and could
be back lighted. To print just the glass block windows, select "no" for all options except
select "yes" for show_glassblockwindow.

You will need 9 high wall sections and 8 short wall sections. You can get a high wall
section by selecting "yes" for all show options except for show_glassblockwindow and
show_white_banner_and_name. This should give you a wall with side relief (double
wythe), cornice, roof flashing, and foundation. There should be an opening for the glass
block windows with a sill (rowlock brick pattern) underneath and a concrete header block
above.

For the short wall section, turn off the side relief, roof, and cornice. Change the number of
brick courses to 106 (down from 140).

Of course, you can change around any of the options and values to get all kinds of
different walls and brick sizes.

The 3/8" bedding may be too small to see when printed in HO or N scale. The wall itself
might be too thin for a good print in HO or N scale - O & G scale walls may be solid enough to print.

Uses Build Plate from the Thingiverse library.

Original development using OpenSCAD 2015.03-3 then moved to 2017.01.20

I've now completed the printing (for O scale) and assembly of the Shops.
I made 4 tall sections and 3 short sections (rather than the 17 total on the
original). In order to fit on my printer bed, I had to print each section
in two pieces. If you look at the code, you can see the setting that I used
for top/bottom sections of the tall/short walls. The walls were spray
painted in a red that looks like brick.The windows were printed in white PLA.

In front of the building in my layout photo is my fleet of P&LE diesel engines. All MTH (SW-1500, 2x GP-7, GP38-2, and U28B).

The name right now is letters printed on paper and attached to the building using double-sided tape. It follows the contour of the layers of brick. Someday (famous last words) I hope to spray paint the white on the bricks and use large decal letters. This font is close to the font used on the prototype but does not match exactly. I'll have to try to find out what font the P&LE used (maybe an NYC font?).

I've added the P&LE logo to Thingiverse here:
https://www.thingiverse.com/thing:2468652

My web page: http://www.silogic.com/trains/layout.html
*/
// http://www.silogic.com/trains/layout.html
//
$fn=32 * 1;
//
// CUSTOMIZING
//
// Show a Build Plate in Customizer. It will not be rendered. Set size below.
show_build_plate="yes"; //[yes,no]
// Print the Wall itself (a Stretcher bond brick pattern)
show_wall="yes"; //[yes,no]
// Print a foundation
show_foundation="yes"; //[yes,no]
// Print an extra layer of bricks (a double wythe) at the left & right vertical edges of the wall
show_relief="yes"; //[yes,no]
// Print the glass block window
show_glassblockwindow="no"; //[yes,no]
// Make a hole in the wall for the glass block window
show_glassblockwindowopening="yes"; //[yes,no]
// Print a sill (Rowlock brick pattern) under the glass block window
show_sill="yes"; //[yes,no]
// Print a concrete header block over the glass block window (a good idea if you use that window)
show_headerblock="yes"; //[yes,no]
// Print a double layer of bricks (a double wythe) along the roof line
show_roof="yes"; //[yes,no]
// Print flashing along the top of the wall
show_roof_flashing="yes"; //[yes,no]
// Print a cornice along the top of the wall
show_cornice="yes"; //[yes,no]
// Print three rows of emblems and corbels on the cornice
show_corbels="yes"; //[yes,no]
// Show the white painted area and the name "Pittsburgh & Lake Erie Locomotive Shop"- don't actually try to print this
show_white_banner_and_name="no"; //[yes,no]
/* [Model Railroad Scale] */
// Model Railroad Scale (3D printers may have a hard time with HO and N scale walls)
Scale = 48; //[160:N, 87:HO, 60:S, 48:O, 22.5:G]
/* [Brick & Bed Dimensions] */
// Bedding is the space filled with mortar between the bricks in Inches (3/8" is the most common)
BedSize = 0.375; //[0.3, 0.375, 0.4, 0.5]
// Also used as the depth of the mortar below the front brick surface

// Width of each Brick in Inches (Modular brick 7 5/8" is the most common)
BrickSize = 7.625; //[7, 7.125, 7.250, 7.50, 7.625, 8]

/*
Standard Brick Size in United States
“In the United States, modern standard bricks are (controlled by American Society
for Testing and Materials i.e. ASTM) about 8 × 3 5�8 × 2 1�4 inches (203 × 92 × 57 mm).
The more commonly used is the modular brick 7 5�8 × 3 5�8 × 2 1�4 inches (194 × 92 × 57 mm).
This modular brick of 7 5�8 with a 3�8 mortar joint eases the calculation of the
number of bricks in a given run.� – Wikipedia
*/
/*
To create a two piece print for larger gauges:
------Bottom Piece of tall wall:
courses = 74;
width = 42;
show_wall="yes"; //[yes,no]
show_foundation="yes"; //[yes,no]
show_relief="yes"; //[yes,no]
show_glassblockwindow="no"; //[yes,no]
show_glassblockwindowopening="yes"; //[yes,no]
show_sill="yes"; //[yes,no]
show_headerblock="yes"; //[yes,no]
show_roof="no"; //[yes,no]
show_roof_flashing="no"; //[yes,no]
show_cornice="no"; //[yes,no]
show_corbels="no"; //[yes,no]
show_white_banner_and_name="no"; //[yes,no]
------Top Piece of tall wall:
courses = 66;
width = 42;
show_wall="yes"; //[yes,no]
show_foundation="no"; //[yes,no]
show_relief="yes"; //[yes,no]
show_glassblockwindow="no"; //[yes,no]
show_glassblockwindowopening="no"; //[yes,no]
show_sill="no"; //[yes,no]
show_headerblock="no"; //[yes,no]
show_roof="yes"; //[yes,no]
show_roof_flashing="yes"; //[yes,no]
show_cornice="yes"; //[yes,no]
show_corbels="yes"; //[yes,no]
show_white_banner_and_name="no"; //[yes,no]
------bottom piece of short wall:
courses = 74;
width = 32;
show_wall="yes"; //[yes,no]
show_foundation="yes"; //[yes,no]
show_relief="no"; //[yes,no]
show_glassblockwindow="no"; //[yes,no]
show_glassblockwindowopening="yes"; //[yes,no]
show_sill="yes"; //[yes,no]
show_headerblock="yes"; //[yes,no]
show_roof="no"; //[yes,no]
show_roof_flashing="no"; //[yes,no]
show_cornice="no"; //[yes,no]
show_corbels="no"; //[yes,no]
show_white_banner_and_name="no"; //[yes,no]
------top piece of short wall:
courses = 32;
width = 32;
show_wall="yes"; //[yes,no]
show_foundation="no"; //[yes,no]
show_relief="no"; //[yes,no]
show_glassblockwindow="no"; //[yes,no]
show_glassblockwindowopening="no"; //[yes,no]
show_sill="no"; //[yes,no]
show_headerblock="no"; //[yes,no]
show_roof="yes"; //[yes,no]
show_roof_flashing="no"; //[yes,no]
show_cornice="no"; //[yes,no]
show_corbels="no"; //[yes,no]
show_white_banner_and_name="no"; //[yes,no]

--> Printed Horizontally (ie, flat on the print bed)
*/
/* [Wall Dimensions] */
// Number of layers of bricks vertically (courses) (must be even)
courses = 140; //[20:2:200] // originally 140 for complete wall;
// Number of bricks horizontally (stretchers)
width = 42; //[10:200] // originally 42;
// Number of bricks in the left and right side relief (wythe)
ReliefWidth = 5; //[4:25]
/* [Roof & Cornice Dimensions] */
// Number of courses in roof relief (double wythe) (must be even)
RoofCourses = 20; //[2:2:30]
// Number of courses in top cornice
CorniceCourses = 5; //[4:10]
// Number of Cornice top row designs (must be odd)
TopRowDesign = 11; //[9:2:21]
// Number of Cornice second row designs (must be even)
SecondRowDesign = 10; //[8:2:20]
// Number of corbels (must be odd)
Corbels = 9; //[7:2:19]

/* [Glass Block Size] */
// Glass Block Size in Inches (Square)
GlassBlockSize = 8; //[6,8,12]

/*
https://www.qualityglassblock.com/loose-glass-block/glass-block-sizes

Glass Block Types and Patterns Nominal Glass Block Sizes Exact Glass Block Sizes
Thickset 60 Decora and Vue 8" x 8" x 4" 7 3/4" x 7 3/4" x 3 7/8"
Thickset 90 Decora, Vue and Endura 8" x 8" x 4" 7 3/4" x 7 3/4" x 3 7/8"
Decora LX 6" x 6" x 4" 5 3/4" x 5 3/4" x 3 7/8"
8" x 8" x 4" 7 3/4" x 7 3/4" x 3 7/8"
12" x 12" x 4" 11 3/4" x 11 3/4" x 3 7/8"
*/
// Size of entire Glass Block Window Opening (measured in # of bricks)
/* [Glass Block Window Opening Dimensions] */
// Glass Block Window Opening width in # bricks (must be even)
WindowWidth = 16; // [6:2:26]
// Glass Block Window Opening height in # of brick courses
WindowCourses = 34;
// Bottom row of Glass Block Window Opening in # of brick courses from bottom of wall
WindowLower = 28;
//
// Size of the actual Glass Block Window (measured in # of glass blocks)
/* [Glass Block Window Dimensions] */
//Actual Glass Block Window width in # glass blocks
BlockWindowWidth = 14;
//Actual Glass Block Window height in # glass blocks
BlockWindowHeight = 16;
//
// Size & Lower Left Position of the small window laid into the glass block window
/* [Inlaid Frame Window Dimensions] */
// Width of Small Inlaid Windows in # of glass blocks - always constructed as two windows, each 1/2 of Width - width must be even
FrameWindowWidth = 6; //[2:2:10]
// Height of Small Inlaid Window in # of glass blocks
FrameWindowHeight = 4; // [2:10]
//Lower left corner of Small Inlaid Window (X) in # of glass blocks from left edge of Glass Block Window
FrameWindowLowerLeftX = 4; //[2:10]
//Lower left corner of Small Inlaid Window (Y) in # of glass blocks from bottom of Glass Block Window
FrameWindowLowerLeftY = 3; //[2:10]
//
/* [Foundation] */
// Height of foundation in # of brick courses (but it's really a solid concrete block)
Foundation = 6;
//
/* [Build Plate] */
// defaults to Prusa i3 Mk2 build plate size
//when Show Build Plate is set to "yes" this controls the build plate x dimension (in mm)
build_plate_x = 250; //[100:400]
//when Show Build Plate is set to "yes" this controls the build plate y dimension (in mm)
build_plate_y = 210; //[100:400]

// preview[view:south, tilt:top]

/* [Hidden] */
HeaderblockCourses = 3; // (but it's really a solid concrete block)
HeaderblockExtraWidth = 1;
inch=25.4;
// Calculate various values after all settings are set
// Size of each brick - in inches, converted to mm and then scaled
Xbrick = BrickSize * inch/Scale;
Ybrick = ((BrickSize - BedSize)/2) * inch/Scale;
Zbrick = 2.25 * inch/Scale; // 2 1/4 inches
//
bed = BedSize * inch/Scale; // converted to mm and then scaled
// Size of each block in Block Window
Xblock = GlassBlockSize * inch/Scale; // converted to mm and then scaled
Yblock = GlassBlockSize * inch/Scale;
Zblock = Zbrick*1; // in the real world, the glass blocks are 4" deep but here they are foreshortened in Z

print_part();

/////////////
// Modules //
/////////////

module print_part() {
//
// ASSEMBLE WALL
//
echo("Brick: Xbrick =" , Xbrick, " Ybrick = ", Ybrick, " Zbrick = ", Zbrick);
echo("bed =", bed);
echo("Wall: ", width=width, courses=courses);
if (show_build_plate=="yes") {
build_plate(build_plate_x, build_plate_y);
}
facade();
}

// complete wall with glass window opening, header block, sill, roof flashing and foundation
module facade () {
if (show_wall=="yes") {
difference(){
wall(Xbrick, Ybrick, width, courses, Zbrick, ReliefWidth);
if (show_glassblockwindowopening== "yes") {
windowopening(width/2 - WindowWidth/2, WindowLower, WindowWidth, WindowCourses);
}
if (show_glassblockwindowopening=="yes") {
// bed on left and right sides of window
// this fills in the empty grout line at left and right sides of the glass block window opening
color("beige", 1.0)
translate ([(width/2 - WindowWidth/2) * (Xbrick + bed) - bed, WindowLower * (Ybrick + bed) + bed, Zbrick - bed])
cube([bed, WindowCourses * (Ybrick + bed) - bed, bed]);
color("beige", 1.0)
translate ([((width/2 - WindowWidth/2)+WindowWidth) * (Xbrick + bed) - bed, WindowLower * (Ybrick + bed) + bed, Zbrick - bed])
cube([bed, WindowCourses * (Ybrick + bed) - bed, bed]);
}
}
}
// glass window header block - 3 bricks high, 1 brick wider than opening on each side
if (show_headerblock=="yes") {
color("black")
translate ([((width/2 - WindowWidth/2)-HeaderblockExtraWidth) * (Xbrick + bed), (WindowLower + WindowCourses) *(Ybrick + bed) + bed, 0])
cube([(WindowWidth+2) * (Xbrick + bed), HeaderblockCourses * (Ybrick + bed) - bed, Zbrick+bed]);
}

// Glass Blocks
if (show_glassblockwindow=="yes") {
glassblockwindow((width/2 - WindowWidth/2), WindowLower, WindowWidth, WindowCourses, BlockWindowWidth, BlockWindowHeight);
}

// Window Sill
if (show_sill=="yes") {
sill(Xbrick, Ybrick, Zbrick, width, WindowWidth);
}
// Roof
if (show_roof=="yes") {
roof(Xbrick, Ybrick, width, courses, Zbrick);
}
// Roof flashing
if (show_roof_flashing=="yes" && show_roof=="no" && show_relief=="yes") {
// Top black roof flashing on two brick deep wall
*color("black")
translate([-Xbrick,(Ybrick + bed) * courses + bed,0])
cube([(Xbrick + bed) * (width + 2), Ybrick, Zbrick*3 + bed]);
// for short roof only - no overhang on left & right
color("black")
translate([0,(Ybrick + bed) * courses + bed,0])
cube([(Xbrick + bed) * (width), Ybrick, Zbrick*3 + bed]);

}
if (show_roof_flashing=="yes" && show_roof=="no" && show_relief=="no") {
// Top black roof flashing on one brick deep wall
*color("black")
translate([-Xbrick,(Ybrick + bed) * courses + bed,0])
cube([(Xbrick + bed) * (width + 2), Ybrick, Zbrick*2 + bed]);
// for short roof only - no overhang on left & right
color("black")
translate([0,(Ybrick + bed) * courses + bed,0])
cube([(Xbrick + bed) * (width), Ybrick, Zbrick*2 + bed]);
}

// Foundation
if (show_foundation=="yes") {
foundation(Xbrick, Zbrick, width);
}
if (show_white_banner_and_name=="yes") {
// White Paint Band
BandCourses = 37;
BandLowerLeftY = WindowLower + WindowCourses + 6;
color("white", .8)
translate([bed, (Ybrick+bed)*BandLowerLeftY + bed, Zbrick])
cube([(Xbrick+bed)*width - bed -bed - bed, (Ybrick+bed)*(BandCourses),0.01]);
color("white", .8)
translate([0, (Ybrick+bed)*BandLowerLeftY + bed, Zbrick*2 + bed])
cube([(Xbrick+bed)*ReliefWidth - bed, (Ybrick+bed)*(BandCourses),0.01]);
color("white", .8)
translate([(Xbrick+bed)* (width-ReliefWidth), (Ybrick+bed)*BandLowerLeftY + bed, Zbrick*2 + bed])
cube([(Xbrick+bed)*ReliefWidth - bed, (Ybrick+bed)*(BandCourses),0.01]);
color("black")
translate([(Xbrick+bed) * ReliefWidth, (Ybrick+bed)*(BandLowerLeftY+9) + bed, Zbrick])
text("PIT", font="Arial", size=(BandCourses-18) * (Ybrick+bed) -bed, spacing=1.5);
//text("PITTSBURGH & LAKE ERIE RAILROAD LOCOMOTIVE SHOP", font="Arial", size=(BandCourses-18) * (Ybrick+bed) -bed, spacing=1);
}
}
// Mortar
module mortar(OffsetX, OffsetY, OffsetZ, Width, Courses, Depth){
// build the mortar between the bricks
// where:
// OffsetX,OffsetY are the X and Y coordinates of the lower left corner of the wall
// Width is the number of bricks wide for the wall
// Courses is the number of brick courses high for the wall
// Depth is the thickness of the mortar (mortar always starts at z=0)
color("beige", 1.0)
translate ([OffsetX + bed, OffsetY, 0])
cube([Width * (Xbrick + bed) - (3 * bed), Courses * (Ybrick + bed)/* + bed*/, Depth+OffsetZ]);
}

// Bricks
module bricks(OffsetX, OffsetY, OffsetZ, XBrick, YBrick, Width, Courses, ZBrick){
// build a wall of bricks (stretcher bond). From Wikipedia:
// All bricks in this bond are stretchers, with the bricks in each successive course staggered by half a stretcher.
// Headers are used as quoins on alternating stretching courses in order to achieve the necessary off-set
for (i = [0 : Courses - 1 ]) {
if (i/2 == floor(i/2)) {
for (j = [0 : Width - 1]) {
//echo("brick");
color("maroon")
translate([OffsetX + j*(XBrick + bed), OffsetY + i*(YBrick + bed) + bed, OffsetZ])
cube([XBrick, YBrick, ZBrick]);
}
}
//echo("1",OffsetX + (Width-1)*(XBrick + bed) + XBrick);
//echo("-",OffsetX + Width * XBrick + (Width -1) * bed);
if (i/2 != floor(i/2)) {
// echo("brick");
// left side edge-on brick
color("maroon")
translate([OffsetX + 0, OffsetY + i*(YBrick + bed) + bed, OffsetZ])
cube([YBrick, YBrick, ZBrick]);
for (j = [0 : Width - 2 ]) {
//echo("brick");
// middle bricks
color("maroon")
translate([OffsetX + j*(XBrick + bed) + (YBrick + bed), OffsetY + i*(YBrick + bed) + bed, OffsetZ])
cube([Xbrick, Ybrick, ZBrick]);
}
// right side edge-on brick
//echo("brick");
color("maroon")
translate([OffsetX + (Width - 1) * (XBrick + bed) + (YBrick + bed), OffsetY + i*(YBrick + bed) + bed, OffsetZ])
cube([YBrick, YBrick, ZBrick]);
}
//echo("2",OffsetX + YBrick + bed + (Width - 1) * (XBrick + bed) + YBrick);
}
}

// Window Opening
module windowopening(OffsetX, OffsetY, Width, Courses) {
// cut an opening into the brick wall for the glass block window
// must be difference() with wall()
echo("Window Opening:", OffsetX=(OffsetX * (Xbrick + bed)), OffsetY=OffsetY * (Ybrick + bed) + bed, Width=Width * (Xbrick + bed) - bed, Height=Courses * (Ybrick + bed) - bed);
// opening is cut with a extra Zbrick unit in each direction in order to get a clean opening in the preview
translate ([OffsetX * (Xbrick + bed), OffsetY * (Ybrick + bed) + bed, -Zbrick])
cube([Width * (Xbrick + bed) - bed, Courses * (Ybrick + bed) - bed, Zbrick * 3]);
}
// Glass Block Window and other window detail
module glassblockwindow(OffsetX, OffsetY, Width, Courses, Width1, Courses1) {
// build the Glass Block window
// all translate() have Z=0
echo("Glass Window --: ", OffsetX=(OffsetX * (Xbrick + bed)), OffsetY=OffsetY * (Ybrick + bed) + bed, Width=Width * (Xbrick + bed) - bed, Height=Courses * (Ybrick + bed) - bed);
color("white", 1.0)
translate ([OffsetX * (Xbrick + bed), OffsetY * (Ybrick + bed) + bed, 0])
cube([Width * (Xbrick + bed) - bed, Courses * (Ybrick + bed) - bed, Zblock - 4*bed]);
XCenter = (OffsetX * (Xbrick + bed)) + (Width * (Xbrick + bed) - bed)/2;
YCenter = (OffsetY * (Ybrick + bed) + bed) + (Courses * (Ybrick + bed) - bed)/2;
XLowerLeft = XCenter - (Width1/2*(Xblock + bed));
YLowerLeft = YCenter - (Courses1/2*(Yblock + bed));

echo("Glass Blocks: ", XCenter=XCenter, YCenter=YCenter);
echo("Glass Blocks: ", XLowerLeft=XLowerLeft, YLowerLeft=YLowerLeft);

for (i = [0 : Courses1 - 1 ]) {
for (j = [0 : Width1 - 1]) {
color("azure", 0.5)
translate([j*(Xblock + bed) + XLowerLeft, i*(Yblock + bed) + bed + YLowerLeft, 0])
cube([Xblock, Yblock, Zblock - 2*bed]);
}
}
// plain windows are usually 6 blocks wide and 4 blocks high, 2 panes of glass
color("slategray")
translate([FrameWindowLowerLeftX*(Xblock + bed) + XLowerLeft, FrameWindowLowerLeftY*(Yblock + bed) + bed + YLowerLeft, 0])
cube([Xblock*(FrameWindowWidth/2) + bed*(FrameWindowWidth/2 -1), Yblock*FrameWindowHeight + bed*(FrameWindowHeight-1), Zblock + bed-2*bed]);
color("slategray")
translate([(FrameWindowLowerLeftX + (FrameWindowWidth/2))*(Xblock + bed) + XLowerLeft, FrameWindowLowerLeftY*(Yblock + bed) + bed + YLowerLeft, 0])
cube([Xblock*(FrameWindowWidth/2) + bed*(FrameWindowWidth/2 -1), Yblock*FrameWindowHeight + bed*(FrameWindowHeight-1), Zblock + bed-2*bed]);
}
// Wall
module wall(Xbrick, Ybrick, Width, Courses, ZBrick, LeftRightReliefWidth){
// build the basic wall
// where:
// XBrick, YBrick & ZBrick are the dimensions of the brick
// Width is the number of bricks wide for the wall
// Courses is the number of brick courses high for the wall
bricks(0, 0, 0, Xbrick, Ybrick, Width, Courses, ZBrick);
mortar(0, 0, 0, Width, Courses, ZBrick-bed);
if (show_relief=="yes") {
// left side relief
bricks(0, 0, Zbrick + bed, Xbrick, Ybrick, LeftRightReliefWidth, Courses, ZBrick); // 5 bricks wide
mortar(0, 0, Zbrick, LeftRightReliefWidth, Courses, ZBrick); // 5 bricks wide
// right side relief
bricks((Xbrick + bed)* (Width - LeftRightReliefWidth), 0, Zbrick + bed, Xbrick, Ybrick, LeftRightReliefWidth, Courses, ZBrick); // 5 bricks wide
mortar((Xbrick + bed)* (Width - LeftRightReliefWidth), 0, Zbrick, LeftRightReliefWidth, Courses, ZBrick); // 5 bricks wide
}
}
// Roof
module roof(XBrick, YBrick, Width, Courses, ZBrick) {
// build the roof structure - cornice and corbels
// where:
// XBrick, YBrick & ZBrick are the dimensions of the brick
// Width is the number of bricks wide for the wall
// Courses is the number of brick courses high for the wall
// for all translate(), z = 0
// Fill
mortar(0, (YBrick + bed) * (courses - RoofCourses), Zbrick, Width, RoofCourses, ZBrick);
bricks (0, (YBrick + bed) * (courses - RoofCourses), Zbrick + bed, XBrick, YBrick, Width, RoofCourses, ZBrick);
if (show_roof_flashing=="yes") {
// Top black roof flashing
color("black")
translate([-XBrick,(YBrick + bed) * courses + bed,0])
cube([(XBrick + bed) * (Width + 2), YBrick, ZBrick*4 + bed]);
}
if (show_cornice=="yes") {
// Cornice - thicker and wider wall
mortar(-YBrick*2 - bed, (YBrick + bed) * (courses - CorniceCourses), 0, Width+2, CorniceCourses, ZBrick*3 - bed);
bricks(-YBrick*2 - bed, (YBrick + bed) * (courses - CorniceCourses), 0, XBrick, YBrick, Width+2, CorniceCourses, ZBrick *3);
}
if (show_corbels=="yes") {
// "dots"
for(p=[1:TopRowDesign]) {
color("brown")
//translate([*2.5*(XBrick+bed)+3*p*(XBrick+bed/*+3.3*/), (courses-2)*(Ybrick+bed), 0])
translate([(Width/(TopRowDesign+1))*p*(XBrick+bed), (courses-2)*(Ybrick+bed), 0])
//cube([Xbrick*2, Ybrick*2 + bed + bed, ZBrick*5]);
cylinder(r=2, h=ZBrick*3.1);
}
// rounded rectangles
for(m=[1:SecondRowDesign]) {
color("brown")
//translate([5*(XBrick + bed)+2*m*(XBrick+bed+2.8), (courses-15)*(YBrick+bed) + bed - YBrick - bed - bed, 0])
translate([(Width/(SecondRowDesign+1))*m*(XBrick+bed) - ((XBrick*1.2)/2), (courses-15)*(YBrick+bed) - YBrick - bed, 0])
minkowski() {
cube([XBrick*1.2, YBrick*1.5+(2 * bed), ZBrick*1.5]);
cylinder(r=2.0, h= ZBrick *1.1);
}
}
// Corbels
for(n=[1:Corbels]) {
color("brown")
//translate([6*(XBrick+bed)+2*n*(XBrick+bed+3), (courses-RoofCourses-1)*(YBrick+bed) + bed - YBrick - bed -bed, 0])
translate([(ReliefWidth*(XBrick+bed)) + ((Width - (ReliefWidth*2))/(Corbels+1))*n*(XBrick+bed) - XBrick, (courses-RoofCourses-1)*(YBrick+bed) + bed - YBrick - bed -bed, 0])
cube([XBrick*2, YBrick*2 + bed + bed, ZBrick*2]);
color("brown")
//translate([6*(XBrick+bed)+2*n*(XBrick+bed+3)+ Xbrick/2, (courses-RoofCourses-4)*(YBrick+bed) + bed, 0])
translate([(ReliefWidth*(XBrick+bed)) + ((Width - (ReliefWidth*2))/(Corbels+1))*n*(XBrick+bed) - Xbrick/2, (courses-RoofCourses-4)*(YBrick+bed) + bed, 0])
cube([XBrick, YBrick*2 + bed + bed, ZBrick*1.5]);
}
}
}
// Foundation
module foundation(XBrick, ZBrick, Width ) {
// build the foundation
// for all translate(), z=0
difference() {
color("beige", 1.0)
translate([0,-(Foundation*Ybrick),0])
cube([(XBrick + bed) * Width - bed, (Foundation*Ybrick), ZBrick*2 + bed]);
}
}
// Sill
module sill(XBrick, YBrick, ZBrick, Width, WinWidth) {
// build the sill under the window
// for all translate(), z=0
//
BrickCount = floor(WinWidth * ((XBrick+bed)/(ZBrick +bed)));
AdjXbed = ((WinWidth * (XBrick+bed) - bed) - (BrickCount * (ZBrick)))/(BrickCount-1);
echo ("Sill :", BrickCount=BrickCount, bed=bed, AdjXbed=AdjXbed);
for (k = [0 : BrickCount-1]) {
//echo("brick");
color("maroon")
translate([((Width/2 - WinWidth/2)) * (XBrick + bed) + k*(ZBrick + AdjXbed), (WindowLower-1) *(YBrick + bed) + bed, 0])
cube([ZBrick, YBrick, ZBrick*2.5]);
}
// bricks under sill
bricks(((Width/2 - WinWidth/2))*(XBrick + bed),0, ZBrick + bed, XBrick, YBrick, WinWidth, WindowLower-1, ZBrick);
mortar(((Width/2 - WinWidth/2))*(XBrick + bed),0, ZBrick, WinWidth, WindowLower-1, (ZBrick));
// mortar under the Sill
mortar(((Width/2 - WinWidth/2))*(XBrick + bed), (WindowLower-1)*(YBrick + bed) + bed, 0, WinWidth, ZBrick -bed -bed, (ZBrick*2) + bed);
}


module build_plate(manX,manY){
/*
Build Plate Library for Customizer by MakerBot
Published on January 23, 2013
www.thingiverse.com/thing:44094
*/

CenterX = (Xbrick + bed) * width/2;
CenterY = (Ybrick + bed) * courses/2;
translate([CenterX,CenterY,-.52])
%cube([manX,manY,1],center = true);

translate([CenterX,CenterY,-.5]){
for(i = [-(floor(manX/20)):floor(manX/20)]){
translate([i*10,0,0])
%cube([.5,manY,1.01],center = true);
}
for(i = [-(floor(manY/20)):floor(manY/20)]){
translate([0,i*10,0])
%cube([manX,.5,1.01],center = true);
}
}
}




This site prepared and maintained by Mark DiVecchio

email :  markd@silogic.com

SD&A HOME
 
 Mark's Home Page

The DiVecchio genealogy home page
The Frazzini genealogy home page

This site will be under construction for a while.