From: jfa Date: Thu, 8 Jun 2006 14:05:08 +0000 (+0000) Subject: Warn about direct SMESH idl usage: smesh python package have to be used where it... X-Git-Tag: V3_2_0 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=c46bd4f9bb602f9863c817bcd622b1b70d5af1e9 Warn about direct SMESH idl usage: smesh python package have to be used where it is possible. --- diff --git a/doc/salome/gui/SMESH/constructing_meshes.htm b/doc/salome/gui/SMESH/constructing_meshes.htm index ca895c640..d460c302f 100755 --- a/doc/salome/gui/SMESH/constructing_meshes.htm +++ b/doc/salome/gui/SMESH/constructing_meshes.htm @@ -89,8 +89,14 @@ if (window.writeIntopicBar)

Creating Meshes

+

At first see Example of 3d mesh generation, using smesh package. +

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

Construction of a Mesh

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

@@ -417,6 +423,9 @@ if (window.writeIntopicBar)

Editing of a mesh

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

 

import @@ -548,6 +557,9 @@ if (window.writeIntopicBar)

Export of a Mesh

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

 

import diff --git a/doc/salome/gui/SMESH/defining_hypotheses_tui.htm b/doc/salome/gui/SMESH/defining_hypotheses_tui.htm index 9ef8f93c3..3fe7884bd 100755 --- a/doc/salome/gui/SMESH/defining_hypotheses_tui.htm +++ b/doc/salome/gui/SMESH/defining_hypotheses_tui.htm @@ -858,6 +858,9 @@ if (window.writeIntopicBar)

Maximum Element Volume

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

@@ -1294,6 +1297,9 @@ if (window.writeIntopicBar)

Defining Meshing Algorithms

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

diff --git a/doc/salome/gui/SMESH/grouping_elements.htm b/doc/salome/gui/SMESH/grouping_elements.htm index 64da11cf2..822a2cfd3 100755 --- a/doc/salome/gui/SMESH/grouping_elements.htm +++ b/doc/salome/gui/SMESH/grouping_elements.htm @@ -181,6 +181,9 @@ if (window.writeIntopicBar)

Create a Group on Geometry

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

diff --git a/doc/salome/gui/SMESH/modifying_meshes.htm b/doc/salome/gui/SMESH/modifying_meshes.htm index 2d488e688..8708a02b0 100755 --- a/doc/salome/gui/SMESH/modifying_meshes.htm +++ b/doc/salome/gui/SMESH/modifying_meshes.htm @@ -1443,6 +1443,9 @@ if (window.writeIntopicBar)

Pattern Mapping

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

diff --git a/doc/salome/gui/SMESH/quality_controls.htm b/doc/salome/gui/SMESH/quality_controls.htm index b1dc4c472..2af942145 100755 --- a/doc/salome/gui/SMESH/quality_controls.htm +++ b/doc/salome/gui/SMESH/quality_controls.htm @@ -87,6 +87,9 @@ if (window.writeIntopicBar)

Free Borders

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

@@ -233,6 +236,9 @@ if (window.writeIntopicBar)

Borders at Multiconnection

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

@@ -399,6 +405,9 @@ if (window.writeIntopicBar)

Length 1D

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

 

import salome

@@ -561,6 +570,9 @@ if (window.writeIntopicBar)

Free Edges

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic

@@ -672,6 +684,9 @@ if (window.writeIntopicBar)

Length 2D

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

@@ -837,6 +852,9 @@ if (window.writeIntopicBar)

Borders at Multiconnection 2D

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

@@ -994,6 +1012,9 @@ if (window.writeIntopicBar)

Area

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic

@@ -1073,6 +1094,9 @@ if (window.writeIntopicBar)

Taper

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic

@@ -1152,6 +1176,9 @@ if (window.writeIntopicBar)

Aspect Ratio

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic

@@ -1231,6 +1258,9 @@ if (window.writeIntopicBar)

Minimum Angle

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

 

import SMESH

@@ -1312,6 +1342,9 @@ if (window.writeIntopicBar)

Warping

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic

@@ -1389,6 +1422,9 @@ if (window.writeIntopicBar)

Skew

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic

@@ -1468,6 +1504,9 @@ if (window.writeIntopicBar)

Aspect Ratio 3D

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import SMESH

import SMESH_mechanic_tetra

diff --git a/doc/salome/gui/SMESH/smesh_py_introduction.htm b/doc/salome/gui/SMESH/smesh_py_introduction.htm new file mode 100755 index 000000000..405ec0138 --- /dev/null +++ b/doc/salome/gui/SMESH/smesh_py_introduction.htm @@ -0,0 +1,208 @@ + + + + + +Introduction to MESH module python interface + + + + + + + + + + + +

Introduction to MESH module python interface

+ +

Package smesh provides a standard API for meshes creation and edition. +

Below you can see an example of package smesh usage for 3d mesh generation. +

  +

Example of 3d mesh generation with NETGEN

+ +
from geompy import * +
+
import smesh +
+
# Geometry +
# ======== +
+
# an assembly of a box, a cylinder and a truncated cone meshed with tetrahedral. +
+
# Define values +
# ------------- +
+
name = "ex21_lamp" +
+
cote = 60 +
+
section = 20 +
size = 200 +
+
radius_1 = 80 +
radius_2 = 40 +
height = 100 +
+
# Build a box +
# ----------- +
+
box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote) +
+
# Build a cylinder +
# ---------------- +
+
pt1 = MakeVertex(0, 0, cote/3) +
di1 = MakeVectorDXDYDZ(0, 0, 1) +
cyl = MakeCylinder(pt1, di1, section, size) +
+
# Build a truncated cone +
# ---------------------- +
+
pt2 = MakeVertex(0, 0, size) +
cone = MakeCone(pt2, di1, radius_1, radius_2, height) +
+
# Fuse +
# ---- +
+
box_cyl = MakeFuse(box, cyl) +
piece = MakeFuse(box_cyl, cone) +
+
# Add in study +
# ------------ +
+
addToStudy(piece, name) +
+
# Create a group of faces +
# ----------------------- +
+
group = CreateGroup(piece, ShapeType["FACE"]) +
+
group_name = name + "_grp" +
addToStudy(group, group_name) +
group.SetName(group_name) +
+
# Add faces in the group +
# ---------------------- +
+
faces = SubShapeAllIDs(piece, ShapeType["FACE"]) +
+
UnionIDs(group, faces) +
+
# Create a mesh +
# ============= +
+
# Define a mesh on a geometry +
# --------------------------- +
+
tetra = smesh.Mesh(piece, name) +
+
# Define 1D hypothesis +
# -------------------- +
+
algo1d = tetra.Segment() +
algo1d.LocalLength(10) +
+
# Define 2D hypothesis +
# -------------------- +
+
algo2d = tetra.Triangle() +
algo2d.LengthFromEdges() +
+
# Define 3D hypothesis +
# -------------------- +
+
algo3d = tetra.Tetrahedron(smesh.NETGEN) +
algo3d.MaxElementVolume(100) +
+
# Compute the mesh +
# ---------------- +
+
tetra.Compute() +
+
# Create a groupe of faces +
# ------------------------ +
+
tetra.Group(group) + + + + diff --git a/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html b/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html index 5b3964358..130b8881f 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html @@ -7,6 +7,9 @@

Package smesh

+Python package smesh defines several classes, destined for easy and clear mesh creation and edition. +

Example.

+

diff --git a/doc/salome/gui/SMESH/viewing_meshes.htm b/doc/salome/gui/SMESH/viewing_meshes.htm index b32bcc84a..a04fe708b 100755 --- a/doc/salome/gui/SMESH/viewing_meshes.htm +++ b/doc/salome/gui/SMESH/viewing_meshes.htm @@ -85,6 +85,9 @@ if (window.writeIntopicBar)

Viewing Mesh Infos

+

Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use smesh package. +
  +

import salome

import geompy

diff --git a/doc/salome/gui/SMESH/whdata/whtdata0.htm b/doc/salome/gui/SMESH/whdata/whtdata0.htm index 29ccd8d04..a39e4b369 100755 --- a/doc/salome/gui/SMESH/whdata/whtdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whtdata0.htm @@ -81,6 +81,7 @@ aTE(2,0,"Pattern mapping","pattern_mapping.htm"); aTE(2,0,"Access to Mesh module functionality from Python (using smesh.py)","smeshpy_doc/namespacesmesh.html"); aTE(1,7,"TUI Scripts"); + aTE(2,0,"Introduction to MESH module python interface","smesh_py_introduction.htm"); aTE(2,0,"Creating Meshes","constructing_meshes.htm"); aTE(2,0,"Defining Hypotheses","defining_hypotheses_tui.htm"); aTE(2,0,"Viewing Meshes","viewing_meshes.htm"); diff --git a/doc/salome/gui/SMESH/whgdata/whlstt9.htm b/doc/salome/gui/SMESH/whgdata/whlstt9.htm index 94e7f25a1..6b042d4c2 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt9.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt9.htm @@ -46,6 +46,7 @@ img {vertial-align:middle;}     Grouping elements
    Modifying meshes
    TUI Scripts
+       Introduction to MESH module python interface
       Creating Meshes
       Defining Hypotheses
       Viewing Meshes
diff --git a/doc/salome/gui/SMESH/whxdata/whtdata0.xml b/doc/salome/gui/SMESH/whxdata/whtdata0.xml index 3777dc98d..7f9178dda 100755 --- a/doc/salome/gui/SMESH/whxdata/whtdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whtdata0.xml @@ -80,6 +80,7 @@ +

Data Structures