2.5 KiB
2.5 KiB
LibFile: battery-holder.scad
Functions and modules for creating battery holders
To use, add the following lines to the beginning of your file:
include <battery-holder.scad>
File Contents
Section: Batteries
Module: battery_case()
Usage:
- battery_case(n);
Description:
Generates a flexible battery holder for 'n' cylindrical batteries with complex features like wire channels, screw holes, and contact points.
Parts: This module constructs a battery holder with
- A main body with a cavity for each battery.
- Plastic springs for negative pole contact using the
sline
module. - Contact points (+ and -) for electrical connectivity.
- Wire channels for routing electrical connections.
- Screw holes for mounting.
- Engraving for battery orientation symbols.
Key Features:
- Chamfering of edges for a more finished look (
chamfered_cube
). - Deepening for better grip on batteries (optional).
- Wire Channels: Both longitudinal and transversal for wire routing.
- Spring: Utilizes
sline
to create a complex spring shape for battery contact. - Contact Points: Bulges for ensuring good electrical contact.
- Engraving: Symbols to indicate battery polarity.
Arguments:
By Position | What it does |
---|---|
n |
Number of battery slots to generate. (default: 1) |
l |
Length of each battery slot. (default: 65) |
d |
Diameter of the battery. (default: 18) |
hf |
Height factor for the battery holder relative to the battery diameter. (default: 0.75) |
r |
Radius for the plastic spring (calculated inside). (default: 4) |
shd |
Screw hole diameter. (default: 3) |
eps |
Epsilon for additional cavity space around the battery. (default: 0.28) |
el |
Extra length for the spring. (default: 0) |
xchan |
Relative positions for traversal wire channels. (default: [1/4, 3/4]) |
$fn |
Number of fragments for circles/cylinders for smoother curves. (default: 24) |
Example 1: Simple Case

include <battery-holder.scad>
battery_case(n=1,l=46.1,d=10.45,hf=0.84,shd=2,el=1,xchan=[0.5],eps=0);