Is there a simple routine to generate an arbitrary point that is guaranteed to be on the surface of a face (within the restriction of the face)? Nothing in the API is leaping out at me.
Bearloga Wed, 02/24/2010 - 10:42
This task is hardly formalized (there can be many variants how to implement it with various performance and robustness). You need to write your own method that fits your needs. E.g., think of issuing a ray from a vertex to inside the face, intersect this ray with a boundary, and take some middle point.
I think you can use the "GeomAPI_ProjectPointOnSurf" class. If your surface is a plane using this class you can get the "nearest point" inside the bound of the surface (if it is bounded).
Try a code like this :
gp_Pnt ThePoint=.....;
GeomAPI_ProjectPointOnSurf TheProjection(ThePoint, TheSurface);
if (TheProjection.NbPoints()) ThePoint=TheProjection.NearestPoint();
Try to have a look how it was made in visualisation classes of the Draw.
A face is visualized by means of iso-curves. These iso-curves lay down on surface of the face where there is a material of the face.
So, any point from any iso-curve of such kind will be that you want.
Wed, 02/24/2010 - 10:42
This task is hardly formalized (there can be many variants how to implement it with various performance and robustness). You need to write your own method that fits your needs. E.g., think of issuing a ray from a vertex to inside the face, intersect this ray with a boundary, and take some middle point.
Wed, 02/24/2010 - 11:10
Hello Spencer,
I think you can use the "GeomAPI_ProjectPointOnSurf" class. If your surface is a plane using this class you can get the "nearest point" inside the bound of the surface (if it is bounded).
Try a code like this :
gp_Pnt ThePoint=.....;
GeomAPI_ProjectPointOnSurf TheProjection(ThePoint, TheSurface);
if (TheProjection.NbPoints()) ThePoint=TheProjection.NearestPoint();
I hope this can help you
Bye
Fri, 02/26/2010 - 07:18
Dear Spencer Burton.
Try to have a look how it was made in visualisation classes of the Draw.
A face is visualized by means of iso-curves. These iso-curves lay down on surface of the face where there is a material of the face.
So, any point from any iso-curve of such kind will be that you want.