aRMaj1 = Tor1.MajorRadius();
aRMin2 = Tor2.MinorRadius();
aRMaj2 = Tor2.MajorRadius();
- if (aRMin1 >= aRMaj1 || aRMin2 >= aRMaj2) {
- typeres = IntAna_NoGeometricSolution;
- return;
- }
//
- const gp_Ax1 anAx1 = Tor1.Axis();
- const gp_Ax1 anAx2 = Tor2.Axis();
+ const gp_Ax1& anAx1 = Tor1.Axis();
+ const gp_Ax1& anAx2 = Tor2.Axis();
+ //
+ const gp_Pnt& aLoc1 = anAx1.Location();
+ const gp_Pnt& aLoc2 = anAx2.Location();
//
gp_Lin aL1(anAx1);
if (!anAx1.IsParallel(anAx2, myEPSILON_AXES_PARA) ||
- (aL1.Distance(anAx2.Location()) > myEPSILON_DISTANCE)) {
+ (aL1.Distance(aLoc2) > myEPSILON_DISTANCE)) {
typeres = IntAna_NoGeometricSolution;
return;
}
//
- gp_Pnt aLoc1, aLoc2;
- //
- aLoc1 = anAx1.Location();
- aLoc2 = anAx2.Location();
- //
if (aLoc1.IsEqual(aLoc2, Tol) &&
- (Abs(aRMin1 - aRMin2) <= Tol) &&
+ (Abs(aRMin1 - aRMin2) <= Tol) &&
(Abs(aRMaj1 - aRMaj2) <= Tol)) {
typeres = IntAna_Same;
return;
}
//
+ if (aRMin1 >= aRMaj1 || aRMin2 >= aRMaj2) {
+ typeres = IntAna_NoGeometricSolution;
+ return;
+ }
+ //
Standard_Real aDist;
gp_Pnt aP1, aP2;
//
bToCheck = aTor1.MajorRadius() > aTor1.MinorRadius();
if (typs1 == typs2) {
const gp_Torus aTor2 = aGeomSurf->Torus();
- bToCheck = aTor2.MajorRadius() > aTor2.MinorRadius();
+ bToCheck = (bToCheck && (aTor2.MajorRadius() > aTor2.MinorRadius())) ||
+ (Abs(aTor1.MajorRadius() - aTor2.MajorRadius()) < TolTang &&
+ Abs(aTor1.MinorRadius() - aTor2.MinorRadius()) < TolTang);
}
//
if (aCTType == GeomAbs_Torus) {
--- /dev/null
+puts "========"
+puts "0030100: Modeling Algorithms - ShapeUpgrade_UnifySameDomain is unable to unify faces based on the same toroidal surface"
+puts "========"
+puts ""
+
+restore [locate_data_file bug30100_usd.brep] s
+unifysamedom result s
+checkshape result
+checknbshapes result -wire 1 -face 1
+checkprops result -s 142506
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "0030100: Modeling Algorithms - ShapeUpgrade_UnifySameDomain is unable to unify faces based on the same toroidal surface"
+puts "========"
+puts ""
+
+restore [locate_data_file bug30100_faces.brep] f
+explode f
+
+if {![regexp "no 3d curves" [bopcurves f_1 f_2]]} {
+ puts "Error: Tangent faces are not detected"
+}