in ListOfGroups theNodesNot,
in GEOM::GEOM_Object theShape );
+ /*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+ boolean Make2DMeshFrom3D();
+
};
};
mesh_tree_mesh_partial.png \
mesh_extractGroup.png \
mesh_precompute.png \
+ mesh_2d_from_3d.png \
mesh_free_faces.png
# VSR: little trick to avoid putting if SMESHCatalog.xml to the distribution archive
const TIDSortedElemSet& theNodesNot,
const TopoDS_Shape& theShape )
{
- SMESHDS_Mesh* aMesh = GetMeshDS();
- if (!aMesh)
- return false;
if ( theShape.IsNull() )
return false;
}
return DoubleNodes( theElems, theNodesNot, anAffected );
}
+
+/*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+
+bool SMESH_MeshEditor::Make2DMeshFrom3D()
+{
+ // iterates on volume elements and detect all free faces on them
+ SMESHDS_Mesh* aMesh = GetMeshDS();
+ if (!aMesh)
+ return false;
+ bool res = false;
+ SMDS_VolumeIteratorPtr vIt = aMesh->volumesIterator();
+ while(vIt->more())
+ {
+ const SMDS_MeshVolume* volume = vIt->next();
+ SMDS_VolumeTool vTool( volume );
+ bool isPoly = volume->IsPoly();
+ for ( int iface = 0, n = vTool.NbFaces(); iface < n; iface++ )
+ {
+ if (!vTool.IsFreeFace(iface))
+ continue;
+ vector<const SMDS_MeshNode *> nodes;
+ int nbFaceNodes = vTool.NbFaceNodes(iface);
+ const SMDS_MeshNode** faceNodes = vTool.GetFaceNodes(iface);
+ if (vTool.IsFaceExternal(iface))
+ for (int inode = 0; inode < nbFaceNodes; inode++)
+ nodes.push_back(faceNodes[inode]);
+ else
+ for (int inode = nbFaceNodes - 1; inode >= 0; inode--)
+ nodes.push_back(faceNodes[inode]);
+
+ // add new face based on volume nodes
+ if (aMesh->FindFace( nodes ) )
+ continue; // face already exsist
+ myLastCreatedElems.Append( AddElement(nodes, SMDSAbs_Face, isPoly && iface == 1) );
+ res = true;
+ }
+ }
+ return res;
+}
const TIDSortedElemSet& theNodesNot,
const TopoDS_Shape& theShape );
+ /*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+ bool Make2DMeshFrom3D();
+
private:
/*!
SMESHGUI_MeshEditPreview.h \
SMESHGUI_IdValidator.h \
SMESHGUI_MeshInfosBox.h \
+ SMESHGUI_Make2DFrom3DOp.h \
SMESH_SMESHGUI.hxx
# Libraries targets
SMESHGUI_MeshEditPreview.cxx \
SMESHGUI_GroupOnShapeDlg.cxx \
SMESHGUI_FileInfoDlg.cxx \
- SMESHGUI_MeshInfosBox.cxx
+ SMESHGUI_MeshInfosBox.cxx \
+ SMESHGUI_Make2DFrom3DOp.cxx
MOC_FILES = \
SMESHGUI_moc.cxx \
SMESHGUI_MakeNodeAtPointDlg_moc.cxx \
SMESHGUI_GroupOnShapeDlg_moc.cxx \
SMESHGUI_FileInfoDlg_moc.cxx \
- SMESHGUI_MeshInfosBox_moc.cxx
+ SMESHGUI_MeshInfosBox_moc.cxx \
+ SMESHGUI_Make2DFrom3DOp_moc.cxx
nodist_libSMESH_la_SOURCES= \
$(MOC_FILES)
#include "SMESHGUI_BuildCompoundDlg.h"
#include "SMESHGUI_ComputeDlg.h"
#include "SMESHGUI_FileInfoDlg.h"
+#include "SMESHGUI_Make2DFrom3DOp.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_MeshUtils.h"
}*/
break;
}
+ case 418: // create 2D mesh from 3D
+ {
+ startOperation( 418 );
+ break;
+ }
case 806: // CREATE GEO GROUP
{
startOperation( 806 );
createSMESHAction( 415, "MAP", "ICON_MAP" );
createSMESHAction( 416, "EXTRUSION_ALONG", "ICON_EXTRUSION_ALONG" );
createSMESHAction( 417, "CONV_TO_QUAD", "ICON_CONV_TO_QUAD" );
+ createSMESHAction( 418, "2D_FROM_3D", "ICON_2D_FROM_3D" );
createSMESHAction( 200, "RESET" );
createSMESHAction( 201, "SCALAR_BAR_PROP" );
createSMESHAction( 211, "WIRE", "ICON_WIRE", 0, true );
createMenu( 414, modifyId, -1 );
createMenu( 415, modifyId, -1 );
createMenu( 417, modifyId, -1 );
+ createMenu( 418, modifyId, -1 );
createMenu( 214, viewId, -1 );
createTool( 414, modifyTb );
createTool( 415, modifyTb );
createTool( 417, modifyTb );
+ createTool( 418, modifyTb );
createTool( 214, dispModeTb );
case 417: //convert to quadratic
op = new SMESHGUI_ConvToQuadOp();
break;
+ case 418: // create 2D mesh as boundary on 3D
+ op = new SMESHGUI_Make2DFrom3DOp();
+ break;
case 4067: // make mesh pass through point
op = new SMESHGUI_MakeNodeAtPointOp();
break;
<source>ICON_UNDERLYING_ELEMS</source>
<translation>mesh_extractGroup.png</translation>
</message>
+ <message>
+ <source>ICON_2D_FROM_3D</source>
+ <translation>mesh_2d_from_3d.png</translation>
+ </message>
</context>
</TS>
<source>MEN_CONV_TO_QUAD</source>
<translation>Convert to/from quadratic</translation>
</message>
+ <message>
+ <source>MEN_2D_FROM_3D</source>
+ <translation>Create 2D mesh from 3D</translation>
+ </message>
<message>
<source>MEN_CREATE_GROUP</source>
<translation>Create Group</translation>
<source>STB_CONV_TO_QUAD</source>
<translation>Convert to/from quadratic</translation>
</message>
+ <message>
+ <source>STB_2D_FROM_3D</source>
+ <translation>Create 2D mesh from 3D</translation>
+ </message>
<message>
<source>STB_CREATE_GROUP</source>
<translation>Create Group</translation>
<source>TOP_CONV_TO_QUAD</source>
<translation>Convert to/from quadratic</translation>
</message>
+ <message>
+ <source>TOP_2D_FROM_3D</source>
+ <translation>Create 2D mesh from 3D</translation>
+ </message>
<message>
<source>TOP_CREATE_GROUP</source>
<translation>Create Group</translation>
<translation>No valid mesh object selected</translation>
</message>
</context>
+ <context>
+ <name>SMESHGUI_Make2DFrom3DDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Create 2D mesh from 3D</translation>
+ </message>
+ </context>
<context>
<name>SMESHGUI_CreatePatternDlg</name>
<message>
storeResult( aMeshEditor) ;
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodes( " << theElems << ", "
+ << theNodesNot << ", " << theAffectedElems << " )";
return aResult;
}
storeResult( aMeshEditor) ;
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodesInRegion( " << theElems << ", "
+ << theNodesNot << ", " << theShape << " )";
return aResult;
}
storeResult( aMeshEditor) ;
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodeGroup( " << theElems << ", "
+ << theNodesNot << ", " << theAffectedElems << " )";
return aResult;
}
storeResult( aMeshEditor) ;
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodeGroupInRegion( " << theElems << ", "
+ << theNodesNot << ", " << theShape << " )";
return aResult;
}
storeResult( aMeshEditor) ;
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodeGroups( " << &theElems << ", "
+ << &theNodesNot << ", " << &theAffectedElems << " )";
return aResult;
}
storeResult( aMeshEditor) ;
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodeGroupsInRegion( " << &theElems << ", "
+ << &theNodesNot << ", " << theShape << " )";
+ return aResult;
+}
+
+//================================================================================
+/*!
+ \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ The created 2D mesh elements based on nodes of free faces of boundary volumes
+ \return TRUE if operation has been completed successfully, FALSE otherwise
+*/
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D()
+{
+ initData();
+
+ ::SMESH_MeshEditor aMeshEditor( myMesh );
+ bool aResult = aMeshEditor.Make2DMeshFrom3D();
+ storeResult( aMeshEditor) ;
+
+ TPythonDump() << "isDone = " << this << ".Make2DMeshFrom3D()";
return aResult;
}
const SMESH::ListOfGroups& theNodesNot,
GEOM::GEOM_Object_ptr theShape );
-private: //!< private methods
+ /*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+ CORBA::Boolean Make2DMeshFrom3D();
+
+ private: //!< private methods
SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
def ConvertFromQuadratic(self):
return self.editor.ConvertFromQuadratic()
+ ## Creates 2D mesh as skin on boundary faces of a 3D mesh
+ # @return TRUE if operation has been completed successfully, FALSE otherwise
+ # @ingroup l2_modif_edit
+ def Make2DMeshFrom3D(self):
+ return self.editor. Make2DMeshFrom3D()
+
## Renumber mesh nodes
# @ingroup l2_modif_renumber
def RenumberNodes(self):