Curvature Combs & Continuity
Curvature Combs (Porcupine Diagnostics): In automotive Class-A surfacing and industrial CAD, inspecting a spline curve visually is deceptively inadequate; flat spots, sudden radius jerks, and unwanted inflection wiggles remain invisible to the naked eye. A curvature comb plots needle-like spikes perpendicular to the curve with lengths strictly proportional to instantaneous curvature $\kappa(t)$, ruthlessly exposing any second-derivative defects.
Porcupine Diagnostic Rules:
1import numpy as np23def compute_curvature_comb(curve_pts, d1_pts, d2_pts, scale=1.0):4 """5 Computes porcupine curvature comb for a parametric curve C(t).6 Curvature kappa(t) = ||C' x C''|| / ||C'||^3.7 Porcupine spikes point along unit normal n(t), with length proportional to kappa(t).8 Inflections appear where comb passes through zero and flips sides.9 """10 comb_tips = []11 for p, v1, v2 in zip(curve_pts, d1_pts, d2_pts):12 speed = np.linalg.norm(v1)13 if speed < 1e-6:14 comb_tips.append(p)15 continue16 cross_prod = v1[0] * v2[1] - v1[1] * v2[0]17 kappa = cross_prod / (speed ** 3)1819 # Unit normal20 unit_norm = np.array([-v1[1], v1[0]]) / speed21 spike = p + unit_norm * (kappa * scale)22 comb_tips.append(spike)2324 return comb_tips
Geometric Continuity Hierarchy (G0 to G3): In luxury automotive styling, surface reflection lines dictate visual perceived quality. While $G^0$ has a sharp crease and $G^1$ aligns tangents, $G^1$ still suffers from a sudden jump in curvature, causing zebra reflection stripes to break abruptly. $G^2$ continuity equates the osculating radius, while $G^3$ Class-A surfacing smooths the rate of change of curvature to make car body reflections flow seamlessly.
Continuity Tiers:
1def classify_joint_continuity(c1_pts, c2_pts):2 """3 Classifies geometric continuity across curve joint:4 G0: Position equality C1(1) == C2(0).5 G1: Tangent vector collinearity: T1 == lambda * T2 (lambda > 0).6 G2: Curvature center and magnitude equality: kappa_1 == kappa_2.7 G3: Curvature rate-of-change equality: d(kappa)/ds is continuous.8 """9 return "Continuity Tier: G0, G1, G2, or G3"