]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #17342: 3D Model defeaturing
authorazv <azv@opencascade.com>
Thu, 30 Jan 2020 12:53:06 +0000 (15:53 +0300)
committerazv <azv@opencascade.com>
Thu, 30 Jan 2020 12:53:06 +0000 (15:53 +0300)
* Translation to French and Russian
* Documentation

src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts
src/FeaturesPlugin/FeaturesPlugin_msg_ru.ts
src/FeaturesPlugin/doc/FeaturesPlugin.rst
src/FeaturesPlugin/doc/TUI_defeaturingFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/defeaturingFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/defeaturing.py [new file with mode: 0644]
src/FeaturesPlugin/doc/images/defeaturing.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/defeaturing_property_panel.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/defeaturing_result.png [new file with mode: 0644]

index df8d45ad1f03249b7da4f1e1311ad6a2f7e20771..71f2863f671249a95bed5358f25a8386d9871607 100644 (file)
     </message>
   </context>
 
+  <!-- Defeaturing -->
+  <context>
+    <name>Defeaturing</name>
+    <message>
+      <source>Defeaturing</source>
+      <translation>Vaincre</translation>
+    </message>
+    <message>
+      <source>Faces to remove</source>
+      <translation>Visages à retirer</translation>
+    </message>
+    <message>
+      <source>Select faces</source>
+      <translation>Sélectionnez des faces</translation>
+    </message>
+  </context>
+  <context>
+    <name>Defeaturing:FeaturesPlugin_ValidatorDefeaturingSelection</name>
+    <message>
+      <source>Error: This validator can only work with selection list attributes.</source>
+      <translation>Erreur: ce validateur ne peut fonctionner qu&apos;avec des attributs de liste de sélection.</translation>
+    </message>
+    <message>
+      <source>Error: Empty attribute selection.</source>
+      <translation>La sélection d&apos;attribut est vide.</translation>
+    </message>
+    <message>
+      <source>Error: Empty selection context.</source>
+      <translation>Erreur: contexte de sélection vide.</translation>
+    </message>
+    <message>
+      <source>Error: Not all selected shapes are sub-shapes of solids.</source>
+      <translation>Erreur: toutes les formes sélectionnées ne sont pas des sous-formes de solides.</translation>
+    </message>
+  </context>
+
   <!-- Extrusion -->
   <context>
     <name>Extrusion</name>
index 6901086373903272fa6a87cae2a6026480e62c67..4e52f45275f6f58f31e0b04506eea85d44d97148 100644 (file)
       <translation>Выберите вспомогательные объекты.</translation>
     </message>
   </context>
+
+  <!-- Defeaturing -->
+  <context>
+    <name>Defeaturing</name>
+    <message>
+      <source>Defeaturing</source>
+      <translation>Удаление фичеров</translation>
+    </message>
+    <message>
+      <source>Faces to remove</source>
+      <translation>Удаляемые грани</translation>
+    </message>
+    <message>
+      <source>Select faces</source>
+      <translation>Выберите грани</translation>
+    </message>
+  </context>
+  <context>
+    <name>Defeaturing:FeaturesPlugin_ValidatorDefeaturingSelection</name>
+    <message>
+      <source>Error: This validator can only work with selection list attributes.</source>
+      <translation>Ошибка: валидатор поддерживает только аттрибуты типа SelectionList.</translation>
+    </message>
+    <message>
+      <source>Error: Empty attribute selection.</source>
+      <translation>Ошибка: незаполненный аттрибут.</translation>
+    </message>
+    <message>
+      <source>Error: Empty selection context.</source>
+      <translation>Ошибка: пустой контекст.</translation>
+    </message>
+    <message>
+      <source>Error: Not all selected shapes are sub-shapes of solids.</source>
+      <translation>Ошибка: не все выбранные объекты являются подэлементами твердых тел.</translation>
+    </message>
+  </context>
 </TS>
index 4d4a52d77d842318766e55784c102f6d22fa4a4c..91db9f48fe1e3e253a596ba62ba34020f4e0b6c5 100644 (file)
@@ -15,6 +15,7 @@ Features plug-in provides a set of common topological operations. It implements
    commonFeature.rst
    copyFeature.rst
    cutFeature.rst
+   defeaturingFeature.rst
    extrusionCutFeature.rst
    extrusionFeature.rst
    extrusionFuseFeature.rst
diff --git a/src/FeaturesPlugin/doc/TUI_defeaturingFeature.rst b/src/FeaturesPlugin/doc/TUI_defeaturingFeature.rst
new file mode 100644 (file)
index 0000000..aafc733
--- /dev/null
@@ -0,0 +1,12 @@
+
+  .. _tui_defeaturing:
+
+Perform Defeaturing
+===================
+
+.. literalinclude:: examples/defeaturing.py 
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/defeaturing.py>` 
+   
diff --git a/src/FeaturesPlugin/doc/defeaturingFeature.rst b/src/FeaturesPlugin/doc/defeaturingFeature.rst
new file mode 100644 (file)
index 0000000..33ebe85
--- /dev/null
@@ -0,0 +1,49 @@
+.. |defeaturing.icon|    image:: images/defeaturing.png
+
+Defeaturing
+===========
+
+**Defeaturing** operation is intended for removal of the unwanted parts or features from the model. These parts can be holes, protrusions, gaps, chamfers, fillets, etc. 
+
+To create a Defeaturing in the active part:
+
+#. select in the Main Menu *Feature -> Defeaturing* item  or
+#. click |defeaturing.icon| **Defeaturing** button in the toolbar.
+
+After that select one or more faces of solids to suppress them. The Defeaturing works with faces from comsolids and compounds of solids as well.
+
+.. image:: images/defeaturing_property_panel.png
+  :align: center
+
+.. centered::
+  Defeaturing property panel
+
+Input field:
+
+- **Faces to remove** panel contains the list of faces which should be suppressed.
+
+**TUI Command**:
+
+.. py:function:: model.addDefeaturing(Part_doc, [faces])
+
+    :param part: The current part object.
+    :param list: A list of faces in format *model.selection("FACE", shape)*.
+    :return: Created object.
+
+Result
+""""""
+
+Result of **Defeaturing** is shown below.
+
+.. image:: images/defeaturing_result.png
+   :align: center
+
+.. centered::
+   Defeaturing operation
+
+**See Also** a sample TUI Script of :ref:`tui_defeaturing` operation.
+
+References
+""""""""""
+
+For more information, please, visit `OpenCASCADE Documentation <https://dev.opencascade.org/doc/overview/html/occt_user_guides__modeling_algos.html#occt_modalg_defeaturing>`_.
diff --git a/src/FeaturesPlugin/doc/examples/defeaturing.py b/src/FeaturesPlugin/doc/examples/defeaturing.py
new file mode 100644 (file)
index 0000000..0dc1f52
--- /dev/null
@@ -0,0 +1,12 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Fillet_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 2)
+Defeaturing_1 = model.addDefeaturing(Part_1_doc, [model.selection("FACE", "Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_3"), model.selection("FACE", "(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_1)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_2)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_3)")])
+
+model.end()
diff --git a/src/FeaturesPlugin/doc/images/defeaturing.png b/src/FeaturesPlugin/doc/images/defeaturing.png
new file mode 100644 (file)
index 0000000..9b5ecc8
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/defeaturing.png differ
diff --git a/src/FeaturesPlugin/doc/images/defeaturing_property_panel.png b/src/FeaturesPlugin/doc/images/defeaturing_property_panel.png
new file mode 100644 (file)
index 0000000..d62e6ae
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/defeaturing_property_panel.png differ
diff --git a/src/FeaturesPlugin/doc/images/defeaturing_result.png b/src/FeaturesPlugin/doc/images/defeaturing_result.png
new file mode 100644 (file)
index 0000000..25b6fcd
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/defeaturing_result.png differ