export class OCCTSolid {
    constructor(occ, och) {
        this.occ = occ;
        this.och = och;
    }
    fromClosedShell(inputs) {
        const shell = this.och.getActualTypeOfShape(inputs.shape);
        const builder = new this.occ.BRepBuilderAPI_MakeSolid_3(shell);
        const result = builder.Solid();
        builder.delete();
        shell.delete();
        return result;
    }
    createBox(inputs) {
        return this.och.bRepPrimAPIMakeBox(inputs.width, inputs.length, inputs.height, inputs.center);
    }
    createCube(inputs) {
        return this.och.bRepPrimAPIMakeBox(inputs.size, inputs.size, inputs.size, inputs.center);
    }
    createBoxFromCorner(inputs) {
        const box = this.och.bRepPrimAPIMakeBox(inputs.width, inputs.length, inputs.height, inputs.corner);
        const cornerBox = this.och.translate({ shape: box, translation: [inputs.width / 2, inputs.height / 2, inputs.length / 2] });
        box.delete();
        return cornerBox;
    }
    createCylinder(inputs) {
        return this.och.bRepPrimAPIMakeCylinder(inputs.center, inputs.direction ? inputs.direction : [0., 1., 0.], inputs.radius, inputs.height);
    }
    createCylindersOnLines(inputs) {
        const cylinders = inputs.lines.map(line => {
            return this.och.bRepPrimAPIMakeCylinderBetweenPoints(line.start, line.end, inputs.radius);
        });
        return cylinders;
    }
    createSphere(inputs) {
        return this.och.bRepPrimAPIMakeSphere(inputs.center, [0., 0., 1.], inputs.radius);
    }
    createCone(inputs) {
        const ax = this.och.gpAx2(inputs.center, inputs.direction);
        const makeCone = new this.occ.BRepPrimAPI_MakeCone_4(ax, inputs.radius1, inputs.radius2, inputs.height, inputs.angle);
        const coneShape = makeCone.Shape();
        makeCone.delete();
        ax.delete();
        return coneShape;
    }
    getSolidSurfaceArea(inputs) {
        return this.och.getSolidSurfaceArea(inputs);
    }
    getSolidVolume(inputs) {
        return this.och.getSolidVolume(inputs);
    }
    getSolidsVolumes(inputs) {
        return this.och.getSolidsVolumes(inputs);
    }
    getSolidCenterOfMass(inputs) {
        return this.och.getSolidCenterOfMass(inputs);
    }
    getSolidsCentersOfMass(inputs) {
        return this.och.getSolidsCentersOfMass(inputs);
    }
    getSolids(inputs) {
        return this.och.getSolids(inputs);
    }
    filterSolidPoints(inputs) {
        return this.och.filterSolidPoints(inputs);
    }
}
