// Bissectrice point - circle. +
//=============================================================================
case 1 : {
- GccAna_CircPnt2dBisec Bisector(circle,asecondpoint->Pnt2d());
+ GccAna_CircPnt2dBisec Bisector(circle, asecondpoint->Pnt2d(), tolerance);
Standard_Real distancemini = Precision::Infinite();
if (Bisector.IsDone()) {
Standard_Integer nbsolution = Bisector.NbSolutions();
---Purpose: Constructs bisecting curves between the circle Circle1 and the point Point2.
+Create(Circle1 : Circ2d from gp;
+ Point2 : Pnt2d from gp;
+ Tolerance : Real from Standard) returns CircPnt2dBisec;
+
+ ---Purpose: Constructs bisecting curves between the circle Circle1 and the point Point2.
+ -- Tolerance is used.
+
+DefineSolutions(me: in out)
+is private;
+ ---Purpose: Defines the number and the type of solutions
+ -- depending on input data
+
IsDone(me) returns Boolean from Standard
is static;
---Purpose: Returns true (this construction algorithm never fails).
-- theposition = 0 when the point is on the circle.
-- theposition = -1 when the point is inside the circle.
+ myTolerance : Real from Standard;
+
end CircPnt2dBisec;
GccAna_CircPnt2dBisec::
GccAna_CircPnt2dBisec (const gp_Circ2d& Circle ,
- const gp_Pnt2d& Point ):
-
- circle(Circle),
- point(Point) {
+ const gp_Pnt2d& Point )
+{
+ circle = Circle;
+ point = Point;
+ myTolerance = 1.e-10;
+ DefineSolutions();
+}
-//=========================================================================
-// Initialization of fields : +
-// - circle ( first argument.) +
-// - line ( second argument.) +
-// - theposition (Integer showing the position of Point +
-// correspondingly to Circle.) +
-// - NbrSol (Integer showing the number of solutions.) +
-// - WellDone (Booleen showing the success or failure of the algorithm). +
-//=========================================================================
+GccAna_CircPnt2dBisec::
+ GccAna_CircPnt2dBisec (const gp_Circ2d& Circle ,
+ const gp_Pnt2d& Point,
+ const Standard_Real Tolerance)
+{
+ circle = Circle;
+ point = Point;
+ myTolerance = 1.e-10;
+ if (myTolerance < Tolerance)
+ myTolerance = Tolerance;
+
+ DefineSolutions();
+}
- Standard_Real dist = Circle.Radius()-Point.Distance(Circle.Location());
-// if (Abs(dist) < gp::Resolution())
- if (Abs(dist) < 1.E-10)
- {
- theposition = 0;
- NbrSol = 1;
- }
- else if (dist > 0.0)
- {
- theposition = -1;
- NbrSol = 1;
- }
- else {
- theposition = 1;
- NbrSol = 2;
- }
- WellDone = Standard_True;
- }
+void GccAna_CircPnt2dBisec::DefineSolutions()
+{
+ Standard_Real dist = circle.Radius() - point.Distance(circle.Location());
+
+ if (Abs(dist) < myTolerance)
+ {
+ theposition = 0;
+ NbrSol = 1;
+ }
+ else if (dist > 0.0)
+ {
+ theposition = -1;
+ NbrSol = 1;
+ }
+ else {
+ theposition = 1;
+ NbrSol = 2;
+ }
+
+ WellDone = Standard_True;
+}
//=========================================================================
// Processing. +
Standard_Real ycencir = circle.Location().Y();
Standard_Real R1 = circle.Radius();
Standard_Real dist = point.Distance(circle.Location());
- // if (dist < gp::Resolution())
- if (dist < 1.E-10)
+
+ if (dist < myTolerance)
{
gp_Circ2d biscirpnt1(gp_Ax2d(point,gp_Dir2d(1.0,0.0)),R1/2.);
bissol = new GccInt_BCirc(biscirpnt1);
--- /dev/null
+puts "============"
+puts "OCC24573"
+puts "============"
+puts ""
+#######################################################################
+# Wrong result of 2d-offset algorithm on customer's shape
+#######################################################################
+
+set BugNumber OCC24573
+
+puts "Load shape ..."
+restore [locate_data_file bug24573_Wire.brep] ww
+
+if [catch { mkoffset resoffset ww 1 12.5 } ] {
+ puts "Faulty ${BugNumber} : mkoffset is wrong"
+} else {
+ renamevar resoffset_1 result
+
+ set length 178.54
+
+ set nb_v_good 10
+ set nb_e_good 10
+ set nb_w_good 1
+ set nb_f_good 0
+ set nb_sh_good 0
+ set nb_sol_good 0
+ set nb_compsol_good 0
+ set nb_compound_good 0
+ set nb_shape_good 21
+}
+
+set 2dviewer 1
-puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
-puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
+puts "TODO ?OCC23068 ALL: Error : big tolerance of shape result"
+puts "TODO ?OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
+puts "TODO OCC23068 ALL: Standard_Failure: BRepFill_OffsetWire::FixHoles"
+puts "TODO OCC23068 ALL: Error: Offset is not done"
+puts "TODO OCC23068 ALL: Error : The offset cannot be built"
+
restore [locate_data_file offset_wire_018.brep] s
set length 24.8301
-puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
-puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_3"
+puts "TODO ?OCC23068 ALL: Error : big tolerance of shape result"
+puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC23068 ALL: Error : result_1 is NOT a closed wire"
+puts "TODO OCC23068 ALL: Error : The length of the resulting shape is"
+puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG because it must contain"
+
restore [locate_data_file offset_wire_018.brep] s
set length 23.8673
puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done."
+puts "TODO ?OCC23748 ALL: Error : result is NOT a closed wire"
+puts "TODO ?OCC23748 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO ?OCC23748 ALL: Error : The length of the resulting shape is"
+puts "TODO ?OCC23748 ALL: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_018.brep] s