Jacobi Elliptic Functions, Seiffert Curve script
 1-9  10-29  30-31

Previous
Next
 From:  bemfarmer
6148.10 
Hi Michael

Is there any way to pass parameters from the .js file to the .htm file?

The only thing that seems to work is, for example: var curvefactory = moi.ui.commandUI.Update();
which does not have any parameters, but does return something, (object?) for curvefactory.
I've tried arrays, but they don't seem to work either.

I'm on my seventh rewrite try for "Seiffert script," but have not figured out everything yet.

Thank you,
- 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:  Michael Gibson
6148.11 In reply to 6148.10 
Hi Brian, yeah it should be possible to pass parameters from the .js script into a function in the .htm file.

They are running in different processes though (.htm file runs in moi.exe and the .js script in moi_commandprocessor.exe), and so I guess there could be some complications from that.

Do you have some code set up where you were using arrays being passed that you could post so I could test it?

- 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
6148.12 In reply to 6148.11 
Thank you Michael,
I'll post some tomorrow
- 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:  bemfarmer
6148.13 
Attached is version 8, the "final" version of SeiffertCurve script, which is FAST and doesn't seem to fail, provided
the values are kept less than a few hundred.

The "rate limiting" code of the curvefactory Update has the code inside of the .htm file, and the result is perhaps 10 times faster
than having all the code in the .js file.

I was unable to pass any parameter or arrays from .js to .htm file, without MoI having exceptions and being very slow.

So getting the endpoints and the unit sphere to Update was harder, but as those two are very short, and could be done fast as subroutine functions
in the .js file, that proved to be the way to do it. Having the end point showing allows the length of the curve to be adjusted, by trial and error.

The modulus k is locked to the range 0.1 to 10.0, or the negative. A negative modulus seems to be a mirror of the curve.
The Length factor, "numturns," is locked to positive, and greater than or equal to 0.1.
The number of points "per turn," is set to be at least 100.

For modulus of 1 or greater, the BoostC++ example was used to adjust the code so as to get a result that is a semi-spherical "hat."
(The prior code had an error, failure to swap cn and dn.)

If nothing else, it was good scripting practice.

- Brian

EDITED: 7 Jan 2022 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
6148.14 In reply to 6148.13 
I'll have to revisit this parameter passing between .js and .html, because looking over Michaels previous
help on the Clothoid script shows 2 points and a cplane being passed successfully from .js to .htm.

So I may have done something else wrong.

- 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:  Michael Gibson
6148.15 In reply to 6148.14 
Hi Brian,

> shows 2 points and a cplane being passed successfully from .js to .htm.

It could be something like objects created by MoI can be accessed between the different processes ok but maybe there's a problem with objects that are created directly by the JavaScript runtime itself like arrays are.

I'm not sure though, I would have thought that should be ok.

Let me know if you get something set up that doesn't work and I'll take a look at it, maybe it's something that needs to be tuned in the script system.

- 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
6148.16 In reply to 6148.15 
Thank you Michael. :-)
I think I'll try putting the point script into the html.
It's kind of nice to start with a script which works, and modify it a little at a time.

- 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:  coi (MARCO)
6148.17 In reply to 6148.16 
Hi Brian!

Sorry to "interrupt" this peaceful scripting thread, but i 've question regarding the adaptation of scripts.
I' ve been fiddling with different L-system environments for an ongoing project..mainly for modelling trees and distribution patterns, but they are such versatile generators for all sort of things.

https://en.wikipedia.org/wiki/L-system

I stumbled over this Javascript based L-System generator..

http://www.plastaq.com/elsy/

that's the underlying script:

http://www.plastaq.com/elsy/js/elsy.js

and was wondering, how much effort it would be(if at all possible) to port something like that to MOI?

Thanks in advance,
Marco

EDITED: 24 Sep 2013 by MARCO

  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)
6148.18 In reply to 6148.17 
Eons software give this for free ;)
http://www.plantfactory-tech.com/download/

I had not tested but pretty sure that there is something like inside somewhere ;)

  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:  coi (MARCO)
6148.19 In reply to 6148.18 
hoi pilou!

i'm more after a versatile but simple generator. some l-system generators do offer dxf export, so it would be possible to get the output into MOI, but i just wondered, as stated in my post, if it might actual be possible to bring this "power" into MOI via scripts.

eon plant factory is a very specific type of software..and quite pricey..there are cheaper alternatives to this.

..some deeper background information on L-systems by the "inventor" Aristid Lindenmayer:

The Algorithmic Beauty of Plants

http://algorithmicbotany.org/papers/#abop

- marco
  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)
6148.20 In reply to 6148.19 
Yep but the link that I have given was also free! ;)
<< Learn the Best 3D Plant Technology on Earth for FREE!
<< The Personal Learning Edition of Plant Factory is a fully functional version of Plant Factory Producer that lets you save your work and never expires.

Yes The L_System is a cool avatar of fractal (Benoit Mandelbrot) who is a cool avatar of Julia (Gaston Julia & Pierre Fatou) who is a cool avatar of...etc
Geometry is Fractal isn't ?
  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:  coi (MARCO)
6148.21 In reply to 6148.20 
yes, it has a recursive nature, like the Koch curve and Mandelbrot fractals, but Lindenmayer introduced a kind of a descriptive grammar based on axioms/rules to the whole concept.

quote:
The central concept of L-systems is that of rewriting. In general, rewriting is a technique for defining complex objects by successively replacing parts of a simple initial object using a set of rewriting rules or productions.


but you/it can produce all sort of "things"..
  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
6148.22 In reply to 6148.17 
Hi Marco

Took a very quick and brief look at the .js code. As an amateur programmer, I would have to study the code a lot more, just to figure out what it is doing,
during a winter "less busy" season. I'm do not know if Nurbs would be appropriate or not?

- 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:  Michael Gibson
6148.23 In reply to 6148.19 
Hi Marco,

> if it might actual be possible to bring this "power" into MOI via scripts.

Well, it's probably not too terrible to do a hard coded single fixed lsystem by a script.

Doing one that allows a highly interactive UI with a lot of adjustable parameters and mouse drawing is different though, just even planning how the interaction will work is probably quite involved and time consuming to develop.

- 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:  coi (MARCO)
6148.24 In reply to 6148.23 
Hi Michael!

..i've found ELSY to be more than sufficient in terms of INPUT parameters, but the HMI(Human-MOI-Interaction) is indeed another matter.

Just one question, is it actually possible to get a 3D DXF into MOI? I had no luck til now, but that might be something to do with the generators..most of them writing something like

quote:
3DFACE
8
1
62
1
10
-0.12687
20
5.54443


into the file and i presume, that's a no-no for MOI like the mesh data in the 3DM file format.

Thanks,
Marco
  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
6148.25 In reply to 6148.24 
Hi Marco, yeah MoI does not attempt to read polygon mesh data from DXF files, it can read LINE, CIRCLE, ARC, POINT, POLYLINE, LWPOLYLINE, ELLIPSE, or SPLINE entities out of the DXF file.

One possibility would be to use a mesh conversion program to convert the DXF file into an OBJ file and then use the OBJ to 3DM wireframe converter from here:
http://moi3d.com/resources#Obj23dmWireframe_converter

- 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:  Frenchy Pilou (PILOU)
6148.26 In reply to 6148.25 
So Sketchup or FreeCAd can make the conversion DXF OBJ ;) (in free)

http://www.freecadweb.org/
http://www.sketchup.com ... + http://rhin.crai.archi.fr/rld/plugin_details.php?id=790 (obj exporter plugin)

http://www.brothersoft.com/downloads/sketchup.html?fromsearch maybe only old free version import DXF so take the V6 ;)

EDITED: 25 Sep 2013 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
6148.27 
Hi Michael,

I was wondering if jQuery can be used with MoI scripts?
(Please excuse ignorant question:-)

- 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:  Michael Gibson
6148.28 In reply to 6148.27 
Hi Brian,

> I was wondering if jQuery can be used with MoI scripts?

It should be possible to use in scripts contained inside of .htm files.

- 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
6148.29 In reply to 6148.28 
Thank you Michael.
I'll have to do some research/learning, but not this week/month :-)

-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
 

Reply to All Reply to All

 

 
Show messages:  1-9  10-29  30-31