[PATCH 4/7] BRepFill_Filling: Curve constraints confused by implicit cast from GeomAb...
authorblobfish <blobfish@gmx.com>
Tue, 29 Sep 2020 11:47:55 +0000 (07:47 -0400)
committerKurt Kremitzki <kkremitzki@debian.org>
Sun, 24 Jan 2021 01:02:43 +0000 (01:02 +0000)
Gbp-Pq: Name 0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch

src/BRepFill/BRepFill_Filling.cxx

index 1d665682edebe9942dfca00bf6f32d52e750ec86..3c7961507e8d4d3e886cd02608d41c02cb8f3745 100644 (file)
@@ -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,