{"_id":"@cadcam/tooth-color","_rev":"2-363f0c678c5c2207490801f174c31e2c","name":"@cadcam/tooth-color","dist-tags":{"latest":"1.1.1"},"versions":{"0.4.1":{"name":"@cadcam/tooth-color","version":"0.4.1","keywords":["mesh","label","tooth","FDI","color"],"author":"","license":"GPL-3.0-or-later","_id":"@cadcam/tooth-color@0.4.1","maintainers":[{"name":"emmanuel-lo","email":"snowray712000@gmail.com"}],"homepage":"https://github.com/snowray712000/cadcam-tooth-color#readme","bugs":{"url":"https://github.com/snowray712000/cadcam-tooth-color/issues"},"dist":{"shasum":"f9d3b398a5f36876020838fd4115c07f3b2f59da","tarball":"https://registry.npmjs.org/@cadcam/tooth-color/-/tooth-color-0.4.1.tgz","fileCount":4,"integrity":"sha512-U4iWrsXLoYwjieV7Cef+i7iVvcXOAUwGlUcdvxrnt5dM6EHGCgtxVsTvEOaBG9AG1nygNnBYgk9dTzVHUP6QeA==","signatures":[{"sig":"MEYCIQCWPIlIUW6vSUmc+3E0wdfAQadcRpsdsnTRXVxkjK6ZdwIhALSFXPWy/Ci7WcuitLlf7WwCg2ivUZI2AHUDZe1LmDqx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5557},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"033eda4d16bfc72bbcf39a4f546e48ecdc634076","scripts":{"dev":"vite demo","test":"vitest","build":"vite build demo --outDir ./../dist --emptyOutDir","preview":"vite preview demo","build:lib":"vite build --config ./vite.config.lib.js && copy src\\index.d.ts dist\\index.d.ts"},"_npmUser":{"name":"emmanuel-lo","email":"snowray712000@gmail.com"},"repository":{"url":"git+https://github.com/snowray712000/cadcam-tooth-color.git","type":"git"},"_npmVersion":"10.8.1","description":"Tooth label conversion and crown color utilities for CAD/CAM workflows.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.16","jsdom":"^29.1.1","three":"^0.184.0","vitest":"^4.1.5"},"_npmOperationalInternal":{"tmp":"tmp/tooth-color_0.4.1_1782217025356_0.6847737684783197","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@cadcam/tooth-color","version":"1.1.1","description":"Tooth label conversion and crown color utilities for CAD/CAM workflows.","main":"dist/index.js","types":"dist/index.d.ts","type":"module","sideEffects":false,"keywords":["mesh","label","tooth","FDI","color"],"scripts":{"dev":"vite demo","build":"vite build demo --outDir ./../dist --emptyOutDir","build:lib":"vite build --config ./vite.config.lib.js && copy src\\index.d.ts dist\\index.d.ts","preview":"vite preview demo","test":"vitest"},"author":"","license":"GPL-3.0-or-later","devDependencies":{"jsdom":"^29.1.1","three":"^0.184.0","vite":"^8.0.16","vitest":"^4.1.5"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"repository":{"type":"git","url":"git+https://github.com/snowray712000/cadcam-tooth-color.git"},"_id":"@cadcam/tooth-color@1.1.1","gitHead":"033eda4d16bfc72bbcf39a4f546e48ecdc634076","bugs":{"url":"https://github.com/snowray712000/cadcam-tooth-color/issues"},"homepage":"https://github.com/snowray712000/cadcam-tooth-color#readme","_nodeVersion":"24.12.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-9ukMK/OqsYX6uYWGWlXlj3u06hj1tcHWDyAlmj58r221XdLy6jRRo/geVF55YcIdsO1yjk7tjSJZH5rOtTUUIw==","shasum":"18999f04f789992a3ab5299db4cb6b806c31f747","tarball":"https://registry.npmjs.org/@cadcam/tooth-color/-/tooth-color-1.1.1.tgz","fileCount":4,"unpackedSize":5633,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICNxDwisPecCxHdIcbD3AU9ewMZ5kfa07+y0vrqgeZ7vAiAt4oZ6Lfi74sadQC0/PTeRl1TqHSCIqdDE4XlR/7U92g=="}]},"_npmUser":{"name":"emmanuel-lo","email":"snowray712000@gmail.com"},"directories":{},"maintainers":[{"name":"emmanuel-lo","email":"snowray712000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tooth-color_1.1.1_1782218389690_0.6361652634565882"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T12:17:05.138Z","modified":"2026-06-23T12:39:49.979Z","0.4.1":"2026-06-23T12:17:05.507Z","1.1.1":"2026-06-23T12:39:49.856Z"},"bugs":{"url":"https://github.com/snowray712000/cadcam-tooth-color/issues"},"license":"GPL-3.0-or-later","homepage":"https://github.com/snowray712000/cadcam-tooth-color#readme","keywords":["mesh","label","tooth","FDI","color"],"repository":{"type":"git","url":"git+https://github.com/snowray712000/cadcam-tooth-color.git"},"description":"Tooth label conversion and crown color utilities for CAD/CAM workflows.","maintainers":[{"name":"emmanuel-lo","email":"snowray712000@gmail.com"}],"readme":"### 目標\r\n\r\n- [demo index](https://snowray712000.github.io/cadcam-tooth-color/demo/)\r\n\r\n- 載入 .lobj 牙齒後，將 label 轉換為對應的顏色。\r\n- 需要先了解牙齒 FDI 編號\r\n  - arch_index 是 1-16 ， 上下顎分開 。\r\n  - FDI 眨是 1* 2* 是上顎， 3* 4* 是下顎\r\n  - 上色通常是使用 arch_index\r\n- 特色是\r\n  - 相鄰牙顏色不那麼接近，使用 色相 的概念。\r\n  - 左右對稱的牙是相近，但較暗。例如 FDI 的 11 和 21。\r\n\r\n### usage\r\n\r\n```js\r\nimport {\r\n  labels_cvt_to_arch_index_from_FDI,\r\n  labels_cvt_to_FDI_from_arch_index,\r\n  labels_to_colors_crown_unique,\r\n} from '@cadcam/tooth-color'\r\n\r\nconst { labels: archLabels, upperlower } = labels_cvt_to_arch_index_from_FDI([\r\n  11,\r\n  12,\r\n  21,\r\n])\r\n\r\nconst fdiLabels = labels_cvt_to_FDI_from_arch_index(archLabels, upperlower)\r\nconst colors = labels_to_colors_crown_unique(archLabels)\r\n```\r\n\r\n### demo\r\n\r\n```bash\r\nnpm run dev\r\n```\r\n\r\ndemo 會以 HTML/CSS/JS 展示 FDI、arch_index 與顏色對應。\r\n\r\n### API\r\n\r\n#### `labels_cvt_to_arch_index_from_FDI(labels)`\r\n\r\n將 FDI label 轉成 arch_index label。\r\n\r\n- `labels`: `ArrayLike<number>`\r\n- 回傳：`{ labels: number[], upperlower: 'upper' | 'lower' }`\r\n\r\n#### `labels_cvt_to_FDI_from_arch_index(labels, upperlower)`\r\n\r\n將 arch_index label 轉成 FDI label。\r\n\r\n- `labels`: `ArrayLike<number>`\r\n- `upperlower`: `'upper' | 'lower'`\r\n- 回傳：`number[]`\r\n\r\n#### `labels_to_colors_crown_unique(labels)`\r\n\r\n將 crown label 轉成 unique RGB color。\r\n\r\n- `labels`: `ArrayLike<number>`\r\n- 回傳：`number[][]`，每個 color 為 `[r, g, b]`，範圍為 `0-1`","readmeFilename":"readme.md"}