-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update worker and 3D viewer #230
Conversation
722fde8
to
3402da1
Compare
513edd1
to
3ba9380
Compare
d49b823
to
2b91431
Compare
...module | ||
}).then(async oc => { | ||
for (const lib of libs) { | ||
await oc.loadDynamicLibrary(lib, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what is this and why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had an issue with building the Salome extension because of missing interfaces in opencascade.js
so I tried to remove the opencascade.js
dependency since we only need the init function.
It turned out the problem was a missing typescript config in the Salome extension, we can roll back to using the function provided by opencascade.js
@@ -18,6 +18,15 @@ | |||
} | |||
}, | |||
"additionalProperties": false | |||
}, | |||
"outputs": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to provide a way to clean outputs in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, adding it now, the output needs to be deleted when the operator is removed
Co-authored-by: martinRenou <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Code changes:
Update JCAD format:
outputs
field with the following schemaThis field contains the output of the post-processing operator. The 3D viewer uses this field to render the shapes without re-run all post-processing operators at startup,
Post::Operator
with the following schema:This is a base part for all post-processing operators, the extensions need to extend this schema with the part prefixed with
Post::
to be picked byJupyterCad
New tokens
IJCadFormSchemaRegistryToken
: token allowing extension to register new form schema, this helps create parameter form and dialog.IJCadExternalCommandRegistryToken
: token allowing extension to add buttons to the JupyterCad toolbarNew worker system
IJCadWorkerRegistryToken
token now exposes a default worker usingocc-worker
and allows registering more workers for the post-processing operator.IJCadWorker
interface.New rendering routine:
WorkerAction.LOAD_FILE
message to the default worker, the default worker then returns the parsed OCC shapes with the same flag. The viewer will render the OCC shapes and use data fromoutputs
field of the shared model to render the post-processing operators.WorkerAction.LOAD_FILE
message to the default worker and get back the parsed OCC shapes and also the BREP strings of objects required in the post-processing operator.WorkerAction.POSTPROCESS
message. Once the workers finish processing data, they send back to the 3D view the STL string of processed shapes with theMainAction.DISPLAY_POST
message.outputs
field of the shared model.closes #236