Model.hm_getuvvectors_byxyz#

Model.hm_getuvvectors_byxyz(surf_entity, xyz, scaled=0)#

Returns the parametric uv derivative vectors at xyz location on the referenced surface.

This function is only valid for single surfaces or surfaces generated by trimming one original surface and suppressing edges. It is not valid for the generic case of surfaces composed from different parametric patches by suppressing edges only (for example, two separate surfaces stitched together, then edges suppressed).

Parameters:
  • surf_entity (Entity) – The object describing the input surface entity.

  • xyz (hwTriple) – The x,y,z coordinates of interest, in global coordinates. The location is projected onto the surf_entity if it does not directly lie on the surface.

  • scaled (int) –

    ptional argument used when the referenced surface is a trimmed surface.

    If the value is set to 0 (default), the uv vectors returned will be in reference to the parametric space of original untrimmed surface.

    If the scale value is set to 1, the uv vectors returned will be in reference to the parametric space of the trimmed surface.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • uTangent (numpy.ndarray) - The u-direction derivative vector. The vector is relative to the global coordinate system

    • vTangent (numpy.ndarray) - The v-direction derivative vector. The vector is relative to the global coordinate system

Example#

Get the uv vectors at ( 100,0,0 ) on surface with ID 1#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getuvvectors_byxyz(
    surf_entity=ent.Surface(model, 1), xyz=[100.0, 0.0, 0.0]
)

print("The u-direction derivative vector:", result.uTangent)
print("The v-direction derivative vector:", result.vTangent)