-
Notifications
You must be signed in to change notification settings - Fork 0
feat(worker): support pattern marker loading in worker and plugin helper #5
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
Conversation
- Add loadMarker message handling in worker with ARController simulation - Add plugin.loadMarker() method with Promise-based API - Add logging for detectionResult and loadMarkerResult messages - Create examples/simple-marker with index.html, patt.hiro, and README - Support both browser and Node worker environments Co-authored-by: kalwalt <[email protected]>
|
@copilot Creating ArtoolkitPlugin instance... |
…ing node:worker_threads Only attempt to import node:worker_threads when in Node.js environment (typeof self === 'undefined'). In browser environments, skip the import entirely to avoid CORS policy violations. Co-authored-by: kalwalt <[email protected]>
Fixed in 372de54. The CORS error was caused by attempting to import |
|
@copilot now it can be loaded: [2025-11-02T00:15:58.322Z] Creating ArtoolkitPlugin instance... |
Implementation plan for pattern marker loading in worker and plugin integration:
Summary
Successfully implemented pattern marker loading support in worker and plugin integration.
Changed Files:
src/worker/worker.js- Added loadMarker message handler with ARController initialization, fixed CORS errorsrc/plugin.js- Added loadMarker() method with Promise-based APIexamples/simple-marker/index.html- Interactive example demonstrating marker loadingexamples/simple-marker/data/patt.hiro- Placeholder pattern fileexamples/simple-marker/README.md- Setup and usage instructionsKey Features:
Latest Fix:
Fixed CORS policy violation by checking environment (
typeof self === 'undefined') before attempting to importnode:worker_threads. The worker now only tries to import Node.js modules when actually running in a Node.js environment.Draft PR: #5
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.