Skip to content

Comments

Add involute to Path info#6448

Closed
benjamaan476 wants to merge 8 commits intomainfrom
ben/involute_path
Closed

Add involute to Path info#6448
benjamaan476 wants to merge 8 commits intomainfrom
ben/involute_path

Conversation

@benjamaan476
Copy link
Contributor

The circular involute sketch segment was using ToPoint as its path type. This adds a specific involute path type

@vercel
Copy link

vercel bot commented Apr 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Apr 25, 2025 2:57pm

@qa-wolf
Copy link

qa-wolf bot commented Apr 23, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Comment on lines +1299 to +1300
let angle = (end_radius * end_radius - start_radius * start_radius).sqrt() / start_radius;
0.5 * start_radius * angle * angle
Copy link
Contributor

Choose a reason for hiding this comment

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

The calculation (end_radius * end_radius - start_radius * start_radius).sqrt() / start_radius will produce a runtime error if end_radius < start_radius, as it would attempt to take the square root of a negative number. This is particularly problematic when the reverse flag is set to true, which suggests the path should go from end_radius to start_radius. Consider adding a validation check or using abs() to ensure the calculation is always performed on a positive value.

Suggested change
let angle = (end_radius * end_radius - start_radius * start_radius).sqrt() / start_radius;
0.5 * start_radius * angle * angle
let angle = ((end_radius * end_radius - start_radius * start_radius).abs()).sqrt() / start_radius;
0.5 * start_radius * angle * angle

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 23, 2025

CodSpeed Instrumentation Performance Report

Merging #6448 will not alter performance

Comparing ben/involute_path (3fcdf84) with main (5c0ca52)

Summary

✅ 54 untouched benchmarks

@codecov
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 48.14815% with 28 lines in your changes missing coverage. Please review.

Project coverage is 85.18%. Comparing base (0ef1483) to head (3fcdf84).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rust/kcl-lib/src/execution/geometry.rs 13.33% 13 Missing ⚠️
rust/kcl-lib/src/std/extrude.rs 0.00% 9 Missing ⚠️
rust/kcl-lib/src/std/args.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6448      +/-   ##
==========================================
- Coverage   85.26%   85.18%   -0.09%     
==========================================
  Files         109      109              
  Lines       47021    47074      +53     
==========================================
+ Hits        40092    40098       +6     
- Misses       6929     6976      +47     
Flag Coverage Δ
rust 85.18% <48.14%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@benjamaan476 benjamaan476 requested a review from jtran April 24, 2025 15:25
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