Auto-fill shapes using the Add Point tool

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Auto-fill shapes using the Add Point tool

Post by Lost Marble »

Here are some modified scripts to allow auto-filling when using the Add Point and Translate Points tools. If you want to try them, download both scripts and put them in the following folder:

.../Moho/scripts/tool

It should be no problem to replace the existing scripts. If you decide you don't like the auto-fill function, just turn it off.

Here are the scripts:

http://www.lostmarble.com/moho/extras/s ... _point.lua
http://www.lostmarble.com/moho/extras/s ... points.lua

Look for the Auto-fill checkbox in the tool options area for these tools (it will be off by default). The scripts will try to fill a shape whenever you weld two points together. Only valid fills will actually happen.

What do you think?
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Well, dang, LM you beat me to it. I was just about to put the one I did up, but looking at your's it's pretty much the same way I coded it. The main differences are that I folded all the translate points stuff into the code of the Add tool. Didn't wan't to risk breaking tools that already worked. I also used the curve selection method from the Select Points tool, instead of the SelectConnected(). In many cases it seems to avoid creating new fills over existing ones (but certainly not all) Works better if you don't do the autowelding where curves intersect. So I'll put mine up too, for the hell of it.

AddPointW-Fill.zip

It's a slightly different way, and I feel like I'm banging my head against the wall half the time when I'm coding, so I figgered I might as well. Separate tool so it won't mess with anything essential, just unzip in the Moho/Scripts/Tools folder. When I get the chance I'll slap it into my Swiss Army Knife Point tool.

--Brian
Post Reply