标签:
基于OpenSCAD的一个盒子造型,可以用于了解OpenSCAD的造型语言。
这个盒子的尺寸是为WRTnode(http://wrtnode.com/)设计的,可以输出STL后通过3D打印机打印出来直接使用(注意:不同3D打印机的输出效果和间歇、材料收缩的公差不同,请自行根据情况调整,否则组装不上喔!)。
WRTnode(http://wiki.wrtnode.com/index.php?title=Main_Page/zh-cn)是一个开源的智能路由器开发板,可以运行OpenWRT开源智能路由器操作系统,功能相当的强大。该系统是基于Linux内核的,很多Linux程序都可以运行,还支持Python和LUA脚本,也可以将该固件刷到很多市售的家用路由器上,从而增强其功能。目前在售的极路由、小米路由等智能路由都是基于OpenWRT定制而成。
原始的OpenSCAD代码如下:
//WRTnode智能路由器,盒子,防雨淋型(垂直安装) //Author:openthings@163.com, //copyright 2015-2025. //打印时注意比例变化,并且旋转向上。 //避免上部打印时无支撑塌陷。 //盖子单独打印,或放为两个模型。 //常量定义 athick=0.5; //盖子厚度 bthick=0.10; //盒壁厚度 bwidth=5.0; //内径净宽 bhight=1.5; //内径净高 blong_inter=5.5;//内径净长 //外径长度=底厚+内径+挡格+盖子厚度 blong=bthick+blong_inter+bthick+athick; //====================================== //盒子体,采用挖空切割方式造型。 difference() { //外盒 translate([0,0,0]) { color([0.8,0.8,0.8]) cube([blong,bwidth+bthick*2, bhight+bthick*2]); } //内盒,挖空。 translate([bthick,bthick,bthick]) { color([0.2,0.8,0.8]) cube([blong+1,bwidth,bhight]); } } //底部加强,在内部形成边角挡格。 translate([bthick,bthick,bthick]) { color([0.2,0.5,0.2]) cube([bthick,bwidth,bthick]); } translate([bthick,bthick,bhight]) { color([0.2,0.5,0.2]) cube([bthick,bwidth,bthick]); } translate([bthick,bthick,bthick]) { color([0.2,0.5,0.2]) cube([bthick,bthick,bhight]); } translate([bthick,bwidth,bthick]) { color([0.2,0.5,0.2]) cube([bthick,bthick,bhight]); } //盖子挡格。 translate([blong-athick,bthick,bthick]) { color([0.2,0.5,0.2]) cube([bthick,bwidth,bthick]); } translate([blong-athick,bthick,bhight]) { color([0.2,0.5,0.2]) cube([bthick,bwidth,bthick]); } //====================================== //盖子,单独打印。嵌入盒子内部,注意留公差。 //translate([2,0.0,0.0]){ translate([0,0,2]){ difference() { //盖子,挖空。 translate([0,bthick,bthick]) { color([0.5,0.5,0.5]) cube([athick-0.05,bwidth,bhight]); } translate([0.2,bthick*2,bthick*2]) { color([0.6,0.3,0.8]) cube([athick+1,bwidth-bthick*2, bhight-bthick*2]); } //通风口,挖空。================ //左侧出风口 translate([-0.1,0.5,1.1]) { color([1,0.8,0.8]) cube([0.8,1.5,0.2]); } translate([-0.1,0.5,0.75]) { color([1,0.8,0.8]) cube([0.8,1.5,0.2]); } translate([-0.1,0.5,0.4]) { color([1,0.8,0.8]) cube([0.8,1.5,0.2]); } //右侧进风口 translate([-0.1,2.8,0.4]) { color([1,0.8,0.8]) cube([0.8,0.8,0.4]); } translate([-0.1,4.0,0.4]) { color([1,0.8,0.8]) cube([0.8,0.3,0.9]); } translate([-0.1,4.5,0.4]) { color([1,0.8,0.8]) cube([0.8,0.3,0.9]); } //USB接口,挖空。 translate([-0.1,2.8,1.00]) { color([1,0.8,0.8]) cube([0.8,0.8,0.3]); } } } //}
标签:
原文地址:http://my.oschina.net/u/2306127/blog/379829