From e36717feb00b623f5bc7ffbbc47d28ea0b95f842 Mon Sep 17 00:00:00 2001 From: abd Date: Thu, 19 Oct 2006 06:52:32 +0000 Subject: [PATCH] First stable version after merging with V3_2_2 --- adm_local/unix/make_commence.in | 2 + adm_local/unix/make_conclude.in | 14 +- configure.in.base | 10 +- doc/salome/PluginMeshers.txt | 6 +- doc/salome/gui/SMESH/constructing_meshes.htm | 638 ++-- .../gui/SMESH/defining_hypotheses_tui.htm | 1082 ++----- .../gui/SMESH/extrusion_along_a_path.htm | 309 +- .../files/importing_and_exporting_meshes.htm | 4 +- doc/salome/gui/SMESH/grouping_elements.htm | 944 +++--- doc/salome/gui/SMESH/image102.gif | Bin 3465 -> 0 bytes doc/salome/gui/SMESH/image104.gif | Bin 9275 -> 0 bytes doc/salome/gui/SMESH/modifying_meshes.htm | 2168 ++++++++------ .../gui/SMESH/pics/circle_angles_after.png | Bin 0 -> 7716 bytes .../gui/SMESH/pics/circle_simple_after.png | Bin 0 -> 5858 bytes .../gui/SMESH/pics/circle_simple_before.png | Bin 0 -> 4018 bytes .../gui/SMESH/pics/curvi_angles_after.png | Bin 0 -> 4276 bytes .../gui/SMESH/pics/curvi_simple_after.png | Bin 0 -> 4598 bytes .../gui/SMESH/pics/curvi_simple_before.png | Bin 0 -> 3585 bytes .../gui/SMESH/pics/edge_wire_3d_after.png | Bin 0 -> 3477 bytes .../gui/SMESH/pics/edge_wire_3d_before.png | Bin 0 -> 5212 bytes doc/salome/gui/SMESH/pics/edge_wire_after.png | Bin 0 -> 3185 bytes .../gui/SMESH/pics/edge_wire_before.png | Bin 0 -> 5036 bytes doc/salome/gui/SMESH/pics/extrusion1.png | Bin 0 -> 22957 bytes .../SMESH/pics/mesh_for_extr_along_path.png | Bin 0 -> 4658 bytes doc/salome/gui/SMESH/pics/straight_after.png | Bin 0 -> 5369 bytes doc/salome/gui/SMESH/pics/straight_before.png | Bin 0 -> 3623 bytes doc/salome/gui/SMESH/quality_controls.htm | 1787 +++++------ doc/salome/gui/SMESH/smesh.log | 28 +- .../gui/SMESH/smesh.py_introduction.htm | 270 ++ .../gui/SMESH/smeshpy_doc/namespacesmesh.html | 3 + doc/salome/gui/SMESH/transforming_meshes.htm | 683 ++--- doc/salome/gui/SMESH/viewing_meshes.htm | 137 +- doc/salome/gui/SMESH/whcsh_home.htm | 2 +- doc/salome/gui/SMESH/whdata/whftdata0.htm | 4 + doc/salome/gui/SMESH/whdata/whfts.htm | 2 +- doc/salome/gui/SMESH/whdata/whfwdata0.htm | 2649 +++++++++-------- doc/salome/gui/SMESH/whdata/whtdata0.htm | 15 +- doc/salome/gui/SMESH/whfform.htm | 2 +- doc/salome/gui/SMESH/whgdata/whlstt7.htm | 2 +- doc/salome/gui/SMESH/whgdata/whlstt9.htm | 1 + doc/salome/gui/SMESH/whiform.htm | 2 +- doc/salome/gui/SMESH/whnjs.htm | 2 +- doc/salome/gui/SMESH/whres.xml | 2 +- doc/salome/gui/SMESH/whskin_info.htm | 2 +- doc/salome/gui/SMESH/whskin_pickup.htm | 2 +- doc/salome/gui/SMESH/whstart.js | 2 +- doc/salome/gui/SMESH/whtdhtml.htm | 2 +- doc/salome/gui/SMESH/whtopic.js | 2 +- doc/salome/gui/SMESH/whxdata/whftdata0.xml | 4 + doc/salome/gui/SMESH/whxdata/whfts.xml | 4 +- doc/salome/gui/SMESH/whxdata/whfwdata0.xml | 2649 +++++++++-------- doc/salome/gui/SMESH/whxdata/whtdata0.xml | 7 +- .../SMESH/sources/static/PluginMeshers.html | 6 +- idl/SMESH_Filter.idl | 3 - idl/SMESH_Gen.idl | 4 +- idl/SMESH_Mesh.idl | 11 + resources/SalomeApp.xml | 10 +- src/Controls/SMESH_Controls.cxx | 72 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 31 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 2 +- src/DriverUNV/DriverUNV_R_SMDS_Mesh.h | 3 + src/MEFISTO2/Rn.h | 10 +- src/OBJECT/Makefile.in | 1 + src/OBJECT/SMESH_Actor.cxx | 2 +- src/OBJECT/SMESH_ActorUtils.h | 1 + src/SMDS/SMDS_MeshElement.hxx | 2 +- src/SMDS/SMDS_VolumeTool.cxx | 2 +- src/SMESH/SMESH_Mesh.cxx | 101 +- src/SMESH/SMESH_MeshEditor.hxx | 12 +- src/SMESH/SMESH_subMesh.cxx | 26 +- src/SMESHDS/SMESHDS_Group.hxx | 4 +- src/SMESHDS/SMESHDS_Mesh.hxx | 1 + src/SMESHGUI/SMESHGUI.cxx | 296 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h | 1 + .../SMESHGUI_AddQuadraticElementDlg.cxx | 17 + .../SMESHGUI_AddQuadraticElementDlg.h | 1 + src/SMESHGUI/SMESHGUI_ClippingDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_ClippingDlg.h | 2 + src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx | 2 + src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_CreatePatternDlg.h | 1 + .../SMESHGUI_CreatePolyhedralVolumeDlg.cxx | 19 +- .../SMESHGUI_CreatePolyhedralVolumeDlg.h | 1 + src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h | 1 + src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx | 18 + src/SMESHGUI/SMESHGUI_EditMeshDlg.h | 1 + .../SMESHGUI_ExtrusionAlongPathDlg.cxx | 27 +- src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h | 1 + src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx | 23 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.h | 1 + src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 33 +- src/SMESHGUI/SMESHGUI_FilterDlg.h | 1 + src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h | 1 + src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_GroupDlg.h | 1 + src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_GroupOpDlg.h | 1 + src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx | 19 +- src/SMESHGUI/SMESHGUI_MergeNodesDlg.h | 1 + src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_MeshInfosDlg.h | 1 + src/SMESHGUI/SMESHGUI_MeshOp.cxx | 120 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx | 24 + src/SMESHGUI/SMESHGUI_MeshPatternDlg.h | 1 + src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx | 23 +- src/SMESHGUI/SMESHGUI_MoveNodesDlg.h | 1 + src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_MultiEditDlg.h | 1 + src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 23 +- src/SMESHGUI/SMESHGUI_NodesDlg.h | 1 + src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h | 1 + src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h | 1 + src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_RenumberingDlg.h | 1 + src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 33 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.h | 1 + src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 33 +- src/SMESHGUI/SMESHGUI_RotationDlg.h | 1 + src/SMESHGUI/SMESHGUI_SewingDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_SewingDlg.h | 1 + src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_SingleEditDlg.h | 1 + src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_SmoothingDlg.h | 1 + src/SMESHGUI/SMESHGUI_SpinBox.cxx | 2 + src/SMESHGUI/SMESHGUI_SpinBox.h | 4 + .../SMESHGUI_StandardMeshInfosDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h | 1 + src/SMESHGUI/SMESHGUI_Swig.cxx | 5 + src/SMESHGUI/SMESHGUI_Swig.i | 19 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 29 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.h | 1 + src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 29 +- src/SMESHGUI/SMESHGUI_TranslationDlg.h | 1 + src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx | 17 + src/SMESHGUI/SMESHGUI_TransparencyDlg.h | 3 + src/SMESHGUI/SMESH_icons.po | 2 +- src/SMESHGUI/SMESH_images.po | 2 +- src/SMESHGUI/SMESH_msg_en.po | 27 +- src/SMESH_I/SMESH_Gen_i.cxx | 247 +- src/SMESH_I/SMESH_MEDMesh_i.hxx | 3 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 34 +- src/SMESH_I/SMESH_Pattern_i.cxx | 3 +- src/SMESH_SWIG/Makefile.in | 1 + src/StdMeshers/StdMeshers_Distribution.cxx | 81 +- .../StdMeshers_NumberOfSegments.cxx | 46 +- src/StdMeshers/StdMeshers_Regular_1D.cxx | 20 +- .../StdMeshersGUI_DistrPreview.cxx | 75 +- src/StdMeshers_I/Makefile.in | 2 +- 154 files changed, 8363 insertions(+), 7047 deletions(-) delete mode 100755 doc/salome/gui/SMESH/image102.gif delete mode 100755 doc/salome/gui/SMESH/image104.gif create mode 100644 doc/salome/gui/SMESH/pics/circle_angles_after.png create mode 100644 doc/salome/gui/SMESH/pics/circle_simple_after.png create mode 100644 doc/salome/gui/SMESH/pics/circle_simple_before.png create mode 100644 doc/salome/gui/SMESH/pics/curvi_angles_after.png create mode 100644 doc/salome/gui/SMESH/pics/curvi_simple_after.png create mode 100644 doc/salome/gui/SMESH/pics/curvi_simple_before.png create mode 100644 doc/salome/gui/SMESH/pics/edge_wire_3d_after.png create mode 100644 doc/salome/gui/SMESH/pics/edge_wire_3d_before.png create mode 100644 doc/salome/gui/SMESH/pics/edge_wire_after.png create mode 100644 doc/salome/gui/SMESH/pics/edge_wire_before.png create mode 100644 doc/salome/gui/SMESH/pics/extrusion1.png create mode 100644 doc/salome/gui/SMESH/pics/mesh_for_extr_along_path.png create mode 100644 doc/salome/gui/SMESH/pics/straight_after.png create mode 100644 doc/salome/gui/SMESH/pics/straight_before.png create mode 100644 doc/salome/gui/SMESH/smesh.py_introduction.htm diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index 71df45053..0be66a96f 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -1,6 +1,8 @@ # common directories to put headerfiles inc_builddir=$(top_builddir)/include/salome +MODULE_NAME=@MODULE_NAME@ + @SET_MAKE@ SHELL=/bin/sh diff --git a/adm_local/unix/make_conclude.in b/adm_local/unix/make_conclude.in index 37c65077f..554b8afb0 100644 --- a/adm_local/unix/make_conclude.in +++ b/adm_local/unix/make_conclude.in @@ -131,7 +131,7 @@ $(DEST_HEADERS): $(inc_builddir)/%: % cp -f $< $@ # build resources file (icons and messages) : .qm file from .po file -resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm) +resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm) # Make installation directories if they don't exist. $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir): @@ -187,10 +187,10 @@ $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: % # generic rule to install .qm files : install-qm: resources - $(INSTALL) -d $(datadir)/resources - @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \ + $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME) + @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \ if test $$f != X; then \ - ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \ + ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \ fi; \ done @@ -234,7 +234,7 @@ uninstall: # Uninstall qm files @for f in X $(PO_FILES:%.po=%.qm); do \ if test $$f != X; then \ - $(LT_UNINSTALL) $(datadir)/resources/$$f ; \ + $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \ fi; \ done @@ -279,7 +279,7 @@ clean: mostlyclean # distclean: clean #remove qm file ! - -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm) + -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm) #remove include files -$(RM) $(DEST_HEADERS) -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep* @@ -326,7 +326,7 @@ distclean: clean %_wrap.cxx : %.i $(SWIG) $(SWIG_FLAGS) -o $@ $< -$(top_builddir)/share/salome/resources/%.qm: %.po +$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po $(MSG2QM) $< $@ ; \ #------------------------------------------------------------------------------ diff --git a/configure.in.base b/configure.in.base index cc915a120..92cad35ec 100644 --- a/configure.in.base +++ b/configure.in.base @@ -22,11 +22,15 @@ AC_CANONICAL_HOST PACKAGE=salome AC_SUBST(PACKAGE) -VERSION=3.2.0 -XVERSION=0x030200 +VERSION=3.2.2 +XVERSION=0x030202 AC_SUBST(VERSION) AC_SUBST(XVERSION) +# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) +MODULE_NAME=smesh +AC_SUBST(MODULE_NAME) + dnl dnl Initialize source and build root directories dnl @@ -350,7 +354,7 @@ else fi # make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl +for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl do # if test ! -d $rep ; then # eval mkdir $rep diff --git a/doc/salome/PluginMeshers.txt b/doc/salome/PluginMeshers.txt index 61bb0842b..802f096ef 100644 --- a/doc/salome/PluginMeshers.txt +++ b/doc/salome/PluginMeshers.txt @@ -83,10 +83,10 @@ The SALOME automatically locates XML files, searching them in the following directories: - ${_ROOT_DIR}/share/salome/resources + ${_ROOT_DIR}/share/salome/resources/ ${SALOME_Resources} ${HOME}/.salome/resources - ${KERNEL_ROOT_DIR}/share/salome/resources + ${KERNEL_ROOT_DIR}/share/salome/resources/kernel where is a name of each mesher plugin package @@ -148,7 +148,7 @@ 4.2.2. Define environment variable SALOME_Resources to point to the directory where resources are situated. - Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources + Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources/smesh 4.3. Implement your Hypothesis Creator and being exported method diff --git a/doc/salome/gui/SMESH/constructing_meshes.htm b/doc/salome/gui/SMESH/constructing_meshes.htm index 90d82bffc..a643f436f 100755 --- a/doc/salome/gui/SMESH/constructing_meshes.htm +++ b/doc/salome/gui/SMESH/constructing_meshes.htm @@ -7,11 +7,13 @@

Creating Meshes

-

Construction of a Mesh

- -

import salome

- -

import geompy

+

First of all see Example + of 3d mesh generation, which is an example of good python script style + for Mesh module.

-

import StdMeshers

+

Other examples of python + scripts will be also updated soon to use smesh package instead of direct + usage of idl interface.

-

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

+

Construction of a Mesh

-

smeshgui = salome.ImportComponentGUI("SMESH")

+

import + geompy

-

smeshgui.Init(salome.myStudyId);

+

import smesh

 

-

# create a box

+

# create a box

-

box = geompy.MakeBox(0., +

box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)

-

 

- -

# add box to the study

- -

idbox = geompy.addToStudy(box, +

idbox = geompy.addToStudy(box, "box")

 

-

# create a hypothesis

- -

print "-------------------------- - create Hypothesis"

- -

print "-------------------------- - NumberOfSegments"

- -

numberOfSegments - = 7

- -

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hypNbSeg.SetNumberOfSegments(numberOfSegments)

- -

print hypNbSeg.GetName()

- -

print hypNbSeg.GetId()

- -

print hypNbSeg.GetNumberOfSegments()

- -

smeshgui.SetName(salome.ObjectToID(hypNbSeg), - "NumberOfSegments_10")

- -

print "-------------------------- - MaxElementArea"

- -

maxElementArea = - 800

- -

hypArea = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hypArea.SetMaxElementArea(maxElementArea)

+

# create a mesh

-

print hypArea.GetName()

- -

print hypArea.GetId()

- -

print hypArea.GetMaxElementArea()

- -

smeshgui.SetName(salome.ObjectToID(hypArea), - "MaxElementArea_500")

- -

print "-------------------------- - MaxElementVolume"

- -

maxElementVolume - = 900

- -

hypVolume = smesh.CreateHypothesis("MaxElementVolume", - "libStdMeshersEngine.so")

- -

hypVolume.SetMaxElementVolume(maxElementVolume)

- -

print hypVolume.GetName()

- -

print hypVolume.GetId()

- -

print hypVolume.GetMaxElementVolume()

- -

smeshgui.SetName(salome.ObjectToID(hypVolume), - "MaxElementVolume_500")

+

tetra = smesh.Mesh(box, + "MeshBox")

 

-

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

print "-------------------------- - Regular_1D"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

+

algo1D = tetra.Segment()

-

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

+

algo1D.NumberOfSegments(7)

-

print "-------------------------- - MEFISTO_2D"

+

 

-

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

+

algo2D = tetra.Triangle()

-

smeshgui.SetName(salome.ObjectToID(mefisto2D), - "MEFISTO_2D")

+

algo2D.MaxElementArea(800.)

 

-

# initialize a mesh with - the box

- -

mesh = smesh.CreateMesh(box)

+

algo3D = tetra.Tetrahedron(smesh.NETGEN)

-

smeshgui.SetName(salome.ObjectToID(mesh), - "MeshBox")

+

algo3D.MaxElementVolume(900.)

 

-

# add the hypothesis to - the box

+

# compute the mesh

-

print "-------------------------- - add hypothesis to the box"

+

ret = tetra.Compute()

-

mesh.AddHypothesis(box,hypNbSeg)

+

if ret == 0:

-

mesh.AddHypothesis(box,hypArea)

+

    print + "problem when computing the mesh"

-

mesh.AddHypothesis(box,hypVolume)

+

else:

-

mesh.AddHypothesis(box,regular1D)

+

    print + "mesh computed"

-

mesh.AddHypothesis(box,mefisto2D)

+

    pass +

 

-

# compute the mesh

- -

print "-------------------------- - compute the mesh of the box"

- -

ret = smesh.Compute(mesh,box)

- -

print ret

- -

if ret == 0:

- -

    print - "probleme when computing the mesh"

- -

salome.sg.updateObjBrowser(1)

- -

 

+

 

Construction of a Submesh

-

 

- -

from +

from geompy import *

-

import smesh

+

import smesh

 

-

# create vertices

- -

Point111 = MakeVertex( 0,  0, -  0)

- -

Point211 = MakeVertex(10,  0, -  0)

+

# create a box

-

Point121 = MakeVertex( 0, 10,  0)

+

box = MakeBoxDXDYDZ(10., 10., 10.)

-

Point221 = MakeVertex(10, 10,  0)

- -

Point112 = MakeVertex( 0,  0, - 10)

- -

Point212 = MakeVertex(10,  0, - 10)

- -

Point122 = MakeVertex( 0, 10, 10)

- -

Point222 = MakeVertex(10, 10, 10)

+

addToStudy(box, "Box")

 

-

# create edges

- -

EdgeX111 = MakeEdge(Point111, Point211)

- -

EdgeX121 = MakeEdge(Point121, Point221)

- -

EdgeX112 = MakeEdge(Point112, Point212)

- -

EdgeX122 = MakeEdge(Point122, Point222)

- -

EdgeY11 = MakeEdge(Point111, Point121)

+

# select one edge of + the box for definition of a local hypothesis

-

EdgeY21 = MakeEdge(Point211, Point221)

+

p5 = MakeVertex(5., 0., 0.)

-

EdgeY12 = MakeEdge(Point112, Point122)

+

EdgeX = GetEdgeNearPoint(box, p5)

-

EdgeY22 = MakeEdge(Point212, Point222)

- -

EdgeZ111 = MakeEdge(Point111, Point112)

- -

EdgeZ211 = MakeEdge(Point211, Point212)

- -

EdgeZ121 = MakeEdge(Point121, Point122)

- -

EdgeZ221 = MakeEdge(Point221, Point222)

+

addToStudyInFather(box, EdgeX, "Edge + [0,0,0 - 10,0,0]")

 

-

# create faces

- -

FaceX11 = MakeQuad(EdgeY11, EdgeZ111, - EdgeY12, EdgeZ121)

+

# create a hexahedral + mesh on the box

-

FaceX21 = MakeQuad(EdgeY21, EdgeZ211, - EdgeY22, EdgeZ221)

- -

FaceY111 = MakeQuad(EdgeX111, EdgeZ111, - EdgeX112, EdgeZ211)

- -

FaceY121 = MakeQuad(EdgeX121, EdgeZ121, - EdgeX122, EdgeZ221)

- -

FaceZ11 = MakeQuad(EdgeX111, EdgeY11, - EdgeX121, EdgeY21)

- -

FaceZ12 = MakeQuad(EdgeX112, EdgeY12, - EdgeX122, EdgeY22)

+

quadra = smesh.Mesh(box, "Box : quadrangle + 2D mesh")

 

-

# create a solid

+

# create a regular + 1D algorithm for the faces

-

Block = MakeHexa(FaceX11, FaceX21, FaceY111, - FaceY121, FaceZ11, FaceZ12)

+

algo1D = quadra.Segment()

 

-

# create a compound

+

# define "NumberOfSegments" + hypothesis to cut

-

box = MakeCompound([Block])

+

# all the edges in + a fixed number of segments

-

 

- -

# add in the study

- -

box_id = addToStudy(box, "Box compound")

+

algo1D.NumberOfSegments(4)

 

-

# create hexahedral mesh - on the box

- -

hexa = smesh.Mesh(box, "Box compound - : hexahedrical mesh")

+

# create a quadrangle + 2D algorithm for the faces

-

algo = hexa.Segment()

+

quadra.Quadrangle()

 

-

# define "NumberOfSegments" - hypothesis to cut the edge in a fixed number of segments

+

# construct a submesh + on the edge with a local hypothesis

-

algo.NumberOfSegments(4)

+

algo_local = quadra.Segment(EdgeX)

 

-

# creates a quadrangle - 2D algorithm for the faces

+

# define "Arithmetic1D" + hypothesis to cut the edge + in several segments with increasing arithmetic length

-

hexa.Quadrangle()

+

algo_local.Arithmetic1D(1, 4)

 

-

# construct a submesh with - a local hypothesis

+

# define "Propagation" + hypothesis that propagates all other hypotheses

-

algo = hexa.Segment(EdgeX111)

+

# on all edges of the + opposite side in case of quadrangular faces

-

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with increasing arithmetic - length

- -

algo.Arithmetic1D(1, 4)

+

algo_local.Propagation()

 

-

# define "Propagation" - hypothesis that propagates all other hypothesis on all edges on the opposite - side in case of quadrangular faces

+

# compute the mesh

-

algo.Propagation()

+

quadra.Compute()

 

-

# compute the mesh

- -

hexa.Compute()

- -

 

-

Editing of a mesh

-

 

- -

import - salome

- -

import geompy

- -

import SMESH

+

import + geompy

-

import StdMeshers

+

import smesh

-

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

+

 

-

smesh.SetCurrentStudy(salome.myStudy)

+

def PrintMeshInfo(theMesh):

-

 

+

    aMesh + = theMesh.GetMesh()

-

box   = - geompy.MakeBox(0., 0., 0., 20., 20., 20.)

+

    print + "Information about mesh:"

-

idbox = geompy.addToStudy(box, "box")

+

    print + "Number of nodes       : + ", aMesh.NbNodes()

-

 

+

    print + "Number of edges       : + ", aMesh.NbEdges()

-

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["EDGE"])

+

    print + "Number of faces       : + ", aMesh.NbFaces()

-

edge   = - subShapeList[0]

+

    print + "Number of volumes     : + ", aMesh.NbVolumes()

-

name   = - geompy.SubShapeName(edge, box)

+

    pass

-

idedge = geompy.addToStudyInFather(box, - edge, name)

+

 

-

 

+

# create a box

-

box  = - salome.IDToObject(idbox)

+

box = geompy.MakeBox(0., 0., 0., 20., + 20., 20.)

-

edge = salome.IDToObject(idedge)

+

geompy.addToStudy(box, "box")

-

 

+

 

-

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

+

# select one edge of + the box for definition of a local hypothesis

-

hyp1.SetNumberOfSegments(3)

+

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["EDGE"])

-

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

+

edge = subShapeList[0]

-

hyp2.SetMaxElementArea(10)

+

name = geompy.SubShapeName(edge, box)

-

hyp3 = smesh.CreateHypothesis("Arithmetic1D", - "libStdMeshersEngine.so")

+

geompy.addToStudyInFather(box, edge, name)

-

hyp3.SetLength(1,1)

+

 

-

hyp3.SetLength(6,0)

+

# create a mesh

-

hyp4 = smesh.CreateHypothesis("Propagation", - "libStdMeshersEngine.so")

+

tria = smesh.Mesh(box, "Mesh 2D")

-

 

+

algo1D = tria.Segment()

-

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

+

hyp1 = algo1D.NumberOfSegments(3)

-

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

+

algo2D = tria.Triangle()

-

 

+

hyp2 = algo2D.MaxElementArea(10.)

-

mesh = smesh.CreateMesh(box)

+

 

-

mesh.AddHypothesis(box,hyp1)

+

# create a sub-mesh

-

mesh.AddHypothesis(box,hyp2)

+

algo_local = tria.Segment(edge)

-

mesh.AddHypothesis(box,algo1)

+

hyp3 = algo_local.Arithmetic1D(1, 6)

-

mesh.AddHypothesis(box,algo2)

+

hyp4 = algo_local.Propagation()

-

mesh.AddHypothesis(edge,hyp3)

+

 

-

mesh.AddHypothesis(edge,hyp4)

+

# compute the mesh

-

mesh.AddHypothesis(edge,algo1)

+

tria.Compute()

-

 

+

PrintMeshInfo(tria)

-

smesh.Compute(mesh,box)

+

 

-

salome.sg.updateObjBrowser(1)

+

# remove a local hypothesis

-

 

+

mesh = tria.GetMesh()

-

# remove a hypothesis

+

mesh.RemoveHypothesis(edge, hyp4)

-

mesh.RemoveHypothesis(edge,hyp4)

+

 

-

 

+

# compute the mesh

-

smesh.Compute(mesh,box)

+

tria.Compute()

-

salome.sg.updateObjBrowser(1)

+

PrintMeshInfo(tria)

-

 

+

 

# change the value - of the hypothesis

- -

hyp2.SetMaxElementArea(2)

- -

mesh.AddHypothesis(box,hyp2)

+ of the 2D hypothesis

-

 

- -

smesh.Compute(mesh,box)

- -

salome.sg.updateObjBrowser(1)

+

hyp2.SetMaxElementArea(2.)

 

-

Export of a Mesh

- -

 

+

# compute the mesh

-

import - salome

+

tria.Compute()

-

import geompy

+

PrintMeshInfo(tria)

-

import StdMeshers

+

 

-

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

+

Export of a Mesh

-

smeshgui = salome.ImportComponentGUI("SMESH")

+

import geompy

-

smeshgui.Init(salome.myStudyId);

+

import smesh

-

 

+

 

-

# create a box

+

# create a box

-

box = geompy.MakeBox(0., +

box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)

-

 

- -

# add the box to the study

- -

idbox = geompy.addToStudy(box, +

idbox = geompy.addToStudy(box, "box")

-

 

- -

# create a hypothesis

- -

print "-------------------------- - create Hypothesis"

- -

print "-------------------------- - NumberOfSegments"

- -

numberOfSegments - = 7

- -

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hypNbSeg.SetNumberOfSegments(numberOfSegments)

- -

print hypNbSeg.GetName()

- -

print hypNbSeg.GetId()

+

 

-

print hypNbSeg.GetNumberOfSegments()

+

# create a mesh

-

smeshgui.SetName(salome.ObjectToID(hypNbSeg), - "NumberOfSegments_10")

- -

print "-------------------------- - MaxElementArea"

- -

maxElementArea = - 800

- -

hypArea = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hypArea.SetMaxElementArea(maxElementArea)

- -

print hypArea.GetName()

- -

print hypArea.GetId()

- -

print hypArea.GetMaxElementArea()

- -

smeshgui.SetName(salome.ObjectToID(hypArea), - "MaxElementArea_500")

- -

print "-------------------------- - MaxElementVolume"

- -

maxElementVolume - = 900

- -

hypVolume = smesh.CreateHypothesis("MaxElementVolume", - "libStdMeshersEngine.so")

- -

hypVolume.SetMaxElementVolume(maxElementVolume)

- -

print hypVolume.GetName()

- -

print hypVolume.GetId()

- -

print hypVolume.GetMaxElementVolume()

- -

smeshgui.SetName(salome.ObjectToID(hypVolume), - "MaxElementVolume_500")

- -

 

- -

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

print "-------------------------- - Regular_1D"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

- -

print "-------------------------- - MEFISTO_2D"

- -

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(mefisto2D), - "MEFISTO_2D")

- -

 

- -

# initialize a mesh with - the box

- -

mesh = smesh.CreateMesh(box)

- -

smeshgui.SetName(salome.ObjectToID(mesh), +

tetra = smesh.Mesh(box, "MeshBox")

-

 

- -

# add the hypothesis to - the box

+

 

-

print "-------------------------- - add hypothesis to the box"

+

algo1D = tetra.Segment()

-

mesh.AddHypothesis(box,hypNbSeg)

+

algo1D.NumberOfSegments(7)

-

mesh.AddHypothesis(box,hypArea)

+

 

-

mesh.AddHypothesis(box,hypVolume)

+

algo2D = tetra.Triangle()

-

mesh.AddHypothesis(box,regular1D)

+

algo2D.MaxElementArea(800.)

-

mesh.AddHypothesis(box,mefisto2D)

- -

 

+

 

-

# compute the mesh

+

algo3D = tetra.Tetrahedron(smesh.NETGEN)

-

print "-------------------------- - compute the mesh of the box"

+

algo3D.MaxElementVolume(900.)

-

ret = smesh.Compute(mesh,box)

+

 

-

print ret

+

# compute the mesh

-

if ret == 0:

+

tetra.Compute()

-

    print - "probleme when computing the mesh"

+

 

-

salome.sg.updateObjBrowser(1)

+

# export the mesh in a + MED file

-

mesh.ExportMED("/tmp/meshMED.med",0)

- -

 

- -

 

+

tetra.ExportMED("/tmp/meshMED.med", + 0)

+ -

Extrusion along a path

+

Extrusion along a path

-

In principle, Extrusion along a path works in the same way as Extrusion, +

In principle, Extrusion along a path + works in the same way as Extrusion, the main difference is that we define not a vector, but a path of extrusion - which must be a meshed edge or wire. To get an idea of how this algorithm - works, let's see the left image, where we have a 1D circle edge and  a - 2D hexagon to be extruded along this path (in the picture they are angular - because we show the wireframe of the mesh). And now let's see the right - image, showing the result of the operation.  

+ which must be a meshed edge. To get an idea of how this algorithm works, + examine several examples, starting from the most simple case of extrusion + along a straight edge. In all examples the same mesh will be extruded + along different paths and with different parameters. This sample 2D mesh + has two quadrangle faces and seven edges. Look at the picture, where white + digits are the node numbers and green are the element numbers:

+ +

.

 

- --+
    + +
  • Extrusion along + a straight edge (not using base point or angles)

  • +
+ +
++- - - + + +
-

-

+

+

-

 

+

   

+ +

The left image shows a 1D path mesh, built + on a linear edge, and the initial 2D mesh. The right image shows the result + of extrusion of two edges (#1 and #2) of the initial mesh along the path. + Node #1 of path mesh has been selected as Start + node.

+ +

 

+ +
    + +
  • Extrusion along + a curvilinear edge (with and without angles)

  • +
+ + ++++ + + + + + + + + + +
+

+

+

+

The left image shows a 1D path mesh, built on curvilinear edge, and + the initial  2D + mesh.

+

The central image shows the result of extrusion of one edge (#2) of + the initial mesh along the path.  Node + #1 of path mesh has been selected as Start + node.

+

The same, but using angles {45, 45, 45, 0, -45, -45, -45}

+ +

 

+ +
    + +
  • Extrusion + along a sub-mesh.

  • +
+ + +++ + + + +
+

+

-

     

+

 

+ +

In this example the path mesh has been built + on a wire (polyline with six edges). The first edge of the wire was used + as Shape (edge), node #1 as Start node. The angles have been defined + as {10, 10, 10}. The middle edge (#4) of the initial mesh has been extruded.

+ +

 

+ +
    + +
  • Extrusion + of 2d elements along a sub-mesh.

  • +
+ + +++ + + + +
+

+

+ +

 

+ +

This extrusion bases on the same path mesh + as in the previous example but the third edge of the wire was set as Shape (edge) and node #4 as Start + node. Please note, that the extrusion has been done in direction + from node #4 to node #3, i.e. against the wire direction. In this example + both faces of the initial mesh have been extruded.

+ +

 

+ +
    + +
  • Extrusion of 2d elements + along a closed path.

  • +
+ + ++++ + + + + + + + + + +
+

+

+

+

The left image shows a path mesh built on a closed edge (circle).

+

The central image shows the result of extrusion of both faces of the + initial mesh. Note, that no sewing has been done, so, there are six coincident + nodes and two coincident faces in the resulting mesh.

+

The same, but using angles {45, -45, 45, -45, 45, -45, 45, -45}

+ +

 

 

To use Extrusion along a path:

-

1. From the Modification +

1. From the Modification menu choose the Extrusion along - a path item or click button in the toolbar. The + a path item or click button in the toolbar. The following dialog box will appear:

-

 

+

 

+ style="margin-left: 80px;">

-

 

+

 

-

2. In the dialog box you should  

+

2. In the dialog box you should  

-