Cone
Create a right circular cone or cone frustum (conical frustum, truncated cone) in 3D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Cone");
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>,"Cone") to create a cone. The following properties are available:
arctan(1/2) (about 26.565 degrees)
Direction of the 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
The color to use. Active when color is set to custom.
on | off
on | off
on | off
angle | radius
If axistype is angle, the radius of the top circle is given by the ang property. If axistype is radius, the radius of the top circle is given by the rtop property.
solid | surface
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.
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.
The following attributes are available:
Table 3-51: Valid attributes
on | off
Compatibility
model.component(<ctag>).geom(<tag>).create(<ftag>,"cone3") creates a solid cone.
model.component(<ctag>).geom(<tag>).create(<ftag>,"cone2") creates a surface cone.
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
Create a cone with an apex:
Code for Use with Java
Model model = ModelUtil.create("Model1");
model.component().create("comp1");
double h = 3;
double r = 2;
GeomSequence g = model.component("comp1").geom().create("geom1",3);
g.angularUnit("rad");
g.create("c1","Cone");
g.feature("c1").set("r",r);
g.feature("c1").set("h",h);
g.feature("c1").set("ang", Math.atan(r/h));
double ang = g.feature("c1").getDouble("ang");
Code for Use with MATLAB
model = ModelUtil.create('Model1');
model.component.create('comp1');
h = 3;
r = 2;
g = model.component('comp1').geom.create('geom1',3);
g.angularUnit('rad');
g.create('c1','Cone');
g.feature('c1').set('r',r);
g.feature('c1').set('h',h);
g.feature('c1').set('ang', atan2(r,h));
ang = g.feature('c1').getDouble('ang');
Create a truncated and rotated cone:
Code for Use with Java
g.create("c2","Cone");
g.feature("c2").set("pos", "1 -2 4");
g.feature("c2").set("axis", "1 -1 0.3");
g.feature("c2").set("rot",Math.PI/3);
g.run();
Code for Use with MATLAB
g.create('c2','Cone');
g.feature('c2').set('pos', '1 -2 4');
g.feature('c2').set('axis', '1 -1 0.3');
g.feature('c2').set('rot', pi/3);
g.run;
See Also
Cylinder, ECone