View previous topic :: View next topic |
Author |
Message |
ufoace
Joined: 11 Mar 2013 Posts: 46
|
Posted: Wed May 22, 2013 8:52 am Post subject: axial symmetry in an ISO field? |
|
|
I'd love to know how to reflect an isosurface shape to make things like starfish, and kaleidoscope etc, not like 3d symmetry, only on x and y... rotational symmetry?
I can't think of it yet, could you please tell me?
same as this:
http://pbskids.org/cyberchase/media/games/symmetry/
for example cylinder f(x*x+z*z -.5)
how to rotate it around the z axis so it is 5 cylinders joined in middle? i will find eventually it will take me a day though! i even think i have programmed it before! |
|
Back to top |
|
 |
Furan
Joined: 05 Oct 2010 Posts: 64 Location: Prague, Czech Republic
|
Posted: Wed May 22, 2013 5:13 pm Post subject: |
|
|
By using modulo function
If not available, use this:
mod(A,b) = b*{0.5+1/pi*arctan tan [pi*(A/b-0.5)]}
Rotation along z axis:
phi0 = angular period [rad]
phi = mod(atan2(y,x), phi0)
r = sqrt(x*x+y*y)
xp = r*sin(phi)
yp = r*cos(phi)
F(xp,yp)
I forgot:
F(xp,yp) will display repeatedly the function F(x,y) at x,y: 0 =< atan2(y,x) =< phi0 |
|
Back to top |
|
 |
ufoace
Joined: 11 Mar 2013 Posts: 46
|
|
Back to top |
|
 |
denisc
Joined: 24 Apr 2013 Posts: 92
|
Posted: Thu May 23, 2013 11:14 pm Post subject: |
|
|
hello
if i understand
you can replace x and y by:
xp = r*sin(phi)
yp = r*cos(phi)
for x*x+y*y -.5
the result:
pi/4=45 degre
(sqrt(x*x+y*y) *sin(pi/4*(0.5+1/pi*atan(tan(pi*(atan2(y,x)/pi/4-0.5))) )))^2
+ (sqrt(x*x+y*y) *cos(pi/4*(0.5+1/pi*atan(tan(pi*(atan2(y,x)/pi/4-0.5))) )))^2-.5
in k3d is always a cylinder ?
can you make a concret example, with picture; in k3d, please ?
(with formula)
i think that will more easy to understand for all people ?
thank
denisc |
|
Back to top |
|
 |
ufoace
Joined: 11 Mar 2013 Posts: 46
|
Posted: Fri May 24, 2013 7:41 pm Post subject: |
|
|
Code: | var phi0 = Math.PI/3;
var phi2 = Math.PI/6;
var phi=Math.Repeat(Mathf.Atan2(x,z),phi0 );// that's a modulo
var rt = Math.Sqrt(x*x+z*z) ;
var xp = rt*Math.Sin(phi-phi2) ;
var zp = rt*Math.Cos(phi-phi2) ;
return (xp*xp + zp*zp -.5); |
that's the code so you have x and z turn around. the above example is cylinder.
i had the example of my demo file wrong here:
https://dl.dropboxusercontent.com/u/114667999/shapegen/shapegen.html
press update twice to renew every time. |
|
Back to top |
|
 |
|