Curvature Combs & Continuity
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
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 κ(t), ruthlessly exposing any second-derivative defects.
Continuity Tiers:
1import numpy as np23def classify_joint_continuity(c1_derivs, c2_derivs, tol=1e-3):4 """5 Classifies geometric continuity (G0, G1, G2, G3) at the junction between two curves6 given endpoint derivatives [C(t), C'(t), C''(t), C'''(t)] at C1(1) and C2(0).7 """8 p1, d1, dd1, ddd1 = [np.asarray(v, dtype=float) for v in c1_derivs]9 p2, d2, dd2, ddd2 = [np.asarray(v, dtype=float) for v in c2_derivs]1011 if np.linalg.norm(p1 - p2) > tol:12 return "Discontinuous"13 t1 = d1 / np.linalg.norm(d1)14 t2 = d2 / np.linalg.norm(d2)15 if np.linalg.norm(t1 - t2) > tol:16 return "G0 (Position Only)"1718 # Curvature vector kappa * N = (C' x C'') x C' / ||C'||^419 k1 = np.cross(np.cross(d1, dd1), d1) / (np.linalg.norm(d1) ** 4)20 k2 = np.cross(np.cross(d2, dd2), d2) / (np.linalg.norm(d2) ** 4)21 if np.linalg.norm(k1 - k2) > tol:22 return "G1 (Tangent Continuity)"2324 # Arc-length derivative of curvature d(kappa)/ds25 dk1 = np.dot( np.cross(d1, ddd1), np.cross(d1, dd1) ) / (np.linalg.norm(d1) ** 6)26 dk2 = np.dot( np.cross(d2, ddd2), np.cross(d2, dd2) ) / (np.linalg.norm(d2) ** 6)27 return "G3 (Class-A Flow)" if abs(dk1 - dk2) <= tol else "G2 (Curvature Continuity)"
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.
Related Concepts
Curvature combs, Class-A continuity G0-G3, clothoid spirals, and curve fairing.
Interactive geometrical visualization of Euler spirals and variational curve fairing.
Interactive geometrical visualization of graphic statics, reciprocal diagrams, and funicular masonry arches.