MoI discussion forum
MoI discussion forum

Full Version: can we do this at some point?

Show messages:  1-10  11-26

From: Frenchy Pilou (PILOU)
3 Apr 2020   [#11]
Extend Surf : French Version somewhere on the page! ;)

http://moiscript.weebly.com/trucs-astuces.html
From: Michael Gibson
3 Apr 2020   [#12] In reply to [#9]
Hi Pilou,

re:
> So can be considered as an parametric Offset Surface ?

Yes, sort of - but usually in CAD that name "Offset Surface" means making a result that is displaced by traveling along the surface normal.

This one instead goes in the UV directions of the surface. You can also put in negative values.

- Michael
From: Frenchy Pilou (PILOU)
3 Apr 2020   [#13] In reply to [#12]
"negative values" : never thougth of that! Very Cool!
From: BurrMan
4 Apr 2020   [#14] In reply to [#7]
yup, that'll do it!!!

Thanks Michael. No need to wait....

Really appreciate the work....
From: Frenchy Pilou (PILOU)
5 Apr 2020   [#15]
Seems this automatic extend don't works for the V3 !
Does this normal ?
From: Michael Gibson
5 Apr 2020   [#16] In reply to [#15]
Hi Pilou, it is possible to modify it to work with v3 - v3 needs to have temporary objects like the planes that are created to be added to the geometry database for async factories (like Flow) to be able to use them. V4 does not require that anymore, in v4 async factories can use "loose" objects (objects not in the geometry database) for input into async factories.

If you replace the Update() function with this below code then it should work on v3 too:

code:
function Update( objects, factories )
{
	while ( factories.length != 0 )
		factories.pop().cancel();

	var base_plane = CreatePlane( 0, 0, 1, 1 ).item(0).getFaces().item(0);

	for ( var i = 0; i < objects.length; ++i )
	{
		var obj = objects.item(i);

		var umin = moi.ui.commandUI.umin.value;
		var umax = moi.ui.commandUI.umax.value;
		var vmin = moi.ui.commandUI.vmin.value;
		var vmax = moi.ui.commandUI.vmax.value;

		var extended_plane = CreatePlane( -umin, -vmin, 1 + umin + umax, 1 + vmin + vmax );

		moi.geometryDatabase.addObject( base_plane.getParentBRep() );
		moi.geometryDatabase.addObjects( extended_plane );

		var factory = moi.command.createFactory( 'flow' );
		factory.setInput( 0, extended_plane ); // objects to deform
		factory.setInput( 1, base_plane );     // base object
		factory.setInput( 2, obj );			   // target object
		factory.setInput( 3, false );           // delete inputs
		factory.setInput( 7, false );          // swap uv
		factory.setInput( 8, false );          // Flip U
		factory.setInput( 9, false );          // Flip V
		factory.setInput( 10, false );         // Flip normal
		factory.setInput( 11, false );         // Projective
		factory.setInput( 12, false );         // Straight for projective

		factory.update();
		factories.push( factory );
		
		moi.geometryDatabase.removeObject( base_plane.getParentBRep() );
		moi.geometryDatabase.removeObjects( extended_plane );
	}
}



- Michael
From: Frenchy Pilou (PILOU)
5 Apr 2020   [#17] In reply to [#16]
Cool! But in what path file is this UpDate function? (for be sure)
From: bemfarmer
5 Apr 2020   [#18] In reply to [#17]
I replaced the UpDate function in the FlowExtendSrf.js file. (or thought I did...)

Edit: Deleted this faulty post.

- Brian
From: Frenchy Pilou (PILOU)
5 Apr 2020   [#19] In reply to [#18]
<< BUT, running the modified script in MoI3 resulted in (endless?) calculating process.

That was the same with the original for the V 3!

And the same with this update, (infinite calculus) there is surely a little bug somewhere...
From: Michael Gibson
5 Apr 2020   [#20] In reply to [#17]
Hi Pilou,

> Cool! But in what path file is this UpDate function? (for be sure)

Well the plugin only has 2 files for it, FlowExtendSrf.js and FlowExtendSrf.htm, and only one of those has an Update() function - FlowExtendSrf.js . That's the one that needs the new code.

- Michael
From: Michael Gibson
5 Apr 2020   [#21] In reply to [#18]
Hi Brian,

re:
> I replaced the UpDate function in the FlowExtendSrf.js file.

It looks like the files in your FlowExtendSrfMoI3.zip are the original versions not the updated ones?

Here's the updated file attached.

- Michael

Attachments:
FlowExtendSrf.js


From: Frenchy Pilou (PILOU)
5 Apr 2020   [#22] In reply to [#21]
Cool! I have missed the new version :)

Works even inside the Infinite Trial version 3 without save!


From: bemfarmer
5 Apr 2020   [#23] In reply to [#21]
Thank you Michael.

I made the changes, but somehow the changes went sideways.
This is not the first time I have had trouble with Notepad++ when reusing and modifying copies of files.
I'll have to be more diligent :-)

- Brian
From: Michael Gibson
5 Apr 2020   [#24] In reply to [#23]
No problem Brian! You might have gotten bit by a permissions issue. Files inside the c:\Program Files (x86) folder are restricted to be read only at the standard privilege level. If you right-click Notepad++ and use "Run as administrator", it will run at an elevated privilege which is then allowed to make changes to files in c:\ Program Files (x86)

Thanks
- Michael
From: bemfarmer
5 Apr 2020   [#25] In reply to [#24]
Yes :-)
- Brian
From: Finema
5 Apr 2020   [#26]
Thanks a lot Michael for the plug-in ! It's great.

Show messages:  1-10  11-26