Quaternion/Floretion Script: Cranborg 1.0 (alpha)

I have uploaded cranborg.py to SourceForge (unfortunately, I needed to remove all links in my previous post, below, since I haven’t been a registered user for very long!)

Release Notes:
This is the first version of my translation of the Java FAMP “Floretion Algebra Multiplication Program” into Python for use in Blender.

Basically, I’ve taken quaternions (and their “extenions” to floretions) and created short algorithms based on quaternion multiplication and adding back in the fractional parts of the coefficients of the basis vectors (for example 'i, 'j, 'k, and e). Under the right conditions, these algorithms result in sequences of integers which can be graphed, leading in many cases to stunningly beautiful objects (author’s opinion). This depends on:

  1. the algorithm itself
  2. the parameters for the algorithm
  3. the chosen quaternion/floretion
  4. the number of points plotted

Name: Gerald’s Spiral, published at the Online Encyclopedia of Integer Sequences under A108618

Script Settings:
Floretion: “Gerald’s Spiral” (be sure to hit this button first!)
Sum E-factor: 1
Sum I-factor: 0
Sum J-factor: 0
Sum K-factor: 0

2-D toggle button: on (default)
Add X toggle button: on (default)
Zap toggle button: off
Last sequence toggle button: off
em sequence toggle button: off

Note: Be sure to experiment by increasing the “number of terms” slider and toggling into edit Mode in Blender to view the points! Also, the curves created should be deleted (currently by hand in Object mode) or else they will begin to clutter the view- and RAM. When experimenting, it is advised to plot in stages: first 100, deleting object. If the object looks interesting, then move up to 1000-3000 points. Calculating 20000 points creates a time delay of approximately 15 seconds on a 1800 dual core, 2GB machine before the object appears in the 3D window (and a much longer time to render, of course, depending on the settings)

Name: Chung shu’s Spiral, published at the Online Encyclopedia of Integer Sequences under A117154

Script Settings:
Floretion: hit the button “Chung shu’s Spiral”
Sum E-factor: 2
Sum I-factor: 0
Sum J-factor: 0
Sum K-factor: 0

2-D toggle button: on (default)
Add X toggle button: off
Zap toggle button: on
Last sequence toggle button: off
em sequence toggle button: on

I will be setting up a forum in the next few days to discuss any user comments regarding algorithms and floretions on my website. Until then, you may download the pre-release at SourceForge- search for the term cranborg!
Warning: This is a test release. The exact effect of the buttons may change with later releases.

My email: mail(AT)fumba.eu

p.s. one of my favorites is this 1-5-1 setting (try also 2-8-6):
Script Settings:
Floretion: hit the button “Gerald’s Spiral”
Sum E-factor: 0
Sum I-factor: 1
Sum J-factor: 5
Sum K-factor: 1
Mod: 3 (default)

2-D toggle button: on (default)
Add X toggle button: on
Zap toggle button: off
Last sequence toggle button: off
em sequence toggle button: off / on (try both and look at result for, say, 3000 terms)

Finally, I should add that I am in fact new to both Python and Blender- your own suggestions and improvements to the script are therefore well-appreciated.

hi, good job.
the ui reminds me a little of the parametric object script by Ed Mackey.
if you don’t know it, it’s worth looking up.
http://www.blinken.com/blender-plugins.php
the first thing i noticed was the lack of button tooltips.
they would be a good inclusion.
it is possible also to have short descriptions also appear as text in the script ui.
so the information you have above could appear when you press the preset button.
anyway, just some ideas, it is an interesting script & i look forward to more updates.
thanks.

No picture?

Sourceforge page:


you tube video:
http://blenderartists.org/forum/showthread.php?t=122708
(new users can’t post links)

Thank you for posting these links and especially for your comments, above: the first thing I did was to breathe a short sigh of relief as I was quite nervous about posting to so many experts at once!

I’ll get right to work on completing the tooltips. Not sure if it’s a big or little problem yet, but two values in the code don’t match which should, so I need to clean up the code and re-examine it.

p.s.Ed Mackey’s script looks very interesting… I will look into it. Again, thank you.

Update: Cranborgv1_2.py has been released to SourceForge (see Meta-Androcto’s 2nd post for links) . The newer version allows the user to select several pre-defined curves to be plotted; the parameters will be changed automatically. My hope is that users will have fun making up their own creations. For example, drawing a “mandala” curve, converting to a mesh (in many cases it helps to extrude the curve a bit beforehand), and applying a wave and/or particle modifier to it is an easy way to achieve nice effects very quickly. I’m already working on the next release- modifying parameters (which takes up at least half of all time) while also allowing the user to save files and backtrack over previous steps. Let me know if you’d like to help!

There is also a new blendfile (soswetoo.blend) at the link which contains an example. For those who downloaded in the first few hours, I found a typo in the white text at the top of the script: the line should read eIJe = IJ = JeeI, eIKe = IK = KeeI, etc. - this has since been corrected. Note: another notation used for the last example is ‘i * j’ = ‘ij’ = j’ * 'i

p.s. Ideasman’s solid wire script seems to work well once the curve has been extruded and turned into a mesh!

Excellent :D.

Beautiful forms from maths that are reminiscent of 3d fractals, and some eerie music too. Thanks for the script, I’m just getting into scripting and might learn some stuff apart from the maths.

How much interpretation is needed with the music? Like the algorithms come out with the music as it is, or you layer different, compatible tracks on top of each other? It sounds very tense then kind of exhibits a controlled break-down into semi-cyclic chaos.

Some of the forms that you present in your youtube video are reminiscent of alien spacecraft. I’m sure I’ll find time to fly a little ship around some of these forms in the game engine ;).

Once again, thanks for bringing this to Blender :).

@FunkyWyrm: I’m really glad you like it. Thanks! (you aren’t the first person to suggest that some of the results tend to look like futuristic spacecraft!). As for the music, you can actually turn the sequences of numbers generated by the algorithms into music itself- something I find fascinating and have done before.

If you’re interested, see Jonathan Middleton’s MUSICALALGORITHMS website to convert sequences of numbers generated by the various algorithms and floretions into notes (in particular midi-files). However, that’s not what I did in the video you watched- I just picked one of my favorite songs (for the second half of the video) and tried my best to synchronize it.

By the way, I added a screenshot of “Floret’s Cube” to the download page at Sourceforge. That screenshot isn’t from the program, but is from the original graph diagram I drew approximately 5 years ago when I first began looking into floretions. If you look closely, you’ll notice that the floretion which appears at the bottom of the screen when you choose “Floret’s cube” from the upper right menu in the script has a special place “atop” Floret’s cube (the diagram).

Can’t wait to see some of this stuff in the game engine- good luck!

Update: I think I slightly misunderstood your question. Had you already found one of my “floretion songs” on the web? (my first video had one but not the 2nd, which I thought you were referring to). My method is usually to take a midi track of an integer sequence, copy it to a second track, and offset it by a few notes. The “interpretation” comes in at several points, for example when considering how far to offset the 2nd track.

Looks to me like crystalline type, maybe some of it reminds me of the movie Tron.

I’m gonna have a look at the script and see if I can refine my script or finish it

For those interested in the math side, I believe the following is really neat: I originally named one of the pre-defined curves “Six ellipses” because the set of vertices looked a lot like 6 ellipses (two pairs appear to be touching). However, there was no mathematical evidence to back this up. Since 5 points define a conic section, I plotted the curve “Six ellipses”, switched to edit mode, and chose 5 points at random from one of the six “ellipses”.

This led to the equation:
-67.539x^2 + 84.408xy - 67.550y^2 - 521.317x - 817.342 + 325.815y = 0

The other points also seem to fulfill this equation. For ex, let’s choose another point on the same “ellipse”, say (-4.325, 1.340). Plugging this in to the above equation gives 0.10 = 0. That seems very good considering there’s some slight rounding going on. And speaking of rounding, changing the last point to (-4.325, 1.350) returns 2.1 = 0… a much bigger error. What is still unclear is what’s happening as more and more points on the curve are plotted- do these points approach a “real ellipse”?

Googling a bit, I found there seem to be many interesting problems concerning ellipses and touching ellipses. That opens up new possibilities! Thanks, of course, to the Blender team for creating such a wonderful product.

Wow, I can’t believe it’s been almost a year since my last post. I work full-time as a translator so I apologize that I haven’t been able to update the script itself. That said, I have created a website which explains floretions here: http://fumba.eu/sitelayout/Floretion.html

A link to the draft paper Floretions 2009 can be found on that site. Now that I am getting some of the documentation out of the way, I hope to go back and update the script soon!