在Mathematica中沿3D路径移动AutoCad DXF实体

时间:2011-04-09 05:15:48

标签: wolfram-mathematica autocad

我遇到了this post,发现belisarius的答案很有趣。想知道是否有人可以发布他的  完整的mma代码并给出一些解释。一般来说,我的问题是如何在mma中实现这种广义/绘图行为。这对我来说太棒了!

非常感谢。

1 个答案:

答案 0 :(得分:3)

如果需要进一步说明,请告诉我。

x[t_] := {Cos@t, Sin@t, .1  t} /; t <= 3 Pi;
x[t_] := {Cos@t, Sin@t, .3 Pi  (4 - t/Pi)} /; t > 3 Pi;
plotRange = {{-110, 110}, {-110, 110}, {-10, 110}};
z1 = ParametricPlot3D[100 x[t], {t, 0, 4 Pi}, PlotRange -> plotRange];
hel = Import["ExampleData/helicopter.dxf.gz", 
   ViewPoint -> {10, 10, 10}, AlignmentPoint -> {80, 80, 80}];

zz = Table[
   Show[z1, 
    Graphics3D[
     Translate[Rotate[First[hel], t + Pi/2, {0, 0, 1}], 100 x[t]]], 
    PlotRange -> plotRange], {t, 0, 4 Pi, 4 Pi/15}];
Export["c:\\test.gif", zz, "DisplayDurations" -> .5]

(* Or
 Animate[Show[z1, 
   Graphics3D[
    Translate[Rotate[First[hel], t + Pi/2, {0, 0, 1}], 100 x[t]]], 
   PlotRange -> plotRange], {t, 0, 4 Pi}]

enter image description here

可以使用曲线导数计算直升机旋转。现在太懒了。

修改

遵守Sjoerd的家居装饰规则:

enter image description here