"""Estimated front-only allocation of nominal overall-length discrepancy.

Factory imperial11ft9in is3581.4mm; its adjacent metric3.36m conflicts.
Neither a bumper survey nor front/rear overhang allocation is available.
The retained rear bumper drawing ends at-1930.4mm. The old front drawing ended
at1820.333mm; move its bumper/lamp module169.333mm rearward. Rear panel/hinge/
stay stations throughZ.835 stay; unmeasured forward body contours shorten
smoothly. Axles, wheel-opening cuts, engine/cowl and rear structure stay.
"""
import math
ANCHOR=.835
OLD_NOSE_FACE=2.025
SHIFT=.2
K=SHIFT/(OLD_NOSE_FACE-ANCHOR)**2

def panel_z(z):
    if z<=ANCHOR:return z
    if z>=OLD_NOSE_FACE:return z-SHIFT
    return z-K*(z-ANCHOR)**2

def source_z(z):
    if z<=ANCHOR:return z
    if z>=OLD_NOSE_FACE-SHIFT:return z+SHIFT
    return ANCHOR+2*(z-ANCHOR)/(1+math.sqrt(1-4*K*(z-ANCHOR)))

def rigid_z(z):return z-SHIFT

def metadata(scale):
    return dict(factory_source='https://www.spridgets.de/downloads/Midget%201500%20WH%20Teil%201.pdf#page=14',factory_publication='AKM4071/B general specification p14',factory_imperial_overall_length='11ft9in',imperial_conversion_mm=3581.4,printed_metric_overall_length_m=3.36,metric_conflict='The adjacent factory metric entry conflicts with the imperial entry. Imperial conversion is the selected nominal comparison, not a fitted survey.',supplier_crosscheck='https://mossmotors.com/1500-midget-gan6',owner_photos=['IMG_6329','IMG_6853','IMG_6854','IMG_6856'],owner_dimensions_applied=False,estimated_fixed_rear_bumper_extreme_mm=-1930.4,previous_front_bumper_extreme_mm=2.15*scale,previous_drawing_overall_length_mm=2.15*scale+1930.4,estimated_front_module_shift_mm=-SHIFT*scale,estimated_front_bumper_extreme_mm=1.95*scale,estimated_drawing_overall_length_mm=1.95*scale+1930.4,held_aft_panel_boundary_units=ANCHOR,old_nose_face_units=OLD_NOSE_FACE,new_nose_face_units=rigid_z(OLD_NOSE_FACE),panel_map='Z unchanged through.835; Znew=Zold-(.2/(2.025-.835)^2)*(Zold-.835)^2 up to the old nose face; rigid-.2 beyond. Inverse maps the retained longitudinal height/width profile.',basis='The original bumper envelopes exceed the selected nominal length by169.333mm. Owner IMG_6329 wheel-derived comparison independently flags excess forward body/marker projection. This reconstruction allocates that whole drawing difference to the front, retaining the rear body, axles, engine/cowl and rear bonnet hinges/stay. This allocation is estimated, not determined by the overall-length specification.',limits='No measured front/rear overhangs, actual bumper extremities, factory body-alignment station map or common body/engine survey. The printed metric conflict remains. Panel longitudinal contours shorten; wheel-opening Y/Z cuts and axle stations stay. Front detailed lamp and bumper dimensions remain rigid while their drawing positions change; front bumper beams shorten from held rear feet. Landing-panel/catch/bonnet relationships follow the revised reference. No fitted seams, weld ownership, operating clearance, collision safety, support strength, locking, bonnet sweep or verified replacement/removal path is established. Do not use this as a fabrication or drilling template.')
