From: rnc Date: Wed, 27 Mar 2013 16:16:00 +0000 (+0000) Subject: Thickening option in the extrusion operation : X-Git-Tag: V6_main_FINAL~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b3ea6a032799585edc11507ab31c692bba53f0fe;p=modules%2Fgeom.git Thickening option in the extrusion operation : - missing translations - missing doc - bug fix --- diff --git a/doc/salome/gui/GEOM/images/extrusion1.png b/doc/salome/gui/GEOM/images/extrusion1.png index 1d3bc40da..467d81276 100755 Binary files a/doc/salome/gui/GEOM/images/extrusion1.png and b/doc/salome/gui/GEOM/images/extrusion1.png differ diff --git a/doc/salome/gui/GEOM/images/extrusion2.png b/doc/salome/gui/GEOM/images/extrusion2.png index 42b6d8ba5..755e133c3 100755 Binary files a/doc/salome/gui/GEOM/images/extrusion2.png and b/doc/salome/gui/GEOM/images/extrusion2.png differ diff --git a/doc/salome/gui/GEOM/images/extrusion3.png b/doc/salome/gui/GEOM/images/extrusion3.png index 47cd72260..a462de17d 100644 Binary files a/doc/salome/gui/GEOM/images/extrusion3.png and b/doc/salome/gui/GEOM/images/extrusion3.png differ diff --git a/doc/salome/gui/GEOM/input/creating_extrusion.doc b/doc/salome/gui/GEOM/input/creating_extrusion.doc index 104b7a286..81384e7ba 100644 --- a/doc/salome/gui/GEOM/input/creating_extrusion.doc +++ b/doc/salome/gui/GEOM/input/creating_extrusion.doc @@ -5,6 +5,14 @@ \n To generate an \b Extrusion on an object in the Main Menu select New Entity - > Generation - > Extrusion +Examples: + +\image html prisms_basessn.png +Base Shape + +\image html prismssn.png +Prisms + \n There are 3 algorithms for creation of an \b Extrusion (Prism). \n The \b Result of the operation will be a GEOM_Object (edge, face, shell solid or compsolid). @@ -56,13 +64,20 @@ the opposite base). \image html extrusion3.png -Examples: + Add thickness -\image html prisms_basessn.png -
Base Shape
+\n For all three ways of creation of a prism it is possible to add a thickness +to the created prism (only when extruding an edge or wire). -\image html prismssn.png -
Prisms
+\image html prism_with_thickness.png + +You can choose the \b Thickness and the direction of the thickening. By default the material is added on +the outside of the generated pipe. + +\image html extrusion4.png + +\n TUI Command: geompy.Thicken(Shape, Thickness) +\n Arguments: A shape (shell or face only) and a thickness Our TUI Scripts provide you with useful examples of creation of \ref tui_creation_prism "Complex Geometric Objects". diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 28275e13c..8024ed9cb 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -2106,6 +2106,10 @@ Please, select face, shell or solid and try again GEOM_SplitContinuity SplitContinuity + + GEOM_THICKNESS + Thickness + GEOM_TOLERANCE Tolerance @@ -5267,6 +5271,21 @@ Number of sketch points too small Please, select one or more sub-shapes + + GenerationGUI_PrismDlg + + GEOM_THICKENING + Thickening + + + GEOM_ADD_THICKNESS + Add thickness (edges or wires only) + + + GEOM_TOWARDS_INSIDE + Thicken towards the inside + + GroupGUI diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 70fb7487d..7d6ae22cb 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -2090,6 +2090,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau GEOM_SplitContinuity Séparer continuité + + GEOM_THICKNESS + Epaisseur + GEOM_TOLERANCE Tolérance @@ -5250,6 +5254,21 @@ Le nombre de points n'est pas suffisant Choisissez un ou plusieurs sous-objets + + GenerationGUI_PrismDlg + + GEOM_THICKENING + Epaississement + + + GEOM_ADD_THICKNESS + Epaissir (arêtes ou contours uniquement) + + + GEOM_TOWARDS_INSIDE + Epaissir vers l'intérieur + + GroupGUI diff --git a/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx b/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx index f146cec95..2c870d03c 100644 --- a/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx @@ -35,6 +35,8 @@ #include #include +#include + #include #include @@ -45,6 +47,8 @@ #include #include +#include "utilities.h" + //======================================================================= //function : GetID //purpose : @@ -117,6 +121,15 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const } else if (aType == OFFSET_THICKENING || aType == OFFSET_THICKENING_COPY) { + BRepClass3d_SolidClassifier aClassifier = BRepClass3d_SolidClassifier(aShapeBase); + aClassifier.PerformInfinitePoint(Precision::Confusion()); + if (aClassifier.State()==TopAbs_IN) + { + // If the generated pipe faces normals are oriented towards the inside, the offset is negative + // so that the thickening is still towards outside + anOffset=-anOffset; + } + BRepOffset_MakeOffset myOffsetShape(aShapeBase, anOffset, aTol, BRepOffset_Skin, Standard_False, Standard_False, GeomAbs_Intersection, Standard_True); @@ -125,6 +138,15 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const StdFail_NotDone::Raise("Thickening construction failed"); } aShape = myOffsetShape.Shape(); + + // Control the solid orientation. This is mostly done to fix a bug in case of extrusion + // of a circle. The built solid is then badly oriented + BRepClass3d_SolidClassifier anotherClassifier = BRepClass3d_SolidClassifier(aShape); + anotherClassifier.PerformInfinitePoint(Precision::Confusion()); + if (anotherClassifier.State()==TopAbs_IN) + { + aShape.Reverse(); + } } if (aShape.IsNull()) return 0; diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index 619b7b9ac..c86cdf592 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -111,10 +111,10 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg (GeometryGUI* theGeometryGUI, QWi GroupDXDYDZ->CheckBox2->setText(tr("GEOM_SCALE_PRISM")); GroupThickening = new DlgRef_1Check1Spin1Check(centralWidget()); - GroupThickening->GroupBox1->setTitle("Thickening"); - GroupThickening->checkButton1->setText("Add thickness (edges or wires only)"); - GroupThickening->checkButton2->setText("Thicken towards outside"); - GroupThickening->TextLabel1->setText("Thickness"); + GroupThickening->GroupBox1->setTitle(tr("GEOM_THICKENING")); + GroupThickening->checkButton1->setText(tr("GEOM_ADD_THICKNESS")); // "Add thickness (edges or wires only)" + GroupThickening->checkButton2->setText(tr("GEOM_TOWARDS_INSIDE")); // "Thicken towards the inside" + GroupThickening->TextLabel1->setText(tr("GEOM_THICKNESS")); QVBoxLayout* layout = new QVBoxLayout(centralWidget()); layout->setMargin(0); layout->setSpacing(6); @@ -716,12 +716,11 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects) if(GroupThickening->checkButton1->isChecked()) { - double aThickness = 0.0; - - if(GroupThickening->checkButton2->isChecked() ^ GroupVecH->CheckBox2->isChecked()) // if "towards outside" XOR "reversed" is checked - aThickness = -1.0*(GroupThickening->SpinBox_DX->value()); // change the offset sign to negative - else - aThickness = GroupThickening->SpinBox_DX->value(); + double aThickness = GroupThickening->SpinBox_DX->value(); + if (GroupThickening->checkButton2->isChecked()) + { + aThickness = -aThickness; + } anObj = anotherOper->MakeThickening(anObj, aThickness, /*copy=*/false); }