why Control Points can be split in U and V?

why Control Points can be split in U and V?

keatshao
Observer Observer
344 Views
2 Replies
Message 1 of 3

why Control Points can be split in U and V?

keatshao
Observer
Observer
void InitControlPoints(int pUCount, EType pUType, int pVCount, EType pVType);

Like the codes above, why the control points are not in the xyz coordinate? By this code, I found out there are pUCount*pVCount numbers of control points. How does it transfer to xyz coord?

0 Likes
345 Views
2 Replies
Replies (2)
Message 2 of 3

RyanCameron
Advocate
Advocate

Are you looking to convert to xyz it sounds like?

I believe the reason why the control points are not represented in xyz coordinates is that they represent the underlying geometry of the surface, rather than the final fixed position of the surface in 3D space. Each control point is defined by a sort of "set of parameters" that determine its position in the U, V, and Z (W) directions, where Z (W) is is obviously the depth/height. 

To convert the control points to xyz coordinates, I think you need to apply a script that maps the surface from its parameter space (U, V, W) to 3D space (x, y, z). This gets a little outside my expertise but wouldn't it be something like this to basically append a "z" point to the field?:

import math

def init_control_points(pUCount, pVCount):

# Initialize an empty list to store the control points control_points = []

# Loop over each control point in the U and V directions for u in range(pUCount):

for v in range(pVCount):

          # Calculate the x, y, and z coordinates of the control point

                           x = u * 2.0 / (pUCount - 1) - 1.0

                           y = v * 2.0 / (pVCount - 1) - 1.0

                           z = 0.0

# Add the control point to the list control_points.append((x, y, z))

       return control_points

# Example usage: control_points = init_control_points(5, 4)

print(control_points)

Again, probably not exact enough but should be a good start.

RB Cameron, AIA, LEED AP, EDAC
Digital Practice Leader

0 Likes
Message 3 of 3

RyanCameron
Advocate
Advocate

Oh yeah, save before doing any script testing. 🙂

RB Cameron, AIA, LEED AP, EDAC
Digital Practice Leader

0 Likes