Skip to content

Add 3D part preview with perimeter-based visualization#15

Open
Sethhondl wants to merge 5 commits into
6238:mainfrom
Sethhondl:feature/3d-part-preview
Open

Add 3D part preview with perimeter-based visualization#15
Sethhondl wants to merge 5 commits into
6238:mainfrom
Sethhondl:feature/3d-part-preview

Conversation

@Sethhondl

@Sethhondl Sethhondl commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add perimeter-based 3D part preview that shows actual part outline instead of rectangular bounds
  • Add arbitrary rotation angle input with "minimize area" auto-optimization
  • Improve tube 3D visualization with actual dimensions from backend
  • Add stock size display in G-code preview

Changes

  • Output perimeter points from postprocessor as JSON for frontend visualization
  • Parse PERIMETER_POINTS in Flask app and include in response
  • New rotation angle text input (0-359°) replaces 90° toggle button
  • "Min" button automatically finds rotation with smallest bounding box
  • Tube visualization now uses actual dimensions instead of G-code bounds

Test plan

  • System tests pass
  • Manual test: verify part preview shows correct outline for complex DXF shapes
  • Manual test: verify rotation angle and minimize area feature work correctly

Note: Some unit tests fail on origin/main due to pre-existing issue (tests expect bearing_holes attribute that doesn't exist).

🤖 Generated with Claude Code

@joshsirota

Copy link
Copy Markdown
Contributor

This branch also has conflicts. Please resolve and re-test

Sethhondl and others added 4 commits January 9, 2026 15:51
- Replace 90° rotation button with text input for any angle (0-359°)
- Add "Min" button to automatically find rotation with smallest bounding box
- Fix bounding box calculation to accurately fit rotated geometry
- Keep origin fixed at bottom-left while part rotates around it

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Output perimeter points from postprocessor as JSON for frontend use
- Parse PERIMETER_POINTS in Flask app and include in response
- Use perimeter from postprocessor in 3D preview instead of rectangular bounds
- This shows the actual part outline in the G-code preview for plates

Also includes tube facing improvements:
- Fix Y coordinate calculations for tube facing arc patterns
- Improve comments documenting tool edge positions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Pass tube_width and tube_length from backend to frontend
- Use actual tube dimensions for 3D preview instead of G-code bounds
- Fix coordinate transformation to properly position tube at origin
- G-code toolpath now renders correctly relative to tube geometry

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Sethhondl Sethhondl force-pushed the feature/3d-part-preview branch from a303117 to 175522d Compare January 9, 2026 23:51
- Changed tube_facing_offset from 0.125" to 0.0625" (1/16")
- Phase 1 face is at Y=+0.0625", so holes need +0.0625" offset

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

@joshsirota joshsirota left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just don't understand this change yet. This is an awfully big change, let's talk through what this really does.

Comment thread frc_cam_gui_app.py
print(f"📄 Actual output file: {actual_output_path}")
elif line.startswith('PERIMETER_POINTS:'):
try:
import json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use inline imports. Isn't json already imported?

Comment thread frc_cam_gui_app.py
elif line.startswith('PERIMETER_POINTS:'):
try:
import json
perimeter_points = json.loads(line.split('PERIMETER_POINTS:', 1)[1].strip())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these perimeter points? Is this a huge array? Are we basically trying to move all of the logic from the backend to the frontend? This seems awfully redundant.

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