# Face is a Circle

Hi Guys,

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

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 :

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

maybe there'll be another method...

check also GeomAbs_SurfaceType..

Hi Damien,

how do i get the value of the radius?

Should I get it like this?

Thanks!

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.

Hi Damien,

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

no need :-)