OpenSCAD User Manual/Libraries

出典: フリー教科書『ウィキブックス(Wikibooks)』

Here is a collection of shape/part libraries that you can use in your OpenSCAD design. (see the include and use command)

Shapes by Catarina Mota[編集]

Contains the following modules:

(Included in the MCAD distro, see below)

(All these modules are 3D shapes despite some of them having 2D names)

  • box(width, height, depth);
  • roundedBox(width, height, depth, factor);
  • cone(height, radius);
  • oval(width, height, depth);
  • tube(height, radius, wall);
  • ovalTube(width, height, depth, wall);
  • hexagon(height, depth);
  • octagon(height, depth);
  • dodecagon(height, depth);
  • hexagram(height, depth);
  • rightTriangle(adjacent, opposite, depth);
  • equiTriangle(side, depth);
  • 12ptStar(height, depth);

Shapes by Giles Bathgate[編集]


  • triangle(radius)
  • reg_polygon(sides,radius)
  • pentagon(radius)
  • hexagon(radius)
  • heptagon(radius)
  • octagon(radius)
  • nonagon(radius)
  • decagon(radius)
  • hendecagon(radius)
  • dodecagon(radius)


  • cone(height, radius, center = false)
  • oval_prism(height, rx, ry, center = false)
  • oval_tube(height, rx, ry, wall, center = false)
  • cylinder_tube(height, radius, wall, center = false)
  • tubify(radius,wall) Tubifies any regular prism
  • triangle_prism(height,radius)
  • triangle_tube(height,radius,wall)
  • pentagon_prism(height,radius)
  • pentagon_tube(height,radius,wall)
  • hexagon_prism(height,radius)
  • heptagon_prism(height,radius)
  • octagon_prism(height,radius)
  • nonagon_prism(height,radius)
  • decagon_prism(height,radius)
  • hendecagon_prism(height,radius)
  • dodecagon_prism(height,radius)
  • torus(outerRadius, innerRadius)
  • triangle_pyramid(radius)
  • square_pyramid(width,height,depth)

Metric Fasteners by Giles Bathgate[編集]

All dimensions are proportional to the dia, so for example cap_bolt(3,15) will produce a M3 cap bolt with a 15mm threaded section.

  • cap_bolt(dia,len)
  • csk_bolt(dia,len)
  • washer(dia)
  • flat_nut(dia)
  • bolt(dia,len)
  • cylinder_chamfer(r1,r2)
  • chamfer(len,r)

MCAD library[編集]

(Originally from

(The following is taken from the README, follow the link for the latest version)

Currently Provided Tools:

  • gears.scad (Old version):
    • gear(number_of_teeth, circular_pitch OR diametrical_pitch, pressure_angle OPTIONAL, clearance OPTIONAL)
  • motors.scad:
    • stepper_motor_mount(nema_standard, slide_distance OPTIONAL, mochup OPTIONAL)

Other tools (alpha quality):

  • nuts_and_bolts.scad: for creating metric and imperial bolt/nut holes
  • bearing.scad: standard/custom bearings
  • screw.cad: screws and augers
  • materials.scad: color definitions for different materials


  • math.scad: general math functions
  • constants.scad: mathematical constants
  • curves.scad: mathematical functions defining curves
  • units.scad: easy metric units
  • utilities: geometric functions and misc. useful stuff


  • 2Dshapes.scad: 2D Shapes Library
    • ngon(sides, radius, center=false)
    • complexRoundSquare(size,rads1=[0,0], rads2=[0,0], rads3=[0,0], rads4=[0,0], center=true)
    • roundedSquare(pos=[10,10],r=2)
    • ellipsePart(width,height,numQuarters)
    • donutSlice(innerSize,outerSize, start_angle, end_angle)
    • pieSlice(size, start_angle, end_angle) **size in radius(es)
    • ellipse(width, height)
  • 3d_triangle.scad: Primitives Solid with Trinagles
  • boxes.scad:
    • roundedBox([width, height, depth], float radius, bool sidesonly)
  • fonts.scad: Font Functions
  • gridbeam.scad: GridBeam Library
    • zBeam(segments) - create a vertical gridbeam strut 'segments' long
    • xBeam(segments) - create a horizontal gridbeam strut along the X axis
    • yBeam(segments) - create a horizontal gridbeam strut along the Y axis
    • zBolt(segments) - create a bolt 'segments' in length
    • xBolt(segments)
    • yBolt(segments)
    • topShelf(width, depth, corners) - create a shelf suitable for use in gridbeam structures width and depth in 'segments', corners == 1 notches corners
    • bottomShelf(width, depth, corners) - like topShelf, but aligns shelf to underside of beams
    • backBoard(width, height, corners) - create a backing board suitable for use in gridbeam structures width and height in 'segments', corners == 1 notches corners
    • frontBoard(width, height, corners) - like backBoard, but aligns board to front side of beams
    • translateBeam([x, y, z]) - translate gridbeam struts or shelves in X, Y, or Z axes in units 'segments'
  • hardware.scad:
  • layouts.scad: Layout Library
    • list(iHeight)
    • grid(iWidth,iHeight,inYDir = true,limit=3)
  • lego_compatibility.scad:
    • block(width,length,height,axle_hole=false,reinforcement=false, hollow_knob=false, flat_top=false, circular_hole=false, solid_bottom=true, center=false)
  • libtriangles.scad:
  • multiply.scad: Multiplication along certain curves
    • spin(no, angle=360, axis=Z)
    • linear_multiply(no, separation, axis=Z)
  • polyholes.scad: Using this holes should come out approximately right when printed
    • polyhole(h, d)
  • servos.scad: Servo outline library
    • alignds420(position, rotation, screws = 0, axle_lenght = 0)
  • stepper.scad: A nema standard stepper motor module.
  • teardrop.scad: This script generates a teardrop shape at the appropriate angle to prevent overhangs greater than 45 degrees. The angle is in degrees, and is a rotation around the Y axis. You can then rotate around Z to point it in any direction. Rotation around X or Y will cause the angle to be wrong.
    • teardrop(radius, length, angle)
  • transformations.scad:
    • local_scale(v, reference=[0, 0, 0])
  • triangles.scad: Simple triangles library
    • triangle(o_len, a_len, depth) Standard right-angled triangle
    • a_triangle(tan_angle, a_len, depth) Standard right-angled triangle (tangent version)
  • trochoids.scad:
    • epitrochoid(R, r, d, n, thickness)
    • hypotrochoid(R, r, d, n, thickness)
    • epitrochoidWBore(R, r, d, n, p, thickness, rb)
    • epitrochoidWBoreLinear(R, r, d, n, p, thickness, rb, twist)
    • epitrochoidLinear(R, r, d, n, p, thickness, twist)
    • hypotrochoidWBore(R, r, d, n, p, thickness, rb)
    • hypotrochoidWBoreLinear(R, r, d, n, p, thickness, rb, twist)
    • hypotrochoidLinear(R, r, d, n, p, thickness, twist)
  • unregular_shapes.scad: Give a list of 4+4 points (check order) to form an 8 point polyhedron
    • connect_squares(points)

ISO-standard screw threads[編集]

Metric and inch dimensions - ISO-standard thread profiles, for both external threads (bolt) and internal threads (nut) -- the clearances are slightly different between the two.

OpenSCAD Pinball Parts library[編集]

A set of pinball parts models for pinball design work. Includes models for 3d printing of the parts, 3d descriptions of mount holes for CNC drilling and 2d descriptions of parts footprint.

  • popbumpers
  • standup targets
  • flippers
  • lane guides
  • plunger & launch lane
  • drop targets
  • posts
  • studs
  • vertical up kicker