From 5b2298d3996665e7df59cca35ebdbad95b7a3ad5 Mon Sep 17 00:00:00 2001 From: Etienne Rossignon Date: Thu, 20 Jul 2023 09:57:37 +0200 Subject: [PATCH] writeStep and readSter use Shape rather than Solid --- lib/interfaces.ts | 13 ++++++------- test/test_makePipeShell.ts | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/interfaces.ts b/lib/interfaces.ts index 108ab88..e2bc7cd 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -243,6 +243,8 @@ export interface IWire extends IShape { polygonize(): Float32Array; } +export type Shape = ISolid | IWire | IFace | IShell | IVertex; + export interface OCC { makeAxis(): IAxis; @@ -383,13 +385,10 @@ export interface OCC { gc(): void; - writeSTEP(filename: string, solid: ISolid): boolean; - writeSTEP(filename: string, solids: ISolid[]): boolean; - writeSTEP(filename: string, ...solids: ISolid[]): boolean; - readSTEP( - filename: string, - callback: (err: Error | null, solids: ISolid[]) => void - ): void; + writeSTEP(filename: string, shape: Shape): boolean; + writeSTEP(filename: string, shapes: Shape[]): boolean; + writeSTEP(filename: string, ...shapes: Shape[]): boolean; + readSTEP(filename: string, callback: (err: Error | null, shapes: Shape[]) => void): void; writeBREP(filename: string, solid: ISolid): boolean; writeBREP(filename: string, solids: ISolid[]): boolean; diff --git a/test/test_makePipeShell.ts b/test/test_makePipeShell.ts index 06f9025..d735fa7 100644 --- a/test/test_makePipeShell.ts +++ b/test/test_makePipeShell.ts @@ -78,8 +78,8 @@ describe("makePipeShell", () => { const spine = occ.makeWire(occ.makeLine([0, 0, 0], [0, 0, 10])); - const angleInDegree = 180; - const height = 40; + const angleInDegree = 90; + const height = 10; const points = makeHelixPoints({ startPoint: p1, angleInDegree, height, nbPoints: 10 }); // we want a auxilary curve, one point should coincide with one edge of the triangle and