Cutting data: refuse a tool diameter that is not positive and finite before computing speed and feed

Open Beginner friendly
#4,616 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start in crates/app/src/cutting.rs at crate::cutting::compute and trace how the tool diameter is used before speed and feed are calculated. Check the speeds command in camcraft-tools and the existing unit tests. Done means the computation refuses zero, negative, NaN, and infinite diameters with a message naming the tool and diameter, while valid diameter suggestions stay unchanged.

Written by the indexing model from the issue text.

Description

bug effort:high P7

What

crate::cutting::compute (crates/app/src/cutting.rs) turns a tool's diameter into a spindle speed with n = Vc·1000/(π·D) and a feed with vf = fz·z·n. Since #4605 (PR #4607), fz_scale returns 0 for a diameter that is not positive and finite. For D = 0 the speed is then infinite and the feed is 0 × ∞, which is NaN. Before #4605 the feed was infinite. Both results are wrong.

The tool record refuses such a diameter, so a user cannot reach this path today. The review of PR #4607 noted it as a follow-up.

Expected

compute refuses, by name, a tool diameter that is not positive and finite, before any arithmetic. The suggestion then says why there is no number, as it does for an unknown material row.

Done means

  • compute (and the speeds command of camcraft-tools) refuse a diameter of 0, a negative diameter, NaN and infinity with a message that names the tool and the diameter.
  • A unit test pins each refusal on made-up values.
  • No suggestion for a valid diameter changes.

Suggested labels (I cannot set labels): bug, area:tools, source:agent, effort:medium, P7.

Dominant language
Rust
Stars
8
Forks
11
Avg merge
10h 3m
Merged PRs (30d)
927

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NeoTech/Camcraft

All issues in NeoTech/Camcraft

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.