Sweep
Sweep one or several faces along a spine curve into a solid in 3D.
Syntax
model.component(<ctag>).geom(<tag>).create(<ftag>,"Sweep");
model.component(<ctag>).geom(<tag>).feature(<ftag>).selection(property);
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>,"Sweep") to sweep faces along a spine curve.
Use model.component(<ctag>).geom(<tag>).feature(<ftag>).selection("face") to select the faces to sweep.
Use model.component(<ctag>).geom(<tag>).feature(<ftag>).selection("edge") to select the edges to sweep along.
Use model.component(<ctag>).geom(<tag>).feature(<ftag>).selection("diredge") to select the edge whose direction defines the positive sweep direction. If this selection is empty, it is automatically set when the edge selection is set. The diredge selection can be empty if the edge selection contains a single edge.
The following properties are available:
noadjust | adjustspine | moveface
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.
bezier | spline
on | off
on | off
arclength | normalizedarclength | internal
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.
on | off
The expressions in scale and twist can contain functions defined in the model. If the definition of such a function is changed, the swept object is not automatically rebuilt. Use model.component(<ctag>).geom(<tag>).feature(<ftag>).importData() to rebuild the swept object after such a change.
If includefinal is off, input objects are automatically removed in the Finalize (Form Union/Assembly) operation if they are completely used by this feature. Objects used in face are considered completely used if they contain a single face. Objects used in edge are considered completely used if they contain no faces and all their edges are included in edge. If an object is considered completely used by one property but not completely used by another property, the object is not removed in the Finalize operation. If includefinal is on, input objects are not removed in the Finalize operation.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
The following attributes are available:
Table 3-162: Valid attributes
on | off | inherit
Designate the resulting objects as construction geometry. Use inherit to set the construction geometry attribute only if all input objects are construction geometry.
Compatibility
In COMSOL Multiphysics 4.2a and earlier versions, the  positive sweep direction was defined as the curve direction instead of the edge direction.
Example
Create a half torus about the y-axis using a sweep operation:
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("wp1","WorkPlane");
g.feature("wp1").geom().create("c1","Circle");
g.create("pc1","ParametricCurve");
g.create("swe1","Sweep");
g.feature("pc1").set("parmax","pi");
g.feature("pc1").set("coord",new String[]{"(cos(s)-1)*3","0","sin(s)*3"});
g.feature("swe1").selection("face").set("wp1.c1", new int[]{1});
g.feature("swe1").selection("edge").set("pc1(1)",new int[]{1});
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('wp1','WorkPlane');
g.feature('wp1').geom.create('c1','Circle');
g.create('pc1','ParametricCurve');
g.create('swe1','Sweep');
g.feature('pc1').set('parmax','pi');
g.feature('pc1').set('coord',{'(cos(s)-1)*3','0','sin(s)*3'});
g.feature('swe1').selection('face').set('wp1.c1', 1);
g.feature('swe1').selection('edge').set('pc1(1)', 1);
g.run;
See Also
Extrude, Helix, Revolve, WorkPlane