Skip to content
Snippets Groups Projects
Commit 0d1df915 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Added warning + option for circle/ellipse arcs >= Pi
parent 85335b8c
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,8 @@ public : ...@@ -137,7 +137,8 @@ public :
int point_type, line_type; // flat or 3D int point_type, line_type; // flat or 3D
int hidden, shade; int hidden, shade;
int highlight; int highlight;
int level, old_circle, circle_points, extrude_spline_points, old_newreg; int level, old_circle, circle_points, circle_warning;
int extrude_spline_points, old_newreg;
double normals, tangents; double normals, tangents;
double scaling_factor; double scaling_factor;
int color_scheme ; int color_scheme ;
......
...@@ -604,6 +604,8 @@ StringXNumber GeometryOptions_Number[] = { ...@@ -604,6 +604,8 @@ StringXNumber GeometryOptions_Number[] = {
"Number of points used to draw a circle/ellipse" }, "Number of points used to draw a circle/ellipse" },
{ F|O, "ColorScheme" , opt_geometry_color_scheme , 0. , { F|O, "ColorScheme" , opt_geometry_color_scheme , 0. ,
"Default geometry color scheme (0, 1 or 2)" }, "Default geometry color scheme (0, 1 or 2)" },
{ F|O, "CircleWarning" , opt_geometry_circle_warning, 1. ,
"Warn if circle arc is greater than Pi" },
{ F|O, "ExtrudeSplinePoints" , opt_geometry_extrude_spline_points, 5. , { F|O, "ExtrudeSplinePoints" , opt_geometry_extrude_spline_points, 5. ,
"Number of control points for splines created during extrusion" }, "Number of control points for splines created during extrusion" },
......
// $Id: Options.cpp,v 1.106 2003-04-15 18:32:01 geuzaine Exp $ // $Id: Options.cpp,v 1.107 2003-05-29 14:36:56 geuzaine Exp $
// //
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -2840,6 +2840,13 @@ double opt_geometry_circle_points(OPT_ARGS_NUM) ...@@ -2840,6 +2840,13 @@ double opt_geometry_circle_points(OPT_ARGS_NUM)
return CTX.geom.circle_points; return CTX.geom.circle_points;
} }
double opt_geometry_circle_warning(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
CTX.geom.circle_warning = (int)val;
return CTX.geom.circle_warning;
}
double opt_geometry_extrude_spline_points(OPT_ARGS_NUM) double opt_geometry_extrude_spline_points(OPT_ARGS_NUM)
{ {
if(action & GMSH_SET) if(action & GMSH_SET)
......
...@@ -321,6 +321,7 @@ double opt_geometry_highlight(OPT_ARGS_NUM); ...@@ -321,6 +321,7 @@ double opt_geometry_highlight(OPT_ARGS_NUM);
double opt_geometry_old_circle(OPT_ARGS_NUM); double opt_geometry_old_circle(OPT_ARGS_NUM);
double opt_geometry_old_newreg(OPT_ARGS_NUM); double opt_geometry_old_newreg(OPT_ARGS_NUM);
double opt_geometry_circle_points(OPT_ARGS_NUM); double opt_geometry_circle_points(OPT_ARGS_NUM);
double opt_geometry_circle_warning(OPT_ARGS_NUM);
double opt_geometry_extrude_spline_points(OPT_ARGS_NUM); double opt_geometry_extrude_spline_points(OPT_ARGS_NUM);
double opt_geometry_scaling_factor(OPT_ARGS_NUM); double opt_geometry_scaling_factor(OPT_ARGS_NUM);
double opt_geometry_color_scheme(OPT_ARGS_NUM); double opt_geometry_color_scheme(OPT_ARGS_NUM);
......
// $Id: Create.cpp,v 1.44 2003-04-10 13:12:36 remacle Exp $ // $Id: Create.cpp,v 1.45 2003-05-29 14:36:56 geuzaine Exp $
// //
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -395,6 +395,15 @@ void End_Curve(Curve * c) ...@@ -395,6 +395,15 @@ void End_Curve(Curve * c)
for(i = 0; i < 4; i++) for(i = 0; i < 4; i++)
Curve->Circle.v[i] = v[i]; Curve->Circle.v[i] = v[i];
if(CTX.geom.circle_warning && Curve->Num > 0 && A3-A1 >= Pi){
Msg(GERROR1, "Circle or ellipse arc %d greater than/equal to Pi (angle=%g)",
Curve->Num, A3-A1);
Msg(GERROR2, "(If you understand what this implies, you can disable this error");
Msg(GERROR2, "message by setting Geometry.CircleWarning to 0. Otherwise, please");
Msg(GERROR3, "subdivide the arc in smaller pieces)");
}
} }
if(c->cp) if(c->cp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment