Biconcave script

Next
 From:  bemfarmer
6718.1 
The Biconcave script is a 2d curve generator, which creates a curve in one quadrant of the xy plane.
Repeating the script with Bottom and Left checkboxes puts curves in different quadrants.
Other parameters create different curves. The "bottom" or "left" curves can be different.

Using 500 points results in end tangents perpendicular to x or y axis. ( In the ranges tested ) Rebuild is recommended.

Revolve about the y axis yields a solid resembling an erythrocyte, (red blood cell), for the default parameters in the .htm file.

The Parametric equations are from the paper "Modeling Human Erythrocyte Shape and Size Abnormalities"
http://arxiv.org/ftp/q-bio/papers/0507/0507024.pdf
The source document also modifies the parameters, resulting in deformations resembling Microcytes, Macrocytes, and Stomatocytes.
The sin, cos, and angle phi in the equations are not needed.
This script uses the three Jacobi elliptic functions, sn, cn, and dn, which were previously used in the SeiffertCurve script. q.v.
The Jacobi elliptic functions sn(u|m), cn(u|m), and dn(u|m) are calculated by using AGM, (arithmetic geometric mean,) plus recurrence relation.
Source: Boost and Abramowitz and Stegun, Page 571. http://www.math.hkbu.edu.hk/support/aands/toc.htm
The parameter "m" is equal to the modulus "k" squared. (k may also equal the eccentricity of some ellipse.)

The parameter "m" is limited to the interval (0,1), which excludes 0 and 1.0. Entries of 0 or 1.0 are set by code to .001 or .9999.
A trial of values of "m" between 1 and 10 yielded "pseudo ellipses", so the code excludes those values also.

The parameter u ranges in value in the interval of [0,U] inclusive, and is used to plot points on the curve.
U = IK = K(k). (Some papers call it K(m)) K(k) is the Complete elliptic integral of the first kind.
U will limit the curve to the first quadrant of the xy plane, for positive height and length.
http://en.wikipedia.org/wiki/Quarter_period
k is the modulus, but m = k*k is used here.
U is calculated with another version of the arithmetic geometric mean, Landen's_transformation.
http://www.robertobigoni.eu/Matematica/Integrali/IntegraliEllittici/Elliptic.html (e = k)
http://en.wikipedia.org/wiki/Landen's_transformation
IE is the Complete elliptic integral of second kind. (Not used)

I also tried a Blend, which created a heart shape.
Bowling pins have a different specification.

The tolerance is "tuned up" to avoid the last two points being incorrect.

- Brian

Edit, deleted version 02, uploaded version 03 with height bulge slider.





Edit, Version 04 is faster, with code in .htm, and the slider works "continuously," with 1/2 second flicker.

EDITED: 25 May 2014 by BEMFARMER


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6718.2 In reply to 6718.1 
That's another cool one Brian, you're getting quite proficient at rolling these out!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6718.3 In reply to 6718.2 
Thank you Michael!

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mike (MGG942)
6718.4 In reply to 6718.1 
Neat!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6718.5 
Edit: Squared and cubed version, Standby...
- Brian

EDITED: 23 May 2014 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
6718.6 
Aaaaaaaaaaah! :)

French version + article ! ;)
http://moiscript.weebly.com/geacuteomeacutetries-par-bemfarmer.html

---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6718.7 
The script "_Biconcave03," now has a "Bulge" slider which acts on the Y height of the curve.
It applies an exponent, like squared or cubed, etc. to a portion of the equation for the Y coordinate.
The exponent slider has a minimum of .5, and a maximum of 4.
(The height for a high modulus value, to the power 4 is extremely large.)
Other exponent values can be keyed in.

A negative exponent value tends to yield a "slender" curve.

The original source paper had provisions for squared and cubed exponents.

This slider is not continuous, but it does not blink like the clothoid slider does.
Is it because the slider is shorter?
I'll have to practice some more:-)

Note that the code is still in the .js file, and is fairly fast, so placing code in the .htm file has not been resorted to, at this time.

- Brian

EDITED: 23 May 2014 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6718.8 In reply to 6718.7 
In the .htm for the slider, I failed to include the line:

onmousemovevaluechange="moi.ui.fireUIEvent(id);"

Including this code results in the "bulge" of the curve trying to respond to the mouse movement in a continuous way,
but apparently each (pixel change?) causes recalculation, so the curve flickers for dozens of times, due to relatively slow (?) javascript.

I'll try putting some of the calculations in the .htm file.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  bemfarmer
6718.9 In reply to 6718.8 
The Update() function, and the functions it calls, were moved to .htm.
Finally, this resulted in the slider working "continuously with movement," and the "flicker" only lasts for about 1/2 second.

Three problems were encountered with using script in .htm.
1. The range checks for mValue, and/or alert messages, did not work in .htm. (Why?)
So the range checks, and alert function were move back to .js, and Update() was changed to Update(mValue).
(Maybe range check could be moved to a subroutine.)

2. Using abbreviations like var ui = moi.ui seems not to work. (Why?)

3. Calling a function, like "var pt = EvalJacobi( tval, mValue, U, cHeight, Lradius, exponent );"
and then substituting m for mValue, like "EvalJacobi( tval, m, U, cHeight, Lradius, exponent ) {... ...} does not work. (Why?)

The new version of Biconcave script is .04.

Due to the "less forgiving" .htm code, please report any hangups. :-)

- Brian

EDITED: 25 May 2014 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All