Model.hm_getuvbounds#
- Model.hm_getuvbounds(surface, scalar=False)#
Returns the parametric uv coordinate bounds associated with the referenced surface.
This is most useful to determine the bounds of trimmed surfaces, where the trimmed surface’s parametric space is a subset of the untrimmed surface’s parametric space. It can be used in conjunction with
Model.hm_getuvcoordinates().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) – The object describing the input surface entity.
scalar (bool) –
Optional argument used when the referenced surface is a trimmed surface.
If the value is set to
False, the uv bounds returned will be in reference to the parametric space of original untrimmed surface.If the scale value is set to
True, the uv bounds returned will be in reference to the parametric space of the trimmed surface.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:umin (double) - The lower bound u-coordinate of parametric space associated with the
surfaceumax (double) - The upper bound u-coordinate of parametric space associated with the
surfacevmin (double) - The lower bound v-coordinate of parametric space associated with the
surfacevmax (double) - The upper bound v-coordinate of parametric space associated with the
surface
Example#
Get the uv bounds of surface with ID 1#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_getuvbounds(surface=ent.Surface(model, 1)) print("u-bound range:", [result.umin, result.umax]) print("v-bound range:", [result.vmin, result.vmax])