View Issue Details

IDProjectCategoryView StatusLast Update
0031290CommunityOCCT:Modeling Algorithmspublic2020-01-15 12:15
Reporterb_walter Assigned Tomsv 
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformMacOSOS 
Product Version7.3.0 
Summary0031290: Modeling Algorithms - Center of mass of the TopoDS_Edge of an ellipse seems to be wrong
DescriptionI use opencascade 7.4.0_1

If I create an ellipse with the following code

```
  gp_Pnt center(0., 0., 0.);
  gp_Dir zDir = gp::DZ();
  gp_Ax2 axis(center, zDir);
  gp_Elips ellipse_gp(axis, 4000., 40.);
  TopoDS_Edge ellipse = BRepBuilderAPI_MakeEdge(ellipse_gp);
```

then calculating the center of mass by

```
  GProp_GProps Properties;
  BRepGProp::LinearProperties(ellipse, Properties);
  gp_Pnt c = Properties.CentreOfMass();
```

leads to (-81.295066, 0.000000, 0.000000)

I would have expected (0, 0, 0).

What happens here?

Steps To Reproduceellipse el 0 0 0 4000 40
mkedge e el
lprops e

Center of gravity :
X = -81.2951
Y = 1.40172e-15
Z = 0
TagsNo tags attached.
Test case number

Activities

msv

2020-01-01 23:25

developer   ~0089836

This seems to be a bug in calculation of linear properties of an ellipse.

Workaround is to create a face of that ellipse and to compute surface properties of that face.

The computed center of such face is (0, -3.91083e-15, 0).

b_walter

2020-01-02 15:48

reporter   ~0089837

As a side note, if I approximate the ellipse with points (python code for illustration)

```
  def ellipse(maj_r, min_r, alpha):
      return (maj_r * math.cos(alpha), min_r * math.sin(alpha))
  alphas = np.linspace(0, 2*math.pi, 3601)
  points = [ellipse(400, 10, alpha) for alpha in alphas]
```

and build a closed wire, the center of mass is correct. So it is not a matter of the shape dimensions or the shape form, but of the ellipse itself.

Issue History

Date Modified Username Field Change
2020-01-01 21:43 b_walter New Issue
2020-01-01 21:43 b_walter Assigned To => msv
2020-01-01 23:25 msv Note Added: 0089836
2020-01-01 23:26 msv Steps to Reproduce Updated
2020-01-02 15:48 b_walter Note Added: 0089837
2020-01-15 12:14 kgv Summary Center of mass of the TopoDS_Edge of an ellipse seems to be wrong => Modeling Algorithms - Center of mass of the TopoDS_Edge of an ellipse seems to be wrong