]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Thickening option in the extrusion operation :
authorrnc <rnc@opencascade.com>
Wed, 27 Mar 2013 16:16:00 +0000 (16:16 +0000)
committerrnc <rnc@opencascade.com>
Wed, 27 Mar 2013 16:16:00 +0000 (16:16 +0000)
- missing translations
- missing doc
- bug fix

doc/salome/gui/GEOM/images/extrusion1.png
doc/salome/gui/GEOM/images/extrusion2.png
doc/salome/gui/GEOM/images/extrusion3.png
doc/salome/gui/GEOM/input/creating_extrusion.doc
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMImpl/GEOMImpl_OffsetDriver.cxx
src/GenerationGUI/GenerationGUI_PrismDlg.cxx

index 1d3bc40daf45d70fa8596da53085739a79883aed..467d812767743b260f972465797e4d3e4acfc4b2 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/extrusion1.png and b/doc/salome/gui/GEOM/images/extrusion1.png differ
index 42b6d8ba5317655f883a49ecb6158d7f95a2b7b2..755e133c3fe057c198293f650b0e424295d4a3e9 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/extrusion2.png and b/doc/salome/gui/GEOM/images/extrusion2.png differ
index 47cd7226071422cc9a50cd21cb117391e53c062a..a462de17da156daeec7c950e256770fae8e89db8 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/extrusion3.png and b/doc/salome/gui/GEOM/images/extrusion3.png differ
index 104b7a2863054e23fa8a854e4acfd0973bed33da..81384e7ba59b3f091c6b8bf28afc043306b56645 100644 (file)
@@ -5,6 +5,14 @@
 \n To generate an \b Extrusion on an object in the <b>Main Menu</b>
 select <b>New Entity - > Generation  - > Extrusion</b>
 
+<b>Examples:</b>
+
+\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
 
-<b>Examples:</b>
+<b> Add thickness </b>
 
-\image html prisms_basessn.png
-<center>Base Shape</center>
+\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
-<center>Prisms</center>
+\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 <b>TUI Command:</b> <em>geompy.Thicken(Shape, Thickness)</em>
+\n <b>Arguments:</b> A shape (shell or face only) and a thickness
 
 Our <b>TUI Scripts</b> provide you with useful examples of creation of
 \ref tui_creation_prism "Complex Geometric Objects".
index 28275e13cd68c1882e5f6e2f998aa55e24b2eb62..8024ed9cbcf122a09d538bc6416750c56fa3b380 100644 (file)
@@ -2106,6 +2106,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_SplitContinuity</source>
         <translation>SplitContinuity</translation>
     </message>
+    <message>
+        <source>GEOM_THICKNESS</source>
+        <translation>Thickness</translation>
+    </message>
     <message>
         <source>GEOM_TOLERANCE</source>
         <translation>Tolerance</translation>
@@ -5267,6 +5271,21 @@ Number of sketch points too small</translation>
         <translation>Please, select one or more sub-shapes</translation>
     </message>
 </context>
+<context>
+    <name>GenerationGUI_PrismDlg</name>
+    <message>
+        <source>GEOM_THICKENING</source>
+        <translation>Thickening</translation>
+    </message>
+    <message>
+        <source>GEOM_ADD_THICKNESS</source>
+        <translation>Add thickness (edges or wires only)</translation>
+    </message>
+    <message>
+        <source>GEOM_TOWARDS_INSIDE</source>
+        <translation>Thicken towards the inside</translation>
+    </message>
+</context>
 <context>
     <name>GroupGUI</name>
     <message>
index 70fb7487df16964dc69cd40d0d7fb407f487db13..7d6ae22cbc7e0ead7426d4877bbb9a4bfd1148bc 100644 (file)
@@ -2090,6 +2090,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_SplitContinuity</source>
         <translation>Séparer continuité</translation>
     </message>
+    <message>
+        <source>GEOM_THICKNESS</source>
+        <translation>Epaisseur</translation>
+    </message>
     <message>
         <source>GEOM_TOLERANCE</source>
         <translation>Tolérance</translation>
@@ -5250,6 +5254,21 @@ Le nombre de points n&apos;est pas suffisant</translation>
         <translation>Choisissez un ou plusieurs sous-objets</translation>
     </message>
 </context>
+<context>
+    <name>GenerationGUI_PrismDlg</name>
+    <message>
+        <source>GEOM_THICKENING</source>
+        <translation>Epaississement</translation>
+    </message>
+    <message>
+        <source>GEOM_ADD_THICKNESS</source>
+        <translation>Epaissir (arêtes ou contours uniquement)</translation>
+    </message>
+    <message>
+        <source>GEOM_TOWARDS_INSIDE</source>
+        <translation>Epaissir vers l'intérieur</translation>
+    </message>
+</context>
 <context>
     <name>GroupGUI</name>
     <message>
index f146cec959549179024acd427d380181e3e105e9..2c870d03c7aa4a35a12149f455ff76187537cfb5 100644 (file)
@@ -35,6 +35,8 @@
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 
+#include <BRepClass3d_SolidClassifier.hxx>
+
 #include <Precision.hxx>
 #include <gp_Pnt.hxx>
 
@@ -45,6 +47,8 @@
 #include <Standard_ConstructionError.hxx>
 #include <StdFail_NotDone.hxx>
 
+#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;
index 619b7b9ac6db5c41008394a6f198086513441531..c86cdf5922fe235d3cd2dc9b48e93a18e40b1fcf 100644 (file)
@@ -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);    
     }