Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 428

LiveLink for Matlab: access the edge of a Bezier curve

$
0
0
Hi everyone,

I'm trying to access a Bezier curve as an 'edge' in LiveLink for Matlab, but I cannot figure out how to do it. I want to create a sweep of a rectangle, following a Bezier curve 'b1'.
Here are some code and explanations:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% creation of Bezier curve 'b1'
model.geom('geom1').feature('wp3').geom.create('b1', 'BezierPolygon');
model.geom('geom1').feature('wp3').geom.feature('b1').set('p', {['-0.01295' '-0.01295';'0' '0.00466']});
model.geom('geom1').feature('wp3').geom.feature('b1').set('w', {'1' '1'});
model.geom('geom1').feature('wp3').geom.feature('b1').set('degree', {'1'});

% providing I have a face named 'r1', creation of a sweep of 'r1' following 'b1'
model.geom('geom1').create('swe1', 'Sweep');
model.geom('geom1').feature('swe1').label('Sweep 1');
model.geom('geom1').feature('swe1').set('crossfaces', true);
model.geom('geom1').feature('swe1').set('includefinal', false);
model.geom('geom1').feature('swe1').selection('face').set('wp2.r1', 1);
model.geom('geom1').feature('swe1').selection('edge').set( ??? );
model.geom('geom1').feature('swe1').selection('diredge').set( ??? );
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Now, what should I write instead of the '???' to have my sweep follow the curve 'b1' ?

Thanks in advance for your replies :-)

Viewing all articles
Browse latest Browse all 428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>