Add geometry inspector panel including mesh stats#67
Add geometry inspector panel including mesh stats#67soshiCS wants to merge 1 commit intoAdam-CAD:masterfrom
Conversation
|
@soshiCS is attempting to deploy a commit to the Adam Team on Vercel. A member of the Team first needs to authorize it. |
Greptile OverviewGreptile SummaryAdds a Geometry Inspector panel overlay in the 3D viewer that displays live mesh statistics for loaded STL files.
The implementation correctly captures geometry stats before transforming the mesh, preventing data loss. The only minor issue is using Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant OpenSCADViewer
participant STLLoader
participant BufferGeometry
participant UI
User->>OpenSCADViewer: Load STL file
OpenSCADViewer->>STLLoader: parse(arrayBuffer)
STLLoader-->>OpenSCADViewer: return BufferGeometry
OpenSCADViewer->>BufferGeometry: computeBoundingBox()
BufferGeometry-->>OpenSCADViewer: boundingBox computed
OpenSCADViewer->>BufferGeometry: getSize(size)
OpenSCADViewer->>BufferGeometry: getCenter(center)
Note over OpenSCADViewer: Capture original stats<br/>(size, center)
OpenSCADViewer->>BufferGeometry: center()
Note over OpenSCADViewer: Transform for viewing
OpenSCADViewer->>BufferGeometry: computeVertexNormals()
OpenSCADViewer->>OpenSCADViewer: setGeometry(geom)
OpenSCADViewer->>OpenSCADViewer: setGeometryStats({size, center, counts})
OpenSCADViewer->>UI: Render 3D scene + Inspector panel
UI-->>User: Display mesh with stats overlay
|
Additional Comments (1)
Context Used: Rule from Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: src/components/viewer/OpenSCADViewer.tsx
Line: 234:234
Comment:
Avoid `as` type casting. Check already confirmed it's an `OpenSCADError`, so the cast is unnecessary:
```suggestion
if (error && error.name === 'OpenSCADError') {
fixError?.(error);
}
```
**Context Used:** Rule from `dashboard` - Avoid using 'as' type casting in TypeScript code. Find alternative approaches for type safety instea... ([source](https://app.greptile.com/review/custom-context?memory=096c10cb-12df-4744-903f-f7cad6ba6369))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
Adds a Geometry Inspector panel in the viewer that shows live mesh stats for the current STL:
Note
Introduces an on-canvas Geometry Inspector for STL outputs in the OpenSCAD viewer.
size (X/Y/Z),center,vertexCount,triangleCount, andSTL byteSizeafter parsing withSTLLoadercomputeBoundingBox()before recentring (geom.center()), thencomputeVertexNormals(); stores metrics ingeometryStatsrelativeto position overlayVector3; defensive resets when no geometrypeer: truemetadata to numerous dependencies (React, ESLint, Tailwind, Three, Vite, etc.)Written by Cursor Bugbot for commit 9118f5d. This will update automatically on new commits. Configure here.