Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rocinante.scad
- //
- // Version 1, May 1, 2025
- // By: Stone Age Sculptor
- // License: CC0 (only this script, not the fonts)
- //
- // Version 2, May 2, 2025
- // By: Stone Age Sculptor
- // License: CC0 (only this script, not the fonts)
- // Changes:
- // Added 2D output for a svg file.
- // The length of the bar below the text "ROCINANTE"
- // is now automatically sized.
- // Note:
- // Use a OpenSCAD version of at least 2025,
- // and turn on all the Features in
- // the Preferences.
- // Then the shapes are not melted together.
- //
- // Version 3, May 2, 2025
- // By: Stone Age Sculptor
- // License: CC0 (only this script, not the fonts)
- // Changes:
- // Corrected the text:
- // SAVAGE -> SALVAGE
- // NOLDEN -> HOLDEN
- // BUNTON -> BURTON
- //
- // Find the fonts yourself!
- // I could not find the right fonts
- // with a free/open license.
- //
- // OpenSCAD can finetune the shapes of a font.
- // A text can be made heavier or lighter
- // with the offset() function, it
- // can be scaled in one direction,
- // and the intercharacter spacing
- // can be adjusted, the corners can
- // be made round, and so on.
- // Overall accuracy, 10 is very low, 500 is very high.
- $fn = 200;
- // ----------------------------------------
- // Use the fonts that you found here.
- // ----------------------------------------
- use <BankGothicLH Heavy.ttf>
- font1 = "BankGothicLH:style=Heavy";
- // use <FF-DIN-Black.ttf>
- // font2 = "DIN Black:style=Regular";
- use <645-font.otf>
- font2 = "DIN Pro:style=Condensed Black";
- // ----------------------------------------
- // Select 3D output or 2D output.
- // Set to 'true' for 2D output.
- Output_SVG = false;
- // The size of the base plate in millimeters (14" x 10.5").
- xsize = 14 * 25.4;
- ysize = 10.5 * 25.4;
- // The distance between the outer edge and the rectangle.
- edge_outer = 9;
- // The width of the rectangle.
- edge_linewidth = 4;
- // The thickness of the base plate.
- thickness_plate = 10;
- // The thickness of the text.
- thickness_print = 2;
- // The width of the bar below the Rocinante text.
- bar_width = 4;
- // The diameter of the circles in the text.
- circle_diameter = 4;
- // The distance between the edge and the center of a hole.
- hole_offset = 23;
- // The diameter of the hole that goes through and through.
- hole_diameter = 3;
- // The diameter of the wider part of the hole.
- hole_wider = 10;
- // The depth of the wider part of the hole.
- depth_wider = 3;
- // Helper value to avoid rounding errors.
- epsilon = 0.001;
- if(Output_SVG)
- {
- // Keep everything in 2D.
- // A OpenSCAD version of at least 2025 is required
- // with all the features turned on.
- // Only that way the shapes will be as seperate parts
- // in the svg file.
- color("LightBlue")
- BasePlate2D();
- color("Green")
- Print2D();
- // Add the shapes for the holes.
- // They are not combined
- // to keep the shapes separated.
- color("Purple")
- PositionHoles()
- circle(d=hole_wider);
- color("Red")
- PositionHoles()
- circle(d=hole_diameter);
- }
- else
- {
- // A 3D model.
- // The base plate, with the holes removed.
- color("Gray")
- {
- difference()
- {
- // The base plate.
- linear_extrude(thickness_plate)
- BasePlate2D();
- // Remove the holes.
- linear_extrude(100,center=true)
- PositionHoles()
- circle(d=hole_diameter);
- translate([0,0,thickness_plate-depth_wider])
- linear_extrude(100)
- PositionHoles()
- circle(d=hole_wider);
- }
- }
- // The print.
- color("Silver")
- {
- // The print is sunk a little into the base plate,
- // to be sure that they connect.
- translate([0,0,thickness_plate-epsilon])
- linear_extrude(thickness_print+epsilon)
- Print2D();
- }
- }
- // A small helper module to generate the
- // location for the holes.
- module PositionHoles()
- {
- for(xm=[-1,1],ym=[-1,1])
- {
- x = xm*(xsize/2-hole_offset);
- y = ym*(ysize/2-hole_offset);
- translate([x,y])
- children();
- }
- }
- // The base plate as a 2D shape.
- module BasePlate2D()
- {
- // The base plate.
- square([xsize,ysize],center=true);
- }
- // The Print2D is all the text and the rectangle
- // as 2D shapes.
- // But not the base plate and not the holes.
- module Print2D()
- {
- // The rectangle.
- difference()
- {
- x1 = xsize-2*edge_outer;
- y1 = ysize-2*edge_outer;
- x2 = x1 - 2*edge_linewidth;
- y2 = y1 - 2*edge_linewidth;
- square([x1,y1],center=true);
- square([x2,y2],center=true);
- }
- // The size and font are set in the module "Rocinante()".
- translate([0,70])
- Rocinante();
- // This position and the length of the bar
- // could be calculated with the new textmetrics()
- // function.
- //
- // This is with numbers that are visually finetuned:
- // translate([1.56,47])
- // square([286.8,bar_width],center=true);
- //
- // This is by trying to be smart with the resize() function.
- // It might not work for every font.
- // The 'E' at the end might not have the same length for
- // the horizontal bars, therefor the text is combined with
- // a mirrored text.
- translate([0,47])
- resize([0,bar_width],auto=false)
- hull()
- {
- Rocinante();
- mirror([0,1,0])
- Rocinante();
- }
- translate([0,15])
- text("AN INDEPENDENT SHIP",font=font2,size=12,spacing=1.1,halign="center");
- translate([0,-2])
- text("OWNED & OPERATED BY",font=font2,size=12,spacing=1.1,halign="center");
- translate([0,-34])
- text("JAMES HOLDEN NAOMI NAGATA",font=font2,size=15,spacing=1.05,halign="center");
- translate([0,-54])
- text("ALEX KAMAL AMOS BURTON",font=font2,size=15,spacing=1.05,halign="center");
- translate([0,-86])
- text("A LEGITIMATE SALVAGE",font=font2,size=14,spacing=1.05,halign="center");
- // Not every font might have the definition
- // for the circle, therefor they are
- // just circles and visually positioned.
- translate([0.7,-26.7])
- circle(d=circle_diameter);
- translate([-7,-46])
- circle(d=circle_diameter);
- }
- // A seperate module for the text "ROCINANTE",
- // to be able to automatically set the length
- // of the bar below the text.
- //
- // The valign="center" is required for a mirror(),
- // which is used to automatically create the length of the bar
- // below this text.
- module Rocinante()
- {
- // The parameter "spacing" is the intercharacter spacing.
- // It is default 1.
- text("ROCINANTE",font=font1,size=32,spacing=0.98,halign="center",valign="center");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement