]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #3222: 1d fillet
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Thu, 23 Apr 2020 19:01:56 +0000 (22:01 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Fri, 24 Apr 2020 06:47:15 +0000 (09:47 +0300)
* Documentation update.
* Translations to French.

18 files changed:
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
src/FeaturesPlugin/FeaturesPlugin_msg_en.ts
src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts
src/FeaturesPlugin/FeaturesPlugin_msg_ru.ts
src/FeaturesPlugin/doc/FeaturesPlugin.rst
src/FeaturesPlugin/doc/TUI_fillet1DVertices.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_fillet1DWire.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/fillet1d_vertices.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/fillet1d_wire.py [new file with mode: 0644]
src/FeaturesPlugin/doc/fillet1dFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/images/Fillet1DPanel_Vertices.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/Fillet1DPanel_Wire.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/Fillet1DResult_Vertices.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/Fillet1DResult_Wire.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/fillet1d.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/fillet1d_points.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/fillet1d_wire.png [new file with mode: 0644]
src/FeaturesPlugin/fillet1d_widget.xml

index 538a5097fabcc853646fcfed7ebf099375a8dcaf..f47f5ba79d1580b936fe78cb19afbdb5b703cc76 100644 (file)
@@ -971,7 +971,7 @@ bool FeaturesPlugin_ValidatorFillet1DSelection::isValid(const AttributePtr& theA
         return false;
       }
       if (aVertex->shapeType() != GeomAPI_Shape::VERTEX) {
-        theError = "Selected shape it not a vertex";
+        theError = "Selected shape is not a vertex";
         return false;
       }
 
index 0ff1004eeb8a3f1aba72d2007d64ce5fc19aac3f..c65a3e3ed60afab7f8f86b2885a7ba793b0c344f 100644 (file)
       <translation>Base shape is not selected.</translation>
     </message>
   </context>
+
+  <!-- 1D-fillet -->
+  <context>
+    <name>Fillet1D</name>
+    <message>
+      <source>1D-fillet</source>
+      <translation>1D-fillet</translation>
+    </message>
+    <message>
+      <source>Perform fillet on vertices of a wire</source>
+      <translation>Perform fillet on vertices of a wire</translation>
+    </message>
+    <message>
+      <source>Wire has no vertices for fillet.</source>
+      <translation>Wire has no vertices for fillet.</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_wires</name>
+    <message>
+      <source>Wires</source>
+      <translation>Wires</translation>
+    </message>
+    <message>
+      <source>Select wires</source>
+      <translation>Select wires</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Select wires.</translation>
+    </message>
+    <message>
+      <source>Fillet each sharp corner of the wire</source>
+      <translation>Fillet each sharp corner of the wire</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_vertices</name>
+    <message>
+      <source>Vertices</source>
+      <translation>Vertices</translation>
+    </message>
+    <message>
+      <source>Select vertices</source>
+      <translation>Select vertices</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Select vertices on wires.</translation>
+    </message>
+    <message>
+      <source>Fillet the specified corners of the wire</source>
+      <translation>Fillet the specified corners of the wire</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_vertices:FeaturesPlugin_ValidatorFillet1DSelection</name>
+    <message>
+      <source>Selected vertex is not a wire corner</source>
+      <translation>Selected vertex is not a wire corner</translation>
+    </message>
+    <message>
+      <source>Selected shape is not a vertex</source>
+      <translation>Selected shape is not a vertex</translation>
+    </message>
+    <message>
+      <source>Selected vertex does not exist in the wire</source>
+      <translation>Selected vertex does not exist in the wire</translation>
+    </message>
+    <message>
+      <source>Vertex should be shared between 2 edges exactly</source>
+      <translation>Vertex should be shared between 2 edges exactly</translation>
+    </message>
+    <message>
+      <source>Error: Edges are not planar</source>
+      <translation>Error: Edges are not planar</translation>
+    </message>
+    <message>
+      <source>Error: Edges are tangent</source>
+      <translation>Error: Edges are tangent</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:creation_method</name>
+    <message>
+      <source>Wires</source>
+      <translation>Wires</translation>
+    </message>
+    <message>
+      <source>Vertices</source>
+      <translation>Vertices</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:radius</name>
+    <message>
+      <source>Radius</source>
+      <translation>Radius</translation>
+    </message>
+    <message>
+      <source>Fillet radius</source>
+      <translation>Fillet radius</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Specify fillet radius.</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:radius:GeomValidators_Positive</name>
+    <message>
+      <source>Value is too small.</source>
+      <translation>Value is too small.</translation>
+    </message>
+  </context>
+
 </TS>
index 0dfcdfacfc2121fad06c2cb84f1583b09f5feeb1..6f821a2e2fa1c59eadfbf68ab80c4f2e9fbd427a 100644 (file)
       <source>Fillet</source>
       <translation>Congé</translation>
     </message>
+    <message>
+      <source>1D-fillet</source>
+      <translation>1D-congé</translation>
+    </message>
     <message>
       <source>Fuse</source>
       <translation>Fusionner</translation>
     </message>
   </context>
 
+  <!-- 1D-fillet -->
+  <context>
+    <name>Fillet1D</name>
+    <message>
+      <source>1D-fillet</source>
+      <translation>1D-congé</translation>
+    </message>
+    <message>
+      <source>Perform fillet on vertices of a wire</source>
+      <translation>Effectuer un congé sur les sommets d&apos;un contour</translation>
+    </message>
+    <message>
+      <source>Wire has no vertices for fillet.</source>
+      <translation>Le contour n&apos;a pas de sommet pour le congé.</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_wires</name>
+    <message>
+      <source>Wires</source>
+      <translation>Contours</translation>
+    </message>
+    <message>
+      <source>Select wires</source>
+      <translation>Sélectionnez les contours</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Sélectionnez les contours.</translation>
+    </message>
+    <message>
+      <source>Fillet each sharp corner of the wire</source>
+      <translation>Raccordez chaque coin pointu du contour</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_vertices</name>
+    <message>
+      <source>Vertices</source>
+      <translation>Sommets</translation>
+    </message>
+    <message>
+      <source>Select vertices</source>
+      <translation>Sélectionnez les sommets</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Sélectionnez des sommets sur les contours.</translation>
+    </message>
+    <message>
+      <source>Fillet the specified corners of the wire</source>
+      <translation>Raccorder les coins spécifiés du contour</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_vertices:FeaturesPlugin_ValidatorFillet1DSelection</name>
+    <message>
+      <source>Selected vertex is not a wire corner</source>
+      <translation>Le sommet sélectionné n&apos;est pas un coin de contour</translation>
+    </message>
+    <message>
+      <source>Selected shape is not a vertex</source>
+      <translation>La forme sélectionnée n&apos;est pas un sommet</translation>
+    </message>
+    <message>
+      <source>Selected vertex does not exist in the wire</source>
+      <translation>Le sommet sélectionné n&apos;existe pas dans le contour</translation>
+    </message>
+    <message>
+      <source>Vertex should be shared between 2 edges exactly</source>
+      <translation>Le sommet doit être partagé entre 2 bords exactement</translation>
+    </message>
+    <message>
+      <source>Error: Edges are not planar</source>
+      <translation>Erreur: les arêtes ne sont pas planes</translation>
+    </message>
+    <message>
+      <source>Error: Edges are tangent</source>
+      <translation>Erreur: les bords sont tangents</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:creation_method</name>
+    <message>
+      <source>Wires</source>
+      <translation>Contours</translation>
+    </message>
+    <message>
+      <source>Vertices</source>
+      <translation>Sommets</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:radius</name>
+    <message>
+      <source>Radius</source>
+      <translation>Rayon</translation>
+    </message>
+    <message>
+      <source>Fillet radius</source>
+      <translation>Rayon de congé</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Spécifiez le rayon du congé.</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:radius:GeomValidators_Positive</name>
+    <message>
+      <source>Value is too small.</source>
+      <translation>La valeur est trop petite.</translation>
+    </message>
+  </context>
+
   <!-- Fuse -->
   <context>
     <name>Fuse</name>
index 4e52f45275f6f58f31e0b04506eea85d44d97148..e2777069916eb3f9224efa0e75d3462a1a4b892b 100644 (file)
       <translation>Ошибка: не все выбранные объекты являются подэлементами твердых тел.</translation>
     </message>
   </context>
+
+  <!-- 1D-fillet -->
+  <context>
+    <name>Fillet1D</name>
+    <message>
+      <source>1D-fillet</source>
+      <translation>1D-сглаживание</translation>
+    </message>
+    <message>
+      <source>Perform fillet on vertices of a wire</source>
+      <translation>Выполнить сглаживание в узлах контура</translation>
+    </message>
+    <message>
+      <source>Wire has no vertices for fillet.</source>
+      <translation>Контур не имеет узлов, подходящих для сглаживания.</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_wires</name>
+    <message>
+      <source>Wires</source>
+      <translation>Контуры</translation>
+    </message>
+    <message>
+      <source>Select wires</source>
+      <translation>Выберите контуры</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Выберите контуры.</translation>
+    </message>
+    <message>
+      <source>Fillet each sharp corner of the wire</source>
+      <translation>Сгладить все острые углы контура</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_vertices</name>
+    <message>
+      <source>Vertices</source>
+      <translation>Узлы</translation>
+    </message>
+    <message>
+      <source>Select vertices</source>
+      <translation>Выберите узлы</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Выберите острые углы на контуре.</translation>
+    </message>
+    <message>
+      <source>Fillet the specified corners of the wire</source>
+      <translation>Сгладить выбранные узлы контура</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:main_vertices:FeaturesPlugin_ValidatorFillet1DSelection</name>
+    <message>
+      <source>Selected vertex is not a wire corner</source>
+      <translation>Выбранный узел не принадлежит контуру</translation>
+    </message>
+    <message>
+      <source>Selected shape is not a vertex</source>
+      <translation>Выбранный объект не является узлом</translation>
+    </message>
+    <message>
+      <source>Selected vertex does not exist in the wire</source>
+      <translation>Выбранный узел не принадлежит контуру</translation>
+    </message>
+    <message>
+      <source>Vertex should be shared between 2 edges exactly</source>
+      <translation>Узел должен примыкать ровно к двум рёбрам</translation>
+    </message>
+    <message>
+      <source>Error: Edges are not planar</source>
+      <translation>Ошибка: рёбра не лежат на одной плоскости</translation>
+    </message>
+    <message>
+      <source>Error: Edges are tangent</source>
+      <translation>Ошибка: рёбра касаются друг друга</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:creation_method</name>
+    <message>
+      <source>Wires</source>
+      <translation>Контуры</translation>
+    </message>
+    <message>
+      <source>Vertices</source>
+      <translation>Узлы</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:radius</name>
+    <message>
+      <source>Radius</source>
+      <translation>Радиус</translation>
+    </message>
+    <message>
+      <source>Fillet radius</source>
+      <translation>Радиус сглаживания</translation>
+    </message>
+    <message>
+      <source>Attribute "%1" is not initialized.</source>
+      <translation>Задайте радиус сглаживания.</translation>
+    </message>
+  </context>
+  <context>
+    <name>Fillet1D:radius:GeomValidators_Positive</name>
+    <message>
+      <source>Value is too small.</source>
+      <translation>Значение радиуса слишком мало.</translation>
+    </message>
+  </context>
+
 </TS>
index 91db9f48fe1e3e253a596ba62ba34020f4e0b6c5..4cb87c3cb4b4e41b35cdbf2b0e8a983376d8dc82 100644 (file)
@@ -19,6 +19,7 @@ Features plug-in provides a set of common topological operations. It implements
    extrusionCutFeature.rst
    extrusionFeature.rst
    extrusionFuseFeature.rst
+   fillet1dFeature.rst
    filletFeature.rst
    fuseFeature.rst
    fuseFeatureFaces.rst
diff --git a/src/FeaturesPlugin/doc/TUI_fillet1DVertices.rst b/src/FeaturesPlugin/doc/TUI_fillet1DVertices.rst
new file mode 100644 (file)
index 0000000..6a7f037
--- /dev/null
@@ -0,0 +1,12 @@
+
+  .. _tui_create_fillet1d_vertices:
+
+Create 1D-fillet for special vertices on a wire
+===============================================
+
+.. literalinclude:: examples/fillet1d_vertices.py 
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/fillet1d_vertices.py >` 
+   
diff --git a/src/FeaturesPlugin/doc/TUI_fillet1DWire.rst b/src/FeaturesPlugin/doc/TUI_fillet1DWire.rst
new file mode 100644 (file)
index 0000000..c222306
--- /dev/null
@@ -0,0 +1,12 @@
+
+  .. _tui_create_fillet1d_wire:
+
+Create 1D-fillet on a wire
+==========================
+
+.. literalinclude:: examples/fillet1d_wire.py 
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/fillet1d_wire.py >` 
+   
diff --git a/src/FeaturesPlugin/doc/examples/fillet1d_vertices.py b/src/FeaturesPlugin/doc/examples/fillet1d_vertices.py
new file mode 100644 (file)
index 0000000..d2a0cbe
--- /dev/null
@@ -0,0 +1,25 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+
+### Create Part
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+### Create Box
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+### Create Wire
+Wire_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"),
+                  model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"),
+                  model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"),
+                  model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects, False)
+
+### Create Fillet1D
+Fillet1D_1_objects = [model.selection("VERTEX", "[Wire_1_1/Edge_2]e[Wire_1_1/Edge_3]e"),
+                      model.selection("VERTEX", "[Wire_1_1/Edge_3]e[Wire_1_1/Edge_4]e")]
+Fillet1D_1 = model.addFillet(Part_1_doc, Fillet1D_1_objects, 3)
+
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/fillet1d_wire.py b/src/FeaturesPlugin/doc/examples/fillet1d_wire.py
new file mode 100644 (file)
index 0000000..36ccfc9
--- /dev/null
@@ -0,0 +1,23 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+
+### Create Part
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+### Create Box
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+### Create Wire
+Wire_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"),
+                  model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"),
+                  model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"),
+                  model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects, False)
+
+### Create Fillet1D
+Fillet1D_1 = model.addFillet(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], 3)
+
+model.end()
diff --git a/src/FeaturesPlugin/doc/fillet1dFeature.rst b/src/FeaturesPlugin/doc/fillet1dFeature.rst
new file mode 100644 (file)
index 0000000..e3a30a4
--- /dev/null
@@ -0,0 +1,100 @@
+.. |fillet1d.icon|    image:: images/fillet1d.png
+
+.. _featureFillet1D:
+
+1D-fillet
+=========
+
+**1D-fillet** feature creates fillets on the vertices of a wire. 
+The fillet may be performed on sharp corners of a wire, which are shared exactly between 2 edges, and which are placed ona single plane. 
+
+To create a 1D-fillet in the active part:
+
+#. select in the Main Menu *Feature - > 1D-fillet* item  or
+#. click |fillet1d.icon| **1D-fillet** button in the toolbar
+
+There are 2 types of fillet:
+
+  .. image:: images/fillet1d_wire.png   
+    :align: left
+  fillet all sharp corners on a wire
+
+  .. image:: images/fillet1d_points.png   
+    :align: left
+  fillet only the specified corners
+
+Fillet a wire
+-------------
+
+The property panel for this mode is shown below.
+
+.. image:: images/Fillet1DPanel_Wire.png
+  :align: center
+
+.. centered::
+  Property panel of an operation to fillet all sharp corners on a wire
+
+Input fields:
+
+- **Wires** panel contains the list of wires for the operation. The fillet will be performed to the applicable corners. If the wire has no such corner, the error message will be shown;
+- **Radius** defines the fillet radius.
+
+**TUI Command**:
+
+.. py:function:: model.addFillet(Part_doc, [wires], radius)
+
+    :param part: The current part object.
+    :param list: A list of wires subject to fillet operation in format *model.selection(TYPE, shape)*.
+    :param number: Radius value.
+    :return: Created object.
+
+Result
+""""""
+
+Result of **Fillet a wire** is shown below. In this case all vertices were sharp, thus, filleted.
+
+.. image:: images/Fillet1DResult_Wire.png
+   :align: center
+
+.. centered::
+   Result of filleting a wire
+
+**See Also** a sample TUI Script of :ref:`tui_create_fillet1d_wire` operation.
+
+Fillet the specified vertices on a wire
+---------------------------------------
+
+Alternatively, there is a possibility to create a fillet on a special sharp corners of a wire.
+
+.. image:: images/Fillet1DPanel_Vertices.png
+  :align: center
+
+.. centered::
+  Property panel to fillet the specified vertices of a wire
+
+Input fields:
+
+- **Vertices** panel contains list of vertices on a wires applicable for fillet operation;
+- **Radius** defines the fillet radius.
+
+**TUI Command**:
+
+.. py:function:: model.addFillet(Part_doc, [vertices], radius)
+
+    :param part: The current part object.
+    :param list: A list of vertices subject to fillet operation in format *model.selection(TYPE, shape)*.
+    :param number: Radius value.
+    :return: Created object.
+
+Result
+""""""
+
+Result of **Fillet by vertices** is shown below. The only 2 corners of the wire become smooth.
+
+.. image:: images/Fillet1DResult_Vertices.png
+   :align: center
+
+.. centered::
+   Result of filleting the specified vertices of a wire
+
+**See Also** a sample TUI Script of :ref:`tui_create_fillet1d_vertices` operation.
diff --git a/src/FeaturesPlugin/doc/images/Fillet1DPanel_Vertices.png b/src/FeaturesPlugin/doc/images/Fillet1DPanel_Vertices.png
new file mode 100644 (file)
index 0000000..883c5e0
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/Fillet1DPanel_Vertices.png differ
diff --git a/src/FeaturesPlugin/doc/images/Fillet1DPanel_Wire.png b/src/FeaturesPlugin/doc/images/Fillet1DPanel_Wire.png
new file mode 100644 (file)
index 0000000..668627e
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/Fillet1DPanel_Wire.png differ
diff --git a/src/FeaturesPlugin/doc/images/Fillet1DResult_Vertices.png b/src/FeaturesPlugin/doc/images/Fillet1DResult_Vertices.png
new file mode 100644 (file)
index 0000000..4ec0fa9
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/Fillet1DResult_Vertices.png differ
diff --git a/src/FeaturesPlugin/doc/images/Fillet1DResult_Wire.png b/src/FeaturesPlugin/doc/images/Fillet1DResult_Wire.png
new file mode 100644 (file)
index 0000000..a465525
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/Fillet1DResult_Wire.png differ
diff --git a/src/FeaturesPlugin/doc/images/fillet1d.png b/src/FeaturesPlugin/doc/images/fillet1d.png
new file mode 100644 (file)
index 0000000..a94aba3
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/fillet1d.png differ
diff --git a/src/FeaturesPlugin/doc/images/fillet1d_points.png b/src/FeaturesPlugin/doc/images/fillet1d_points.png
new file mode 100644 (file)
index 0000000..c0f751a
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/fillet1d_points.png differ
diff --git a/src/FeaturesPlugin/doc/images/fillet1d_wire.png b/src/FeaturesPlugin/doc/images/fillet1d_wire.png
new file mode 100644 (file)
index 0000000..62eed22
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/fillet1d_wire.png differ
index d9670639618b7beba74df75e6079e7d682381ca2..e7f3cafa1191a8c06e9bf5eddbeb04c5a30ad3ba 100644 (file)
@@ -32,7 +32,7 @@
   </toolbox>
   <doublevalue id="radius"
                label="Radius"
-               tooltip="Fillet radius."
+               tooltip="Fillet radius"
                min="0"
                default="0">
     <validator id="GeomValidators_Positive"/>