mphselectcoords
Select a geometric entity using point coordinates.
Syntax
n = mphselectcoords(model,geomtag,coord,entity,...)
Description
n = mphselectcoords(model,geomtag,coord,entity,...) finds geometric entity numbers based on their vertex coordinates.
One or more coordinates can be provided. The function searches for vertices near these coordinates using a tolerance radius. The list of the entities that are adjacent to such vertices is returned.
coord is a NxM array where N correspond of the number of point to use and M the space dimension of the geometry.
entity can be one of point, edge, boundary or domain following the entity space dimension defined below:
domain: maximum geometry space dimension
boundary: maximum geometry space dimension -1
edges: 1(only for 3D geometry)
The function mphpselectcoords accepts the following property/value pairs:
all | any
When a model uses form an assembly, more than one vertex can have the same coordinate if the coordinate is shared by separate geometry objects. In that case you can use the adjnumber property to identify the domain that the vertices should be adjacent to.
The radius property is used to specify the radius of the sphere or circle that the search should be within. A small positive radius (based on the geometry size) is used by default in order to compensate for rounding errors.
Use the property include when two point coordinates are used. Set it to all to select objects within the search radius of all points. any returns objects within the search radius of any points.
Example
Find the geometric entity number:
model = mphopen('model_tutorial_llmatlab');
coord = [10e-3 0 10e-3;0 10e-3 10e-3];
n = mphselectcoords(model,'geom1',coord','point')
Return the indices of the point at coordinates within a search radius of 0.011:
n = mphselectcoords(model,'geom1',coord','point',...
'radius',0.011)
Return the indices of the boundaries that have a vertex within the search radius:
n = mphselectcoords(model,'geom1',coord','boundary',...
'radius',11e-3)
Return the indices of the edges that have a vertex within the search radius from all points:
coord = [5e-3 0 10e-3;0 5e-3 10e-3];
n = mphselectcoords(model,'geom1',coord','edge',...
'radius',6e-3);
Return the indices of the edges that have a vertex within the search radius from at least one point:
n = mphselectcoords(model,'geom1',coord','edge',...
'radius',6e-3,'include','any');
Find geometric entity index in an assembly
model = mphopen('model_tutorial_llmatlab');
geom = model.component('comp1').geom('geom1');
geom.feature('fin').set('action', 'assembly');
geom.run('fin');
Return the indices of the boundaries that have any vertices within the search range of a point:
coord = [0,0,10e-3];
n0 = mphselectcoords(model,'geom1',coord,'boundary')
Return the indices of the boundaries that also are adjacent to domain 1:
n1 = mphselectcoords(model,'geom1',coord,'boundary',...
'adjnumber',1);
Return the indices of the boundaries that also are adjacent to domain 2:
n1 = mphselectcoords(model,'geom1',coord,'boundary',...
'adjnumber',2);
See also
mphgetadj, mphgetcoords, mphselectbox, mphviewselection