BallSelection, BoxSelection, CylinderSelection, Disk Selection
Create selections of geometric entities or objects that (partly) lie inside a ball, box, cylinder, or disk.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"BallSelection");
model.component(<ctag>).geom(<tag>).create(<ftag>,"BoxSelection");
model.component(<ctag>).geom(<tag>).create(<ftag>,"CylinderSelection");
model.component(<ctag>).geom(<tag>).create(<ftag>,"DiskSelection");
model.component(<ctag>).geom(<tag>).set(property,<value>);
model.component(<ctag>).geom(<tag>).getType(property);
Description
The following general properties are available:
none | custom | integer between 1 and the number of colors in the current theme
intersects | inside | somevertex | allvertices
The color to use. Active when color is set to custom.
-1 | 0 | 1 | 2 | 3
on | off
all | selections
on | off
on | off
For BallSelection, you define the ball using the following properties (using the geometry sequence’s length unit):
For BoxSelection, you define the box using the following properties (using the geometry sequence’s length unit):
For CylinderSelection, you define the cylinder using the following properties (using the geometry sequence’s length unit):
Direction of cylinder axis. Vector has length 3 if axistype is cartesian and length 2 is axistype is spherical. Not used if axistype is x, y, or z.
x | y | z | cartesian | spherical
Type of axis or coordinate system used for axis. The value is synchronized with axis.
For DiskSelection, you define the disk using the following properties (using the geometry sequence’s length unit):
You select the input entities or objects to select among using the properties entitydim, inputent, and input. For a boundary or edge selection in 2D or 3D, you can force the selection to select whole groups of entities by setting the property groupcontang to on. Each group consists of adjacent entities that meet at an angle less than angletol.
The output entities/objects are determined by the property condition:
intersects: All entities/objects that intersect the ball/box/cylinder are included.
inside: All entities/objects that are completely inside the ball/box/cylinder are included.
somevertex: All entities/objects that have at least one adjacent vertex inside the ball/box/cylinder are included.
allvertices: All entities/objects that have all adjacent vertices inside the ball/box/cylinder are included.
For intersects and inside, the rendering mesh is used for the calculation. You can set the resolution of the rendering mesh using
ModelUtil.setPreference("graphics.rendering.detail",<detail>);
where <detail> is coarse, normal, fine, or wireframe.
See Selections of Geometric Entities for general information about selections.
Example
In a 10-by-10 array of squares, delete the squares that lie in the box x>9.5, y>9.5.
Code for Use with Java
Model model = ModelUtil.create("Model");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1", 2);
g.create("sq1", "Square");
g.create("arr1", "Array");
g.feature("arr1").selection("input").set("sq1");
g.feature("arr1").set("fullsize", new int[]{10,10});
g.feature("arr1").set("displ", new double[]{2,2});
g.run("arr1");
g.create("boxsel1","BoxSelection");
g.feature("boxsel1").set("entitydim", -1);
g.feature("boxsel1").set("xmin", 9.5);
g.feature("boxsel1").set("ymin", 9.5);
g.create("del1", "Delete");
g.feature("del1").selection("input").init();
g.feature("del1").selection("input").named("boxsel1");
g.run("del1");
// g.objectNames().length = 75
Code for Use with MATLAB
model = ModelUtil.create('Model');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1', 2);
g.create('sq1', 'Square');
g.create('arr1', 'Array');
g.feature('arr1').selection('input').set('sq1');
g.feature('arr1').set('fullsize', [10,10]);
g.feature('arr1').set('displ', [2,2]);
g.run('arr1');
g.create('boxsel1','BoxSelection');
g.feature('boxsel1').set('entitydim', -1);
g.feature('boxsel1').set('xmin', 9.5);
g.feature('boxsel1').set('ymin', 9.5);
g.create('del1', 'Delete');
g.feature('del1').selection('input').init;
g.feature('del1').selection('input').named('boxsel1');
g.run('del1');
% length(g.objectNames)= 75
See Also
AdjacentSelection, ExplicitSelection, UnionSelection, IntersectionSelection, DifferenceSelection, ComplementSelection