View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033169 | Community | OCCT:Modeling Algorithms | public | 2022-10-12 11:59 | 2023-02-04 16:24 |
Reporter | christopher.lackner_140546 | Assigned To | christopher.lackner_140546 | ||
Priority | normal | Severity | major | ||
Status | feedback | Resolution | open | ||
Platform | Linux | OS | Arch | ||
Product Version | 7.5.3 | ||||
Summary | 0033169: Modeling Algorithms - Wrong center after scaling with gp_GTrsf | ||||
Description | After a cylindrical scaling the center properties seem to be computed incorrectly. Attached an example with volume centre of mass, but also the surface properties seem to be off. I would expect the center to stay the same. | ||||
Steps To Reproduce | auto cyl = BRepPrimAPI_MakeCylinder(gp_Ax2({0., 0., 0.}, {0., 0., 1.}), 0.1, 0.1); GProp_GProps props; BRepGProp::VolumeProperties(cyl, props); auto center = props.CentreOfMass(); cout << "Volume center of cyl = " << center.X() << ", " << center.Y() << ", " << center.Z() << endl; gp_GTrsf trafo; trafo.SetVectorialPart( { 1.1, 0, 0, 0, 1.1, 0, 0, 0, 1 } ); trafo.SetTranslationPart({ 0., 0., 0. }); BRepBuilderAPI_GTransform builder(cyl, trafo, true); auto scaled = builder.Shape(); BRepGProp::VolumeProperties(scaled, props); center = props.CentreOfMass(); cout << "Volume center of scaled cyl = " << center.X() << ", " << center.Y() << ", " << center.Z() << endl; | ||||
Additional information and documentation updates | Volume center of cyl = -1.34809e-17, 1.09606e-18, 0.05 Volume center of scaled cyl = 0.000779815, 6.86631e-18, 0.05 Expected would be that the X center is also 0, 7e-4 seems to far off for from a numerical 0. | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
wrong_center.cpp (1,112 bytes) CMakeLists.txt (619 bytes) |
|
There are two methods of computation of volume properties. One is the standard method, which precision is not controlled, and another is with adaptive integration. Please see their description in the corresponding header file. If you use the second method the precision can be increased: BRepGProp::VolumeProperties(scaled, props, 1e-7); Volume center of scaled cyl = -2.70359e-08, -5.7627e-18, 0.05 |
|
So, this is not a bug. |
|
Thank you for the clarification. |
Date Modified | Username | Field | Change |
---|---|---|---|
2022-10-12 11:59 | christopher.lackner_140546 | New Issue | |
2022-10-12 11:59 | christopher.lackner_140546 | Assigned To | => msv |
2022-10-12 11:59 | christopher.lackner_140546 | File Added: wrong_center.cpp | |
2022-10-12 11:59 | christopher.lackner_140546 | File Added: CMakeLists.txt | |
2022-10-12 16:12 |
|
Note Added: 0111524 | |
2022-10-12 16:13 |
|
Assigned To | msv => christopher.lackner_140546 |
2022-10-12 16:13 |
|
Status | new => feedback |
2022-10-12 16:13 |
|
Note Added: 0111525 | |
2023-01-16 13:09 | christopher.lackner_140546 | Note Added: 0112809 | |
2023-02-04 16:24 | dpasukhi | Summary | Wrong center after scaling with gp_GTrsf => Modeling Algorithms - Wrong center after scaling with gp_GTrsf |
2023-02-04 16:24 | dpasukhi | Steps to Reproduce Updated | |
2023-02-04 16:24 | dpasukhi | Steps to Reproduce Updated |