vdimension ld_5 -length -shapes as_28 -plane xoy -color black -flyout -15
vdimension ld_6 -length -shapes as_18 -plane xoy -color black -flyout 30
vdimension ld_7 -length -shapes bs_20 -plane xoy -color black -flyout -20
-vdimension ld_8 -length -shapes as_43 -plane xoy -color black -flyout 55 -label right
+vdimension ld_8 -length -shapes as_42 -plane xoy -color black -flyout 55 -label right
vdimension ld_9 -length -shapes as_12 -plane xoy -color black -flyout 35 -label right
vdimension ld_10 -length -shapes as_40 -plane xoy -color black -flyout 15
vdimension ad_1 -angle -shapes as_38 as_49 -color black
vdimension ad_2 -angle -shapes bs_24 bs_25 -color black
-vdimension ad_3 -angle -shapes as_48 as_43 -color black
+vdimension ad_3 -angle -shapes as_48 as_42 -color black
puts "Changing text and arrow parameters of dimensions..."
foreach i $aList {
}
//
Standard_Integer nEOut;
- Standard_Real aTolNew;
+ Standard_Real aTolNew = -1.;
bExist = IsExistingPaveBlock(aPB, aNC, aLSE, nEOut, aTolNew);
if (bExist)
{
Bnd_Box aBoxPm;
Standard_Real aTm = IntTools_Tools::IntermediatePoint (aT1, aT2);
gp_Pnt aPm;
- aIC.D0(aTm, aPm);
+ gp_Vec aVTgt1;
+ const Handle(Geom_Curve)& aC3d = aIC.Curve();
+ aC3d->D1(aTm, aPm, aVTgt1);
aBoxPm.Add (aPm);
+ Standard_Boolean isVtgt1Valid = aVTgt1.SquareMagnitude() > gp::Resolution();
+ if (isVtgt1Valid)
+ aVTgt1.Normalize();
// last point
Bnd_Box aBoxP2;
Standard_Real aTolCheck = theTolR3D + myFuzzyValue;
+ //Some limit values to define "thin" face when iflag1=iflag2=2 and
+ //edge has no common block with any face
+ Standard_Real aMaxTolAdd = 0.001; //Maximal tolerance of edge allowed
+ const Standard_Real aCoeffTolAdd = 10.; //Coeff to define max. tolerance with help of aTolCheck
+ aMaxTolAdd = Min(aMaxTolAdd, aCoeffTolAdd * aTolCheck);
+
// Look for the existing pave block closest to the section curve
Standard_Boolean bFound = Standard_False;
theTolNew = ::RealLast();
continue;
Standard_Real aDist = 0.;
+ Standard_Real aCoeff = 1.; //Coeff for taking in account deflections between edge and theNC
+ //when aPB is not common block
+ Standard_Real aDistm1m2 = 0.;
+ Standard_Integer aPEStatus = 1;
Standard_Real aRealTol = aTolCheck;
if (myDS->IsCommonBlock(aPB))
// increase the chance to coincide with section curve
aRealTol *= 2.;
}
-
+ else if (iFlag1 == 2 && iFlag2 == 2)
+ {
+ //Check, if edge could be common block with section curve
+ // and increase the chance to coincide with section curve
+ //skip processing if one edge is closed, but other is not closed
+ //such configurations can give iFlag1 == 2 && iFlag2 == 2
+ Standard_Boolean bSkipProcessing = ((nV11 == nV12) && (nV21 != nV22)) || ((nV11 != nV12) && (nV21 == nV22));
+
+ if (!bSkipProcessing)
+ {
+
+ if (isVtgt1Valid)
+ {
+ BRepAdaptor_Curve aBAC2(aSp);
+ if (aIC.Type() != GeomAbs_Line ||
+ aBAC2.GetType() != GeomAbs_Line)
+ {
+ Standard_Real aTldp;
+ Standard_Real aTolAdd = 2. * Min(aMaxTolAdd, Max(aRealTol, Max(aTolV1, aTolV2)));
+ aPEStatus = myContext->ComputePE(aPm, aTolAdd, aSp,
+ aTldp, aDistm1m2);
+
+ if (aPEStatus == 0 )
+ {
+ gp_Pnt aPm2;
+ gp_Vec aVTgt2;
+ aBAC2.D1(aTldp, aPm2, aVTgt2);
+ if (aVTgt2.SquareMagnitude() > gp::Resolution())
+ {
+ // The angle should be close to zero
+ Standard_Real aCos = aVTgt1.Dot(aVTgt2.Normalized());
+ if (Abs(aCos) >= 0.9063)
+ {
+ aRealTol = aTolAdd;
+ aCoeff = 2.;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
Bnd_Box aBoxTmp = aBoxPm;
aBoxTmp.Enlarge(aRealTol);
Standard_Real aDistToSp = 0.;
Standard_Real aTx;
- if (aBoxSp.IsOut(aBoxTmp) || myContext->ComputePE(aPm,
- aRealTol,
- aSp,
- aTx, aDistToSp)) {
+ if (aBoxSp.IsOut(aBoxTmp) || aPEStatus < 0)
+ {
continue;
}
+ else if(aPEStatus == 0) //aPEStatus == 0 for case iflag1 == iflag2 == 2
+ {
+ aDistToSp = aDistm1m2;
+ }
+ else if (aPEStatus == 1) //Projection has not been done yet
+ {
+ aPEStatus = myContext->ComputePE(aPm, aRealTol, aSp,
+ aTx, aDistToSp);
+ if (aPEStatus < 0)
+ continue;
+ }
//
if (iFlag1 == 1) {
iFlag1 = !myContext->ComputePE(aP1, aRealTol, aSp, aTx, aDist);
if (aDistToSp < theTolNew)
{
aPBOut = aPB;
- theTolNew = aDistToSp;
+ theTolNew = aCoeff * aDistToSp;
bFound = Standard_True;
}
}