Model.hm_getuvcoordinates#

Model.hm_getuvcoordinates(surface_entity, node_entity, scaled=0)#

Returns the parametric uv coordinates at a node 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:
  • surface_entity (Entity) – The object describing the input surface entity.

  • node_entity (Entity) – The object describing the node entity. The node must be associated to the surface.

  • scaled (int) –

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

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

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

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • uvCoordinates (numpy.ndarray) - The coordinates at node_entity location in parametric space

Example#

Get the uv coordinates of node with ID 5 of surface with ID 1#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getuvcoordinates(
    surface_entity=ent.Surface(model, 1), node_entity=ent.Node(model, 5)
)

print("u,v-coordinates:", result.uvCoordinates)