-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
why?
<CadViewer /> is good, but you can't swap the renderer, lightning, and so on.
We need to extract the 3d component.
<MyCanvas>
<CustomCamera />
<WorldEnvironment />
<Pcb3D>
…
</Pcb3D>
</MyCanvas>Important
required so there is no duplicate dependencies when tscircuit/circuit-to-svg#166 merged
I'm using 👇 in that PR
bun add github:tscircuit/3d-viewerso I can use the typescript file directly.
[trivia]
Q: why not usingbun patchcommand?
A: patching the package doesn't work because the./src/**.tsis missing, it only have./dist/*.js
Change of plan
- rewrite <Pcb3D> as
class Pcb3D extends Object3Dconstructor(circuitJSON, options)
- dispatch event on: hover/unhover and select/unselect; cad component (use raycast)
event dispatch can be disabled viaoptionsor.hoverComponent = false
nice to have:
- perf: instancing multiple mesh that has same footprint/cadModel
avoid:
- don't implement tooltip and highlight on hover
- don't store soup/circuitJSON as property, if it's unavoidable then set them to
nullafter doing the transformation of circuit.json->three.js.
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels