Skip to main content


This example shows how to construct a simple triangle.

const builder = new oc.BRep_Builder();
const aComp = new oc.TopoDS_Compound();
const path = [[-50, 0, 0], [50, 0, 0], [50, 100, 0]].map(([x, y, z]) => new oc.gp_Pnt_3(x, y, z));
const makePolygon = new oc.BRepBuilderAPI_MakePolygon_3(path[0], path[1], path[2], true);
const wire = makePolygon.Wire();
const f = new oc.BRepBuilderAPI_MakeFace_15(wire, false);
builder.Add(aComp, f.Shape());

Just because you can doesn't mean you should

If you solely want to operate on polygonal data then there's no need for a fully blown CAD kernel like OpenCascade.js.