MoI discussion forum
MoI discussion forum

Full Version: [script] FxGraph - 2D/3D Function plotter

Show messages:  1-10  11-30  31-50  51-70  71-90  91

From: Frenchy Pilou (PILOU)
28 Jul 2017   [#51] In reply to [#50]
Amazing indeed!
From: speedy (AL2000)
28 Jul 2017   [#52] In reply to [#50]
Hi Mike
look this
Stereo Sphere-
link :https://www.mediafire.com/?xni7d1ima5h4aio
in Elephant Stereo Sphere Parametrized
best
al
From: Mike (MGG942)
28 Jul 2017   [#53] In reply to [#52]
Thanks, Al.

I've not yet taken the plunge into node editor but you've given me another reason to do so.

Mike.
From: Mike (MGG942)
31 Jul 2017   [#54]
A way to make a solid version a 'Trumpet'.
The method is based on Max's marvellous _FXGraph3D and uses parametric equations from the equally marvellous MathMod.
Copy (Ctr-c) the following and then within Moi hit Tab and paste (Ctr-v)
_FxGraph3D cos(u)*sin(v); sin(u)*sin(v); cos(v)+log(tan(1/2*v));0;6.283;0.03;1.5;50;50;1;1;1;UV

Note. If you have done what I apparently have foolishly done and omitted the leading underscore of _FxGraph3D in your set up then you will need to omit it from the preceding line.

In (bottom right of) the _FxGraph3D dialog change Mode from UV to U then click on done.
Now select all the curves and execute Construct/Loft using Loft Style: Normal and Profiles: Auto
Delete (or hide) the curves. This should give you 'Trumpet' shaped surface with a slice out of it.
Select the surface and execute Construct/Offset/Shell using Thickness: 0.02mm and Direction: Centerline.
This should result in a solid.
Select the 8 edges that form the gap in the Trumpet, then copy (Ctrl-c) and paste (Ctrl-v) them and execute Edit/Join.
Then execute Construct/Loft using Loft Style: Normal and Profiles: Auto.
This should result in a solid filling the gap.
Select both solids and Boolean Union them together.
Here's the result:




Image Attachments:
TrumpetSolid.JPG 


From: Mike (MGG942)
31 Jul 2017   [#55]
Michael, I've being trying to use the idea of making a js file of the _FxGraph3D parameters but I'm having limited success.
Some work and some don't.

The following two work OK
Brian's leafsinh.js
moi.command.execCommand( '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' );
My MoebiusStripSolid.js
moi.command.execCommand( 'FxGraph3D cos(v)+u*cos(v/2)*cos(v);sin(v)+u*cos(v/2)*sin(v);u*sin(v/2);-0.4;0.4;0;6.20;15;15;1;1;1;UV' );

but this one (My TrumpetSolid.js) doesn't:
moi.command.execCommand( 'FxGraph3D cos(u)*sin(v);sin(u)*sin(v);cos(v)+log(tan(1/2*v));0;6.283;0.03;1.5;50;50;1;1;1;UV' );

For the life of me I can't see why.
When I try to run if from Max's Ext Scripts feature I get the following error:



Image Attachments:
TrumpetSolid error.JPG 


From: Michael Gibson
31 Jul 2017   [#56] In reply to [#55]
Hi Mike,

re:
> but this one (My TrumpetSolid.js) doesn't:
> moi.command.execCommand( 'FxGraph3D cos(u)*sin(v);sin(u)*sin(v);cos(v)+log(tan(1/2*v));0;6.283;0.03;1.5;50;50;1;1;1;UV' );

Can you please post the My TrumpetSolid.js file so I can test it over here and take a look?


> When I try to run if from Max's Ext Scripts feature I get the
> following error:

That error looks like it's trying to execute that string as direct script code rather than seeing it as a command and parameter for that command. That will happen if the command is not recognized. Do you possibly have some spaces in the front before FxGraph3D ?

- Michael
From: Mike (MGG942)
31 Jul 2017   [#57] In reply to [#56]
Thanks, Michael.

Don't think that I have spaces where they shouldn't be, but ...

Attached my two files,

The one that works, MoebiusStripSolid.js, and the one that doesn't TrumpetSolid.js

Note that neither have an underscore preceding FxGraph3D - you may need to add that for your set up.

Attachments:
MoebiusStripSolid.js
TrumpetSolid.js


From: bemfarmer
31 Jul 2017   [#58]
I did observe the error with Trumpet.js, but after spending an inordinate amount of time, I managed to
fix the problem. I'm using _ before the _Trumpet.js, and also _ before _FxGraph3D.

- Brian

Edit: It has been very confusing.
3rd party .js scripts without leading _ show up in Max's Ext.Scripts list at the tail end, after all the ones with leading _. (Which is alphabetical.)
The same script with a leading _ show up at the front side of the Ext.Scripts list, without the _.

I use _FxGraph3D. Some other people use FxGraph3D, without the leading _. (So a missing .js error can occur, due to alternate names, with/without leading _.

Also, a carriage return, or cr/lf, in the .js can cause the first "(" to not match up with the last ")", which also causes a parse error.
From: Michael Gibson
31 Jul 2017   [#59] In reply to [#57]
Hi Mike, both those files seem to be working ok for me over here (after adding an _ before FxGraph3D).

Can you give me some more details like where you're placing those files and how you're triggering them to be called?

- Michael
From: Mike (MGG942)
31 Jul 2017   [#60] In reply to [#59]
Thanks Brian and Michael.

Now working OK.

Suspect that the problem was having more than one instance of Moi running.

However, before thinking of that I added the leading underscore to _FxGraph3D.js and _FxGraph3D.htm and altered my files to match which did not fix the problem.
After that I shut all instances down and then started one only.
Then the files worked.

Bit hard to believe that the underscores were the problem so I suspect that while doing this sort of stuff with more that one instance of Moi running is a no-no.
From: Michael Gibson
31 Jul 2017   [#61] In reply to [#60]
Hi Mike, glad you're set up ok now. Having more than one instance running can cause problems with setting up shortcut keys since the moi.ini file will get written at program shutdown time and so the last exited instance will be the one that ends up actually setting the moi.ini file. So yeah when getting things like this set up it's a good idea to exit other instances but once it's all set up you should be fine to use it with multiple instances.

- Michael
From: Mike (MGG942)
31 Jul 2017   [#62] In reply to [#61]
Got it.

Thanks.
From: speedy (AL2000)
31 Jul 2017   [#63]
Hi Mike,
your job is very appreciates ;
remember, however:that
omitting Math formulas that do not everybody Know
, and , Using elementary geometric elements
Such ,curves, polygon ,circles ,etc.etc
And using Elephant ;
Not only do you get the desired result, but you can
using the parameters used, modify it as you like
And why not, re-use it in successive jobs-
Furthermore make the result more understandable
reached ...
what do you think about it...
In some cases, believe me, as with Moebius
The goal is very easy-
link :
http://www.mediafire.com/file/gmef25bhq2dnp42/Solidify_Moebius.rar
Then concluding We urge you to begin with
Know Elephant-
Have a nice day
al
From: bemfarmer
31 Jul 2017   [#64] In reply to [#60]
One more thought, is your setting in moi.ini "DisableFileCaching=y" ?
- Brian
From: Mike (MGG942)
31 Jul 2017   [#65] In reply to [#63]
Al I'm going to! Really!
I've already found 'Project Elephant's UNOFFICIAL Repository' and will dive right in
From: Mike (MGG942)
31 Jul 2017   [#66] In reply to [#64]
Just checked, Brian, and the answer is no.
I have: DisableFileCaching=n
Mike.
From: bemfarmer
31 Jul 2017   [#67] In reply to [#66]
So modification of a .js script which has just been run in MoI, is not recognized until MoI is restarted.
(A more or less answer?)
- Brian
From: Mike (MGG942)
31 Jul 2017   [#68] In reply to [#63]
OK, Al, I've dived in.
As you wrote, the Basic Parametric Moebius.nod is wonderfully interactive. Most impressive.
However understanding how the nod was created is quite another story.
I'll read the Wiki.
Any other resources that you can recommend for a raw beginner?
Mike.
From: speedy (AL2000)
1 Aug 2017   [#69] In reply to [#68]
Hi Mike

The recommendations for a newbie are as follows:
-
Knowing theNode, and getting in touch with them,
Understand what inputs are accepted and output results, etc .etc.
-
See if similarities with other modelers
Nodal- (Grasshopper for Rhino ), (Dynamo for Autocad)
for instance
-
Use the files that have been posted to the Forum
By me, by James, by Karsten etc etc
To understand the various steps and the results obtained

Lastly, persevere without being discouraged and beginning to think
to parametric modeling, planning the various phases
to reach the target...
My goal is "less it's more" but believe me not always and easy
succeed
Good depth
We'll talk with all , after the holidays..........
Greetings to you and all the friends of Forun
al
From: Mike (MGG942)
5 Aug 2017   [#70] In reply to [#63]
Al, Thank you for getting me started with Elephant.

I've been studying your Basic Parametric Moebius.nod and finding it difficult to understand how it could produce a solid Moebius strip when my many attempts to do so (outside of Elephant) have failed when using Loft to make the complete strip in one go.

Eventually - it took a while - I realised that your node is not producing a solid Moebius strip - with only one surface - but a strip with two surfaces. See below.
Did you also do the moebius.nod? No problem with the strips in that however I've temporarily given up trying to fully understand the nod - it's too complex for me at the moment.
Mike.




Image Attachments:
Basic Parametric Moebius.JPG 


Show messages:  1-10  11-30  31-50  51-70  71-90  91