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.
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.
Tue, 08/10/2004 - 21:21
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...
Tue, 08/10/2004 - 21:28
check also GeomAbs_SurfaceType..
Wed, 08/11/2004 - 04:11
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!
Wed, 08/11/2004 - 19:17
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.
Fri, 08/13/2004 - 02:39
Hi Damien,
Thanks very much for your help! It works good for me. thanks!
Mon, 08/16/2004 - 16:33
no need :-)