Code covered by the BSD License  

Highlights from
RF Utilities V1.2

image thumbnail
from RF Utilities V1.2 by Neill Tucker
Routines for Smith Chart, TDR, Mixed-Mode S-params, Matching

dxftest2.m
% DXF Test2
%
% 3D Geometry, define two 10x10x10 cubes, 
% lower left corners at (0,0,0) and (30,30,30)
% 
% See setfname.m for the default DXF filename, 
% to change it, open the file and edit.

clc;
close all;
help dxftest2;

% Define 1st 10x10x10 cube

% Side1
X1=[0,10,10,0 ,0];
Y1=[0, 0,10,10,0];
Z1=[0,0 ,0 ,0 ,0];

% Side2
X2=[0,10,10,0 ,0];
Y2=[0,0 ,0 ,0 ,0];
Z2=[0,0 ,10,10,0];

% Side3
X3=[0,0 ,0 ,0 ,0];
Y3=[0,10,10,0 ,0];
Z3=[0,0 ,10,10,0];

% Construct cube1 by move-copying sides1/2/3 to make the other 3 sides.
%    Side1---Copy       Side2---Copy       Side3---Copy
Xc1=[X1,-1e6,X1   ,-1e6,X2,-1e6,X2,   -1e6,X3,-1e6,X3+10];
Yc1=[Y1,-1e6,Y1   ,-1e6,Y2,-1e6,Y2+10,-1e6,Y3,-1e6,Y3   ];
Zc1=[Z1,-1e6,Z1+10,-1e6,Z2,-1e6,Z2,   -1e6,Z3,-1e6,Z3   ];

% Construct cube2 by move-copying cube1 by 30,30,30
Xc2=Xc1+30;
Yc2=Yc1+30;
Zc2=Zc1+30;

% Constuct complete list for the 2 cubes
Xc=[Xc1,-1e6,Xc2];
Yc=[Yc1,-1e6,Yc2];
Zc=[Zc1,-1e6,Zc2];

filename=setfname;
mat2dxfp(Xc,Yc,Zc,5,'MYPOLY',filename)

Contact us at files@mathworks.com