#include <ShapeUpgrade_ShapeDivideArea.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
+#include <ShapeFix.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
tool.NbParts() = theNbPnts;
tool.Perform();
TopoDS_Shape res = tool.Result();
+ if (res.IsNull())
+ return -1;
+
+ // Splitting algorithm can produces invalid shapes that results in
+ // infinite loop on ShapeUpgrade_UnifySameDomain::build() call.
+ // Here is a fix from OCCT DRAW: SWDRAW_ShapeUpgrade: splitbynumber().
+ ShapeFix::SameParameter(res, Standard_False);
BRep_Builder aBB;
TopoDS_Compound aGlobalRes;
aLocalTool.SetNumbersUVSplits (1, aNumberToSplit);
aLocalTool.Perform();
aLocalResult = aLocalTool.Result();
+
+ // Splitting algorithm can produces invalid shapes that results in
+ // infinite loop on ShapeUpgrade_UnifySameDomain::build() call.
+ // Here is a fix from OCCT DRAW: SWDRAW_ShapeUpgrade: splitbynumber().
+ ShapeFix::SameParameter(aLocalResult, Standard_False);
+
aNbFacesInLocalResult = aNumberToSplit;
#endif
}
aLocalTool.SetNumbersUVSplits (1, aNumberToSplit);
aLocalTool.Perform();
aLocalResult = aLocalTool.Result();
+
+ // Splitting algorithm can produces invalid shapes that results in
+ // infinite loop on ShapeUpgrade_UnifySameDomain::build() call.
+ // Here is a fix from OCCT DRAW: SWDRAW_ShapeUpgrade: splitbynumber().
+ ShapeFix::SameParameter(aLocalResult, Standard_False);
#endif
}
else
--- /dev/null
+# Point Cloud on Face Cone\r
+\r
+from salome.geom import geomBuilder\r
+geompy = geomBuilder.New()\r
+\r
+# Create one closed cone face\r
+O = geompy.MakeVertex(0, 0, 0)\r
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)\r
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)\r
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)\r
+Cone_1 = geompy.MakeConeR1R2H(50, 100, 50)\r
+[Face_1] = geompy.SubShapes(Cone_1, [3])\r
+geompy.addToStudy( O, 'O' )\r
+geompy.addToStudy( OX, 'OX' )\r
+geompy.addToStudy( OY, 'OY' )\r
+geompy.addToStudy( OZ, 'OZ' )\r
+geompy.addToStudy( Cone_1, 'Cone_1' )\r
+geompy.addToStudyInFather( Cone_1, Face_1, 'Face_1' )\r
+\r
+# Make a cloud of given number of points in range 1-30 on the cone face\r
+try:\r
+ for i in range(1, 31):\r
+ PointCloudOnFilling = geompy.MakeVertexInsideFace(Face_1, i, "PointCloudOnFilling")\r
+except Exception as err:\r
+ print(err)\r
+ # this test should not fail in case of "Improper OCCT version"\r
+ assert("Improper OCCT version" in str(err))\r