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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

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

AugustineSky
7-Bedrock

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!

ACCEPTED SOLUTION

Accepted Solutions


@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.

 

 

View solution in original post

6 REPLIES 6

Try this function ProPoint3dOnsurfaceFind()

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

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?

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?

MKZ[GX7_@}%~S5OFIT7PQGU.png

 


@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.

 

 

the distance should be radius, but it's zero 

Announcements


Top Tags