mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-29 05:30:33 +05:00
52977: Find Element by Point does not find supporting node of Ball element at group of balls selection
+ minor changes in sample scripts
This commit is contained in:
parent
a6bce4daba
commit
1a82677a35
@ -62,8 +62,7 @@ def group(name, shape, type, base=None, direction=None):
|
|||||||
t = geompy.ShapeType[type]
|
t = geompy.ShapeType[type]
|
||||||
g = geompy.CreateGroup(shape, t)
|
g = geompy.CreateGroup(shape, t)
|
||||||
|
|
||||||
geompy.addToStudy(g, name)
|
geompy.addToStudyInFather(shape, g, name)
|
||||||
g.SetName(name)
|
|
||||||
|
|
||||||
if base!=None:
|
if base!=None:
|
||||||
l = geompy.GetShapesOnPlaneWithLocationIDs(shape, t, direction, base, GEOM.ST_ON)
|
l = geompy.GetShapesOnPlaneWithLocationIDs(shape, t, direction, base, GEOM.ST_ON)
|
||||||
@ -87,12 +86,12 @@ geompy.DifferenceList(group_1, [group_1_box])
|
|||||||
|
|
||||||
smesh.SetCurrentStudy(salome.myStudy)
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
def discretize(x, y, z, n, s=blocks):
|
def discretize(x, y, z, nbSeg, shape=blocks):
|
||||||
p = geompy.MakeVertex(x, y, z)
|
vert = geompy.MakeVertex( x, y, z )
|
||||||
e = geompy.GetEdgeNearPoint(s, p)
|
edge = geompy.GetEdgeNearPoint( shape, vert )
|
||||||
a = hexa.Segment(e)
|
algo = hexa.Segment( edge )
|
||||||
a.NumberOfSegments(n)
|
algo.NumberOfSegments( nbSeg )
|
||||||
a.Propagation()
|
algo.Propagation()
|
||||||
|
|
||||||
hexa = smesh.Mesh(blocks)
|
hexa = smesh.Mesh(blocks)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ smesh = smeshBuilder.New(salome.myStudy)
|
|||||||
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
||||||
face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
|
face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
|
||||||
|
|
||||||
# generate 3D mesh
|
# generate a prismatic 3D mesh
|
||||||
mesh = smesh.Mesh(box)
|
mesh = smesh.Mesh(box)
|
||||||
localAlgo = mesh.Triangle(face)
|
localAlgo = mesh.Triangle(face)
|
||||||
mesh.AutomaticHexahedralization()
|
mesh.AutomaticHexahedralization()
|
||||||
@ -44,4 +44,4 @@ nodeIds = nGroup.GetIDs()[-10:]
|
|||||||
newMesh = smesh.CopyMesh( mesh.GetIDSource( nodeIds, SMESH.NODE), "some nodes copy")
|
newMesh = smesh.CopyMesh( mesh.GetIDSource( nodeIds, SMESH.NODE), "some nodes copy")
|
||||||
|
|
||||||
# 6. copy a sub-mesh
|
# 6. copy a sub-mesh
|
||||||
newMesh = smesh.CopyMesh( subMesh, "submesh copy" )
|
newMesh = smesh.CopyMesh( subMesh, "sub-mesh copy" )
|
||||||
|
@ -4481,12 +4481,14 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID
|
|||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
SMESH::long_array_var res = new SMESH::long_array;
|
SMESH::long_array_var res = new SMESH::long_array;
|
||||||
|
|
||||||
|
if ( type != SMESH::NODE )
|
||||||
|
{
|
||||||
SMESH::array_of_ElementType_var types = elementIDs->GetTypes();
|
SMESH::array_of_ElementType_var types = elementIDs->GetTypes();
|
||||||
if ( types->length() == 1 && // a part contains only nodes or 0D elements
|
if ( types->length() == 1 && // a part contains only nodes or 0D elements
|
||||||
( types[0] == SMESH::NODE || types[0] == SMESH::ELEM0D || types[0] == SMESH::BALL) &&
|
( types[0] == SMESH::NODE || types[0] == SMESH::ELEM0D || types[0] == SMESH::BALL) &&
|
||||||
type != types[0] ) // but search of elements of dim > 0
|
type != types[0] ) // but search of elements of dim > 0
|
||||||
return res._retn();
|
return res._retn();
|
||||||
|
}
|
||||||
if ( SMESH::DownCast<SMESH_Mesh_i*>( elementIDs )) // elementIDs is the whole mesh
|
if ( SMESH::DownCast<SMESH_Mesh_i*>( elementIDs )) // elementIDs is the whole mesh
|
||||||
return FindElementsByPoint( x,y,z, type );
|
return FindElementsByPoint( x,y,z, type );
|
||||||
|
|
||||||
@ -4500,7 +4502,8 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID
|
|||||||
SMESHDS_Mesh* meshDS = SMESH::DownCast<SMESH_Mesh_i*>( mesh )->GetImpl().GetMeshDS();
|
SMESHDS_Mesh* meshDS = SMESH::DownCast<SMESH_Mesh_i*>( mesh )->GetImpl().GetMeshDS();
|
||||||
|
|
||||||
if ( !idSourceToSet( elementIDs, meshDS, elements,
|
if ( !idSourceToSet( elementIDs, meshDS, elements,
|
||||||
SMDSAbs_ElementType(type), /*emptyIfIsMesh=*/true))
|
( type == SMESH::NODE ? SMDSAbs_All : (SMDSAbs_ElementType) type ),
|
||||||
|
/*emptyIfIsMesh=*/true))
|
||||||
return res._retn();
|
return res._retn();
|
||||||
|
|
||||||
typedef SMDS_SetIterator<const SMDS_MeshElement*, TIDSortedElemSet::const_iterator > TIter;
|
typedef SMDS_SetIterator<const SMDS_MeshElement*, TIDSortedElemSet::const_iterator > TIter;
|
||||||
|
Loading…
Reference in New Issue
Block a user