在Mathematica中沿3D路径移动AutoCad DXF实体 [英] Moving an AutoCad DXF solid along a 3D path in Mathematica

查看:89
本文介绍了在Mathematica中沿3D路径移动AutoCad DXF实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这篇文章,并找到了belisarius.回答很有趣.想知道某人是否可以发布他的消息 完整的mma代码,并给出一些解释.通常,我的问题是关于如何在mma中实现这种动画/绘图行为.对我来说真是太神奇了!

I came across this post and found belisarius' answer interesting. Wondering whether he someone can post his complete mma code and give some explanation. In general, my question is about how to achieve this kind of annimation/plotting behavior in mma. It looks amazing to me!

非常感谢.

推荐答案

请告诉我是否需要进一步的说明.

Please tell me if further explanation is needed.

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}]

可以使用曲线导数来计算直升机的旋转角度.现在太懒了.

One could calculate the heli rotation using the curve derivatives. Too lazy to do it right now.

修改

要遵守Sjoerd的家居装饰规则:

To comply with Sjoerd's home decoration rules:

这篇关于在Mathematica中沿3D路径移动AutoCad DXF实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆