Hi all, working on discretizing surfaces in Rhino/Grasshopper, and I’m running into an annoying issue. When I use Grasshopper to evaluate a surface, the UV parameterization given by “EvalSrf” is different than what I see in Rhino–very frustrating since extrusion along the same vector for all surfaces is impossible.
Swapping UV using “Dir” in Rhino strangely does not change the UV in Grasshopper, but flipping the surface Rhino does flip the surface in Grasshopper.
Evaluating either the base surface or reparametrized gives the same result.
How do I evaluate a surface in Grasshopper to give the same UV as I see in Rhino?
Hello- it looks like in one case you are finding the middle of the domains and in the other you are explicitly setting to 0.5. The domain in the latter case is not normalized, so .5 will not be the middle.
the V-directions of both surfaces are coming from the shared diagonal edge, the U-directions are parallel to the ridge, and the normals are both “up”.
But in Grasshopper, EvalSrf is giving the surface UV vectors that look like this regardless of where the surface is evaluated, or if it’s been reparametrized:
the U and V of the bright red surface is swapped, and both surfaces shared the same normal. Annoyingly, swapping the UV of the bright red surface using “Dir” in Rhino changes the UV grid in Rhino but doesn’t change the UV grid in Grasshopper.
It looks like the Frame output of EvalSrf outputs a plane where Z is aligned with the normal of the surface.
As far as I can tell Planes (in Grasshopper) are right handed (?) / setup for a right handed coordinate system, where X axis is to the right, Y upwards and Z towards you.
For surfaces the normal can be point inwards or outwards without changes to the U or V direction. This would be equal to switching between a right and left handed coordinate system.
Hope that makes sens.
Regarding your file, you can use the point, U and V output of the EvalSrf to create a plane aligned with the UV directions of the surface:
The UV is preserved, but the normals are different. One surface faces up and one faces down which is annoying. Any idea how to change it so both normals are pointing the same direction?
From what I see, the planes constructed with the UV directions have different normal directions (purple group). This is likely because Grasshopper only creates right-handed planes.
So, I think the next thing to try is to pick either the surface or the flipped surface by comparing their normal to world-z (green group). This still gives the same result…? (pink group).
You can use the cross product between the normal and either the surface U or V direction, then use those to create a plane that has the normal pointing in the right direction and aligned with the surface:
Another way would be to compare the normal of the plane (from UV directions) and surface, then flip if they are pointing in different directions (using e.g. dot product).
You can also use the flip plane component from Pufferfish and a plane from Normal: