mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0027476: Code alignment for ShapeFix_ComposeShell
This commit is contained in:
parent
4613a51fd4
commit
38f24151f6
@ -153,7 +153,6 @@ void ShapeFix_ComposeShell::Init (const Handle(ShapeExtend_CompositeSurface) &Gr
|
|||||||
if ( myVResolution == RealLast() ) myVResolution = ::Precision::Parametric ( 1. );
|
if ( myVResolution == RealLast() ) myVResolution = ::Precision::Parametric ( 1. );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Perform
|
//function : Perform
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -203,7 +202,6 @@ Standard_Boolean ShapeFix_ComposeShell::Perform ()
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SplitEdges
|
//function : SplitEdges
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -222,7 +220,6 @@ void ShapeFix_ComposeShell::SplitEdges ()
|
|||||||
SplitByGrid ( seqw );
|
SplitByGrid ( seqw );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Result
|
//function : Result
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -233,7 +230,6 @@ const TopoDS_Shape& ShapeFix_ComposeShell::Result () const
|
|||||||
return myResult;
|
return myResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Status
|
//function : Status
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -244,7 +240,6 @@ Standard_Boolean ShapeFix_ComposeShell::Status (const ShapeExtend_Status status)
|
|||||||
return ShapeExtend::DecodeStatus ( myStatus, status );
|
return ShapeExtend::DecodeStatus ( myStatus, status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// PRIVATE (working) METHODS
|
// PRIVATE (working) METHODS
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -264,7 +259,6 @@ Standard_Boolean ShapeFix_ComposeShell::Status (const ShapeExtend_Status status)
|
|||||||
#define ITP_ENDSEG 32 // stop of tangential segment
|
#define ITP_ENDSEG 32 // stop of tangential segment
|
||||||
#define ITP_TANG 64 // tangential point
|
#define ITP_TANG 64 // tangential point
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PointLineDeviation
|
//function : PointLineDeviation
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -277,7 +271,6 @@ static Standard_Real PointLineDeviation (const gp_Pnt2d &p, const gp_Lin2d &line
|
|||||||
return n.XY() * ( p.XY() - line.Location().XY() );
|
return n.XY() * ( p.XY() - line.Location().XY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PointLinePosition
|
//function : PointLinePosition
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -290,7 +283,6 @@ static Standard_Integer PointLinePosition (const gp_Pnt2d &p, const gp_Lin2d &li
|
|||||||
return ( dev > TOLINT ? IOR_LEFT : ( dev < -TOLINT ? IOR_RIGHT : IOR_UNDEF ) );
|
return ( dev > TOLINT ? IOR_LEFT : ( dev < -TOLINT ? IOR_RIGHT : IOR_UNDEF ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PointLinePosition
|
//function : PointLinePosition
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -302,7 +294,6 @@ static Standard_Integer PointLinePosition (const gp_Pnt2d &p, const gp_Lin2d &li
|
|||||||
return PointLinePosition ( p, line, dev );
|
return PointLinePosition ( p, line, dev );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ParamPointsOnLine
|
//function : ParamPointsOnLine
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -313,7 +304,6 @@ static inline Standard_Real ParamPointOnLine (const gp_Pnt2d &p, const gp_Lin2d
|
|||||||
return line.Direction().XY() * ( p.XY() - line.Location().XY() );
|
return line.Direction().XY() * ( p.XY() - line.Location().XY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ParamPointsOnLine
|
//function : ParamPointsOnLine
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -340,7 +330,6 @@ static Standard_Real ParamPointsOnLine (const gp_Pnt2d &p1, const gp_Pnt2d &p2,
|
|||||||
ParamPointOnLine ( p2, line ) * dist1 ) / ( dist2 - dist1 );
|
ParamPointOnLine ( p2, line ) * dist1 ) / ( dist2 - dist1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ProjectPointOnLine
|
//function : ProjectPointOnLine
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -351,7 +340,6 @@ static inline gp_Pnt2d ProjectPointOnLine (const gp_Pnt2d &p, const gp_Lin2d &li
|
|||||||
return line.Location().XY() + line.Direction().XY() * ParamPointOnLine ( p, line );
|
return line.Location().XY() + line.Direction().XY() * ParamPointOnLine ( p, line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ApplyContext
|
//function : ApplyContext
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -583,7 +571,6 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ComputeCode
|
//function : ComputeCode
|
||||||
//purpose : compute code for wire segment between two intersections (by deviation)
|
//purpose : compute code for wire segment between two intersections (by deviation)
|
||||||
@ -607,8 +594,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi
|
|||||||
( wire->Edge(begInd).Orientation() == TopAbs_FORWARD ||
|
( wire->Edge(begInd).Orientation() == TopAbs_FORWARD ||
|
||||||
wire->Edge(begInd).Orientation() == TopAbs_INTERNAL) ==
|
wire->Edge(begInd).Orientation() == TopAbs_INTERNAL) ==
|
||||||
( begPar > endPar ) ? 1 : 0);
|
( begPar > endPar ) ? 1 : 0);
|
||||||
if ( ! special && begInd == endInd && begPar == endPar &&
|
if ( ! special && begInd == endInd && begPar == endPar && (myClosedMode || isInternal))
|
||||||
(myClosedMode || isInternal))
|
|
||||||
special = 1;
|
special = 1;
|
||||||
|
|
||||||
// for tracking cases in closed mode
|
// for tracking cases in closed mode
|
||||||
@ -711,7 +697,6 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : DistributeSplitPoints
|
//function : DistributeSplitPoints
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -744,7 +729,6 @@ static void DistributeSplitPoints (const Handle(ShapeExtend_WireData) &sbwd,
|
|||||||
indexes.SetValue ( i, indexes(i) + nsplit - 1 );
|
indexes.SetValue ( i, indexes(i) + nsplit - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CheckByCurve3d
|
//function : CheckByCurve3d
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -761,7 +745,6 @@ static Standard_Integer CheckByCurve3d (const gp_Pnt &pos,
|
|||||||
return pos.SquareDistance ( p ) <= tol * tol;
|
return pos.SquareDistance ( p ) <= tol * tol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : DefinePatch
|
//function : DefinePatch
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -796,7 +779,6 @@ static Standard_Real GetGridResolution(const Handle(TColStd_HArray1OfReal) Split
|
|||||||
return Min(leftLen,rigthLen)/3.;
|
return Min(leftLen,rigthLen)/3.;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SplitWire
|
//function : SplitWire
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -893,7 +875,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
TColStd_SequenceOfReal aNMVertParams;
|
TColStd_SequenceOfReal aNMVertParams;
|
||||||
if( nbNMVert) {
|
if( nbNMVert) {
|
||||||
Geom2dAdaptor_Curve adc(C2d);
|
Geom2dAdaptor_Curve adc(C2d);
|
||||||
|
|
||||||
Standard_Integer n =1;
|
Standard_Integer n =1;
|
||||||
for( ; n<= nbNMVert; n++) {
|
for( ; n<= nbNMVert; n++) {
|
||||||
gp_Pnt apV = BRep_Tool::Pnt(TopoDS::Vertex(aNMVertices.Value(n)));
|
gp_Pnt apV = BRep_Tool::Pnt(TopoDS::Vertex(aNMVertices.Value(n)));
|
||||||
@ -906,7 +887,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
adist2 *= adist2;
|
adist2 *= adist2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
gp_Pnt2d aP2d = aSurfTool->ValueOfUV(apV,Precision::Confusion());
|
gp_Pnt2d aP2d = aSurfTool->ValueOfUV(apV,Precision::Confusion());
|
||||||
Extrema_ExtPC2d aExtr(aP2d,adc);
|
Extrema_ExtPC2d aExtr(aP2d,adc);
|
||||||
if(aExtr.IsDone() && aExtr.NbExt()) {
|
if(aExtr.IsDone() && aExtr.NbExt()) {
|
||||||
@ -921,7 +901,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
apar = aExtr.Point(index).Parameter();
|
apar = aExtr.Point(index).Parameter();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aNMVertParams.Append(apar);
|
aNMVertParams.Append(apar);
|
||||||
@ -953,7 +932,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
currPar = ( j < stop ? values.Value(j) : lastPar );
|
currPar = ( j < stop ? values.Value(j) : lastPar );
|
||||||
|
|
||||||
//fix for case when pcurve is periodic and first parameter of edge is more than 2P
|
//fix for case when pcurve is periodic and first parameter of edge is more than 2P
|
||||||
//method ShapeBuild_Edge::CopyRanges shift pcurve to range 0-2P and parameters of cutting
|
//method ShapeBuild_Edge::CopyRanges shift pcurve to range 0-2P and parameters of cutting
|
||||||
//should be shifted too. gka SAMTECH 28.07.06
|
//should be shifted too. gka SAMTECH 28.07.06
|
||||||
@ -1000,8 +978,8 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
vRes = Min(myVResolution,gridRes);
|
vRes = Min(myVResolution,gridRes);
|
||||||
}
|
}
|
||||||
if ( IsCoincided ( lastPnt2d, currPnt2d, uRes, vRes, tol ) &&
|
if ( IsCoincided ( lastPnt2d, currPnt2d, uRes, vRes, tol ) &&
|
||||||
IsCoincided ( lastPnt2d, C2d->Value(0.5*(currPar+lastPar)),
|
IsCoincided ( lastPnt2d, C2d->Value(0.5*(currPar+lastPar)), uRes, vRes, tol ) )
|
||||||
uRes, vRes, tol ) ) doCut = Standard_False;
|
doCut = Standard_False;
|
||||||
}
|
}
|
||||||
else if ( currPnt.Distance ( prevVPnt ) <= prevVTol &&
|
else if ( currPnt.Distance ( prevVPnt ) <= prevVTol &&
|
||||||
prevPnt.Distance ( currPnt ) <= tol &&
|
prevPnt.Distance ( currPnt ) <= tol &&
|
||||||
@ -1020,8 +998,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
vRes = Min(myVResolution,gridRes);
|
vRes = Min(myVResolution,gridRes);
|
||||||
}
|
}
|
||||||
if ( IsCoincided ( prevPnt2d, currPnt2d, uRes, vRes, tol ) &&
|
if ( IsCoincided ( prevPnt2d, currPnt2d, uRes, vRes, tol ) &&
|
||||||
IsCoincided ( prevPnt2d, C2d->Value(0.5*(currPar+prevPar)),
|
IsCoincided ( prevPnt2d, C2d->Value(0.5*(currPar+prevPar)), uRes, vRes, tol ) ) {
|
||||||
uRes, vRes, tol ) ) {
|
|
||||||
vertices.Append ( prevV );
|
vertices.Append ( prevV );
|
||||||
code = SegmentCodes ( j ); // classification code - update for next segment
|
code = SegmentCodes ( j ); // classification code - update for next segment
|
||||||
continue; // no splitting at this point, go to next one
|
continue; // no splitting at this point, go to next one
|
||||||
@ -1086,7 +1063,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
anInitEdge.Orientation(TopAbs_FORWARD);
|
anInitEdge.Orientation(TopAbs_FORWARD);
|
||||||
TopoDS_Edge newEdge = sbe.CopyReplaceVertices (anInitEdge, prevV, V );
|
TopoDS_Edge newEdge = sbe.CopyReplaceVertices (anInitEdge, prevV, V );
|
||||||
|
|
||||||
|
|
||||||
//addition internal vertices if they exists on edge
|
//addition internal vertices if they exists on edge
|
||||||
Standard_Integer n =1;
|
Standard_Integer n =1;
|
||||||
for( ; n <= aNMVertParams.Length(); n++) {
|
for( ; n <= aNMVertParams.Length(); n++) {
|
||||||
@ -1113,16 +1089,13 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sbe.CopyPCurves ( newEdge, anInitEdge );
|
sbe.CopyPCurves ( newEdge, anInitEdge );
|
||||||
|
|
||||||
|
|
||||||
Handle(ShapeAnalysis_TransferParameters) theTransferParamtool = GetTransferParamTool();
|
Handle(ShapeAnalysis_TransferParameters) theTransferParamtool = GetTransferParamTool();
|
||||||
theTransferParamtool->SetMaxTolerance(MaxTolerance());
|
theTransferParamtool->SetMaxTolerance(MaxTolerance());
|
||||||
theTransferParamtool->Init(anInitEdge,myFace);
|
theTransferParamtool->Init(anInitEdge,myFace);
|
||||||
theTransferParamtool->TransferRange(newEdge,prevPar,currPar,Standard_True);
|
theTransferParamtool->TransferRange(newEdge,prevPar,currPar,Standard_True);
|
||||||
|
|
||||||
|
|
||||||
if(!ismanifold) {
|
if(!ismanifold) {
|
||||||
if(code == IOR_UNDEF) //tangential segment
|
if(code == IOR_UNDEF) //tangential segment
|
||||||
newEdge.Orientation(TopAbs_EXTERNAL);
|
newEdge.Orientation(TopAbs_EXTERNAL);
|
||||||
@ -1186,7 +1159,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SplitByLine
|
//function : SplitByLine
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1253,7 +1225,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
gp_Pnt2d firstPos, prevPos;
|
gp_Pnt2d firstPos, prevPos;
|
||||||
Standard_Real firstDev=0., prevDev=0.;
|
Standard_Real firstDev=0., prevDev=0.;
|
||||||
for (Standard_Integer iedge = 1; iedge <= nbe; iedge++) {
|
for (Standard_Integer iedge = 1; iedge <= nbe; iedge++) {
|
||||||
|
|
||||||
TopoDS_Edge E= sewd->Edge ( iedge );
|
TopoDS_Edge E= sewd->Edge ( iedge );
|
||||||
Standard_Boolean isreversed = ( E.Orientation() == TopAbs_REVERSED );
|
Standard_Boolean isreversed = ( E.Orientation() == TopAbs_REVERSED );
|
||||||
|
|
||||||
@ -1271,7 +1242,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
Standard_Integer nbIter = 1;
|
Standard_Integer nbIter = 1;
|
||||||
gp_Vec2d shiftNext(0.,0.);
|
gp_Vec2d shiftNext(0.,0.);
|
||||||
if ( myClosedMode ) {
|
if ( myClosedMode ) {
|
||||||
|
|
||||||
// get bounding box of pcurve
|
// get bounding box of pcurve
|
||||||
ShapeAnalysis_Curve sac;
|
ShapeAnalysis_Curve sac;
|
||||||
Bnd_Box2d box;
|
Bnd_Box2d box;
|
||||||
@ -1337,7 +1307,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
|
|
||||||
// cycle with shift in order to track all possible intersections
|
// cycle with shift in order to track all possible intersections
|
||||||
for ( Standard_Integer iter=1; iter <= nbIter; iter++ ) {
|
for ( Standard_Integer iter=1; iter <= nbIter; iter++ ) {
|
||||||
|
|
||||||
// data for intersection
|
// data for intersection
|
||||||
IntRes2d_Domain iDom ( pppf, f, TOLINT, pppl, l, TOLINT );
|
IntRes2d_Domain iDom ( pppf, f, TOLINT, pppl, l, TOLINT );
|
||||||
Geom2dAdaptor_Curve iGAC(c2d);
|
Geom2dAdaptor_Curve iGAC(c2d);
|
||||||
@ -1348,7 +1317,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
|
|
||||||
// Fill arrays with new intersection points
|
// Fill arrays with new intersection points
|
||||||
if ( Inter.IsDone() ) {
|
if ( Inter.IsDone() ) {
|
||||||
|
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
for ( i = 1; i <= Inter.NbPoints(); i++ ) {
|
for ( i = 1; i <= Inter.NbPoints(); i++ ) {
|
||||||
IntRes2d_IntersectionPoint IP = Inter.Point (i);
|
IntRes2d_IntersectionPoint IP = Inter.Point (i);
|
||||||
@ -1369,7 +1337,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( iter < nbIter ) {
|
if ( iter < nbIter ) {
|
||||||
if ( iter == 1 ) c2d = Handle(Geom2d_Curve)::DownCast ( c2d->Copy() );
|
if ( iter == 1 ) c2d = Handle(Geom2d_Curve)::DownCast ( c2d->Copy() );
|
||||||
pppf += shiftNext.XY();
|
pppf += shiftNext.XY();
|
||||||
@ -1543,8 +1510,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=======================================
|
//=======================================
|
||||||
|
|
||||||
|
|
||||||
// Split edges in the wire by intersection points and fill vertices array
|
// Split edges in the wire by intersection points and fill vertices array
|
||||||
TopTools_SequenceOfShape IntVertices;
|
TopTools_SequenceOfShape IntVertices;
|
||||||
wire = SplitWire ( wire, IntEdgeInd, IntEdgePar, IntVertices,
|
wire = SplitWire ( wire, IntEdgeInd, IntEdgePar, IntVertices,
|
||||||
@ -1560,7 +1525,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SplitByLine
|
//function : SplitByLine
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1687,18 +1651,14 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
Standard_Real aPar = SplitLinePar(i-1) + shiftU;
|
Standard_Real aPar = SplitLinePar(i-1) + shiftU;
|
||||||
|
|
||||||
seg.DefineIUMin ( 1, GetPatchIndex ( aPar+::Precision::PConfusion(), myGrid->UJointValues(), myUClosed ) );
|
seg.DefineIUMin ( 1, GetPatchIndex ( aPar+::Precision::PConfusion(), myGrid->UJointValues(), myUClosed ) );
|
||||||
seg.DefineIUMax ( 1, GetPatchIndex ( aPar-::Precision::PConfusion(),
|
seg.DefineIUMax ( 1, GetPatchIndex ( aPar-::Precision::PConfusion(), myGrid->UJointValues(), myUClosed ) + 1 );
|
||||||
myGrid->UJointValues(), myUClosed ) + 1 );
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Standard_Real shiftV = (myClosedMode && myVClosed ? ShapeAnalysis::AdjustToPeriod(SplitLinePar(i-1) -TOLINT, myGrid->VJointValue(1), myGrid->VJointValue(2)) : 0.);
|
Standard_Real shiftV = (myClosedMode && myVClosed ? ShapeAnalysis::AdjustToPeriod(SplitLinePar(i-1) -TOLINT, myGrid->VJointValue(1), myGrid->VJointValue(2)) : 0.);
|
||||||
Standard_Real aPar = SplitLinePar(i-1) + shiftV;
|
Standard_Real aPar = SplitLinePar(i-1) + shiftV;
|
||||||
seg.DefineIVMin ( 1, GetPatchIndex ( aPar+::Precision::PConfusion(),
|
seg.DefineIVMin ( 1, GetPatchIndex ( aPar+::Precision::PConfusion(), myGrid->VJointValues(), myVClosed ) );
|
||||||
myGrid->VJointValues(), myVClosed ) );
|
seg.DefineIVMax ( 1, GetPatchIndex ( aPar-::Precision::PConfusion(), myGrid->VJointValues(), myVClosed ) + 1 );
|
||||||
seg.DefineIVMax ( 1, GetPatchIndex ( aPar-::Precision::PConfusion(),
|
|
||||||
myGrid->VJointValues(), myVClosed ) + 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wires.Append ( seg );
|
wires.Append ( seg );
|
||||||
}
|
}
|
||||||
if ( parity % 2 ) {
|
if ( parity % 2 ) {
|
||||||
@ -1715,7 +1675,6 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SplitByGrid
|
//function : SplitByGrid
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1739,7 +1698,6 @@ void ShapeFix_ComposeShell::SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw)
|
|||||||
//Therefore in this case it is necessary to move all wire segments in the range of the patch between first and last joint
|
//Therefore in this case it is necessary to move all wire segments in the range of the patch between first and last joint
|
||||||
//values. Then all wire segments are lie between -period and period in order to have valid split ranges after splitting.
|
//values. Then all wire segments are lie between -period and period in order to have valid split ranges after splitting.
|
||||||
//Because for closed mode cut index always equal to 1 and parts of segments after splitting always should have index either (0,1) or (1,2).
|
//Because for closed mode cut index always equal to 1 and parts of segments after splitting always should have index either (0,1) or (1,2).
|
||||||
|
|
||||||
for ( i=1; i <= seqw.Length(); i++ )
|
for ( i=1; i <= seqw.Length(); i++ )
|
||||||
{
|
{
|
||||||
ShapeFix_WireSegment &wire = seqw(i);
|
ShapeFix_WireSegment &wire = seqw(i);
|
||||||
@ -1763,7 +1721,6 @@ void ShapeFix_ComposeShell::SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw)
|
|||||||
Standard_Integer iumin = Max(0,GetPatchIndex ( Uf1+pprec, myGrid->UJointValues(), myUClosed ));
|
Standard_Integer iumin = Max(0,GetPatchIndex ( Uf1+pprec, myGrid->UJointValues(), myUClosed ));
|
||||||
Standard_Integer iumax = GetPatchIndex ( Ul1-pprec, myGrid->UJointValues(), myUClosed ) + 1;
|
Standard_Integer iumax = GetPatchIndex ( Ul1-pprec, myGrid->UJointValues(), myUClosed ) + 1;
|
||||||
|
|
||||||
|
|
||||||
for ( Standard_Integer j=1; j <= wire.NbEdges(); j++ ) {
|
for ( Standard_Integer j=1; j <= wire.NbEdges(); j++ ) {
|
||||||
wire.DefineIUMin ( j, iumin );
|
wire.DefineIUMin ( j, iumin );
|
||||||
wire.DefineIUMax ( j, iumax );
|
wire.DefineIUMax ( j, iumax );
|
||||||
@ -1836,10 +1793,8 @@ void ShapeFix_ComposeShell::SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw)
|
|||||||
else
|
else
|
||||||
SplitByLine ( seqw, line, Standard_False, i );
|
SplitByLine ( seqw, line, Standard_False, i );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BreakWires
|
//function : BreakWires
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1847,7 +1802,6 @@ void ShapeFix_ComposeShell::SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw)
|
|||||||
|
|
||||||
void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw)
|
void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw)
|
||||||
{
|
{
|
||||||
|
|
||||||
// split all the wires by vertices
|
// split all the wires by vertices
|
||||||
TopTools_MapOfShape splitVertices;
|
TopTools_MapOfShape splitVertices;
|
||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
@ -1921,7 +1875,6 @@ void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw)
|
|||||||
edge.Orientation(TopAbs_FORWARD);
|
edge.Orientation(TopAbs_FORWARD);
|
||||||
nbnew++;
|
nbnew++;
|
||||||
}
|
}
|
||||||
|
|
||||||
newwire.AddEdge ( 0, edge, iumin, iumax, ivmin, ivmax );
|
newwire.AddEdge ( 0, edge, iumin, iumax, ivmin, ivmax );
|
||||||
}
|
}
|
||||||
if ( nbnew ) {
|
if ( nbnew ) {
|
||||||
@ -1932,7 +1885,6 @@ void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsShortSegment
|
//function : IsShortSegment
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -1979,7 +1931,6 @@ static Standard_Integer IsShortSegment (const ShapeFix_WireSegment &seg,
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsSamePatch
|
//function : IsSamePatch
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@ -2017,7 +1968,6 @@ static Standard_Boolean IsSamePatch (const ShapeFix_WireSegment wire,
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CollectWires
|
//function : CollectWires
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -2026,7 +1976,6 @@ static Standard_Boolean IsSamePatch (const ShapeFix_WireSegment wire,
|
|||||||
void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
|
void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
|
||||||
ShapeFix_SequenceOfWireSegment &seqw)
|
ShapeFix_SequenceOfWireSegment &seqw)
|
||||||
{
|
{
|
||||||
|
|
||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
Standard_Integer i; // svv #1
|
Standard_Integer i; // svv #1
|
||||||
// Collect information on short closed segments
|
// Collect information on short closed segments
|
||||||
@ -2166,17 +2115,16 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
Standard_Real ang = ( shorts(i) >0 ? M_PI : endTan.Angle ( lVec ) );
|
Standard_Real ang = ( shorts(i) >0 ? M_PI : endTan.Angle ( lVec ) );
|
||||||
if ( myClosedMode && shorts(i) <=0 && M_PI-ang < ::Precision::Angular() )
|
if ( myClosedMode && shorts(i) <=0 && M_PI-ang < ::Precision::Angular() )
|
||||||
ang = 0.; // abv 21 Mar 00: trj3_s1-md-214.stp #2471: avoid going back
|
ang = 0.; // abv 21 Mar 00: trj3_s1-md-214.stp #2471: avoid going back
|
||||||
|
|
||||||
// abv 05 Feb 02: face from Parasolid: use tolerance of edges for check
|
// abv 05 Feb 02: face from Parasolid: use tolerance of edges for check
|
||||||
// for coincidence (instead of vertex tolerance) in order
|
// for coincidence (instead of vertex tolerance) in order
|
||||||
// this check to be in agreement with check for position of wire segments
|
// this check to be in agreement with check for position of wire segments
|
||||||
// thus avoiding bad effects on overlapping edges
|
// thus avoiding bad effects on overlapping edges
|
||||||
Standard_Real ctol = Max ( edgeTol, BRep_Tool::Tolerance(lastEdge) );
|
Standard_Real ctol = Max ( edgeTol, BRep_Tool::Tolerance(lastEdge) );
|
||||||
Standard_Boolean conn = IsCoincided ( endPnt, lPnt, myUResolution,
|
Standard_Boolean conn = IsCoincided ( endPnt, lPnt, myUResolution, myVResolution, ctol );
|
||||||
myVResolution, ctol );
|
|
||||||
Standard_Real dist = endPnt.SquareDistance ( lPnt );
|
Standard_Real dist = endPnt.SquareDistance ( lPnt );
|
||||||
|
|
||||||
// check if case is better than last found
|
// check if case is better than last found
|
||||||
|
|
||||||
Standard_Integer w1 = ( sp ? 16 : 0 ) + ( conn ? 4 : 0 ) + (misor==0 ? 8 : 0);
|
Standard_Integer w1 = ( sp ? 16 : 0 ) + ( conn ? 4 : 0 ) + (misor==0 ? 8 : 0);
|
||||||
Standard_Integer tail1 = ( !conn && (dist < mindist) ? 2 : 0) + (ang > angle ? 1 : 0);
|
Standard_Integer tail1 = ( !conn && (dist < mindist) ? 2 : 0) + (ang > angle ? 1 : 0);
|
||||||
Standard_Integer tail2 = ( !connected &&(dist > mindist) ? 2 : 0) + (ang < angle ? 1 : 0);
|
Standard_Integer tail2 = ( !connected &&(dist > mindist) ? 2 : 0) + (ang < angle ? 1 : 0);
|
||||||
@ -2281,8 +2229,11 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
//pdn The short seqments are stil plased in "in" sequence.
|
//pdn The short seqments are stil plased in "in" sequence.
|
||||||
|
|
||||||
for ( i=1; i <= seqw.Length(); i++ ) {
|
for ( i=1; i <= seqw.Length(); i++ ) {
|
||||||
if ( shorts(i) != 1 || seqw(i).IsVertex() || seqw(i).Orientation() == TopAbs_INTERNAL ||
|
if ( shorts(i) != 1 ||
|
||||||
seqw(i).Orientation() == TopAbs_EXTERNAL ) continue;
|
seqw(i).IsVertex() ||
|
||||||
|
seqw(i).Orientation() == TopAbs_INTERNAL ||
|
||||||
|
seqw(i).Orientation() == TopAbs_EXTERNAL )
|
||||||
|
continue;
|
||||||
|
|
||||||
// find any other wire containing the same vertex
|
// find any other wire containing the same vertex
|
||||||
Handle(ShapeExtend_WireData) wd = seqw(i).WireData();
|
Handle(ShapeExtend_WireData) wd = seqw(i).WireData();
|
||||||
@ -2332,7 +2283,6 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
// wires.Remove ( i );
|
// wires.Remove ( i );
|
||||||
// i--;
|
// i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2461,7 +2411,6 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces,
|
|||||||
B.Add(awtmp,aIt.Value());
|
B.Add(awtmp,aIt.Value());
|
||||||
nbe++;
|
nbe++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!nbe)
|
if(!nbe)
|
||||||
continue;
|
continue;
|
||||||
@ -2687,7 +2636,6 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces,
|
|||||||
Standard_Real U1,U2,V1,V2;
|
Standard_Real U1,U2,V1,V2;
|
||||||
myGrid->Bounds(U1,U2,V1,V2);
|
myGrid->Bounds(U1,U2,V1,V2);
|
||||||
for ( i = 1; i <= nb; i++ ) {
|
for ( i = 1; i <= nb; i++ ) {
|
||||||
|
|
||||||
gp_Pnt2d pnt = mPnts(i);
|
gp_Pnt2d pnt = mPnts(i);
|
||||||
Standard_Real ush =0., vsh=0.;
|
Standard_Real ush =0., vsh=0.;
|
||||||
if(myUClosed) {
|
if(myUClosed) {
|
||||||
@ -2737,7 +2685,6 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces,
|
|||||||
newEdge = TopoDS::Edge ( tmpNE );
|
newEdge = TopoDS::Edge ( tmpNE );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(!ismanifold)
|
if(!ismanifold)
|
||||||
anInitEdge.Orientation(TopAbs_FORWARD);
|
anInitEdge.Orientation(TopAbs_FORWARD);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user