MCPcopy Create free account
hub / github.com/DeepGraphLearning/S3F / tangent_vectors

Function tangent_vectors

s3f/surface.py:404–412  ·  view source on GitHub ↗
(normals)

Source from the content-addressed store, hash-verified

402
403
404def tangent_vectors(normals):
405 x, y, z = normals[..., 0], normals[..., 1], normals[..., 2]
406 s = (2 * (z >= 0)) - 1.0 # = z.sign(), but =1. if z=0.
407 a = -1 / (s + z)
408 b = x * y * a
409 uv = torch.stack((1 + s * x * x * a, s * b, -s * x, b, s + y * y * a, -y), dim=-1)
410 uv = uv.view(uv.shape[:-1] + (2, 3))
411
412 return uv
413
414
415def curvatures(

Callers 1

curvaturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected