Sweep
Sweep one or several faces, edges, or points along a spine curve into solids, surfaces, or curves 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, edges, or points along a spine curve.
Use to the following methods to set the dimension of the entities to sweep and to select the entities:
model.component(<ctag>).geom(<tag>).feature(<ftag>).
selection("enttosweep").init(
entDim);
model.component(<ctag>).geom(<tag>).feature(<ftag>).
selection("enttosweep").set(
<objname>,entities);
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:
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
Create cross-sectional faces. Only used if enttosweep has geometric entity level 2.
bezier | spline
on | off
on | off
on | off
on | off
on | off
arclength | normalizedarclength | internal
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.
on | off
on | off
on | off
none | projvector | curvature
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 enttosweep are considered completely used if all of their entities of the selected dimension (2, 1, or 0) are included in enttosweep. Objects used in edge are considered completely used if 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-164: 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("enttosweep").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('enttosweep').set('wp1.c1', 1);
g.feature('swe1').selection('edge').set('pc1(1)', 1);
g.run;
See Also
Extrude, Helix, Revolve, WorkPlane