Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
LiveLink for Matlab: access the edge of a Bezier curve
Posted 2016年10月24日 GMT-4 05:34 Interfacing, Geometry Version 5.2 1 Reply
Please login with a confirmed email address before reporting spam
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 :-)
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 :-)
1 Reply Last Post 2016年11月3日 GMT-4 08:30