3D打印的鸡蛋船仅售$ 15。 烹饪食谱

大家好!

图片

复活节结束了,在鸡蛋上印刷各种图案的主题变得不再那么重要了,但这并没有减少每个人都需要的鸡蛋船的需求,而且总是一年四季都这样:)

对于那些不知道的人,鸡蛋船是一种可以用普通的毡尖笔在任何球形物体上绘画的机器:鸡蛋,网球,圣诞树装饰。 该机制的概念是由设计师Bruce Shapiro于1990年发明的,不久前,著名的公司Evil Mad Scientist Laboratories以名称EggBot发行了该版本。 我们必须向邪恶的疯狂科学家实验室致敬,该项目已经开放,并允许将其用于其他egg bot的软件,甚至是在商业项目中。

以下是在输出中获得的艺术品:

图片


可以在任何矢量编辑器中绘制简单的图片,并且可以在python中创建复杂的几何对象。

这是此类程序的示例:
# Generate a 3200 x 800 geometrical pattern for Eggbot plotting # See http://www.egg-bot.com/ for info on the Eggbot # # Dan Newman, 2 January 2011 # dan dot newman at mtbaldy dot us # Public domain (http://creativecommons.org/licenses/publicdomain/) HEIGHT = float( 800.0 ) WIDTH = float( 3200.0 ) scale = WIDTH / ( 16.0 * 3 ) # 16 horizontal repeats epsilon = float(1.0e-5) # Relative moves for drawing the vertical elements DOWN = [[0.0, scale], [scale, 2*scale], [0.0, scale], [-scale, 2*scale]] UP = [[0.0, -scale], [scale, -2*scale], [0.0, -scale], [-scale, -2*scale]] # How to switch to going up when you stop going down after DOWN[i] DU_switch = [scale, -scale, -scale, scale] # Relative moves for drawing the horizontal elements (L2R = left-to-right) L2R = [[scale, 0.0], [2*scale, scale], [scale, 0.0], [2*scale, -scale]] R2L = [[-scale, 0.0], [-2*scale, scale], [-scale, 0.0], [-2*scale, -scale]] # How to switch to R2L after stopping in L2R at index i LR_switch = [scale, -scale, -scale, scale] # Compute the intersection of two lines # See eggbot_hatch.py for complete details def intersect( P1, P2, P3, P4 ): ''' Determine if two line segments defined by the four points P1 & P2 and P3 & P4 intersect. If they do intersect, then return the fractional point of intersection "sa" along the first line at which the intersection occurs. ''' # Precompute these values -- note that we're basically shifting from # # P = P1 + s (P2 - P1) # # to # # P = P1 + s D # # where D is a direction vector. The solution remains the same of # course. We'll just be computing D once for each line rather than # computing it a couple of times. D21x = P2[0] - P1[0] D21y = P2[1] - P1[1] D43x = P4[0] - P3[0] D43y = P4[1] - P3[1] # Denominator d = D21x * D43y - D21y * D43x # Return now if the denominator is zero if d == 0: return float( -1 ) # For our purposes, the first line segment given # by P1 & P2 is the LONG hatch line running through # the entire drawing. And, P3 & P4 describe the # usually much shorter line segment from a polygon. # As such, we compute sb first as it's more likely # to indicate "no intersection". That is, sa is # more likely to indicate an intersection with a # much a long line containing P3 & P4. nb = ( P1[1] - P3[1] ) * D21x - ( P1[0] - P3[0] ) * D21y # Could first check if abs(nb) > abs(d) or if # the signs differ. sb = float( nb ) / float( d ) if ( sb < 0 ) or ( sb > 1 ): return float( -1 ) na = ( P1[1] - P3[1] ) * D43x - ( P1[0] - P3[0] ) * D43y sa = float( na ) / float( d ) if ( sa < 0 ) or ( sa > 1 ): return float( -1 ) return sa # Determine whether a line segment needs to be clipped to # fit within the drawing page def clip( x1, y1, x2, y2 ): if ( x1 >= 0.0 ) and ( x1 <= WIDTH ) and ( x2 >= 0.0 ) and ( x2 <= WIDTH ) and \ ( y1 >= 0.0 ) and ( y1 <= HEIGHT ) and ( y2 >= 0.0 ) and ( y2 <= HEIGHT ): return float( -1.0 ) if ( x1 < 0.0 ) or ( x2 < 0.0 ): s = intersect( [x1, y1], [x2, y2], [0.0, 0.0], [0.0, HEIGHT] ) if ( s > 0.0 ): return s if ( x1 > WIDTH ) or ( x2 > WIDTH ): # We allow going an extra pixel across in case there is drawing error s = intersect( [x1, y1], [x2, y2], [WIDTH+1.0, 0.0], [WIDTH+1.0, HEIGHT] ) if ( s > 0.0 ): return s if ( y1 < 0.0 ) or ( y2 < 0.0 ): s = intersect( [x1, y1], [x2, y2], [0.0, 0.0], [WIDTH, 0.0] ) if ( s > 0.0 ): return s if ( y1 > HEIGHT ) or ( y2 > HEIGHT ): s = intersect( [x1, y1], [x2, y2], [0.0, HEIGHT], [WIDTH, HEIGHT] ) if ( s > 0.0 ): return s return float( -1.0 ) # Plot a collection of line segments def plot( points, color='black' ): # First line segment s = clip( points[0][0], points[0][1], points[1][0], points[1][1] ) if ( s < 0.0 ): p = 'M %f,%f' % ( points[0][0], points[0][1] ) else: p = 'M %f,%f' % ( points[0][0] + s * ( points[1][0] - points[0][0] ), points[0][1] + s * ( points[1][1] - points[0][1] ) ) x0 = points[1][0] y0 = points[1][1] p += ' L %f,%f' % ( x0, y0 ) # Intermediate line segments for i in range(2, len( points ) - 1): x0 = points[i][0] y0 = points[i][1] p += ' L %f,%f' % ( x0, y0 ) # Final line segment x = points[-1][0] y = points[-1][1] s = clip( x0, y0, x, y ) if ( s < 0.0 ): p += ' L %f,%f' % ( x, y ) else: p += ' L %f,%f' % ( x0 + s * ( x - x0 ), y0 + s * ( y - y0 ) ) print '<path stroke="%s" stroke-width="1" fill="none" d="%s"/>' % ( color, p ) # Draw the vertical elements def vertical( x, y, color, down, up ): if ( y > ( scale + epsilon ) ): i = len( down ) - 1 while ( y > ( scale + epsilon) ): x -= down[i][0] y -= down[i][1] i -= 1 if ( i < 0 ): i = len( down ) - 1 else: i = -1 points = [[x, y]] while ( y < ( HEIGHT - epsilon ) ): i += 1 if ( i >= len( down ) ): i = 0 x += down[i][0] y += down[i][1] points.append( [x, y] ) plot( points, color ) x += DU_switch[i] points = [[x, y]] while ( y > epsilon ): x += up[i][0] y += up[i][1] points.append( [x, y] ) i -= 1 if ( i < 0 ): i = len( up ) - 1 plot( points, color ) # Draw the horizontal elements def horizontal( x, y, color, l2r, r2l ): if ( x > ( scale + epsilon ) ): i = len( l2r ) - 1 while ( x > ( scale + epsilon ) ): x -= l2r[i][0] y -= l2r[i][1] i -= 1 if ( i < 0 ): i = len( l2r ) - 1 else: i = -1 points = [[x, y]] while ( x < ( WIDTH - epsilon ) ): i += 1 if ( i >= len( l2r ) ): i = 0 x += l2r[i][0] y += l2r[i][1] points.append( [x, y] ) plot( points, color ) y += LR_switch[i] points = [[x, y]] while ( x > epsilon ): x += r2l[i][0] y += r2l[i][1] points.append( [x, y] ) i -= 1 if ( i < 0 ): i = len( r2l ) - 1 plot( points, color ) print '<svg xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="%d" height="%d">' % ( int( WIDTH ), int( HEIGHT ) ) print '<g inkscape:groupmode="layer" inkscape:label="1 - vertical">' Color = 'green' x1 = 0.0 y1 = 0.0 x2 = 1.5 * scale y2 = 1.5 * scale while ( x1 < ( WIDTH - epsilon ) ): vertical( x1, y1, 'green', DOWN, UP ) if ( x2 < ( WIDTH - epsilon ) ): vertical( x2, y2, 'green', DOWN, UP ) x1 += 3 * scale x2 += 3 * scale print '</g>' print '<g inkscape:groupmode="layer" inkscape:label="2 - horizontal">' x1 = 0.0 y1 = 0.0 x2 = 1.5 * scale y2 = 1.5 * scale while ( y1 < ( HEIGHT - epsilon ) ): horizontal( x1, y1, 'blue', L2R, R2L) if ( y2 < ( HEIGHT - epsilon ) ): horizontal( x2, y2, 'blue', L2R, R2L) y1 += 3 * scale y2 += 3 * scale print '</g>' print '<g inkscape:groupmode="layer" inkscape:label="3 - border">' print '<path stroke="black" stroke-width="1" fill="none" d="M 0,0 l %d,0"/>' % ( int( WIDTH ) ) print '<path stroke="black" stroke-width="1" fill="none" d="M 0,%dl %d,0"/>' % ( int( HEIGHT ), int( WIDTH ) ) print '</g>' print '</svg>' 


但是生成的图像已经在鸡蛋上了:

图片


发烧友甚至可以在旋转过程中产生具有频闪效果的图片:



当创建我的鸡蛋船时,我并没有设定自己达到15美元的目标,但这确实发生了:)。 相比之下,原始的Eggbot Pro售价325美元,贵了一个数量级。 任何蛋船的主要成本都是步进电机。 我使用了最便宜的-28BYJ-48-12V,因此最终价格为15美元。

因此,准备我的鸡蛋船需要:

1.110克ABS或PLA塑料。 我用ABS和黄色PLA印刷了黑色部分。 在玻璃上打印时,很痛苦的PLA很漂亮:)
2.库存电子产品:

  • 1 x中文Arduino UNO c Aliexpress,带计算机电缆,250卢布。
  • 2个28BYJ-48-12V步进电机+ ULN2003步进电机驱动器,价格为100卢布。
  • 1 x SG90微型伺服电机100擦。
  • 1 x 12V电源(如果有,则不能购买)。

3.我们无法打印的内容,但是我们可以在几乎任何硬件商店中购买:

  • 春天。
  • 螺栓,螺钉,螺母,垫圈。
  • 橡胶垫圈(如果有Flex,则可以打印)。
  • 轴承608。

我们将塑料放入3D打印机中并打印细节,我在这里仔细放置了模型。

有关在此处打印什么和要打印多少,要在何处正确获取电子设备,需要查看多少螺栓和哪种螺栓的详细信息

对于那些还没有购买3D打印机但真的想准备自己的鸡蛋船的人,我可以打印所有详细信息并通过邮件发送。 在PM中联系,一切都会以最好的方式进行! 我保证!

打印后,您可以开始组装。 设备的组装看起来像这样:

图片

为了使您成功,我花了很多时间,并准备了有关在图片中组装和连接电子设备的说明。 您可以在此处下载说明。

在打印和组装后,您应该获得以下设备:

图片

组装完成后,您需要将固件放入鸡蛋船中。 由于设备的大脑是普通的arduino,因此您应该不会有任何问题。

  1. 从此处下载并解压缩固件。
  2. 下载Arduino IDE ,安装并运行。
  3. 我们将鸡蛋船连接到计算机,在Arduino IDE中选择板的型号和COM端口。
  4. 从带有固件的文件夹中打开Eggduino.ino文件,并将其加载到Arduino中。

控制程序使用Evil Mad Scientist Laboratories编写的带有插件的著名Inkscape。 该插件可让您自定义eggbot,对其进行手动管理并发送图片进行打印。 我小心地将插件添加到Inkscape中,并将完成的存档放在此处

如果您已经有Inkscape,但没有插件,则可以在此处单独使用。

下载,安装并运行Inkscape。 我们转到插件菜单,在此处查找EggBot子菜单。 打开插件,调整毡尖笔的高度,然后在鸡蛋上打印任何东西。

如果您在尝试控制bot时遇到Inkscape,则显示错误“无法连接到EggBot”,请不要绝望。 这个问题很容易解决。 在已连接设备的列表中,您的电路板名称是什么。 然后,在Inkscape插件的ebb_serial.py文件中,在第52行用您的名字替换“ USB-SERIAL CH340”。

我还收集并上传了一个带有示例的小集合。 你可以在这里看到它。

结果,蛋船应该像这样工作:


我将项目发布在github上 。 叉,放星星,修改等等。 我也没有忘记 thingiverse.com。

感谢您的关注!

Source: https://habr.com/ru/post/zh-CN403293/


All Articles