mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0024328: Revolution of a wire generates two interfered faces.
Correct treatment of cones with collinear axes. Test case for issue CR24328
This commit is contained in:
parent
d5af86261d
commit
b92a64cc68
@ -31,6 +31,7 @@
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
//
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
@ -1853,9 +1854,11 @@ Standard_Boolean FindPointInFace(const TopoDS_Edge& aE,
|
||||
case GeomAbs_Cylinder:
|
||||
aR = aBAS.Cylinder().Radius();
|
||||
break;
|
||||
case GeomAbs_Cone:
|
||||
aR = aBAS.Cone().RefRadius();
|
||||
case GeomAbs_Cone: {
|
||||
gp_Lin aL(aBAS.Cone().Axis());
|
||||
aR = aL.Distance(aP);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Sphere:
|
||||
aR = aBAS.Sphere().Radius();
|
||||
break;
|
||||
|
@ -784,21 +784,17 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
}
|
||||
|
||||
//// modified by jgv, 15.12.02 for OCC565 ////
|
||||
if (typs1 == GeomAbs_Cone)
|
||||
if (typs1 == GeomAbs_Cone && TreatAsBiParametric)
|
||||
{
|
||||
const gp_Cone Con1 = theS1->Cone();
|
||||
const Standard_Real a1 = Abs(Con1.SemiAngle());
|
||||
if (a1 < 0.02 && a2 < 0.02) //quasi-cylinders: if same domain, treat as canonic
|
||||
//if collinear, treat as canonical
|
||||
const gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis();
|
||||
const gp_Lin L1(A1);
|
||||
if (A1.IsParallel(A2,Precision::Angular()) &&
|
||||
(L1.Distance(A2.Location()) <= Precision::Confusion()))
|
||||
{
|
||||
const gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis();
|
||||
if (A1.IsParallel(A2,Precision::Angular()))
|
||||
{
|
||||
const gp_Lin L1(A1);
|
||||
if (L1.Distance(A2.Location()) <= Precision::Confusion())
|
||||
{
|
||||
TreatAsBiParametric = Standard_False;
|
||||
}
|
||||
}
|
||||
TreatAsBiParametric = Standard_False;
|
||||
}
|
||||
else if (a1 > 1.55 && a2 > 1.55) //quasi-planes: if same domain, treat as canonic
|
||||
{
|
||||
@ -813,14 +809,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((a1 > 1.55) || (a2 > 1.55))
|
||||
{
|
||||
const gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis();
|
||||
if (A1.IsCoaxial(A2,Precision::Angular(),Precision::Confusion()))
|
||||
{
|
||||
TreatAsBiParametric = Standard_False;
|
||||
}
|
||||
}
|
||||
}// if (typs1 == GeomAbs_Cone) {
|
||||
}// if(typs2 == GeomAbs_Cone) {
|
||||
|
||||
@ -984,21 +972,17 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
}
|
||||
|
||||
//// modified by jgv, 15.12.02 for OCC565 ////
|
||||
if (typs1 == GeomAbs_Cone)
|
||||
if (typs1 == GeomAbs_Cone && TreatAsBiParametric)
|
||||
{
|
||||
const gp_Cone Con1 = theS1->Cone();
|
||||
const Standard_Real a1 = Abs(Con1.SemiAngle());
|
||||
if (a1 < 0.02 && a2 < 0.02) //quasi-cylinders: if same domain, treat as canonic
|
||||
//if collinear, treat as canonical
|
||||
const gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis();
|
||||
const gp_Lin L1(A1);
|
||||
if (A1.IsParallel(A2,Precision::Angular()) &&
|
||||
(L1.Distance(A2.Location()) <= Precision::Confusion()))
|
||||
{
|
||||
const gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis();
|
||||
if (A1.IsParallel(A2,Precision::Angular()))
|
||||
{
|
||||
const gp_Lin L1(A1);
|
||||
if (L1.Distance(A2.Location()) <= Precision::Confusion())
|
||||
{
|
||||
TreatAsBiParametric = Standard_False;
|
||||
}
|
||||
}
|
||||
TreatAsBiParametric = Standard_False;
|
||||
}
|
||||
else if (a1 > 1.55 && a2 > 1.55) //quasi-planes: if same domain, treat as canonic
|
||||
{
|
||||
@ -1013,14 +997,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((a1 > 1.55) || (a2 > 1.55))
|
||||
{
|
||||
const gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis();
|
||||
if (A1.IsCoaxial(A2,Precision::Angular(),Precision::Confusion()))
|
||||
{
|
||||
TreatAsBiParametric = Standard_False;
|
||||
}
|
||||
}
|
||||
}// if (typs1 == GeomAbs_Cone) {
|
||||
}// if(typs2 == GeomAbs_Cone) {
|
||||
|
||||
|
23
tests/bugs/modalg_5/bug24328
Normal file
23
tests/bugs/modalg_5/bug24328
Normal file
@ -0,0 +1,23 @@
|
||||
puts "================"
|
||||
puts "OCC24328"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Revolution of a wire generates two interfered faces
|
||||
#######################################################################
|
||||
|
||||
vertex v1 23.500000 11.123000 0
|
||||
vertex v2 22.000000 11.140900 0
|
||||
vertex v3 20.500000 11.180700 0
|
||||
edge e1 v1 v2
|
||||
edge e2 v2 v3
|
||||
wire w e1 e2
|
||||
revol r w 0 0 0 1 0 0 360
|
||||
|
||||
set info [bopcheck r]
|
||||
|
||||
if { [regexp "This shape seems to be OK" ${info}] != 1 } {
|
||||
puts "Error : Revolution works wrong"
|
||||
} else {
|
||||
puts "OK: Revolution works properly"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user