Skip to content

feat: add smart shape recognition for whiteboard#172

Open
aarushii25 wants to merge 4 commits into
KENZY004:mainfrom
aarushii25:feature/smart-shapes-75
Open

feat: add smart shape recognition for whiteboard#172
aarushii25 wants to merge 4 commits into
KENZY004:mainfrom
aarushii25:feature/smart-shapes-75

Conversation

@aarushii25

@aarushii25 aarushii25 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Hi @KENZY004,

I've successfully implemented the Smart Shape Recognition feature for Issue #75. Here's a summary of what's working and what needs further iteration:

Working shapes:

Circle: detected via closed stroke with no sharp corners

Triangle: detected via geometric error calculation and edge point distribution

Rectangle: detected via corner/bounding-box error analysis

Straight Line: detected via point-to-line error calculation

Partially Working (Pentagon, Hexagon, Octagon):
These shapes require 5, 6, and 8 sharp corners respectively to be detected. However, during testing, the corner detection algorithm maxes out at ~4 corners even when drawing these shapes carefully. This is because:

The resampling + smoothing pipeline merges nearby corners.

Freehand drawing naturally rounds out corners, reducing sharpness.

The MIN_GAP constraint prevents detecting corners that are too close together.

Suggested next step:

Implementing a multi-stroke approach where each side is drawn separately, allowing the algorithm to combine individual strokes into a complex polygon.

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the MINHA's projects Team on Vercel.

A member of the Team first needs to authorize it.

@aarushii25

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-06-07.002349.mp4

@KENZY004

KENZY004 commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Thanks for working on this! I wanted to test the feature locally, but I noticed you accidentally deleted the isHost variable in Whiteboard.jsx. This causes a fatal ReferenceError that crashes the whiteboard entirely (which is why the GitHub CI pipeline is failing). Please restore the isHost logic and fix the errors so I can test out the drawing feature!

@aarushii25

Copy link
Copy Markdown
Contributor Author

Hi @KENZY004, sorry about that! The isHost logic got accidentally removed during the merge conflict resolution. I have restored it now, and the CI pipeline should pass. Let me know how the smart shapes feature feels!

@aarushii25

Copy link
Copy Markdown
Contributor Author

@KENZY004 could you pls review it

1 similar comment
@aarushii25

Copy link
Copy Markdown
Contributor Author

@KENZY004 could you pls review it

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.

2 participants