Skip to main content
8-Gravel
Dec 21, 2023 10:07 AM UTC
Solved

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

_10883733_0-1703152952804.png

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!

17-Peridot
Dec 22, 2023 7:29 AM UTC

@AugustineSky wrote:

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


Some thoughts about this: play with ProSolidRayIntersectionCompute()

creo_ray.png

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

17-Peridot
Dec 21, 2023 1:20 PM UTC

Try this function ProPoint3dOnsurfaceFind()

Translate
8-Gravel
Dec 22, 2023 3:12 AM UTC

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

Translate
17-Peridot
Dec 22, 2023 5:08 AM UTC

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?

Translate
8-Gravel
Dec 22, 2023 3:38 AM UTC

the distance should be radius, but it's zero 

Translate