Skip to content

Commit 234f9bf

Browse files
authored
Fix build shape from brep string (#334)
Fix build shape
1 parent a3e4d9b commit 234f9bf

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/occ-worker/src/actions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ function buildModel(
2929
let shapeData: IOperatorFuncOutput | undefined = undefined;
3030
if (shapeFactory[shape]) {
3131
shapeData = shapeFactory[shape]?.(parameters as IOperatorArg, model);
32-
} else if (parameters['Shape'] && parameters['Type']) {
32+
} else if (parameters['Shape']) {
3333
// Creating occ shape from brep file.
34-
shapeData = ObjectFile(
35-
{ content: parameters['Shape'], type: parameters['Type'] },
36-
model
37-
);
34+
const type = parameters['Type'] ?? 'brep';
35+
shapeData = ObjectFile({ content: parameters['Shape'], type }, model);
3836
} else if (shape.startsWith('Post::')) {
3937
shapeData = shapeFactory['Post::Operator']?.(
4038
parameters as IOperatorArg,

0 commit comments

Comments
 (0)