Pipe


pipe()

Creates a solid pipe from a curve(spine) and profiles. Pipe can be a solid or a shell depending on if the wires are closed.

Syntax

cadlib.pipe(spine, profile, mode);

Parameters

Name Type Description
spine Wire line or curve (wire) used to define spine of a pipe
profile Shape Shape can be either a Face or a Wire
mode String Optional. Case Sensitive. One of: Fixed(default) , CorrectedFrenet, ConstantNormal, Darboux, GuideAC, GuidePlan, GuideACWithContact, GuidePlanWithContact, DiscreteTrihedron

Returns

Solid

Example

Following code creates a cylinder passing through a single circular wire (circle). Spine is a straight line.


function build() {

    //define edge
    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
    );
	
    //Create face from edges. In this case, just one element in the array    
    var f = cadlib.faceFromEdges([edge]);

    //Line segments of the spine

    let line1 = cadlib.line({x:0, y:0, z:0}, {x:0, y:5, z:0});
    let line2  = cadlib.line({x:0, y:5, z:0}, {x:2, y:10, z:0});

    //make spine
    var spine = cadlib.wire([line1, line2]);

    //Builds the cylinder shape
    var s = cadlib.pipe(spine, f, 'ConstantNormal');

    //return the solid
    return s;
}


pipeShell()

Creates a solid or shell pipe from a spine and profiles

Syntax

cadlib.pipeShell(spine, profiles, options);

Parameters

Name Type Description
spine Wire Line or curve used to define spine
profiles Array List of Wires which represent the shapes thru which pipe passes
options Object see below for option attributes
options = {
    isFrenet: true| false,  false is default
    withContact:true|false,  false is default
    withCorrection:true|false, false is default
    solid: true|false,          false is default
    generateName:true|false     true is defaults
}

Note: If solid = false, a hole type shape is created

Returns

Solid