File: 0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch

package info (click to toggle)
opencascade 7.8.1%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 293,936 kB
  • sloc: cpp: 1,249,635; tcl: 15,974; cs: 5,173; java: 1,554; sh: 1,354; ansic: 821; xml: 737; makefile: 30; javascript: 22
file content (54 lines) | stat: -rw-r--r-- 1,748 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Subject: [PATCH 4/7] BRepFill_Filling: Curve constraints confused by implicit cast from GeomAbs_Shape to Standard_Integer
From: blobfish <blobfish@gmx.com>

Date: Tue, 29 Sep 2020 07:47:55 -0400


---
 src/BRepFill/BRepFill_Filling.cxx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

--- a/src/BRepFill/BRepFill_Filling.cxx
+++ b/src/BRepFill/BRepFill_Filling.cxx
@@ -323,13 +323,22 @@
       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 );
 	}
@@ -353,7 +362,7 @@
 	  Handle (Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface( CurvOnSurf );
 	  
 	  Constr = new GeomPlate_CurveConstraint(HCurvOnSurf,
-						 CurOrder,
+						 orderAdapt,
 						 myNbPtsOnCur,
 						 myTol3d,
 						 myTolAng,
@@ -373,7 +382,7 @@
 	  Handle (Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface( CurvOnSurf );
 
 	  Constr = new BRepFill_CurveConstraint( HCurvOnSurf,
-						 CurOrder,
+						 orderAdapt,
 						 myNbPtsOnCur,
 						 myTol3d,
 						 myTolAng,