\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).
\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".
<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>
<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>
<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>
<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>
#include <TopAbs.hxx>
#include <TopExp.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+
#include <Precision.hxx>
#include <gp_Pnt.hxx>
#include <Standard_ConstructionError.hxx>
#include <StdFail_NotDone.hxx>
+#include "utilities.h"
+
//=======================================================================
//function : GetID
//purpose :
}
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);
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;
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);
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);
}