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

0030398: Modeling Algorithms - thrusection produces twisted solid

Change FirstBary to PrevBary to correct Offset calculation relative prev wire instead of first wire
This commit is contained in:
mgerus 2022-06-29 09:27:09 +03:00 committed by smoskvin
parent b284dc42dc
commit ca1491f88b
2 changed files with 19 additions and 3 deletions

View File

@ -1585,7 +1585,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
NbSamples = 4;
gp_Pln FirstPlane;
PlaneOfWire(TopoDS::Wire(myWork(ideb)), FirstPlane);
gp_Pnt FirstBary = FirstPlane.Location();
gp_Pnt PrevBary = FirstPlane.Location();
gp_Vec NormalOfFirstPlane = FirstPlane.Axis().Direction();
for (i = ideb+1; i <= ifin; i++)
{
@ -1596,10 +1596,10 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
gp_Pln CurPlane;
PlaneOfWire(aWire, CurPlane);
gp_Pnt CurBary = CurPlane.Location();
gp_Vec aVec(FirstBary, CurBary);
gp_Vec aVec(PrevBary, CurBary);
gp_Vec anOffsetProj = (aVec * NormalOfFirstPlane) * NormalOfFirstPlane;
CurBary.Translate(-anOffsetProj); //projected current bary center
gp_Vec Offset(CurBary, FirstBary);
gp_Vec Offset(CurBary, PrevBary);
TopoDS_Wire newwire;
BRep_Builder BB;
@ -1804,6 +1804,8 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
newwire.Closed( Standard_True );
newwire.Orientation( TopAbs_FORWARD );
myWork(i) = newwire;
PrevBary = CurBary;
}
#ifdef OCCT_DEBUG_EFV

View File

@ -0,0 +1,14 @@
puts "================================================="
puts "0030398: Modeling Algorithms - thrusection produces twisted solid"
puts "================================================="
puts ""
restore [locate_data_file bug30398.brep] a
eval thrusections r 1 1 [explode a w]
checkshape r
checknbshapes r -shell 1 -face 630 -wire 630 -edge 1260
smallview
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png