Skip to content

Commit 6ddbb83

Browse files
added from right handed option to saveShapeStep
1 parent 169183d commit 6ddbb83

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

packages/dev/occt-worker/lib/api/occt/shapes/face.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class OCCTFace {
4040
* @shortname faces from wires on face
4141
* @drawable true
4242
*/
43-
createFacesFromWiresOnFace(inputs: Inputs.OCCT.FacesFromWiresOnFaceDto<Inputs.OCCT.TopoDSWirePointer, Inputs.OCCT.TopoDSFacePointer>): Promise<Inputs.OCCT.TopoDSFacePointer> {
43+
createFacesFromWiresOnFace(inputs: Inputs.OCCT.FacesFromWiresOnFaceDto<Inputs.OCCT.TopoDSWirePointer, Inputs.OCCT.TopoDSFacePointer>): Promise<Inputs.OCCT.TopoDSFacePointer[]> {
4444
return this.occWorkerManager.genericCallToWorkerPromise("shapes.face.createFacesFromWiresOnFace", inputs);
4545
}
4646

packages/dev/occt/lib/api/inputs/occ-inputs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5508,6 +5508,12 @@ export namespace OCCT {
55085508
* @default false
55095509
*/
55105510
adjustYtoZ = false;
5511+
/**
5512+
* Will assume that the shape is created in right handed coordinate system environment
5513+
* and will compensate by not mirroring the shape along z axis
5514+
* @default false
5515+
*/
5516+
fromRightHanded? = false;
55115517
/**
55125518
* Will attempt to downlaod the file if that is possible
55135519
* @default true

packages/dev/occt/lib/occ-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class OccHelper {
5656
public readonly shapesHelperService: ShapesHelperService,
5757
public readonly occ: OpenCascadeInstance,
5858
) {
59-
59+
this.base = new BaseBitByBit();
6060
this.occRefReturns = new OCCReferencedReturns(occ);
6161
this.iteratorService = new IteratorService(occ);
6262
this.enumService = new EnumService(occ);

packages/dev/occt/lib/services/io.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ export class OCCTIO {
1515
let adjustedShape;
1616
if (inputs.adjustYtoZ) {
1717
const rotatedShape = this.och.transformsService.rotate({ shape: inputs.shape, axis: [1, 0, 0], angle: -90 });
18-
adjustedShape = this.och.transformsService.mirrorAlongNormal(
19-
{ shape: rotatedShape, origin: [0, 0, 0], normal: [0, 0, 1] }
20-
);
21-
rotatedShape.delete();
18+
if (inputs.fromRightHanded) {
19+
adjustedShape = rotatedShape;
20+
} else {
21+
adjustedShape = this.och.transformsService.mirrorAlongNormal(
22+
{ shape: rotatedShape, origin: [0, 0, 0], normal: [0, 0, 1] }
23+
);
24+
rotatedShape.delete();
25+
}
2226
}
2327
const fileName = "x";
2428
const writer = new this.occ.STEPControl_Writer_1();
@@ -115,7 +119,7 @@ export class OCCTIO {
115119
if (incrementalMeshBuilder) {
116120
incrementalMeshBuilder.Delete();
117121
}
118-
122+
119123
return result;
120124
}
121125

0 commit comments

Comments
 (0)