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.
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!
Solved! Go to Solution.
Solved by jeremytammik. Go to 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!
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.
Can't find what you're looking for? Ask the community or share your knowledge.