UV direction of 'Box 2Pt' face flip-flops with Z (height) issue

I haven’t used gh in a while now. Back to it briefly for some office furnishing schematics. One of the things that always drove me nuts about gh is the need for extensive “error” reconciling when modifying base geometry–in this case, a simple gh-generated 2-pt box–an excellent primitive example. What I mean is, just because an initial result came out one way/direction, doesn’t mean it’ll come out that way again (like when adjusting an earlier parameter (e.g.height)), which still tends to fall on the “incomprehensible” spectrum for me–could be my lack of CompSci, but seems like an order-of-things issue… Anyway, here’s the description

Issue: UV directions of face/surface flip depending on the height of the originating 2-point box. (At least face0 is always face0, relative to world-plane.)

Description: When box height = 40", U direction is vertical (horizontal divisions); when box height = 41", U direction is horizontal (vertical divisions). Issue exists for other ‘Z’ values, too.

Expectation:
UV direction is based on some predictable formal quality, and does not flip (randomly) unless the formal quality is seriously altered, similar to predictable vertex numbering order, etc., perhaps based upon proportion or something (U is always the longer side, etc).

Steps (all in Grasshopper):

  1. Use gh ‘Construct Point’ to supply ‘Box 2Pt’ w/ A & B point values
  2. Extract a desired face using ‘DeBrep’
  3. Subdivide surface (various techniques) & select output to preview/highlight
  4. Using a slider, adjust the Z value of point B

Notes:
Various surface division techniques will flip UV on diff Z values, but they all seem to flip at some point;
Doesn’t seem to be predicated upon box/face proportion (e.g. small-Z or big-Z relative to XY area).;
Can’t predict which values will flip it (w/o differential calculus, anyway!).

File:
Box-UV flip.gh (25.8 KB)

Please advise, and thanks in advance,
-dt

Hello there!

The culprit here is Boundary Surfaces:
2023-07-02 01_02_06-Window
It takes curves to generate a surface, but as you noted it’s not reliable about the orientation of the surface.

Some tips:

  • Offset Curve might mess up your segments order etc etc… use Offset Curve Loose if possible; much faster and totally reliable about preserving segment amount and order. Use a plane to make the offset more reliable (valid for normal offset too).

  • If you have box domains (DeBox) you can generate a rectangle with the same domains!
    2023-07-02 01_09_41-Window

  • Use Loft , Sweep, 4Point Surface to have a direct control over the resulting surface UV orientations.
    For example:
    2023-07-02 01_09_46-Window

Thanks for those suggestions & the insight!

-dt