Skip to content

Comments

Cursor Surface Tool#5312

Open
murphyownbey-cognite wants to merge 2 commits intomasterfrom
murphyo/cursor-surface-circle-tool
Open

Cursor Surface Tool#5312
murphyownbey-cognite wants to merge 2 commits intomasterfrom
murphyo/cursor-surface-circle-tool

Conversation

@murphyownbey-cognite
Copy link

@murphyownbey-cognite murphyownbey-cognite commented Sep 9, 2025

Cursor Surface tool

  • Two-ring cursor indicator with pixel/world sizing, fade, and optional 360-only visibility
  • Added JSDoc and default options
  • Integrated into Viewer example

Type of change

Feat

Description 📝

  • Added CursorSurfaceCircleTool:
    • Two-ring cursor indicator that anchors to CAD/point cloud surfaces.
    • Pixel-locked or world-locked sizing, inactivity fade-in/out.
    • Optional 360-only visibility gating.
  • Documentation:
    • JSDoc for class, constructor, methods, and all options.
  • Examples:
    • Integrated into examples/src/pages/Viewer.tsx.

How has this been tested? 🔍

  • Built the viewer successfully (including WASM step).
  • Manual testing in examples:
    • Verified cursor appears over CAD/point cloud surfaces.
    • Verified 360 gating behavior and fallback rendering while in active 360.
    • Confirmed fade-in/out timing with fadeAfterMs and fadeDurationMs.
    • Confirmed group-based visibility and scaling during camera motion.

Test instructions ℹ️

  • Run the examples app.

  • Open Viewer example:

    • Bring in a mesh or point cloud model along with 360 images.
    • Toggle 360 images; when 360 is active and visibleOnlyIn360 is true, cursor appears; otherwise hides.

    Current Limitations/Bug:

    • The cursor circle size may instantiate at too small of a size depending on how close the mesh/point is too the viewer.
    • The tool is not implemented into the main CogniteViewer.
    • Surface normals for point clouds functionality is subpar. The surface normal causes the cursor circle to look sporadic due to the current calculation logic.

Checklist ☑️

  • I am happy with this implementation.
  • I have performed a self-review of my own code.
  • I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • I have added documentation to new and changed elements; both public and internally shared ones
  • I have refactored the code for testability, readability and extendibility to the best of my ability.
  • I have listed the JIRA tasks covering remaining work or tech debt related to this PR in the description.

…examples

- Two-ring cursor indicator with pixel/world sizing, fade, and optional 360-only visibility
- Added JSDoc and default options
- Integrated into Viewer example
@murphyownbey-cognite murphyownbey-cognite requested a review from a team as a code owner September 9, 2025 07:06
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 0% with 499 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.31%. Comparing base (58d1b5f) to head (4906b72).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...src/CursorSurfaceCircle/CursorSurfaceCircleTool.ts 0.00% 497 Missing and 1 partial ⚠️
viewer/packages/tools/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5312      +/-   ##
==========================================
- Coverage   65.70%   65.31%   -0.39%     
==========================================
  Files        1181     1182       +1     
  Lines       83484    83983     +499     
  Branches     7958     7961       +3     
==========================================
+ Hits        54850    54852       +2     
- Misses      28527    28990     +463     
- Partials      107      141      +34     
Files with missing lines Coverage Δ
viewer/packages/tools/index.ts 0.00% <0.00%> (ø)
...src/CursorSurfaceCircle/CursorSurfaceCircleTool.ts 0.00% <0.00%> (ø)

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant