Get a point on a brepface


#1

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?


(Menno Deij - van Rijswijk) #2

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.


(Dale Fugier) #3

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


#4

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


#5

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!


(Menno Deij - van Rijswijk) #6

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.


(Dale Fugier) #7

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

– Dale


(Menno Deij - van Rijswijk) #8

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.


#9

yes,my goa isl just as menno say.
I have read the comments in the RhinoSdkUtilities.h include file.
but still don’t know how to set “iso_constant” params.


(Dale Fugier) #10

Lets says you have a surface with a domain u=0,50 and v=0,25 and you wanted an isocurve for any value of u through v=13, you’d specify iso_dir=0 and iso_constant=13.

Does this help?

– Dale


#11

dale:
thanks very much.
you explain is very clear