def quadricsForTriangles(tris):
    normal = numpy.cross( tris[::,1] - tris[::,0], tris[::,2] - tris[::,0] )
    collada.util.normalize_v3(normal)
    
    s1 = tris[::,1] - tris[::,0]
    s1 = array_dot(s1, s1)
    s2 = tris[::,2] - tris[::,0]
    s2 = array_dot(s2, s2)
    s3 = tris[::,2] - tris[::,1]
    s3 = array_dot(s3, s3)
    
    sp = (s1 + s2 + s3) / 2.0
    area = sp*(sp-s1)*(sp-s2)*(sp-s3)
    
    area = numpy.sqrt(numpy.abs(area))
    
    d = -array_mult(normal, tris[:,0])

    b = normal * (area*d)[:,numpy.newaxis]
    c = area*d*d
    
    A = numpy.dstack((normal[:,0][:,numpy.newaxis] * normal,
                       normal[:,1][:,numpy.newaxis] * normal,
                       normal[:,2][:,numpy.newaxis] * normal))
    A = area[:,numpy.newaxis,numpy.newaxis] * A
   
    return (A, b, c, area, normal)
Given a model instance save it to the database.
dataset/ETHPy150Open pycollada/meshtool/meshtool/filters/simplify_filters/sander_simplify.py/quadricsForTriangles--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/contrib/admin/options.py/ModelAdmin.save_model