Retrieving Geometry Information
With the function mphgeominfo you can access detailed information of a geometry object as well its data.
To get the information of a geometry object enter the command:
info = mphgeominfo(model, <geomtag>);
where <geomtag> is the tag of either a geometry node or a part geometry node you want the information from. In case of the model has only geometry node, the tag <geomtag> is optional.
The output info is a MATLAB® structure. The default fields available in the structure are listed in the table:
In addition to geometry information, you can retrieve geometric entity data, such as local parameters, coordinates, curvature, up and down domain indices, and so on. To get the geometry data enter:
[info, data] = mphgeominfo(model, <geomtag>, 'entity', <entitytype>);
where <entitytype> is the type of the entity to get the data from. It can be either 'face', 'edge', or 'vertex'.
data is a MATLAB structure which fields depend on the entity type. These are listed in the table below:
In addition you can specify a selection of the entity type to get the data from as in the command below:
[info, data] = mphgeominfo(model, <geomtag>, ...
  'entity', <entitytype>, 'selection', <sel>);
where <sel> is an array of entity numbers.
The geometric data are evaluated within the local parameter range on a structured grid for faces or interval for edge, with default sizes of 10-by-10 and 10, respectively. To change the size of geometric data evaluation point use the steps property as in the command below:
[info, data] = mphgeominfo(model, <geomtag>, ...
  'entity', <entitytype>, 'selection', <sel>, 'steps', <steps>);
where <steps> is an integer or a NxM integer array for a face type in case you need to evaluate the data on an uneven grid.
Retrieving Geometry Information
This example shows how to use mphgeominfo to retrieve geometry information.
First create a simple 3D geometry:
model = ModelUtil.create('Model');
comp1 = model.component.create('comp1',true);
 
geom1 = comp1.geom.create('geom1', 3);
geom1.feature.create('blk1','Block');
geom1.feature.create('con1','Cone');
geom1.run;
To visualize the geometry in a MATLAB figure window enter:
mphgeom(model)
As only one geometry node is available in the model, to access the geometry information enter:
info = mphgeominfo(model)
To determine the space dimension of the geometry, enter:
info.sdim
To inquire about the number of domains and the number of boundaries:
info.Ndomains
info.Nboundaries
The bounding box coordinates of the geometry are accessible using:
info.boundingbox
To get the geometry data for the face number 1 enter the command:
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'face',...
  'selection', 1);
To get the range of the surface parameters enter:
data.paramrange
this returns a 4-by-1 array following the given format: [s1min; s1max; s2min; s2max] where s1min and s1max are the minimum, and maximum respectively, of the first surface parameter. s2min and s2max are the minimum, and maximum respectively, of the second surface parameter.
To evaluate the face coordinates, in the global coordinate system, enter:
data.facex
The face coordinates are evaluated with the local parameter range on a 10 x 10 points grid. If you want to reduce or increase the size of evaluation grid, use the property 'steps'. For instance to evaluate the face coordinates on a 5 x 10 grid enter:
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'face',...
  'selection', 1,'steps', [5 10]);
To get the parameter range of an edge and, for example, to get the length of edge number 3, enter:
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'edge',...
  'selection', 3);
paramrange = data.paramrange;
edgelength = paramrange(end)
To get the coordinates and the curvature data at the middle of edge number 3 enter:
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'edge',...
  'selection', 3,'steps', 1);
pt = data.edgex
curvature = data.edgecurvature
Code for use with MATLAB®
model = ModelUtil.create('Model');
comp1 = model.component.create('comp1',true);
geom1 = comp1.geom.create('geom1', 3);
geom1.feature.create('blk1','Block');
geom1.feature.create('con1','Cone');
geom1.run;
mphgeom(model)
info = mphgeominfo(model);
info.sdim
info.Ndomains
info.Nboundaries
info.boundingbox
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'face',...
'selection', 1);
data.paramrange
data.facex
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'face',...
'selection', 1,'steps', [5 10]);
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'edge',...
'selection', 3);
paramrange = data.paramrange;
edgelength = paramrange(end)
[info, data] = mphgeominfo(model, 'geom1', 'entity', 'edge',...
'selection', 3,'steps', 1);
pt = data.edgex
curvature = data.edgecurvature