MoI discussion forum
MoI discussion forum

Full Version: Log Spiral

Show messages:  1-12  13-31

From: bemfarmer
18 Jul 2022   [#13] In reply to [#12]
Hi Larry,

Clicking on a line of text, in order to cause a certain value to be restored, was borrowed from one of Max's scripts.

The "grow_shrink" default "b" exponent value of 0.306349... (an irrational number), is calculated from the Golden Ratio number (1+sqrt(5))/2, = about 1.618...,
also irrational, and yields the Golden Logarithmic spiral (within some decimal tolerance or approximation, because the decimals go on forever).
In the event the value of "grow_shrink" is changed by the user, clicking on the Click line of text, restores the "grow_shrink" value to 0.306349...

I agree that there could be some confusion about clicking on the text line.
Perhaps someone knows of a different control "button" which could be clicked on, placed next to the Click for Golden Spiral.
Maybe a "radio button"?
Another checkbox button does not seem quite right, because the checkbox check persists, unless script could be added to both the grow_shrink slider, and the grow_shrink entry slot, which would uncheck the checkbox, in the event some other value is chosen?

I do not know which new control button would be appropriate...
Maybe Michael would have a better idea...
Maybe a button could be named "here"? And have a different color?
Or the whole text line could become a "button", a different color in a rounded box.
Part of the htm or html code is ... onclick='growthslider.value=0.306349; moi.ui.fireUIEvent("growthslider");...Click for Golden Spiral...

So some augmentation of the .htm code would be nice...
https://www.w3docs.com/snippets/html/how-to-make-button-onclick-in-html.html
So maybe all that needs to be added is a couple of "button" controls? And maybe a color change?

The onclick button needs to look like a button...

- Brian
From: bemfarmer
18 Jul 2022   [#14] In reply to [#13]
Changed the "Click for Golden Spiral" to a button, but it looks like a parameter entry box.

Did not change color. Looks like html could be used, or CSS, or both.
Do not know how best to be compatible with MoI "themes".
Maybe I should be using <moi:LabelButton?, like for the blue help button?

Modified Help text for "Click for Golden Spiral.

- Brian
From: Larry Fahnoe (FAHNOE)
18 Jul 2022   [#15] In reply to [#13]
Hi Brian,

Ah, I see how it works now, thanks!

I'm not much of a UI guy...I end up copying other people's patterns... The button idea sounds like a logical UI element for the purpose and if that doesn't work, either a "here" using a different color in the text should help guide the user.

On edit:

Just grabbed LogSpiral6.zip and it is much clearer.

--Larry
From: bemfarmer
18 Jul 2022   [#16] In reply to [#15]
Hi Larry,

Thank you for your prompting to make things more understandable.

- Brian
From: Michael Gibson
18 Jul 2022   [#17] In reply to [#14]
Hi Brian, for the button probably use a <moi:PushButton>, like:

<moi:PushButton>Golden Spiral</moi:PushButton>

That should make it look like other buttons.

- Michael
From: bemfarmer
18 Jul 2022   [#18] In reply to [#17]
Thank you Michael.

Redid the PushButton in the .htm file from good version6 file, and now it works.

*****
Notepad++ formats .htm code with different colors, black, red, bold, for certain html code portions.
Various MoI code is not formatted this way.
Wonder if some simple addon to Notepad++ would do such formatting?,
or maybe it would not be worth the effort...?

- Brian
From: Michael Gibson
18 Jul 2022   [#19] In reply to [#18]
Hi Brian, you should be able to have an onclick="" event handler on a <moi:PushButton>. I'll give it a test on your file.

re:
> I cannot get the LogSpiral6b script to run, even if I delete the pushbutton completely,
> so I must have zonked something else?
> Or is there a cache rerunning the older version of the script?

It looks like the zonked thing is you've got the file named _LogSpiral6b.html (note ending l in html) while MoI is expecting it to be named _LogSpiral6b.htm (note just .htm not .html).

- Michael
From: Michael Gibson
18 Jul 2022   [#20] In reply to [#18]
Hi Brian, sounds like you've got the <moi:PushButton> working ok now?

One other thing to note, if you give a control in the command UI an id="" value then it will automatically generate a UI event of that id value when it is clicked or updated or whatever it does.

- Michael
From: bemfarmer
18 Jul 2022   [#21] In reply to [#20]
Thank you Michael.

.html vs htm, my mistake. (I'll blame it on the computer helping me out with extension.)

put " " around 0.306349. (does not seem to matter.)

added missing table closure. ( absence did not seem to matter.)

Script is working good now. PushButton looks nice.

- Brian

ps,
per google search, As of June 2022, it is not possible to disable the popup on Hover of the news/weather, in Windows 11. (Very annoying.)
From: bemfarmer
18 Jul 2022   [#22] In reply to [#20]
re:
>One other thing to note, if you give a control in the command UI an id="" value then it will automatically generate a UI event of that id value when it is clicked or updated or whatever it does.

So in another situation, PushButton could feed a value into the .js file?

- Brian
From: bemfarmer
18 Jul 2022   [#23] In reply to [#22]
I should rename the PushButton "Restore Golden Spiral"

- Brian
From: Michael Gibson
18 Jul 2022   [#24] In reply to [#22]
Hi Brian,

re:
> So in another situation, PushButton could feed a value into the .js file?

Yup! Usually the .js file will have an event loop in it and can respond to the event triggered by the button.

- Michael
From: Larry Fahnoe (FAHNOE)
19 Jul 2022   [#25] In reply to [#23]
The PushButton in LogSpiral7 looks good Brian.

> I should rename the PushButton "Restore Golden Spiral"

I'd suggest that it simply say "Golden Spiral" as it is now a clear UI element whose function is to reset the Grow_Shrink to the proper value to produce the Golden Spiral.

On edit:

The help text "To revert to the default Golden Spiral, Click on the box: Click for Golden Spiral." might be simplified to "Click the Golden Spiral button to revert to the Golden Spiral."

--Larry
From: bemfarmer
24 Jul 2022   [#26]
Version 8 of LogSpiral.

As per Larry, renamed pushbutton and changed help text.

Changed color of pushbutton text to html darkgoldenrod.

- Brian
From: Larry Fahnoe (FAHNOE)
24 Jul 2022   [#27] In reply to [#26]
Looks good Brian & again, a neat script!

--Larry
From: bemfarmer
7 Aug 2022   [#28]
"Final" update to LogSpiral scripts. This would be version9, but I removed the version number.
Got rid of darkgoldenrod color.
Added elastica style centerPlane1 Frame, so the LogSpiral will form in any of the seven MoI Views, parallel to it's axis grid, including previously set CPlane Frame.

If user has an old LogSpiral script in a commands folder that the user wishes to keep, suggest renaming it LogSpiralOLD.

Thought about getting rid of underline, but did not.

- Brian

Attachments:
LogSpiral2022.zip


From: Larry Fahnoe (FAHNOE)
8 Aug 2022   [#29] In reply to [#28]
Looks good Brian, neat to be able to use any view as well, thanks!

--Larry
From: bemfarmer
18 Oct   [#30]
Here is an update of LogSpiral script, and may be installed in the MOI AppData>commands folder, if Custom UI is installed.
It is essentially the same as the 2022 version, but the blue help button information was updated.
It was good to refresh memory of the 2022 code, preparatory to a Conical Logarithmic spiral, also known as a ConchoSpiral.
Note that the name remains LogSpiral, without any underscore (_) prefix. The script will show up in Max's CustomUI, to the right of any scripts with underscore (_) prefixes.
The 2022 version may be overwritten.

For user selection of the center point of the spiral in any one of the six 2D views, if other geometry is in the way, said geometry may be temporarily hidden by the user.

- Brian

Attachments:
LogSpiral2024.zip


From: Frenchy Pilou (PILOU)
19 Oct   [#31]
For test the script Log Spiral by BemFarmer
Alpaca






















Show messages:  1-12  13-31