Skip to content

Commit

Permalink
Fix build shape from brep string (#334)
Browse files Browse the repository at this point in the history
Fix build shape
  • Loading branch information
trungleduc authored Mar 13, 2024
1 parent a3e4d9b commit 234f9bf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/occ-worker/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ function buildModel(
let shapeData: IOperatorFuncOutput | undefined = undefined;
if (shapeFactory[shape]) {
shapeData = shapeFactory[shape]?.(parameters as IOperatorArg, model);
} else if (parameters['Shape'] && parameters['Type']) {
} else if (parameters['Shape']) {
// Creating occ shape from brep file.
shapeData = ObjectFile(
{ content: parameters['Shape'], type: parameters['Type'] },
model
);
const type = parameters['Type'] ?? 'brep';
shapeData = ObjectFile({ content: parameters['Shape'], type }, model);
} else if (shape.startsWith('Post::')) {
shapeData = shapeFactory['Post::Operator']?.(
parameters as IOperatorArg,
Expand Down

0 comments on commit 234f9bf

Please sign in to comment.