1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00

Modeling Algorithms - UnifySameDomain improvement #371

Extend ShapeUpgrade_UnifySameDomain algorithm working on cases,
  where SurfaceOfRevolution or SurfaceOfLinearExtrusion was made on basis of TrimmedCurve.
Original issue: 0033328
This commit is contained in:
jfa 2023-04-21 10:40:49 +01:00 committed by dpasukhi
parent 4c5f9c77cb
commit e375bd7c3e
3 changed files with 46 additions and 0 deletions

View File

@ -1233,6 +1233,13 @@ static Standard_Boolean getCylinder(Handle(Geom_Surface)& theInSurface, gp_Cylin
{
Handle(Geom_SurfaceOfRevolution) aRS = Handle(Geom_SurfaceOfRevolution)::DownCast(theInSurface);
Handle(Geom_Curve) aBasis = aRS->BasisCurve();
while (aBasis->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
{
Handle(Geom_TrimmedCurve) aTc = Handle(Geom_TrimmedCurve)::DownCast(aBasis);
aBasis = aTc->BasisCurve();
}
if (aBasis->IsKind(STANDARD_TYPE(Geom_Line)))
{
Handle(Geom_Line) aBasisLine = Handle(Geom_Line)::DownCast(aBasis);
@ -1255,6 +1262,13 @@ static Standard_Boolean getCylinder(Handle(Geom_Surface)& theInSurface, gp_Cylin
Handle(Geom_SurfaceOfLinearExtrusion) aLES =
Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(theInSurface);
Handle(Geom_Curve) aBasis = aLES->BasisCurve();
while (aBasis->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
{
Handle(Geom_TrimmedCurve) aTc = Handle(Geom_TrimmedCurve)::DownCast(aBasis);
aBasis = aTc->BasisCurve();
}
if (aBasis->IsKind(STANDARD_TYPE(Geom_Circle)))
{
Handle(Geom_Circle) aBasisCircle = Handle(Geom_Circle)::DownCast(aBasis);

View File

@ -0,0 +1,16 @@
puts "================================"
puts "0033328: Modeling Algorithms - UnifySameDomain improvement"
puts "================================"
puts ""
restore [locate_data_file bug33328_Shell_1.brep] shell
numshapes shell
checknbshapes shell -vertex 6 -edge 7 -wire 2 -face 2 -shell 1 -solid 0
unifysamedom res shell
#Warning: BRepTools_ReShape::Replace: shape already recorded
checknbshapes res -vertex 4 -edge 4 -wire 1 -face 1 -shell 1 -solid 0

View File

@ -0,0 +1,16 @@
puts "================================"
puts "0033328: Modeling Algorithms - UnifySameDomain improvement"
puts "================================"
puts ""
restore [locate_data_file bug33328_Shell_2.brep] shell
numshapes shell
checknbshapes shell -vertex 6 -edge 7 -wire 2 -face 2 -shell 1 -solid 0
unifysamedom res shell
#Warning: BRepTools_ReShape::Replace: shape already recorded
checknbshapes res -vertex 4 -edge 4 -wire 1 -face 1 -shell 1 -solid 0