[script] FxGraph - 2D/3D Function plotter
 1-20  21-40  41-60  61-80  81-91

Previous
Next
 From:  bemfarmer
6447.21 
Very nice script!

Fermat Spiral:
_FxGraph3D a*c*sqrt(v)*cos(v);b*c*sqrt(v)*sin(v);0;0;1;0;6.283185307179586;0;50;1;1;1;UV

This can be pasted to the command window in Moi.
1. Highlight and CTRL-C the entire Fermat Spiral equation line above, _FxGraph3D...;UV
2. In Moi, press TAB key, and CTRL-V paste, then press Return. Voila

The a, b, and c values will scale the curve.
A negative c will rotate the curve.
A negative a and positive b will Mirror the curve.
a, b, and c are not really needed, as Moi can do these actions already.

- Brian

I just did a Fermat Spiral script, but can now delete it :-)
Or add some bells and whistles.


Attachments:

  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:  Max Smirnov (SMIRNOV)
6447.22 
Sphere
_FxGraph3D cos(u)*cos(v)*a;sin(u)*cos(v)*b;sin(v)*c;0;6.283185307179586;-1.5707963267948966;1.5707963267948966;50;50;1;1;1;V

Torus
_FxGraph3D cos(u)*(cos(v)+a/b)*b;sin(u)*(cos(v)+a/b)*b;sin(v)*b;-3.141592653589793;3.141592653589793;-3.141592653589793;3.141592653589793;50;50;20;10;;UV

Spiral
_FxGraph3D cos(u/c)*(cos(v)+a/b)*b;sin(u/c)*(cos(v)+a/b)*b;sin(v)*b+u;0;50;0;6.283185307179586;100;20;10;3;2;UV

Conic Spiral
_FxGraph3D cos(u)*(u/(a*pi)*cos(v)+b)*c;sin(u)*(u/(a*pi)*cos(v)+b)*c;u*sin(v)/(a*pi)*c;0;9.42477796076938;0;6.283185307179586;100;20;1.5;5;1;U

Knot
_FxGraph3D cos(u)*cos(v)+c*cos(u)*(b+sin(u*a)/2);sin(u)*cos(v)+c*sin(u)*(b+sin(a*u)/2);sin(v)+2*cos(a*u);0;18.84955592153876;0;6.283185307179586;300;10;1.666666;2;3;UV

Dini's Surface
_FxGraph3D cos(u)*sin(v);sin(u)*sin(v);cos(v)+log(tan(v/2))+a*u;0;12.566370614359172;0.1;2;300;10;0.3;;;U

Enneper surface
_FxGraph3D u*cos(v)-pow(u,2*a-1)/(2*a-1)*cos((2*a-1)*v);-u*sin(v)-pow(u,2*a-1)/(2*a-1)*sin((2*a-1)*v);2/a*pow(u,a)*cos(a*v);0;1.2;0;6.283185307179586;50;27;4;;;UV

EDITED: 7 Sep 2014 by SMIRNOV

  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
6447.23 In reply to 6447.22 
Maybe someone could come up with a repository for these formulas,
an easy place to copy them from, ... in Moi , or someplace like the object library?

- 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:  Max Smirnov (SMIRNOV)
6447.24 
Version 1.1beta
Changes since 1.0:
[added] Surface modes (beta): SrfV and SrfU. Use it carefully. Sometimes it can hang MoI for up to a few minutes.


>>Maybe someone could come up with a repository for these formulas, an easy place to copy them from, ... in Moi , or someplace like the object library?
Hi Brian!
It's good idea. I'll think about it.

EDITED: 7 Mar 2022 by SMIRNOV

  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
6447.25 
Golden Logarithmic Spiral, also known as equiangular spiral, and Spira Mirabilis.
For growth factor b = 0.306349 (approx.), the Golden Spiral is formed, for angles in radians.
a is a scale factor.
c is the number of "coils."
_FxGraph3D a*cos(c*v)*exp(b*c*v);a*sin(c*v)*exp(b*c*v);0;0;1;0;6.283185307179586;0;50;1;0.306349;2;UV

- 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:  Frenchy Pilou (PILOU)
6447.26 
Excellent!
The trick is run the Script then just take 2 curves from the result for make a Loft or a Sweep! ;)

EDITED: 7 Sep 2014 by PILOU

  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
6447.27 
Heart (half)
(c of 2 makes a full heart, but with two hairpin curve regions.)
_FxGraph3D a*16*sin(c*v)*sin(c*v)*sin(c*v);a*(13*cos(c*v)-5*cos(2*c*v)-2*cos(3*c*v)-cos(4*c*v));0;0;1;0;3.141592653589793;0;50;1;1;1;UV
  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)
6447.28 
With the last beta "Cancel" don't works with these parameters and reasonnable time!

EDITED: 8 Sep 2014 by PILOU

  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
6447.29 In reply to 6447.28 
I think it is a tradeoff due to the speed of the htm code?

- 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:  Max Smirnov (SMIRNOV)
6447.30 
While writing Math nodes for my nodeedit project, I found one significant bug in the FxGraph/3D code. The script incorrectly processes a square brackets and "rnd" command in some cases.
Updated scripts:
http://moi.maxsm.net/media/files/FxGraph3D.v.1.1.2016.04.17.zip
http://moi.maxsm.net/media/files/FxGraph.v.1.2e.2016.04.17.zip
  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
6447.31 
While exploring Scherk2 minimal surface, and hyperbola, these shapes came up:

sinhLeaf:
_FxGraph3D u;v;((exp(u) - exp((-1)*u))/2 + (exp(v) - exp((-1)*v))/2);-3.14159;3.14159;-3.14159;3.14159;15;15;0;0;0;UV

sinhcoshScoop:
_FxGraph3D u;v;((exp(u) - exp((-1)*u))/2 + (exp(v) + exp((-1)*v))/2);-3.14159;3.14159;-3.14159;3.14159;15;15;;;;UV

coshBag:
_FxGraph3D u;v;((exp(u) + exp((-1)*u))/2 + (exp(v) + exp((-1)*v))/2);-3.14159;3.14159;-3.14159;3.14159;15;15;;;;UV

The scripts can be stored in a notepad++ text file.

To repeat how to view in MoI, with Max's _FXGraph3D script already installed, highlight one entire line, press Ctrl+C.
Open MoI, press TAB, press Ctrl+V, press Enter.
Network can be used to make a quick surface.

- 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:  TOM (SIRTOM)
6447.32 In reply to 6447.31 
Beautyful - did not know about that cpoy+paste function !
  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
6447.33 
This script is called BowTie.
_FxGraph3D v*sin(u);v*cos(u);a * asin(((exp(u*sin(v)) - exp(-u*sin(v)))/2) * ((exp(u*cos(v)) + exp(-u*cos(v)))/2));-0.8;0.8;-3.14159;3.14159;15;15;1;;;UV

Selecting just the U iso curves, allows trim with a point at the origin.
Each bow will then network at the 15 curve density.
Each surface can be extruded slightly and the fillet applied.

- 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)
6447.34 In reply to 6447.33 
Nice - except I've not been able to make a surface.

Would you mind splitting this: "Selecting just the U iso curves, allows trim with a point at the origin." into a number of discrete steps?

My particular confusion is what to trim with what, and what to delete (or not).

Mike.
  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
6447.35 In reply to 6447.34 
Hi Mike,
Network does not always work on such complete structures, but may work with portions.
(Having a lot more U and V curves may prevent Network from working.)

After creating the UV curves,
1. Place a point at the origin. This is not essential, but helps locating the origin.
2. Select only the curves passing through the origin.
These are the U curves, and could have been identified by previously running a separate U mode. (It is not essential to run a separate U mode.)
3. Run Trim command
4. Press "add trim points"
5. Select origin point as place to put the added trim point.
6. Press Done. (Do not press "remove curves" button.)
7. Press Done again. The two "lobes" are now separate.
8. Select both U and V curves for one entire lobe.
9. Press Network, which creates one lobe surface in half a second or so.
(Network does not work if both lobes UV lines are selected at the same time.)
10. The second lobe can also be Networked separately.

- Brian

EDITED: 24 Jul 2017 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:  BurrMan
6447.36 
Hi Michael,
With regard to these last "FXGraph" scripts posted here:

http://moi3d.com/forum/index.php?webtag=MOI&msg=6447.31

They work from entering the command in the command area. Is there a modification to it to call from a js file like a regular script? Or is a complete rewrite?
  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
6447.37 In reply to 6447.36 
Hi Burr,

re:
> They work from entering the command in the command area. Is there a modification to it
> to call from a js file like a regular script? Or is a complete rewrite?

That's just one option that it can be run from the command area - the way Brian shows above runs the _FxGraph3D command but also gives it command line parameters. I think the _FxGraph3D command can also be run without any command line parameters too, that's just one way for it to initialize its UI.

- 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:  Mike (MGG942)
6447.38 In reply to 6447.35 
Many thanks, Brian.

The bit that tripped me up (I am now embarrassed to admit) was to attempt to Network both halves in one operation.
  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:  BurrMan
6447.39 In reply to 6447.37 
Hi Michael,
""""""""""" the way Brian shows above runs the _FxGraph3D command but also gives it command line parameters."""""""""""""""""

Yes. But can that work from a js file? Like is it just missing a "command execute" or something? How to make those parameters pass from the js file? (Without a big rewrite.)
  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
6447.40 In reply to 6447.39 
Hi Burr, from what other .js file, do you have something like a launcher dialog you're setting up? You should be able to use moi.command.execCommand(); to do the same thing, it should support command line parameters just make sure there is a space between the command name and the parameters in the string you send to moi.command.execCommand() same as in the pasted in text.

- 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
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-40  41-60  61-80  81-91