MoI discussion forum
MoI discussion forum

Full Version: MoI embedded inside CPython 3.91?

Show messages:  1-20  21-40  41-44

From: bemfarmer
28 Mar 2021   [#41]
The following code performed the python script gNetP0.py, and produced the output Desktop\gNetP0.csv, from Desktop\gDomain3_12.csv. However there was no visible indicator in MoI that python had done its job.

code:
 
var res = moi.filesystem.shellExecute('cmd /c C:\\Users\\orcha\\Desktop2\\gNetP0.py', '', true );
if ( res.output ) moi.ui.alert( res.output );


Maybe some parameter could be added to show the action occured?
Or the gNetP0.py could have a completed print(...) message added at end...

- Brian

ps:
https://stackoverflow.com/questions/89228/how-to-execute-a-program-or-call-a-system-command-from-python

"If you're on Python 3.5 or later, you can use the new subprocess.run function, which is a lot like the above but even more flexible and returns a CompletedProcess object when the command finishes executing."

"...There are serious security implications if any part of the string that you pass can not..."
From: Michael Gibson
28 Mar 2021   [#42] In reply to [#38]
Hi Brian,

re:
> I take it that moi.filesystem.shellExecute(...) is running the Windows 10 shellexecute?
> (Or some Mac equivalent...?)

It depends - if the optional "WaitForFinished" function argument is false then it will run straight Win32 ShellExecute(). If "WaitForFinished" is true then it will use Qt QProcess to create the process, wait for it to finish, and capture it's output.

- Michael
From: bemfarmer
29 Mar 2021   [#43] In reply to [#33]
An attempt was made to offset or shell patch P0, and gyroid boundary patch.

It appears that the "symmetry" operations have resulted in Flip of some surface normals, as some patches offset or shell in opposite directions.
Also P1 and P2 offset or shell with a little wiggle near a corner.

PatchPO Shell Centerline, 0.02, works very well. Node creation from PatchPO Shell slolid to the boundary patch with 12 solids looks good.
Boolean union two of the 12 solid patches has not worked. But hiding two skins and deleting the two surfaces in common, does permit two solid patches to boolean.

A few stray curve segments were created a some time...

- Brian
From: bemfarmer
30 Mar 2021   [#44] In reply to [#43]
The 12 patches of the boundary surface do not quite meet at the center. Some faint grooves are visible in the resulting surface. Boolean union of the shelled patches created up to 3 each of sliver solids that look like lines... The python math is not perfect... Join was an alternative to Boolean union, also showing the 'grooves".
The project is probably sufficiently complete to move on...
Or further investigate the papers math for z coordinates...
And investigate the symmetry "Flips"...

- Brian

Boolean union once created or modified two offset surfaces which acted as one surface, and also sometimes deleted one surface...

Show messages:  1-20  21-40  41-44