Skip to content

Add involute to Path info #6448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Add involute to Path info #6448

wants to merge 8 commits into from

Conversation

benjamaan476
Copy link
Contributor

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

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

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.

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

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.

1 participant