Retrieving 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)
The model object contains general geometry information methods. For example, to determine the space dimension of the geometry, enter:
geom1.getSDim
There are also methods to determine the number of geometrical entities. For example, to inquire about the number of domains and the number of boundaries:
geom1.getNDomains
geom1.getNBoundaries
Another group of geometry information methods concern adjacency properties of the geometric entities. For example, the number of up and down domain information on each boundary:
geom1.getUpDown
There are also methods for evaluating properties such as coordinate values and curvatures on faces and edges. To get the range of the surface parameters of a given entity, use the method faceParamRange(N), where N is the face number. For example:
geom1.faceParamRange(1)
returns a 4x1 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 coordinates, in the global coordinate system, on face 1 for the face parameters (2, 50), enter:
geom1.faceX(1,[2,50])
To get the parameter range of an edge, use the edgeParamRange(N) method. For example, to get the length of edge number 3, enter:
edgeParamRange = geom1.edgeParamRange(3)
To get the coordinates and the curvature data at the middle of edge number 3 enter:
geom1.edgeX(3,edgeParam(2)/2)
geom1.edgeCurvature(2,edgeParam(2)/2)
There are also methods for getting information about the internal representation of the geometry. For example, the coordinates of the geometry vertices:
geom1.getVertexCoord
To fetch geometry information from elements in the geometry sequence, enter:
geom1.obj('blk1').getNBoundaries
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)
SDim = geom1.getSDim
NDomains = geom1.getNDomains
NBoundaries = geom1.getNBoundaries
UpDown = geom1.getUpDown
faceParamRange = geom1.faceParamRange(1)
faceX = geom1.faceX(1,[2,50])
edgeParamRange = geom1.edgeParamRange(3)
edgeX = geom1.edgeX(3,edgeParamRange(2)/2)
edgeCurvature = geom1.edgeCurvature(2,edgeParamRange(2)/2)
VertexCoord = geom1.getVertexCoord
objNBoundaries = geom1.obj('blk1').getNBoundaries