Skip to content

Instantly share code, notes, and snippets.

@Spiritdude
Last active November 1, 2018 16:20
Show Gist options
  • Save Spiritdude/1f1c1308d119e5787ae31690e266198a to your computer and use it in GitHub Desktop.
Save Spiritdude/1f1c1308d119e5787ae31690e266198a to your computer and use it in GitHub Desktop.
// title : CTC Label
// author : Rene K. Mueller
// license : MIT License
// description: create your own label plate
// date : 2018/11/01
// file : ctc_label.jscad
function main() {
var param = { thickness: 3, name: "CTC DIY I3 Pro B" };
var o = []; // our stack of objects
var l = []; // our stack of line segments (when rendering vector text)
var p = []; // our stack of extruded line segments
// -- render name & extrude
l = vector_text(0,0,param.name);
l.forEach(function(s) {
p.push(rectangular_extrude(s, { w:param.thickness*1.5, h:param.thickness*2 }));
});
o.push(union(p).scale(0.53).translate([4,0,0]));
var t = 1;
o.push(cube({size: [152,3,t] }).translate([0,-3,0]));
// -- washer(s) for M3
var w = difference(cylinder({d:8, h:t}),cylinder({d:3.2, h:t}));
o.push(w.translate([-3,-1.5,0]),w.translate([157.5-3,-1.5,0]));
return union(o).translate([-75,0,0]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment