How to understand the BoundingBoxUV of face

How to understand the BoundingBoxUV of face

1120415118
Enthusiast Enthusiast
1,617 Views
2 Replies
Message 1 of 3

How to understand the BoundingBoxUV of face

1120415118
Enthusiast
Enthusiast

Hi all!

I am recently doing something with AVF, and have some problems with the BoundingBoxUV of face. I use following codes to achieve the feature points of the bottom-left corner area of the face,  but the result shows that the feature points refer to the upper-right corner area.

Snipaste_2020-03-12_22-55-34.png

 BoundingBoxUV boundingBoxUV = face.GetBoundingBox();
UV min = boundingBoxUV.Min;
double midU = (boundingBoxUV.Max.U + boundingBoxUV.Min.U) / 2;
double midV = (boundingBoxUV.Max.V + boundingBoxUV.Min.V) / 2;
UV mid = new UV(midU, midV);

 

I'm confused about this result! anyone can help me? Thanks in advance!

 

 

0 Likes
Accepted solutions (1)
1,618 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

You need to know in which XYZ direction in 3D space the UV vector components U and V are pointing.

 

You can find out by projecting a XYZ point onto the face surface and seeing where it ends up:

 

https://www.revitapidocs.com/2020/802cc09b-d0a4-dfc5-8ca1-e8c5e8cd4ced.htm

 

  public void Project(
    XYZ point,
    out UV uv,
    out double distance
  );

 

There is probably some more direct way to query either the face or its underlying surface for the U and V directions in 3D space.

 

Please find out and let us know.

 

Thank you!

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

1120415118
Enthusiast
Enthusiast

Thanks for your replay, Jeremy Tammik.

Forgive my stupidity, I don't understand your method, but it inspired me to think of another way. I use Dynamo to query the U and V directions of the face, and I am glad to share it.

Snipaste_2020-03-13_12-51-08.png

0 Likes