... quand on n'y connait rien!
:)
Juste pour voir si c'était possible de nos jous!
J'aimais bien cette fonction dans TopMod ou Vectary
J'ai donc demandé à Banana 3ème du nom !
Voici sa réponse!
-----
To create a command (plugin) for MoI3D that generates an "arch" (or smooth bridge) between two selected faces, we can utilize the Blend factory. In NURBS modeling, creating a seamless, curved connection between two separate surfaces is typically done by blending their edges.
This script automates the process: it takes two selected faces, extracts their boundaries (edges), and runs the blend command to generate a smooth solid connecting them.
The JavaScript Code (MakeArch.js)
Save the following code into a text file named MakeArch.js.
To create a command (plugin) for MoI3D that generates an "arch" (or smooth bridge) between two selected faces, we can utilize the Blend factory. In NURBS modeling, creating a seamless, curved connection between two separate surfaces is typically done by blending their edges.
This script automates the process: it takes two selected faces, extracts their boundaries (edges), and runs the blend command to generate a smooth solid connecting them.
The JavaScript Code (MakeArch.js)
Save the following code into a text file named MakeArch.js.
JavaScript
/* MakeArch.js
MoI3D Command to create a smooth Blend (Arch) between 2 selected faces.
*/
function MakeArch() {
var gd = moi.geometryDatabase;
var faces = gd.getSelectedObjects().getFaces();
// Validation: Ensure exactly 2 faces are selected
if ( faces.length !== 2 ) {
moi.ui.alert( "Error: Please select exactly 2 faces to create an arch." );
return;
}
// Initialize the Blend factory
var factory = moi.command.createFactory( 'blend' );
// Input 0: Edges of the first face
// Input 1: Edges of the second face
factory.setInput( 0, faces.item(0).getEdges() );
factory.setInput( 1, faces.item(1).getEdges() );
// Optional: Adjust Bulge (1.0 is standard, higher is more 'arched')
// factory.setInput( 2, 1.0 );
// Generate the geometry
factory.commit();
// Optional: Select the new object and deselect the original faces
gd.deselectAll();
// (We cannot easily grab the exact new object ID after commit without listeners,
// but the new object will be created in the scene)
}
MakeArch();