import bpy
SRC="/Users/danicosta/Desktop/Avatar-Platon/3d_pipeline/oc_output/plato_4k.usdz"
bpy.ops.wm.read_factory_settings(use_empty=True); sc=bpy.context.scene
bpy.ops.wm.usd_import(filepath=SRC)
ms=[o for o in sc.objects if o.type=='MESH']
for o in sc.objects: o.select_set(False)
for o in ms: o.select_set(True)
bpy.context.view_layer.objects.active=ms[0]
if len(ms)>1: bpy.ops.object.join()
h=bpy.context.active_object
bpy.ops.object.transform_apply(location=True,rotation=True,scale=True)
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY',center='BOUNDS'); h.location=(0,0,0)
h.scale=[2.2/max(h.dimensions)]*3; bpy.ops.object.transform_apply(scale=True)
vs=[v.co for v in h.data.vertices]
zmin=min(c.z for c in vs); zmax=max(c.z for c in vs)
import math
print("Z range: %.3f .. %.3f" % (zmin,zmax))
# perfil de radio (percentil 90) por banda de z, en la mitad superior
NB=26
for b in range(NB):
    z0=zmin+(zmax-zmin)*b/NB; z1=zmin+(zmax-zmin)*(b+1)/NB
    band=[math.hypot(c.x,c.y) for c in vs if z0<=c.z<z1]
    if not band: continue
    band.sort(); r90=band[int(len(band)*0.9)]
    zc=(z0+z1)/2
    if zc>0.35:   # solo parte alta (cabeza/embudo)
        bar="#"*int(r90*40)
        print("z=%.2f  r90=%.3f  n=%4d  %s" % (zc,r90,len(band),bar))
