For my project I need to discretize curvature in a UV grid.
Doing so in Rhino took 180+ seconds, in PythonOCC it takes less than 2.
Over a 100* fold speedup...

What can I say... thanks Thomas!

-jelle


tA = time.time()

u_grid, v_grid = numpy.arange(0.0, 0.1, 0.0002), numpy.arange(0.0, 0.1, 0.0002)
for u in u_grid.tolist():
    for v in v_grid.tolist():
        curvature.SetParameters(u,v)
        s=curvature.GaussianCurvature()
        is_locally_spheric = curvature.IsUmbilic()
        #tan_u, tan_v = curvature.TangentU(), curvature.TangentV()
_mean, _min, _max = curvature.MeanCurvature(), curvature.MinCurvature(), curvature.MaxCurvature()

tB = time.time()

print 'It took', tB-tA, 'to sample n_samples', u_grid.shape[0]*v_grid.shape[0], ' a N*N grid', u_grid.shape[0] ,'*', v_grid.shape[0]

tA = time.time()
for u in u_grid.tolist():
    for v in v_grid.tolist():
        pass

tB = time.time()

print 'Just looping ( python overhead, NON optimal ) takes ', tB-tA

_______________________________________________
Minerva-pythonocc mailing list
Minerva-pythonocc@gna.org
https://mail.gna.org/listinfo/minerva-pythonocc

Reply via email to