export class ShellsService {
    constructor(occ, shapeGettersService, converterService, facesService) {
        this.occ = occ;
        this.shapeGettersService = shapeGettersService;
        this.converterService = converterService;
        this.facesService = facesService;
    }
    getShellSurfaceArea(inputs) {
        const faces = this.shapeGettersService.getFaces(inputs);
        const faceAreas = this.facesService.getFacesAreas({ shapes: faces });
        return faceAreas.reduce((p, c) => p + c, 0);
    }
    sewFaces(inputs) {
        const sew = new this.occ.BRepBuilderAPI_Sewing(inputs.tolerance, true, true, true, false);
        inputs.shapes.forEach(face => {
            sew.Add(face);
        });
        const messageProgress = new this.occ.Message_ProgressRange_1();
        sew.Perform(messageProgress);
        const res = sew.SewedShape();
        const result = this.converterService.getActualTypeOfShape(res);
        sew.delete();
        messageProgress.delete();
        res.delete();
        return result;
    }
}
