Get a point on a brepface

I have a trimed brepface.
how can I get a any point on the brepface and this point can’t closed to the edges of the brepface.
that to say I want this point as far as possible to the edges of the brepface.

I try write codes like that:
on_3dpoint GetPointOnBrepFace(on_brepface*in_facel)
{
double u0,u1;
double v0,v1;
in_face->getdomain(0,&u0,&u1);
in_face->getdomain(1,&v0,&v1);
return in_face->pointat((u1-u0)/2,(v1-v0).2);
}

I find on_brepface::getdomain just get the domain of the surface ,not the on_brepface,
so using in_face->pointat((u1-u0)/2,(v1-v0).2) get a point maybe not on the brepface,but on the surface.

can anyone tell me how to write this fuction?

As far as I know you can use (see rhinoSdkUtilities.h)

``````int RhinoGetBrepFaceIsoIntervals(
const ON_BrepFace& face,
int iso_dir,
double iso_constant,
ON_SimpleArray<ON_Interval>& intervals
);
``````

or

``````int RhinoGetBrepFaceIsoCurves(
const ON_BrepFace& face,
int iso_dir,
double iso_constant,
ON_SimpleArray<ON_Curve*>& iso_curves
);
``````

To get the intervals or curves that are visible. Next, you need to decide which is furthest away from the edge of the brep. This is not trivial if there is e.g. a hole in the brep.
Also: furthest away in parameter space does not mean furthest away in real space.

My apologies, but I am having a real difficult time understanding what you are trying to do. Can you explain further? What are you trying to do and why?

If you are trying to see if a point is in the active region of a face, use RhinoIsPointOnFace(). See rhinoSdkUtilities.h for details.

Thanks,

– Dale

dale:
I an not trying to see if a point is in the active region.but want to get a point in the active region of a brepface.
and this point should as far as possible to the edges of the brepface.

menno:
thanks for you idea,I think this maybe a good idea,I will try it later on

I find thers are four similar functions.

RhinoGeIsoIntervals
RhinoGetBrepFaceIsoIntervals
RhinoGeIsoCurves
RhinoGetBrepFaceIsoCurves

what different they are?
I want get all intervals both u and v dir.
but I don’t know how to use these funtions,can anybody give me some examples?
specially,I dont’t know how to set “iso_constant” params.

thanks very much!

I think the ones with “BrepFace” in the function name will give you trim-aware curves and intervals; the others will not be trim-aware.

Please also read the comments in the RhinoSdkUtilities.h include file, they are very good in describing the objective of the function.

Any point on any Brep edge curve will be on a face. Perhaps I am confused as to what your real goal is…

– Dale

The goal seems to be the point that is furthest away from the edges. For a square, that would be the middle.

It is the point for which the edge curves maximise their distance to that point. I have no idea for an algorithm on how to get this for any given brepface, because there is not a unique solution.

yes,my goa isl just as menno say.