MoI discussion forum
MoI discussion forum

Full Version: Scripting

Show messages:  1-20  21-40  41-60  61-68

From: Bravlin
13 Dec 2018   [#61]
How shall i query current tool context ? Is it possible ?
For example if i start Trim command dialog ?
From: Michael Gibson
13 Dec 2018   [#62] In reply to [#61]
Hi Bravlin, do you mean you want to get the name of the currently running command, if there is one, from script?

- Michael
From: Bravlin
13 Dec 2018   [#63]
Yes currently runing command or dialog.
From: Michael Gibson
13 Dec 2018   [#64] In reply to [#63]
Hi Bravlin, there isn't anything set up for a script to get that currently but I will add a property at moi.command.currentCommandName for the next v4 beta.

- Michael
From: bemfarmer
21 Dec 2021   [#65]
Hi Michael,

What are the inputs for "network"?

Inputs for network:

0 : ObjectList - curves.
1 :
2 :
3 :
4:
5:
6:

From network.js Moi command:
4 moi.ui.bindUIToInput( 'mode', 'value', factory.getInput(4) );
5 moi.ui.bindUIToInput( 'tolerance', 'value', factory.getInput(5) );
6 moi.ui.bindUIToInput( 'numpoints', 'value', factory.getInput(6) );

From network.nod:
4 nFac.setInput(4, this.properties.mode[0]);
// nFac.setInput(4, 'normal');
5 nFac.setInput(5, this.properties.tolerance[0]);
6 nFac.setInput(6, this.properties.numPts[0]);

- Brian

(I plan on using network in a .js, .htm script.)

Thank you
From: Michael Gibson
21 Dec 2021   [#66] In reply to [#65]
Hi Brian, the inputs for Network go like this:

0: Object list - U curves
1: Object list - V curves
2: List of curve orientation values - U orientations, each has a "flipped" bool value and a "seam" parameter value.
3: List of curve orientation values - V orientations
4: String - Mode, one of "normal", "lighter", "custom", "uniform"
5: number - Custom tolerance, Fitting tolerance to use when mode = "custom"
6: int - Uniform Num Points, Number of interior points to use when mode = "uniform".

If you pile up all the curves in input 0 and leave input 1 blank and the orientation lists blank it will automatically sort the curves into separate U and V lists and generate the orientations.

- Michael
From: bemfarmer
21 Dec 2021   [#67] In reply to [#66]
Thank you very much Michael.
Separate u v inputs, availability seems nice.
Does this have any speed advantage?

I wonder a bit about what "List of curve orientation values means and how it works.
But probably do not need it.

Saw something about coons patch also...

- Brian
From: Michael Gibson
21 Dec 2021   [#68] In reply to [#67]
Hi Brian,

re:
> Does this have any speed advantage?

Not much speed advantage, but if you already know which set a curve is supposed to be in if you separate them then you won't run the risk of the automatic sorter making a mistake in classifying them.


re:
> I wonder a bit about what "List of curve orientation values means and how it works.
> But probably do not need it.

They will be created automatically for you if you leave it blank. It stores whether a curve should be flipped from its natural direction when used in the network and where the closing seam point of a closed curve should be switched to from its natural seam when used in the network.


> Saw something about coons patch also...

A Coons patch is when you have just 4 boundary curves, there is an "exact" option that can be used in this case.

- MIchael

Show messages:  1-20  21-40  41-60  61-68