Sphere
Create a solid ball, surface sphere, or bounding ball in 3D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Sphere");
model.component(<ctag>).geom(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getType(property);
model.component(<ctag>).geom(<tag>).feature(<ftag>).setAttribute(attribute,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getAttribute(attribute);
Description
Use model.component(<ctag>).geom(<tag>).create(<ftag>,"Sphere") to create a sphere. The following properties are available:
Direction of the local z-axis. Vector has length 3 if axistype is cartesian, and length 2 if axistype is spherical.
x | y | z | cartesian | spherical
none | custom | integer between 1 and the number of colors in the current theme
on | off
The color to use. Active when color is set to custom.
size | bounding
coord | vertex
on | off
on | off
on | off
all | obj | dom | bnd | edg | pnt | off
Show selections, if selresult is on, of resulting objects in physics, materials, and so on, or in part instances. obj is not available in a component’s geometry. dom, bnd, and edg are not available in all features.
solid | surface
this | part-instance feature
xyplane | work-plane feature
Work-plane feature that defines the coordinate system. The default, xyplane, is the global Cartesian coordinate system.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
manual | centroid
on | off
Keep input objects. Only used if input is an object selection.
The following attributes are available:
Table 3-162: Valid attributes
on | off
Compatibility
model.component(<ctag>).geom(<tag>).create(<ftag>,"sphere3") creates a solid sphere.
model.component(<ctag>).geom(<tag>).create(<ftag>,"sphere2") creates a surface sphere.
The following properties are also available:
Alias for axis when axistype is spherical.
Alias for axis when axistype is cartesian.
x, y, z
The property const is no longer available.
Example
The following commands create a surface and solid sphere, where the position and radius are defined differently:
Code for Use with Java
Model model = ModelUtil.create("Model1");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1",3);
g.create("s2","Sphere");
g.feature("s2").set("type","surface");
g.feature("s2").set("pos","0 1 0");
g.create("s3","Sphere");
g.feature("s3").set("r",4);
g.run();
Code for Use with MATLAB
model = ModelUtil.create('Model1');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1',3);
g.create('s2','Sphere');
g.feature('s2').set('type','surface');
g.feature('s2').set('pos','0 1 0');
g.create('s3','Sphere');
g.feature('s3').set('r',4);
g.run;
See Also
Ellipsoid