From d1d561aebd140f6010976cd218bd8512accb9a09 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Tue, 20 Oct 2026 23:14:49 -0400 Subject: [PATCH] kernel: pcurve fits start from four samples per span Each sample of an intersection curve is one of truck's double projections (about 0.13 ms in a release build), and a fit evaluates the curve at every sample and halfway between. Starting from four samples a span instead of eight halves that; the checks stay at eight points a span, and the knots at the curve's own breaks already carry the shape. The cylinder cut by a tilted box now takes 70 ms at 1e-3 mm and 149 ms at 1e-5 mm for all its faces (release), from 183 and 638 ms. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QWhMwdqJYQKQq8RCLSL1LT --- crates/kernel/src/native/pcurve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/kernel/src/native/pcurve.rs b/crates/kernel/src/native/pcurve.rs index 1a1ae807e..157f50419 100644 --- a/crates/kernel/src/native/pcurve.rs +++ b/crates/kernel/src/native/pcurve.rs @@ -60,7 +60,7 @@ const MAX_SPANS: usize = 4000; /// Refinement rounds of one fit. const MAX_ROUNDS: usize = 40; /// Samples per knot span when a fit starts. -const PER_SPAN: usize = 8; +const PER_SPAN: usize = 4; /// Spans a fit starts from (more where the curve has its own knots). const START_SPANS: usize = 4;