m3sh.traits.

cotan_weight#

cotan_weight(halfedge, boundary=nan, clamp=False)#

Cotangent weight.

Compute the cotangent of the angle opposite of halfedge.

Parameters:
halfedgeHalfedge

A halfedge instance of a triangle mesh.

boundaryfloat, optional

Default value if halfedge is on the boundary. A nan value typically signals missing data. For numerical computations the value 0.0 can be useful to skip missing data without raising an error.

clampbool, optional

Pass True to set negative weights to zero.

Returns:
cotfloat

Cotangent value. This value is negative if the opposite angle is obtuse. For halfedges incident to degenerate triangles (zero area) this value can be inf or nan depending on the type of degeneracy. Such cases currently trigger an assertion.