Loft


loft

Makes a loft through specified sections. This can be a computationally intensive operation with complex shapes and large number of sections.

Difference between loft and pipe: Pipe requires a spine. Loft does not.

Syntax

cadlib.loft(sections, options)

Parameters

Name Type Description
sections Array Array of wires to pass the loft through.
options Object See below for options.
options = {

    solid,  //default true, if false, a shell is returned
    ruled,  //default false, if true, loft sections are connected by lines. Set to false for smoother surface
    precision: 0.000001 
}



Returns

Solid or Shell

Example

// A very simple example of a loft using two circular wires

function build() {

    //define first profile 
    var edge = cadlib.circle(
        {x:0.0, y:0, z:0.0}, //center
        {x:0.0, y:1.0, z:0.0}, //normal
        10 //radius
    );

    //second profile shifted on the X and Y axis
	var edge2 = cadlib.circle(
        {x:10.0, y:10, z:0.0}, //center
        {x:0.0, y:1.0, z:0.0}, //normal
        10 //radius
    );
	
    //Supply two profiles for lofting
	var s = cadlib.loft( [cadlib.wire([edge]), cadlib.wire([edge2]) ]);

    //return the solid
    return s;
}