Commit fbd515e1 authored by Christophe Geuzaine's avatar Christophe Geuzaine

option to disable OCC STL generation (in case it fails)

parent 5887006c
Pipeline #1496 passed with stage
in 36 minutes 32 seconds
......@@ -74,6 +74,7 @@ struct contextGeometryOptions {
double tolerance, toleranceBoolean, snap[3], transform[3][3], offset[3];
int occAutoFix, occFixDegenerated, occFixSmallEdges, occFixSmallFaces;
int occSewFaces, occParallel, occBooleanPreserveNumbering;
int occDisableSTL;
double occScaling;
std::string occTargetUnit;
int copyMeshingMethod, exactExtrusion;
......
......@@ -873,6 +873,8 @@ StringXNumber GeometryOptions_Number[] = {
{ F|O, "OCCAutoFix" , opt_geometry_occ_auto_fix , 1. ,
"Automatically fix orientation of wires, faces, shells and volumes when creating"
" new entities" },
{ F|O, "OCCDisableSTL" , opt_geometry_occ_disable_stl , 0. ,
"Disable STL computation" },
{ F|O, "OCCFixDegenerated" , opt_geometry_occ_fix_degenerated , 0. ,
"Fix degenerated edges/faces in STEP, IGES and BRep models" },
{ F|O, "OCCFixSmallEdges" , opt_geometry_occ_fix_small_edges , 0. ,
......
......@@ -4717,6 +4717,13 @@ double opt_geometry_occ_auto_fix(OPT_ARGS_NUM)
return CTX::instance()->geom.occAutoFix;
}
double opt_geometry_occ_disable_stl(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
CTX::instance()->geom.occDisableSTL = val ? 1 : 0;
return CTX::instance()->geom.occDisableSTL;
}
double opt_geometry_occ_fix_degenerated(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
......
......@@ -390,6 +390,7 @@ double opt_geometry_surface_type(OPT_ARGS_NUM);
double opt_geometry_light(OPT_ARGS_NUM);
double opt_geometry_light_two_side(OPT_ARGS_NUM);
double opt_geometry_occ_auto_fix(OPT_ARGS_NUM);
double opt_geometry_occ_disable_stl(OPT_ARGS_NUM);
double opt_geometry_occ_fix_degenerated(OPT_ARGS_NUM);
double opt_geometry_occ_fix_small_edges(OPT_ARGS_NUM);
double opt_geometry_occ_fix_small_faces(OPT_ARGS_NUM);
......
......@@ -3707,6 +3707,8 @@ static bool makeSTL(TopoDS_Face s,
std::vector<SVector3> *normals,
std::vector<int> &triangles)
{
if(CTX::instance()->geom.occDisableSTL) return false;
Bnd_Box aBox;
BRepBndLib::Add(s, aBox);
......
......@@ -451,7 +451,7 @@ bool OCCFace::buildSTLTriangulation(bool force)
return true;
}
bool OCCFace::isSphere (double &radius, SPoint3 &center) const
bool OCCFace::isSphere(double &radius, SPoint3 &center) const
{
switch(geomType()){
case GEntity::Sphere:
......
......@@ -126,6 +126,11 @@ Automatically fix orientation of wires, faces, shells and volumes when creating
Default value: @code{1}@*
Saved in: @code{General.OptionsFileName}
@item Geometry.OCCDisableSTL
Disable STL computation@*
Default value: @code{0}@*
Saved in: @code{General.OptionsFileName}
@item Geometry.OCCFixDegenerated
Fix degenerated edges/faces in STEP, IGES and BRep models@*
Default value: @code{0}@*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment