Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Get Parameterized UV param of a face for a given point

[ Edited ]

Hi,

 

I am stuck in a following case,

 

I have point3d which I know is on the Face. I know that face too.

 

I want to create a SO point by using a CreatePoint which takes Face and scalar value, ie, I want to create a Point on Face at the input Point3D place.

 

I am unable to figure out how to get scalars. I think, the value for U and V are scalar 1 and scalar 2, can be found out by the location of the point on the face.

 

I tried using AskFaceParms methods to get the value of UV param at the place of point but this method gives some absurd UV values which I think are unParamiterized UV values.

 

Can someone please assist me getting parameterized UV values.

 

eg. If I have block with 100,100,100 dimensions created at origin, and I select a point 30,0,30 then I should get UV values 0.7 and 0.3 and not -0.0300 and -0.0200

 

Thanks

DAS_SSK

3 REPLIES
Solution
Solution
Accepted by topic author DAS_SSK
‎11-23-2016 12:42 PM

Re: Get Parameterized UV param of a face for a given point

I think you need to do this.

 

static void ask_face_normalized_parms(tag_t face, double *pos, double *fparms)
{
    double
        minmax[4],
        parms[2];

    UF_CALL(UF_MODL_ask_face_parm(face, pos, parms, pos));
    UF_CALL(UF_MODL_ask_face_uv_minmax(face, minmax));
    fparms[0] = (parms[0] - minmax[0]) / (minmax[1] - minmax[0]);
    fparms[1] = (parms[1] - minmax[2]) / (minmax[3] - minmax[2]);
}

Re: Get Parameterized UV param of a face for a given point

Hi Technisites,

Your help solved my problem, Thank you Technisites.

DAS_SSK

Re: Get Parameterized UV param of a face for a given point

The SNAP Getting Started Guide has some discussion of these parameterization issues. Your problems are probably a result of confusing normalized versus non-normalized parameter values.

 

And if you have access to SNAP, there is an easy-to-use function called Face.Parameters, which gives you the (u,v) parameters at a given point on a surface.

山田
yamada