Just for see if it is possible today! (without know anything in Java Script! :)
I was always amazed by this function in TopMod or Vectary
So I ask to Banana 3 Following it's answer !
-----
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)
}
How to Install and Use
Locate the Commands Folder:
Windows: C:\Program Files\MoI 4.0\commands (or your version).
Mac: Right-click the MoI app icon > Show Package Contents > drive_c > moi > commands.
Save the File: Place MakeArch.js into this folder.
Run the Command:
Open MoI3D.
Select 2 Faces (e.g., the top faces of two separate pillars or cylinders).
Press Tab, type MakeArch, and hit Enter.
How it Works
The Logic: The script acts as a "Bridge" tool. It grabs the loop of edges from Face A and Face B and tells MoI to calculate a Blend surface between them.
The Shape: Because it uses Blend (and not Loft), the connection will maintain tangency (smoothness) with the source faces, creating a curved "Arch" look rather than a straight pipe.
Troubleshooting
Twisting: If the arch looks twisted, the automatic alignment of the edge start points might be off. This is common in automated scripts. In that case, use the manual Blend command to adjust the "Seam" points.
Flatness: If the faces are perfectly coplanar (flat on the same ground), the blend might try to stay flat. Angle your faces slightly towards each other for a better arch.
... Moi3D Custom Scripts setup ...
I selected this video because it provides a clear visual guide on how to set up custom scripts and hotkeys in MoI3D, which is necessary to install the plugin code provided above.
Hello seems Moid 3D needs curves or edges for the Blend function!
That you propose is for other progs like Rhino not Moi3D!
------
You are absolutely right to point that out. In MoI3D, the native blend factory is strictly designed to work with Curves or Edges, and it often fails if you feed it a list of multiple edges (like a square face's 4 edges) without joining them first.
To make this work reliably for Faces (whether they are circles, rectangles, or complex polygons), the script must first Join the edges of each face into a single composite curve in the background, and then Blend those two curves.
Here is the corrected and robust plugin code.
The Improved Script (MakeArch.js)
This version creates a temporary "joined curve" for each face in memory, ensuring the Blend tool receives exactly one clean input per side.
/* MakeArch.js
Creates a Blended Arch between 2 selected Faces.
Improvements:
- Automatically gathers all edges of a face.
- JOINS them into a single curve (essential for non-circular faces).
- Runs the Blend command on these joined curves.
*/
function MakeArch() {
var gd = moi.geometryDatabase;
var faces = gd.getSelectedObjects().getFaces();
// Helper: Join a Face's edges into a single Curve object
function getJoinedCurve( face ) {
var joinFactory = moi.command.createFactory( 'join' );
joinFactory.setInput( 0, face.getEdges() );
// .calculate() creates the object in memory without adding to the scene yet
var resultList = joinFactory.calculate();
joinFactory.cancel();
return resultList;
}
// 2. Create joined curves for both faces
// This handles cases where a face is made of 4 edges (rectangle)
// by turning them into 1 joined loop for the Blend tool.
var curveListA = getJoinedCurve( faces.item(0) );
var curveListB = getJoinedCurve( faces.item(1) );
// 3. Setup the Blend Factory
var blendFactory = moi.command.createFactory( 'blend' );
blendFactory.setInput( 0, curveListA );
blendFactory.setInput( 1, curveListB );
// Optional: Set Bulge (Default is 1.0).
// Increase to ~2.0 for a higher arch, decrease to ~0.5 for a flatter one.
blendFactory.setInput( 2, 1.0 );
// 4. Create the final geometry
blendFactory.commit();
// Cleanup selection
gd.deselectAll();
}
MakeArch();
Why this works better
Rectangles/Polygons: A rectangular face has 4 edges. If you send them directly to Blend, MoI gets confused about which edge connects to which. This script runs Join first, so Blend sees only one continuous loop per side.
Cylinders: A cylinder top is 1 edge. The script still works (joining 1 edge results in 1 curve) so it is universal.
Memory Management: It uses calculate() for the intermediate step, so it doesn't leave messy "temp curves" floating in your scene; it only creates the final Arch.
Installation Check
Save as MakeArch.js in your \commands\ folder.
Restart MoI3D (or reload scripts).
Select 2 faces -> Press Tab -> Type MakeArch.
This approach mimics the manual workflow of "Select Edges -> Join -> Select Other Edges -> Join -> Blend" in a single click.