mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51: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:
parent
b284dc42dc
commit
ca1491f88b
@ -1585,7 +1585,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
|
|||||||
NbSamples = 4;
|
NbSamples = 4;
|
||||||
gp_Pln FirstPlane;
|
gp_Pln FirstPlane;
|
||||||
PlaneOfWire(TopoDS::Wire(myWork(ideb)), FirstPlane);
|
PlaneOfWire(TopoDS::Wire(myWork(ideb)), FirstPlane);
|
||||||
gp_Pnt FirstBary = FirstPlane.Location();
|
gp_Pnt PrevBary = FirstPlane.Location();
|
||||||
gp_Vec NormalOfFirstPlane = FirstPlane.Axis().Direction();
|
gp_Vec NormalOfFirstPlane = FirstPlane.Axis().Direction();
|
||||||
for (i = ideb+1; i <= ifin; i++)
|
for (i = ideb+1; i <= ifin; i++)
|
||||||
{
|
{
|
||||||
@ -1596,10 +1596,10 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
|
|||||||
gp_Pln CurPlane;
|
gp_Pln CurPlane;
|
||||||
PlaneOfWire(aWire, CurPlane);
|
PlaneOfWire(aWire, CurPlane);
|
||||||
gp_Pnt CurBary = CurPlane.Location();
|
gp_Pnt CurBary = CurPlane.Location();
|
||||||
gp_Vec aVec(FirstBary, CurBary);
|
gp_Vec aVec(PrevBary, CurBary);
|
||||||
gp_Vec anOffsetProj = (aVec * NormalOfFirstPlane) * NormalOfFirstPlane;
|
gp_Vec anOffsetProj = (aVec * NormalOfFirstPlane) * NormalOfFirstPlane;
|
||||||
CurBary.Translate(-anOffsetProj); //projected current bary center
|
CurBary.Translate(-anOffsetProj); //projected current bary center
|
||||||
gp_Vec Offset(CurBary, FirstBary);
|
gp_Vec Offset(CurBary, PrevBary);
|
||||||
|
|
||||||
TopoDS_Wire newwire;
|
TopoDS_Wire newwire;
|
||||||
BRep_Builder BB;
|
BRep_Builder BB;
|
||||||
@ -1804,6 +1804,8 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
|
|||||||
newwire.Closed( Standard_True );
|
newwire.Closed( Standard_True );
|
||||||
newwire.Orientation( TopAbs_FORWARD );
|
newwire.Orientation( TopAbs_FORWARD );
|
||||||
myWork(i) = newwire;
|
myWork(i) = newwire;
|
||||||
|
|
||||||
|
PrevBary = CurBary;
|
||||||
}
|
}
|
||||||
#ifdef OCCT_DEBUG_EFV
|
#ifdef OCCT_DEBUG_EFV
|
||||||
|
|
||||||
|
14
tests/bugs/modalg_7/bug30398
Normal file
14
tests/bugs/modalg_7/bug30398
Normal 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
|
Loading…
x
Reference in New Issue
Block a user