New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Geometry generated by Ellipsoid Primitive #279
Comments
Hello RT, I made a few experiment as you may see in the here annexed (patched) src/Mod/PartDesign/App/FeaturePrimitive.cpp". The two lines 479 and 480 split the ball boundary in two halves. You may comment them out if you prefer the original structure with a single closed face. The following lines of the function Ellipsoid::execute() makes several checks of BRep data. When a data is wrong it is fixed. Shell and Solid are not checked, just fixed. If the split part is kept there are only two kind of data (among those considered) that need to be fixed: missing of two 3D edge curves and something wrong with the shell. I do not know what but you may see that something has been done looking at the integer variable result which is set to 2 at line 528 (just after the application of ShapeFix_Shell). This fix solves the problems I had with the boolean but the Geometry Check of Part WB still gives a continuity error for an Edge and the two faces. It would be useful to look inside the section of code (I do not know where it is) that generates the error and to see which kind of OCC check is called there. Perhaps we could understand what kind of other fix we need to apply. |
I have done other tests using the here annexed "src/Mod/PartDesign/App/FeaturePrimitive.cpp" I have separated the healing part in the following function which is define starting at line 435:
Both checks say that the ball is good and no fixes are needed. The Geometry Check from Part WB gives error just because there are degenerate edges which do not need to have 3D curves. If you look inside OCC function: But the point is that BRepCheck_Analyzer should not be applied recursively on all the subsapes (as done in src/Mod/Part/Gui/TaskCheckGeometry.cpp and also in my test). In fact in the file BRepCheck_Analyzer.hxx it is clearly said that Standard_EXPORT Standard_Boolean IsValid (const TopoDS_Shape& S) const; So in conclusion I would say that the function healSolid (called at line 573) and the geometrical checks are not needed and should not be merged. But please, I would like to merge just the two following lines (numbers 546 and 547 in the annexed file) and the related include of ShapeUpgrade_ShapeDivideClosed.hxx
Because I have seen that the boolean reported in the (now closed) issue 278 doesn't fail any more when the ellipsoid surface is divided in two halves. |
Please notice that the edge check at line 595 of my annexed file doesn't rise an exception just because I have explicitly excluded degenerate edges:
Same thing should be done also in src/Mod/Part/Gui/TaskCheckGeometry.cpp to avoid false errors. |
Looking more carefully inside src/Mod/Part/Gui/TaskCheckGeometry.cpp I have seen that the error reported by Part/Check Geometry on the Ellispoid was generated by BOPAlgo_ArgumentAnalyzer (and not by BRepCheck_Analyzer as said in my previous post). BOPAlgo_ArgumentAnalyzer is used when "Run BOP Check" is activated in the settings and only if nothing wrong is found with BRepCheck_Analyzer. But I am still thinking that the Ellipsoid geometry is good and that it is a false error. This geometry is indeed very simple. After being split in two halves it consists of a couple of meridian edges (which have replaced the seam edge) and a couple of polar degenerate edges in each one of the two face. |
The Ellipsoid created using (in example) the Ellipsoid Primitive of PD WB doesn't pass the geometry check.
The Ellipsoid surface is composed of a single face which contains a single Edge (a seam Edge).
Such an edge can form a degenerated closed wire using it in both directions. But this can not be a good representation of the ellipsoid boundary.
The degenerate wire divides the Ellipsoid surface in two parts one having zero area and the other one covering the whole surface. Usually the internal part of a face is defined by the wire orientation with respect to the surface normal. But such a degenerate wire doesn't have a meaningful orientation. In fact the wire representation doesn't change when, in example, all the edges are reversed. It still contains the same single edge used in both orientations. A good representation of the ellipsoid must contain more than one edge.
My suggestion is to split the boundary in two faces each one of them containing two edges: a full ellipse and a meridian seam edge from the equator to the pole. This can be done using using ShapeUpgrade_ShapeDivideClosed (as explained at https://dev.opencascade.org/doc/overview/html/occt_user_guides__shape_healing.html#occt_shg_4_2_1),
or (probably) also changing the initial ellipsoid definition.
The text was updated successfully, but these errors were encountered: