mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c88a9e8472 | ||
|
14a58b6472 | ||
|
585659c9ed | ||
|
2ac2591bca |
@@ -308,8 +308,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
|
|||||||
const Standard_Boolean theIsBRepMode)
|
const Standard_Boolean theIsBRepMode)
|
||||||
{
|
{
|
||||||
Handle(IGESData_IGESEntity) res;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if (theEdge.IsNull() || GetPCurveMode() ==0 ||
|
if (theEdge.IsNull() || ( ! theIsBRepMode && BRep_Tool::Degenerated (theEdge) ) )
|
||||||
( ! theIsBRepMode && BRep_Tool::Degenerated (theEdge) ) ) return res;
|
return res;
|
||||||
|
|
||||||
//S4181 pdn 23.04.99 adjusting length factor according to analytic mode.
|
//S4181 pdn 23.04.99 adjusting length factor according to analytic mode.
|
||||||
Standard_Real myLen = theLength;
|
Standard_Real myLen = theLength;
|
||||||
|
@@ -86,7 +86,7 @@ void Interface_Static::Standards ()
|
|||||||
Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval Off");
|
Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval Off");
|
||||||
Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval On");
|
Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval On");
|
||||||
// Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval NoAnalytic");
|
// Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval NoAnalytic");
|
||||||
Interface_Static::SetIVal ("write.surfacecurve.mode",1);
|
Interface_Static::SetIVal ("write.surfacecurve.mode",0);
|
||||||
|
|
||||||
// lastpreci : pour recuperer la derniere valeur codee (cf XSControl)
|
// lastpreci : pour recuperer la derniere valeur codee (cf XSControl)
|
||||||
// (0 pour dire : pas codee)
|
// (0 pour dire : pas codee)
|
||||||
|
@@ -987,24 +987,84 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !ModifE1 && !ModifE2 ) {
|
if( ModifE1 == ModifE2 ) {
|
||||||
gp_Pnt P0( (pi1.X()+pi2.X())/2, (pi1.Y()+pi2.Y())/2, (pi1.Z()+pi2.Z())/2 );
|
gp_Pnt P0( (pi1.X()+pi2.X())/2, (pi1.Y()+pi2.Y())/2, (pi1.Z()+pi2.Z())/2 );
|
||||||
tolV = Max( (pi1.Distance(pi2)/2)*1.00001, Precision::Confusion() );
|
tolV = Max( (pi1.Distance(pi2)/2)*1.00001, Precision::Confusion() );
|
||||||
B.MakeVertex(V,P0,tolV);
|
B.MakeVertex(V,P0,tolV);
|
||||||
MaxTolVert = Max(MaxTolVert,tolV);
|
MaxTolVert = Max(MaxTolVert,tolV);
|
||||||
Standard_Boolean isEdgeSplit2 = SplitEdge1(sewd, face, num2, param2,
|
if( !ModifE1 && !ModifE2 ) {
|
||||||
V, tolV, boxes);
|
Standard_Boolean isEdgeSplit2 = SplitEdge1(sewd, face, num2, param2,
|
||||||
if(isEdgeSplit2) {
|
V, tolV, boxes);
|
||||||
NbSplit++;
|
if(isEdgeSplit2) {
|
||||||
num2--;
|
NbSplit++;
|
||||||
|
num2--;
|
||||||
|
}
|
||||||
|
if(SplitEdge1(sewd, face, num1, param1, V, tolV, boxes)) {
|
||||||
|
NbSplit++;
|
||||||
|
num1--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(isEdgeSplit2)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if(SplitEdge1(sewd, face, num1, param1, V, tolV, boxes)) {
|
else if (PVF1.Distance(PVF2) < MaxTolVert || PVF1.Distance(PVL2) < MaxTolVert ||
|
||||||
NbSplit++;
|
PVL1.Distance(PVF2) < MaxTolVert || PVL1.Distance(PVL2) < MaxTolVert)
|
||||||
num1--;
|
{
|
||||||
break;
|
ShapeBuild_Edge sbe;
|
||||||
|
ShapeAnalysis_Edge sae;
|
||||||
|
Standard_Real dist1 = pi1.Distance(PVF1);
|
||||||
|
Standard_Real dist2 = pi1.Distance(PVL1);
|
||||||
|
TopoDS_Edge NewE1, NewAjE1, edgeAj1;
|
||||||
|
Standard_Integer n;
|
||||||
|
if(dist1 < dist2)
|
||||||
|
{
|
||||||
|
NewE1 = sbe.CopyReplaceVertices(edge1,V,VL1);
|
||||||
|
n = num1 - 1;
|
||||||
|
edgeAj1 = sewd->Edge(n);
|
||||||
|
NewAjE1 = sbe.CopyReplaceVertices(edgeAj1,sae.FirstVertex(edgeAj1),V);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewE1 = sbe.CopyReplaceVertices(edge1,VF1,V);
|
||||||
|
n = num1 + 1;
|
||||||
|
edgeAj1 = sewd->Edge(n);
|
||||||
|
NewAjE1 = sbe.CopyReplaceVertices(edgeAj1,V,sae.LastVertex(edgeAj1));
|
||||||
|
}
|
||||||
|
myContext->Replace(edge1,NewE1);
|
||||||
|
myContext->Replace(edgeAj1,NewAjE1);
|
||||||
|
sewd->Set(NewE1,num1);
|
||||||
|
sewd->Set(NewAjE1,n);
|
||||||
|
boxes.Bind(NewE1,B1);
|
||||||
|
Bnd_Box2d BAj1 = boxes.Find(edgeAj1);
|
||||||
|
boxes.Bind(NewAjE1,BAj1);
|
||||||
|
edge1 = NewE1;
|
||||||
|
|
||||||
|
dist1 = pi2.Distance(PVF2);
|
||||||
|
dist2 = pi2.Distance(PVL2);
|
||||||
|
TopoDS_Edge NewE2, NewAjE2, edgeAj2;
|
||||||
|
if(dist1 < dist2)
|
||||||
|
{
|
||||||
|
NewE2 = sbe.CopyReplaceVertices(edge2,V,VL2);
|
||||||
|
n = num2 - 1;
|
||||||
|
edgeAj2 = sewd->Edge(n);
|
||||||
|
NewAjE2 = sbe.CopyReplaceVertices(edgeAj2,sae.FirstVertex(edgeAj2),V);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewE2 = sbe.CopyReplaceVertices(edge2,VF2,V);
|
||||||
|
n = (num2 + 1 > sewd->NbEdges())?(num2 + 1 - sewd->NbEdges()):(num2 + 1);
|
||||||
|
edgeAj2 = sewd->Edge(n);
|
||||||
|
NewAjE2 = sbe.CopyReplaceVertices(edgeAj2,V,sae.LastVertex(edgeAj2));
|
||||||
|
}
|
||||||
|
myContext->Replace(edge2,NewE2);
|
||||||
|
myContext->Replace(edgeAj2,NewAjE2);
|
||||||
|
sewd->Set(NewE2,num2);
|
||||||
|
sewd->Set(NewAjE2,n);
|
||||||
|
boxes.Bind(NewE2,B2);
|
||||||
|
Bnd_Box2d BAj2 = boxes.Find(edgeAj2);
|
||||||
|
boxes.Bind(NewAjE2,BAj2);
|
||||||
|
edge2 = NewE2;
|
||||||
}
|
}
|
||||||
if(isEdgeSplit2)
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( Tr1.PositionOnCurve() == IntRes2d_Middle &&
|
if( Tr1.PositionOnCurve() == IntRes2d_Middle &&
|
||||||
@@ -1321,6 +1381,29 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
if(P01.Distance(PV12)<tolV1) {
|
if(P01.Distance(PV12)<tolV1) {
|
||||||
tolV1 += P01.Distance(PV12);
|
tolV1 += P01.Distance(PV12);
|
||||||
B.UpdateVertex(NewV1,tolV1);
|
B.UpdateVertex(NewV1,tolV1);
|
||||||
|
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,NewV1,V22);
|
||||||
|
myContext->Replace(edge2,NewE);
|
||||||
|
sewd->Set(NewE,num2+dnum1);
|
||||||
|
boxes.Bind(NewE,B2); // update boxes
|
||||||
|
edge2 = NewE;
|
||||||
|
TopoDS_Edge eprev = sewd->Edge(num2+dnum1-1);
|
||||||
|
if (sae.LastVertex(eprev).IsSame(V12))
|
||||||
|
{
|
||||||
|
TopoDS_Vertex VLprev = sae.LastVertex(eprev);
|
||||||
|
TopoDS_Edge NewEprev =
|
||||||
|
sbe.CopyReplaceVertices(eprev,sae.FirstVertex(eprev),NewV1);
|
||||||
|
myContext->Replace(eprev,NewEprev);
|
||||||
|
sewd->Set(NewEprev,num2+dnum1-1);
|
||||||
|
Bnd_Box2d Bprev = boxes.Find(eprev);
|
||||||
|
boxes.Bind(NewEprev,Bprev); // update boxes
|
||||||
|
|
||||||
|
if(VLprev.Orientation()==NewV1.Orientation()) {
|
||||||
|
myContext->Replace(VLprev,NewV1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myContext->Replace(VLprev,NewV1.Reversed());
|
||||||
|
}
|
||||||
|
}
|
||||||
if(V12.Orientation()==NewV1.Orientation()) {
|
if(V12.Orientation()==NewV1.Orientation()) {
|
||||||
myContext->Replace(V12,NewV1);
|
myContext->Replace(V12,NewV1);
|
||||||
V12 = NewV1;
|
V12 = NewV1;
|
||||||
@@ -1330,16 +1413,36 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
V12 = TopoDS::Vertex(NewV1.Reversed());
|
V12 = TopoDS::Vertex(NewV1.Reversed());
|
||||||
}
|
}
|
||||||
nbReplaced++; //gka 06.09.04
|
nbReplaced++; //gka 06.09.04
|
||||||
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,NewV1,V22);
|
akey1 = 1;
|
||||||
|
}
|
||||||
|
if(P01.Distance(PV22)<tolV1) {
|
||||||
|
tolV1 += P01.Distance(PV22);
|
||||||
|
B.UpdateVertex(NewV1,tolV1);
|
||||||
|
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,V12,NewV1);
|
||||||
myContext->Replace(edge2,NewE);
|
myContext->Replace(edge2,NewE);
|
||||||
sewd->Set(NewE,num2+dnum1);
|
sewd->Set(NewE,num2+dnum1);
|
||||||
boxes.Bind(NewE,B2); // update boxes
|
boxes.Bind(NewE,B2); // update boxes
|
||||||
edge2 = NewE;
|
edge2 = NewE;
|
||||||
akey1 = 1;
|
Standard_Integer n =
|
||||||
}
|
(num2+dnum1+1 > sewd->NbEdges())?(num2+dnum1+1 - sewd->NbEdges()):(num2+dnum1+1);
|
||||||
if(P01.Distance(PV22)<tolV1) {
|
TopoDS_Edge enext = sewd->Edge(n);
|
||||||
tolV1 += P01.Distance(PV22);
|
if (sae.FirstVertex(enext).IsSame(V22))
|
||||||
B.UpdateVertex(NewV1,tolV1);
|
{
|
||||||
|
TopoDS_Vertex VFnext = sae.FirstVertex(enext);
|
||||||
|
TopoDS_Edge NewEnext =
|
||||||
|
sbe.CopyReplaceVertices(enext,NewV1,sae.LastVertex(enext));
|
||||||
|
myContext->Replace(enext,NewEnext);
|
||||||
|
sewd->Set(NewEnext,n);
|
||||||
|
Bnd_Box2d Bnext = boxes.Find(enext);
|
||||||
|
boxes.Bind(NewEnext,Bnext); // update boxes
|
||||||
|
|
||||||
|
if(VFnext.Orientation()==NewV1.Orientation()) {
|
||||||
|
myContext->Replace(VFnext,NewV1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myContext->Replace(VFnext,NewV1.Reversed());
|
||||||
|
}
|
||||||
|
}
|
||||||
if(V22.Orientation()==NewV1.Orientation()) {
|
if(V22.Orientation()==NewV1.Orientation()) {
|
||||||
myContext->Replace(V22,NewV1);
|
myContext->Replace(V22,NewV1);
|
||||||
V22 = NewV1;
|
V22 = NewV1;
|
||||||
@@ -1349,16 +1452,34 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
V22 = TopoDS::Vertex(NewV1.Reversed());
|
V22 = TopoDS::Vertex(NewV1.Reversed());
|
||||||
}
|
}
|
||||||
nbReplaced++; //gka 06.09.04
|
nbReplaced++; //gka 06.09.04
|
||||||
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,V12,NewV1);
|
|
||||||
myContext->Replace(edge2,NewE);
|
|
||||||
sewd->Set(NewE,num2+dnum1);
|
|
||||||
boxes.Bind(NewE,B2); // update boxes
|
|
||||||
edge2 = NewE;
|
|
||||||
akey1 = 2;
|
akey1 = 2;
|
||||||
}
|
}
|
||||||
if(P02.Distance(PV12)<tolV2) {
|
if(P02.Distance(PV12)<tolV2) {
|
||||||
tolV2 += P02.Distance(PV12);
|
tolV2 += P02.Distance(PV12);
|
||||||
B.UpdateVertex(NewV2,tolV2);
|
B.UpdateVertex(NewV2,tolV2);
|
||||||
|
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,NewV2,V22);
|
||||||
|
myContext->Replace(edge2,NewE);
|
||||||
|
sewd->Set(NewE,num2+dnum1);
|
||||||
|
boxes.Bind(NewE,B2); // update boxes
|
||||||
|
edge2 = NewE;
|
||||||
|
TopoDS_Edge eprev = sewd->Edge(num2+dnum1-1);
|
||||||
|
if (sae.LastVertex(eprev).IsSame(V12))
|
||||||
|
{
|
||||||
|
TopoDS_Vertex VLprev = sae.LastVertex(eprev);
|
||||||
|
TopoDS_Edge NewEprev =
|
||||||
|
sbe.CopyReplaceVertices(eprev,sae.FirstVertex(eprev),NewV2);
|
||||||
|
myContext->Replace(eprev,NewEprev);
|
||||||
|
sewd->Set(NewEprev,num2+dnum1-1);
|
||||||
|
Bnd_Box2d Bprev = boxes.Find(eprev);
|
||||||
|
boxes.Bind(NewEprev,Bprev); // update boxes
|
||||||
|
|
||||||
|
if(VLprev.Orientation()==NewV2.Orientation()) {
|
||||||
|
myContext->Replace(VLprev,NewV2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myContext->Replace(VLprev,NewV2.Reversed());
|
||||||
|
}
|
||||||
|
}
|
||||||
if(V12.Orientation()==NewV2.Orientation()) {
|
if(V12.Orientation()==NewV2.Orientation()) {
|
||||||
myContext->Replace(V12,NewV2);
|
myContext->Replace(V12,NewV2);
|
||||||
V12 = NewV2;
|
V12 = NewV2;
|
||||||
@@ -1368,16 +1489,36 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
V12 = TopoDS::Vertex(NewV2.Reversed());
|
V12 = TopoDS::Vertex(NewV2.Reversed());
|
||||||
}
|
}
|
||||||
nbReplaced++; //gka 06.09.04
|
nbReplaced++; //gka 06.09.04
|
||||||
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,NewV2,V22);
|
|
||||||
myContext->Replace(edge2,NewE);
|
|
||||||
sewd->Set(NewE,num2+dnum1);
|
|
||||||
boxes.Bind(NewE,B2); // update boxes
|
|
||||||
edge2 = NewE;
|
|
||||||
akey2 = 1;
|
akey2 = 1;
|
||||||
}
|
}
|
||||||
if(P02.Distance(PV22)<tolV2) {
|
if(P02.Distance(PV22)<tolV2) {
|
||||||
tolV2 += P02.Distance(PV22);
|
tolV2 += P02.Distance(PV22);
|
||||||
B.UpdateVertex(NewV2,tolV2);
|
B.UpdateVertex(NewV2,tolV2);
|
||||||
|
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,V12,NewV2);
|
||||||
|
myContext->Replace(edge2,NewE);
|
||||||
|
sewd->Set(NewE,num2+dnum1);
|
||||||
|
boxes.Bind(NewE,B2); // update boxes
|
||||||
|
edge2 = NewE;
|
||||||
|
Standard_Integer n =
|
||||||
|
(num2+dnum1+1 > sewd->NbEdges())?(num2+dnum1+1 - sewd->NbEdges()):(num2+dnum1+1);
|
||||||
|
TopoDS_Edge enext = sewd->Edge(n);
|
||||||
|
if (sae.FirstVertex(enext).IsSame(V22))
|
||||||
|
{
|
||||||
|
TopoDS_Vertex VFnext = sae.FirstVertex(enext);
|
||||||
|
TopoDS_Edge NewEnext =
|
||||||
|
sbe.CopyReplaceVertices(enext,NewV2,sae.LastVertex(enext));
|
||||||
|
myContext->Replace(enext,NewEnext);
|
||||||
|
sewd->Set(NewEnext,n);
|
||||||
|
Bnd_Box2d Bnext = boxes.Find(enext);
|
||||||
|
boxes.Bind(NewEnext,Bnext); // update boxes
|
||||||
|
|
||||||
|
if(VFnext.Orientation()==NewV2.Orientation()) {
|
||||||
|
myContext->Replace(VFnext,NewV2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myContext->Replace(VFnext,NewV2.Reversed());
|
||||||
|
}
|
||||||
|
}
|
||||||
if(V22.Orientation()==NewV2.Orientation()) {
|
if(V22.Orientation()==NewV2.Orientation()) {
|
||||||
myContext->Replace(V22,NewV2);
|
myContext->Replace(V22,NewV2);
|
||||||
V22 = NewV2;
|
V22 = NewV2;
|
||||||
@@ -1387,11 +1528,6 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
V22 = TopoDS::Vertex(NewV2.Reversed());
|
V22 = TopoDS::Vertex(NewV2.Reversed());
|
||||||
}
|
}
|
||||||
nbReplaced++; //gka 06.09.04
|
nbReplaced++; //gka 06.09.04
|
||||||
TopoDS_Edge NewE = sbe.CopyReplaceVertices(edge2,V12,NewV2);
|
|
||||||
myContext->Replace(edge2,NewE);
|
|
||||||
sewd->Set(NewE,num2+dnum1);
|
|
||||||
boxes.Bind(NewE,B2); // update boxes
|
|
||||||
edge2 = NewE;
|
|
||||||
akey2 = 2;
|
akey2 = 2;
|
||||||
}
|
}
|
||||||
Standard_Integer dnum2=0, numseg2=num2+dnum1;
|
Standard_Integer dnum2=0, numseg2=num2+dnum1;
|
||||||
@@ -1436,6 +1572,11 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( akey1>0 || akey2>0 ) {
|
||||||
|
if( UnionVertexes(sewd, edge1, edge2, num2+dnum1, boxes, B2) )
|
||||||
|
nbReplaced ++;
|
||||||
|
}
|
||||||
|
|
||||||
// remove segment
|
// remove segment
|
||||||
sewd->Remove(numseg2);
|
sewd->Remove(numseg2);
|
||||||
sewd->Remove(numseg1);
|
sewd->Remove(numseg1);
|
||||||
|
@@ -7,6 +7,7 @@ puts ""
|
|||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
restore [locate_data_file bug23018_f-ext.brep] f
|
restore [locate_data_file bug23018_f-ext.brep] f
|
||||||
|
param write.surfacecurve.mode 1
|
||||||
brepiges f ${imagedir}/bug23018_f-ext.igs
|
brepiges f ${imagedir}/bug23018_f-ext.igs
|
||||||
set info [entity 6]
|
set info [entity 6]
|
||||||
regexp {Starting +Point +: +\x28([-0-9.+eE]+),([-0-9.+eE]+),([-0-9.+eE]+)\x29} ${info} full x1 y1 z1
|
regexp {Starting +Point +: +\x28([-0-9.+eE]+),([-0-9.+eE]+),([-0-9.+eE]+)\x29} ${info} full x1 y1 z1
|
||||||
|
@@ -598,7 +598,7 @@ if {[regexp "VOLUME_EXACTLY" $CompareDocumentsMode] || [regexp "ALL" $CompareDoc
|
|||||||
# Perform sewing of resulting shape. If amount of closed shells of resulting shape is not equal to amount of
|
# Perform sewing of resulting shape. If amount of closed shells of resulting shape is not equal to amount of
|
||||||
# closed shells of initial shape increace tolerance and perform sewing again
|
# closed shells of initial shape increace tolerance and perform sewing again
|
||||||
set nbClosedShells_Second 0
|
set nbClosedShells_Second 0
|
||||||
set toler 0.00001
|
set toler 0.005
|
||||||
set IsSewingPerformedCorrectly 0
|
set IsSewingPerformedCorrectly 0
|
||||||
XGetOneShape Shape_Second D_Second
|
XGetOneShape Shape_Second D_Second
|
||||||
for {set k 0} {$k < 5} {incr k} {
|
for {set k 0} {$k < 5} {incr k} {
|
||||||
|
Reference in New Issue
Block a user