1. src\BRepSweep\BRepSweep_NumLinearRegularSweep.cxx
Fix bug by adding result in list of generated shapes, if initial shape is vertex, edge or face.
2. src\BRepLib\BRepLib.cxx
Add protection against treatment not geometric edge in BRepLib::UpdateInnerTolerances(...)
3. Add test case for bug and correct test for bug 30346 according to new behavior of algorithm
for (Standard_Integer i = 1; i <= EFmap.Extent(); i++)
{
TopoDS_Edge anEdge = TopoDS::Edge(EFmap.FindKey(i));
+
+ if (!BRep_Tool::IsGeometric(anEdge))
+ {
+ continue;
+ }
+
TopoDS_Vertex V1, V2;
TopExp::Vertices(anEdge, V1, V2);
Standard_Real fpar, lpar;
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
Standard_OutOfRange_Raise_if(iGenS == 0,
"BRepSweep_NumLinearRegularSweep::GenIsUsed: shape index = 0")
- return myBuiltShapes(iGenS, 1) && myUsedShapes(iGenS, 1);
+ if (iGenS == 1)
+ {
+ return myBuiltShapes(iGenS, 1);
+ }
+ else
+ {
+ return myBuiltShapes(iGenS, 1) && myUsedShapes(iGenS, 1);
+ }
}
prism r1 f1 0 0 2
savehistory h1
set s1 [dump h1]
-if { !([regexp "0 Deleted" $s1] && [regexp "2 Generated" $s1])} {
+if { !([regexp "0 Deleted" $s1] && [regexp "3 Generated" $s1])} {
puts "Error: wrong history h1"
}
#
prism r2 f2 0 0 2
savehistory h2
set s2 [dump h2]
-if { !([regexp "0 Deleted" $s2] && [regexp "6 Generated" $s2])} {
+if { !([regexp "0 Deleted" $s2] && [regexp "7 Generated" $s2])} {
puts "Error: wrong history h2"
}
--- /dev/null
+puts "========"
+puts "0031031: Incorrect result is returned from BRepPrimAPI_MakePrism::Generated()"
+puts "========"
+puts ""
+
+pload MODELING
+
+vertex v1 0 0 0
+prism r1 v1 0 0 2
+savehistory h1
+set s1 [dump h1]
+if { !([regexp "0 Deleted" $s1] && [regexp "1 Generated" $s1])} {
+ puts "Error: wrong history h1"
+}
+