All files / lib/services/shapes face.ts

82.97% Statements 39/47
100% Branches 0/0
81.81% Functions 36/44
82.97% Lines 39/47

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190                            8x                       1x       1x               2x       1x       1x       1x       1x       1x       2x       15x                               2x       4x                       5x       3x       1x       1x       1x       1x       1x       1x       30x       2x       12x       13x       6x       6x       29x       30x       4x 4x 4x 4x 4x       35x       2x       1x       1x       4x      
import { Geom_Surface, OpenCascadeInstance, TopoDS_Face, TopoDS_Shape, TopoDS_Wire } from "../../../bitbybit-dev-occt/bitbybit-dev-occt";
import { OccHelper } from "../../occ-helper";
import * as Inputs from "../../api/inputs/inputs";
import { Base } from "../../api/inputs/inputs";
 
export class OCCTFace {
 
    constructor(
        private readonly occ: OpenCascadeInstance,
        private readonly och: OccHelper
    ) {
    }
 
    createFaceFromWire(inputs: Inputs.OCCT.FaceFromWireDto<TopoDS_Wire>): TopoDS_Face {
        return this.och.facesService.createFaceFromWire(inputs);
    }
 
    createFaceFromWireOnFace(inputs: Inputs.OCCT.FaceFromWireOnFaceDto<TopoDS_Face, TopoDS_Wire>): TopoDS_Face {
        return this.och.facesService.createFaceFromWireOnFace(inputs);
    }
 
    createFacesFromWiresOnFace(inputs: Inputs.OCCT.FacesFromWiresOnFaceDto<TopoDS_Face, TopoDS_Wire>): TopoDS_Face[] {
        return this.och.facesService.createFacesFromWiresOnFace(inputs);
    }
 
    createFaceFromWires(inputs: Inputs.OCCT.FaceFromWiresDto<TopoDS_Wire>): TopoDS_Face {
        return this.och.facesService.createFaceFromWires(inputs);
    }
 
    createFacesFromWires(inputs: Inputs.OCCT.FacesFromWiresDto<TopoDS_Wire>): TopoDS_Face[] {
        return this.och.facesService.createFacesFromWires(inputs);
    }
 
    createFaceFromWiresOnFace(inputs: Inputs.OCCT.FaceFromWiresOnFaceDto<TopoDS_Wire, TopoDS_Face>): TopoDS_Face {
        return this.och.facesService.createFaceFromWiresOnFace(inputs);
    }
 
    faceFromSurface(inputs: Inputs.OCCT.ShapeWithToleranceDto<Geom_Surface>) {
        return this.och.facesService.faceFromSurface(inputs);
    }
 
    faceFromSurfaceAndWire(inputs: Inputs.OCCT.FaceFromSurfaceAndWireDto<Geom_Surface, TopoDS_Wire>) {
        return this.och.facesService.faceFromSurfaceAndWire(inputs);
    }
 
    getUMinBound(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): number {
        return this.och.facesService.getUMinBound(inputs);
    }
 
    getUMaxBound(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): number {
        return this.och.facesService.getUMaxBound(inputs);
    }
 
    getVMinBound(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): number {
        return this.och.facesService.getVMinBound(inputs);
    }
 
    getVMaxBound(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): number {
        return this.och.facesService.getVMaxBound(inputs);
    }
 
    subdivideToPointsControlled(inputs: Inputs.OCCT.FaceSubdivisionControlledDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.subdivideToPointsControlled(inputs);
    }
 
    subdivideToPoints(inputs: Inputs.OCCT.FaceSubdivisionDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.subdivideToPoints(inputs);
    }
 
    subdivideToWires(inputs: Inputs.OCCT.FaceSubdivisionToWiresDto<TopoDS_Face>): TopoDS_Wire[] {
        return this.och.facesService.subdivideToWires(inputs);
    }
 
    subdivideToRectangleWires(inputs: Inputs.OCCT.FaceSubdivideToRectangleWiresDto<TopoDS_Face>): TopoDS_Wire[] {
        return this.och.facesService.subdivideToRectangleWires(inputs);
    }
 
    subdivideToRectangleHoles(inputs: Inputs.OCCT.FaceSubdivideToRectangleHolesDto<TopoDS_Face>): TopoDS_Face[] {
        return this.och.facesService.subdivideToRectangleHoles(inputs);
    }
 
    subdivideToNormals(inputs: Inputs.OCCT.FaceSubdivisionDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.subdivideToNormals(inputs);
    }
 
    subdivideToPointsOnParam(inputs: Inputs.OCCT.FaceLinearSubdivisionDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.subdivideToPointsOnParam(inputs);
    }
 
    wireAlongParam(inputs: Inputs.OCCT.WireAlongParamDto<TopoDS_Face>): TopoDS_Wire {
        return this.och.facesService.wireAlongParam(inputs);
    }
 
    wiresAlongParams(inputs: Inputs.OCCT.WiresAlongParamsDto<TopoDS_Face>): TopoDS_Wire[] {
        return this.och.facesService.wiresAlongParams(inputs);
    }
 
    subdivideToUVOnParam(inputs: Inputs.OCCT.FaceLinearSubdivisionDto<TopoDS_Face>): Base.Point2[] {
        return this.och.facesService.subdivideToUVOnParam(inputs);
    }
 
    subdivideToUV(inputs: Inputs.OCCT.FaceSubdivisionDto<TopoDS_Face>): Base.Point2[] {
        return this.och.facesService.subdivideToUV(inputs);
    }
 
    uvOnFace(inputs: Inputs.OCCT.DataOnUVDto<TopoDS_Face>): Base.Point2 {
        return this.och.facesService.uvOnFace(inputs);
    }
 
    pointsOnUVs(inputs: Inputs.OCCT.DataOnUVsDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.pointsOnUVs(inputs);
    }
 
    normalsOnUVs(inputs: Inputs.OCCT.DataOnUVsDto<TopoDS_Face>): Base.Vector3[] {
        return this.och.facesService.normalsOnUVs(inputs);
    }
 
    pointOnUV(inputs: Inputs.OCCT.DataOnUVDto<TopoDS_Face>): Base.Point3 {
        return this.och.facesService.pointOnUV(inputs);
    }
 
    normalOnUV(inputs: Inputs.OCCT.DataOnUVDto<TopoDS_Face>): Base.Vector3 {
        return this.och.facesService.faceNormalOnUV(inputs);
    }
 
    createPolygonFace(inputs: Inputs.OCCT.PolygonDto) {
        return this.och.facesService.createPolygonFace(inputs);
    }
 
    createCircleFace(inputs: Inputs.OCCT.CircleDto): TopoDS_Face {
        return this.och.entitiesService.createCircle(inputs.radius, inputs.center, inputs.direction, Inputs.OCCT.typeSpecificityEnum.face) as TopoDS_Face;
    }
 
    createEllipseFace(inputs: Inputs.OCCT.EllipseDto): TopoDS_Face {
        return this.och.entitiesService.createEllipse(inputs.radiusMinor, inputs.radiusMajor, inputs.center, inputs.direction, Inputs.OCCT.typeSpecificityEnum.face) as TopoDS_Face;
    }
 
    createSquareFace(inputs: Inputs.OCCT.SquareDto): TopoDS_Face {
        return this.och.facesService.createSquareFace(inputs);
    }
 
    createRectangleFace(inputs: Inputs.OCCT.RectangleDto): TopoDS_Face {
        return this.och.facesService.createRectangleFace(inputs);
    }
 
    createFaceFromMultipleCircleTanWireCollections(inputs: Inputs.OCCT.FaceFromMultipleCircleTanWireCollectionsDto<TopoDS_Wire>): TopoDS_Shape {
        return this.och.facesService.createFaceFromMultipleCircleTanWireCollections(inputs);
    }
 
    createFaceFromMultipleCircleTanWires(inputs: Inputs.OCCT.FaceFromMultipleCircleTanWiresDto<TopoDS_Wire>): TopoDS_Shape {
        return this.och.facesService.createFaceFromMultipleCircleTanWires(inputs);
    }
 
    getFace(inputs: Inputs.OCCT.ShapeIndexDto<TopoDS_Shape>): TopoDS_Face {
        return this.och.shapeGettersService.getFace(inputs);
    }
 
    getFaces(inputs: Inputs.OCCT.ShapeDto<TopoDS_Shape>): TopoDS_Face[] {
        return this.och.shapeGettersService.getFaces(inputs);
    }
 
    reversedFace(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): TopoDS_Face {
        const face = inputs.shape as TopoDS_Face;
        const reversed = face.Reversed();
        const result = this.och.converterService.getActualTypeOfShape(reversed);
        reversed.delete();
        return result;
    }
 
    getFaceArea(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): number {
        return this.och.facesService.getFaceArea(inputs);
    }
 
    getFacesAreas(inputs: Inputs.OCCT.ShapesDto<TopoDS_Face>): number[] {
        return this.och.facesService.getFacesAreas(inputs);
    }
 
    getFaceCenterOfMass(inputs: Inputs.OCCT.ShapeDto<TopoDS_Face>): Base.Point3 {
        return this.och.facesService.getFaceCenterOfMass(inputs);
    }
 
    getFacesCentersOfMass(inputs: Inputs.OCCT.ShapesDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.getFacesCentersOfMass(inputs);
    }
 
    filterFacePoints(inputs: Inputs.OCCT.FilterFacePointsDto<TopoDS_Face>): Base.Point3[] {
        return this.och.facesService.filterFacePoints(inputs);
    }
}