MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031290Community[OCCT] OCCT:Modeling Algorithmspublic2020-01-01 21:432020-01-15 12:15
Reporterb_walter 
Assigned Tomsv 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformMacOSOSOS VersionX
Product Version[OCCT] 7.3.0 
Target VersionFixed in Version 
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
Attached Files

- Relationships

-  Notes
(0089836)
msv (developer)
2020-01-01 23:25

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).
(0089837)
b_walter (reporter)
2020-01-02 15:48

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 View Revisions
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
2020-01-15 12:15 kgv Relationship added related to 0030449


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker