cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

7-Bedrock

## Use ProSurfaceParamEval how to the closest point inside the surface contour (face) specified

hello !

when input red point  xyz and surface ,out uv,then put uv to ProSurfaceXyzdataEval,Why do two points have the same value?

my code:

ProError EvalClosestPoint(ProPoint3d xyz,ProPoint3d xyzPnt) {
ProUvParam uv;
ProError status;
status=ProSurfaceParamEval(m_owner, m_surf, xyz, uv);
status= ProSurfaceXyzdataEval(m_surf, uv, xyzPnt, NULL, NULL, NULL);
return status;
}

thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
17-Peridot
(To:AugustineSky)

@AugustineSky wrote:

By the way, do you have any good way to judge whether the cylindrical surface is a through hole or a counterbore?

1. Selected surface

2. Find a contour of the hole

3. Find a surface of the hole, belonged to founded contour (need to check that this is hole and not a add extrude. Check a normal of the surface or using other methods...)

4. Get straight edge of the hole surface

Cast the ray by this edge (or maybe needed to move ray vector a little bit in the radius direction). If the ray will hit any surface (green cross) than this surface (3) is not from the through hole.

6 REPLIES 6
17-Peridot
(To:AugustineSky)

Try this function ProPoint3dOnsurfaceFind()

7-Bedrock
(To:YaroslavSin)

Thanks for your answer, but it will return two values: Pro_B_FASE, and null. I think my problem is that the input face is the face before cutting, but I don't know how to get the face after removing the holes

17-Peridot
(To:AugustineSky)

Can you show how you get the surface?

The documentation say "Determines if distance between the specified point and the specified surface is less than the Creo Parametric model accuracy set in the active Creo Parametric session. You can also set accuracy with function ProSolidAccuracySet()." You can try to set the model accuracy bigger then hole radius. But, I think, this not good solution.

Do you want to find a the hole radius?

7-Bedrock
(To:YaroslavSin)

No, I don't want to get the diameter of the hole, I want to determine whether the hole is a through hole or a countersunk hole, so I get the closest point from the point to the surface。

I was using ProSolidSurfaceVisit before to get the surface,

then i use select get same resultt ,like this:

``````ProModelitem item;
ProSurface sel_surf;
ProUvParam uv;
ProBoolean is_in;
ProSelection* sel;
int n_sel;

ProSelect("surface", 1, NULL, NULL, NULL, NULL, &sel,&n_sel);
ProSelectionModelitemGet(sel[0], &item);
ProGeomitemToSurface(&item, &sel_surf);

status = ProSurfaceParamEval((ProSolid)item.owner, sel_surf, oPnt, uv);
status = ProSurfaceXyzdataEval(sel_surf, uv, closest_pnt3, NULL, NULL, NULL);``````

By the way, do you have any good way to judge whether the cylindrical surface is a through hole or a counterbore?

17-Peridot
(To:AugustineSky)

@AugustineSky wrote:

By the way, do you have any good way to judge whether the cylindrical surface is a through hole or a counterbore?

1. Selected surface

2. Find a contour of the hole

3. Find a surface of the hole, belonged to founded contour (need to check that this is hole and not a add extrude. Check a normal of the surface or using other methods...)

4. Get straight edge of the hole surface

Cast the ray by this edge (or maybe needed to move ray vector a little bit in the radius direction). If the ray will hit any surface (green cross) than this surface (3) is not from the through hole.

7-Bedrock
(To:AugustineSky)

the distance should be radius, but it's zero

Top Tags