I've been trying to hunt that bug but no luck so far.
When you add >1 gProcessors and viewers, the object rendering fails (though axes may still show). It can show a small garbled object.
It does work however if you either run it all sync via the parseJsCadScriptSync variant, or if you time the web workers to ensure they execute in sequence.
Do you have any idea where to start looking?
To re-create (possibly have to use a non-trivial object, like intersection cube/sphere):
Try to add 3 gProcessors in index.html:
var gProcessor=null; var gProcessor2=null; var gProcessor3=null;
...
function onload()
{
gProcessor = new OpenJsCad.Processor(document.getElementById("viewer"), options);
gProcessor2 = new OpenJsCad.Processor(document.getElementById("viewer2"), options);
gProcessor3 = new OpenJsCad.Processor(document.getElementById("viewer3"), options);
}
...
function updateSolid()
{
gProcessor.clearViewer();
gProcessor2.clearViewer();
gProcessor3.clearViewer();
gProcessor.setJsCad(document.getElementById('code').value);
gProcessor2.setJsCad(document.getElementById('code').value);
gProcessor3.setJsCad(document.getElementById('code').value);
}
I've been trying to hunt that bug but no luck so far. When you add >1 gProcessors and viewers, the object rendering fails (though axes may still show). It can show a small garbled object. It does work however if you either run it all sync via the parseJsCadScriptSync variant, or if you time the web workers to ensure they execute in sequence.
Do you have any idea where to start looking?
To re-create (possibly have to use a non-trivial object, like intersection cube/sphere): Try to add 3 gProcessors in index.html:
...
...
...