Face is a Circle

Hi Guys,

How am I able to tell if a face is a circle?

Thanks in advance

Damien's picture

this method is ok when your face is a closed wire on 2 circular edges, so explore both of them and make sur that are circular using the type of shape, but this method had never worked for me !

i do some work on a set of polygones (say a thousands of points), and i use the geometrical properties, so maybe my kind of work may help you.

in global, you have a face, that may be a circle.

TopoDS_Face F = the_face;
GProp_GProps G;
BRepGProp::SurfaceProperties (F, G);

get the moments of inertia.
PrincipalProperties Prop = G.PrincipalProperties();
Standard_Real Ix,Iy,Iz;
Prop.Moments(Ix,Iy,Iz);

and then proove that your moments are at the form of :
Ix = Iy = Pi*pow(radius,4)/4
Iz = Pi*pow(radius,4)/2

if you find the same radius in both equations, make sur that your face is a circle.

maybe there'll be another method...

Damien's picture

check also GeomAbs_SurfaceType..

Howard's picture

Hi Damien,

Thanks for answered my question. I have another question about
how do i get the value of the radius?

Should I get it like this?

radius=G.RadiusOfGyration (gp_Ax1(myPnt, myDir));

Thanks!

Damien's picture

nope, OCC gives u all the moments of inertia, and u know the formula of such moments for a circular surface, so just verify that you have the same radius in all equations, like this :

verify that :

r = pow((4*Ix/Pi),1/4) = pow((4*Iy/Pi),1/4) = pow((2*Iz/Pi),1/4)

if this affirmation is false, then you don't have a circular face.

Howard's picture

Hi Damien,

Thanks very much for your help! It works good for me. thanks!

Damien's picture

no need :-)