Wolfram 语言

三维打印

找出最优的适宜于三维打印的方位取向

利用对基于网格的几何区域的广泛支持,可轻松地对从结构性载荷到直立方位等各方面进行可打印分析.

想把模型放在平面上,给出候选方向.

显示完整的 Wolfram 语言输入
In[1]:=
Click for copyable input
cover = TransformedRegion[ MeshRegion[ Import["http://www.thingiverse.com/download:342676", "STL"], PlotTheme -> "Minimal"], TransformationFunction[{{1., 0.5, 0.03, -0.06}, {-0.05, 0.03, 1.1, 0.1}, {0.53, -1.02, 0.05, 0.19}, {0, 0, 0, 1.}}]]; points = MeshCoordinates[cover]; transform[Polygon[points_]] := Module[{proj = points}, proj[[All, 3]] = 0; Last[FindGeometricTransform[proj, points]]]; highlight[convexHull_, cover_] := Show[HighlightMesh[ convexHull, {Style[1, Brown], Style[2, Opacity[0.3, Brown]]}], cover]; Show[cover, Boxed -> True]
Out[1]=

凸包的每个面代表了一个候选方向.

In[2]:=
Click for copyable input
convexHull = ConvexHullMesh[points]; orientations = MeshPrimitives[convexHull, 2]; highlight[convexHull, cover]
Out[2]=

使用质心的正射投影进一步限制候选方向.

In[3]:=
Click for copyable input
masscenter = RegionCentroid[cover]; projection[polygon_, p_] := RegionNearest[AffineSpace @@ polygon, p]; candidates = Select[orientations, RegionMember[#, projection[#, masscenter]] &];

候选方向之一.

In[4]:=
Click for copyable input
Show[ncover = TransformedRegion[cover, transform[Last[SortBy[candidates, Area]]]], Boxed -> True]
Out[4]=

打印模型.

In[5]:=
Click for copyable input
Printout3D[ncover, "Shapeways"]
Out[5]=

相关范例

de en es fr ja ko pt-br ru