MoI discussion forum
MoI discussion forum

Full Version: Boolean stencil?

Show messages: All  1-10  11-20

From: Michael Gibson
22 Jul 2019   [#11] In reply to [#7]
Hi Przemas, so for doing a script right now it's easiest to modify the current Trim command script to delete cutting objects and do a join at the end. I've attached a version that does this.

The delete part is from this added line:

code:
	moi.geometryDatabase.removeObjects( cutters );


and the join is from this added part:

code:
	var join_factory = moi.command.createFactory( 'join' );
	join_factory.setInput( 0, newobjs );
	join_factory.commit();



Does that then do the boolean stencil function you want?

- Michael

Attachments:
TrimStencil.zip


From: Frenchy Pilou (PILOU)
22 Jul 2019   [#12] In reply to [#11]
How to use it ? Pess Tab then write TrimStencil makes nothing?...

Must to edit the trim command also ? Or it's 2 different things ?
From: Michael Gibson
22 Jul 2019   [#13] In reply to [#12]
Hi Pilou, the one above is a separate command, I'll see about modifying the regular built in Trim command in a bit.

> Pess Tab then write TrimStencil makes nothing?...

Did you download it, unzip it, and copy it into a commands folder?

- Michael
From: Frenchy Pilou (PILOU)
22 Jul 2019   [#14] In reply to [#13]
< Did you download it, unzip it, and copy it into a commands folder?

Of course yes! :)

Edit : That works now for any reason!
That works as aspected but I don't see difference with my method above / final result...:)

Even it's perturbating if you select the cutting object and ask remove (after the mutual "OK" triming) you stay with just the intersection ! :)

So you must deplace it after the mutual triming!



TrimStencil here with 2 another volumes


It's not evident to have the remove of the cutting object!
We must make a Right Click and not Click on the "OK" button!
(here the extrude function after the TrimStencil)


From: Przemas
23 Jul 2019   [#15]
Thank you Michael, that's it! Is there a guide for scripting / macroing MoI? I'd like to modify it even further to automatically pick remove mode so I wouldn't have to do additional click.
Also when it comes to guides - is there a one that would show how do you add custom buttons? I've done mods for my Rhino and Modo installs and would like to see what can be done with MoI :) .

@Pilou: the result is identical in both cases , both manual and with trimstencil. The difference is in workflow - less clicks and that's what I'm looking for :) .

I'm liking what I see so far. Next time I'd probably try doing a sample project first in Rhino / Modo then in MoI so I could make more educated comparisons.
From: Frenchy Pilou (PILOU)
23 Jul 2019   [#16] In reply to [#15]
The manual method is 9 Clicks include Selection(s) of objects, call function(s), Parameter(s), final result! ;)
From: Michael Gibson
23 Jul 2019   [#17] In reply to [#15]
Hi Przemas,

re:
> Is there a guide for scripting / macroing MoI?

Not really, it unfortunately takes quite a bit of work to do a good job documenting and just generally supporting such things. That's why it hasn't been a big focus area so far.

There is some information here though:
http://moi3d.com/wiki/Scripting


> Also when it comes to guides - is there a one that would show how do you add custom buttons?

Not really, but if you're familiar at all with HTML it's pretty straightforward. You can see how the current UI is set up by opening up files like CommandBar.htm and SidePane.htm inside MoI's ui subfolder. You'll then see how buttons are set up as <moi:CommandButton> tags and you can add new ones in.

Is everything working ok under Wine now for you with __GL_MaxFramesAllowed=1 or are there still any problems when changing window size?

- Michael
From: Przemas
23 Jul 2019   [#18]
@Pilou: trimstencil is 5, so less -> that's a win :P . It get's even better in more complex situations (more objects for example). And note I'm not trying to force anyone to use a given method - quite the contrary, I fully understand often there are multiple ways to reach the solution. I simply tend to look for one that requires least amount of steps :) .

@Michael: thank you for the links. For sure will start tinkering in the weekend :) . Html should make it easy to do customization - glad to hear it works this way.

As for __GL_MaxFramesAllowed=1 - so far I haven't encountered any issues with the trial version. Tried in KDE and Gnome. No issues at all (fingers crossed) - really feels like a native app.
Atm I have some hope to try packaging the prepped version into Appimage. Should work a treat.
With MoI V4 and DXVK it should be even better :) (once it is released).
From: Frenchy Pilou (PILOU)
23 Jul 2019   [#19] In reply to [#18]
So you win... and we have won also a new command! ;) Thx to Michael for that!

And put it on my French site! ;) http://moiscript.weebly.com/trimstencil.html
(curiously i don't need to make a French translation...


From: TOM (SIRTOM)
29 Jul 2019   [#20]
Wow, thats a great new tool - thank you also from my side, Michael !

Show messages: All  1-10  11-20