Drawing anything with Fourier Series using Blender and Python

Recently, in the Fourier Series chapter of “Coding Druid”, I practiced the visualization of Fourier Series and demonstrated the periodic square wave curve, which can be decomposed into a series of sine wave curves: Above is Python (Blender) version. There are JavaScript (React) version, and Unity version. “Coding Druid” series is my horizontal programming practice notes, each part around a topic like mathematical, physics, electronic, graphics, sound, etc., implemented in several programming languages. This time I’m try to draw something with Fourier

Using Blender to run Python and visualizing the Fourier Series

“Coding Druid” series is my horizontal programming practice notes, each part around a topic like mathematical, physics, electronic, graphics, sound, etc., implemented in several programming languages. Coding DruidPart: MathChapter: Fourier SeriesSection: Python (in Blender) In this Chapter, I have visualized Fourier Series separately using JavaScript (React): and Unity: This section is Python again. Playground options In the note Sine function visualization using Python I used Jupyter Notebook as Python IDE/Playground.Jupyter is a great online IDE for Python. You can basically do

Sine function visualization using Python

“Coding Druid” series is my horizontal programming practice notes, each part around a topic like mathematical, physics, electronic, graphics, sound, etc., implemented in several programming languages. Coding DruidPart: MathChapter: Trigonometric FunctionSection: Python In the previous two sections, I visualized Trigonometric function (Sine and unit circle) by MaxMSP and JavaScript (React): Trigonometric Function Visualization Using MaxMSP Sine Function Visualization Using JavaScript (React) This time I use Python to implement it. For the quick goal,

flex与django|python通信,通过pyamf

pyamf官网上推荐了一篇中文howto(1,2),介绍django与flex通信,通过pyamf(一个python的开源api,专门针对amf协议)。其中有个小问题,就是destination的设置。 共有三处会用到该属性(这篇中文howto只提到了两处),我的代码片段如下: 1 flex:<mx:RemoteObject id=”djangoService” destination=”destinationFucker” showBusyCursor=”true”/> 2 services-config.xml: <destination id=”destinationFucker”> <channels> <channel ref=”fuckChannel”/> </channels> </destination> 3 amfgateway.py: usersGateway = DjangoGateway({ ‘destinationFucker.testFuck’:testFuck, ‘destinationFucker.testArrayFuck’:testArrayFuck }) 深红色的python部分,在原文中是没有destination的(当然原文中也没有fu*k)。 我不知道原文的example是如何测试的,至少我滴环境下(django自带server,无数据库)如果在python(或django)的方法前不加destination(即直接’testArrayFuck’:testArrayFuck ),flex是无法找到远程方法testArrayFuck的。(后注:后来发现原example无效是因为pyamf版本有更新) flex的RemoteObject,天生出来是与java后台相亲相爱的 ,在java中,destination对应的可以是该class名,即: class destinationFucker { public function testArrayFuck(){} } 而在python中,至少这个example中米有class,所以必须在映射方法testArrayFuck时加上destination才能找到“destinationFucker.testArrayFuck”。 那么客户端flex及services-config中不写destination行不行涅? 答案貌似是“不行”,如果在RemoteObject及services-config中去掉destination,运行时会找不到destination而报错。 那么客户端flex及services-config中destination id=””行不行涅? 答案也貌似是“不行”,在services-config中destination的id不接受””。至少在flex默认配置下这样是不行滴。 另外,上边举的那个java的例子,其实我猜的,因为从没用java试过 ^_<