BezierPolygon
Create a curve or solid polygon consisting of Bézier segments in 2D or 3D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"BezierPolygon");
model.component(<ctag>).geom(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).geom(<tag>).feature(<ftag>).getType(property);
Description
Use model.component(<ctag>).geom(<tag>).create(<ftag>,"BezierPolygon") to create a Bézier polygon or a line segment. The following properties are available
solid | open | closed
solid (2D)
open (3D)
Object type. solid is not available in 3D.
on | off
all | obj | dom | bnd | edg | pnt | off
dom in 2D; edg in 3D.
Show selections, if selresult is on, in physics, materials, and so on; in part instances; or in 3D from a plane geometry. 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
If type is open or closed, a curve consisting of line, quadratic, or cubic rational Bézier segments is constructed. If type is solid, the solid enclosed by such a closed polygon is constructed. If type is closed or solid, but the first and last control points are different, an extra linear segment is added to close the curve.
The degree of the nth segment is degree[n], and it must be 1 (linear), 2 (quadratic), or 3 (cubic). The nth segment has degree[n]+1 control points and weights. The weights are stored consecutively in the array w, which has length degree[0]+...+degree[N-1]+N, where N is the number of segments. The ith coordinates of the control points are stored consecutively in the array p[i]. Adjacent segments share the common control point, which means that p[i] has length degree[0]+...+degree[N-1]+1.
For a linear or cubic segment, the default weights are 1. For a quadratic segment, the default weights are 1, 1/, 1.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
Example
Construct a solid triangle b1 and an elliptic arc b2:
Code for Use with Java
Model model = ModelUtil.create("Model1");
model.component().create("comp1");
GeomSequence g = model.component("comp1").geom().create("geom1",2);
g.create("b1","BezierPolygon");
g.feature("b1").set("p", new double[][]{{0, 0, 2}, {1, 0 ,0}});
g.create("b2","BezierPolygon");
g.feature("b2").set("type","open");
g.feature("b2").set("degree",2);
g.feature("b2").set("p", new double[][]{{0, 1, 0}, {1, 2, 0}});
g.run();
Code for Use with MATLAB
model = ModelUtil.create('Model1');
model.component.create('comp1');
g = model.component('comp1').geom.create('geom1',2);
g.create('b1','BezierPolygon');
g.feature('b1').set('p', [[0, 0, 2]; [1, 0 ,0]]);
g.create('b2','BezierPolygon');
g.feature('b2').set('type','open');
g.feature('b2').set('degree',2);
g.feature('b2').set('p', [[0, 1, 0]; [1, 2,0]]);
g.run;
See Also
Polygon