From: blobfish Date: Sun, 14 May 2023 09:37:53 +0000 (+0100) Subject: [PATCH 4/7] BRepFill_Filling: Curve constraints confused by implicit cast from GeomAb... X-Git-Tag: archive/raspbian/7.6.3+dfsg1-6+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6845883086a3a2e69074e7bd872adea4b10ac275;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 9342a9dde..8c1b77333 100644 --- a/src/BRepFill/BRepFill_Filling.cxx +++ b/src/BRepFill/BRepFill_Filling.cxx @@ -332,13 +332,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_Curve ) HCurve = new BRepAdaptor_Curve(); HCurve->Initialize( CurEdge ); const Handle(Adaptor3d_Curve)& aHCurve = HCurve; // to avoid ambiguity Constr = new BRepFill_CurveConstraint(aHCurve, - CurOrder, + orderAdapt, myNbPtsOnCur, myTol3d ); } @@ -362,7 +371,7 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder Handle (Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface( CurvOnSurf ); Constr = new GeomPlate_CurveConstraint(HCurvOnSurf, - CurOrder, + orderAdapt, myNbPtsOnCur, myTol3d, myTolAng, @@ -382,7 +391,7 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder Handle (Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface( CurvOnSurf ); Constr = new BRepFill_CurveConstraint( HCurvOnSurf, - CurOrder, + orderAdapt, myNbPtsOnCur, myTol3d, myTolAng,