Closed bernhard-42 closed 2 years ago
This works in cq-viewer.html
:
function trimUI() {
viewer.trimUI(["ortho", "axes0"], false);
}
function render(model) {
viewer?.clear();
const [shapes, states] = model;
const [group, tree] = viewer.renderTessellatedShapes(shapes, states, options);
viewer.render(group, tree, states, options);
setTimeout(trimUI, 100);
}
function nc(change) {
// console.debug('viewer info:', JSON.stringify(change, null, 2));
}
function updateView(new_options) {
container.innerHTML = '';
viewer = new Viewer(container, Object.assign({}, options, new_options), nc);
setTimeout(trimUI, 100);
}
Of course, you shouldn't use setTimeout
, but it is a hint that the asynchronous building of the DOM in the background is not ready immediately after new Viewer
. You might want to observe whether the viewer is ready, e.g. via an observer as in https://github.com/bernhard-42/three-cad-viewer/blob/ac71278ba4425e46dffc10d37f4dc1f562c3976a/src/treeview.js#L177-L191 (or any smarter method)
Thanks! I will investigate this.
I have installed CadQuery locally and then I get great code completion and syntax help on hovering.
It's an interesting feature actually, I may provide a cadquery type hinting module for users that use the cadquery server.
It should be fixed in the last release. Want to give a try?
works for me now, closing
I have installed CadQuery locally and then I get great code completion and syntax help on hovering. See https://github.com/bernhard-42/jupyter-cadquery/issues/78