From: blobfish Date: Mon, 8 Feb 2021 00:02:09 +0000 (+0000) Subject: [PATCH 4/7] BRepFill_Filling: Curve constraints confused by implicit cast from GeomAb... X-Git-Tag: archive/raspbian/7.5.1+dfsg1-2+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=efaa9984b8303b88c3fd42e0ab2555feeb9bfb30;p=opencascade.git [PATCH 4/7] BRepFill_Filling: Curve constraints confused by implicit cast from GeomAbs_Shape to Standard_Integer Gbp-Pq: Name 0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch --- diff --git a/src/BRepFill/BRepFill_Filling.cxx b/src/BRepFill/BRepFill_Filling.cxx index 1d665682e..3c7961507 100644 --- a/src/BRepFill/BRepFill_Filling.cxx +++ b/src/BRepFill/BRepFill_Filling.cxx @@ -333,13 +333,22 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder CurFace = SeqOfConstraints(i).myFace; CurOrder = SeqOfConstraints(i).myOrder; + // this silently defaults to C0 with an invalid value, + // where before an exception would be + // thrown out of curve constraints. Good, Bad? + Standard_Integer orderAdapt = 0; + if (CurOrder == GeomAbs_G1) + orderAdapt = 1; + else if (CurOrder == GeomAbs_G2) + orderAdapt = 2; + if (CurFace.IsNull()) { if (CurOrder == GeomAbs_C0) { Handle( BRepAdaptor_HCurve ) HCurve = new BRepAdaptor_HCurve(); HCurve->ChangeCurve().Initialize( CurEdge ); const Handle(Adaptor3d_HCurve)& aHCurve = HCurve; // to avoid ambiguity Constr = new BRepFill_CurveConstraint(aHCurve, - CurOrder, + orderAdapt, myNbPtsOnCur, myTol3d ); } @@ -363,7 +372,7 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder Handle (Adaptor3d_HCurveOnSurface) HCurvOnSurf = new Adaptor3d_HCurveOnSurface( CurvOnSurf ); Constr = new GeomPlate_CurveConstraint(HCurvOnSurf, - CurOrder, + orderAdapt, myNbPtsOnCur, myTol3d, myTolAng, @@ -383,7 +392,7 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder Handle (Adaptor3d_HCurveOnSurface) HCurvOnSurf = new Adaptor3d_HCurveOnSurface( CurvOnSurf ); Constr = new BRepFill_CurveConstraint( HCurvOnSurf, - CurOrder, + orderAdapt, myNbPtsOnCur, myTol3d, myTolAng,