File: c_geometry.i

package info (click to toggle)
necpp 1.2.6%2Bcvs20070816-1.3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,772 kB
  • ctags: 5,989
  • sloc: cpp: 30,761; ansic: 10,162; fortran: 8,339; python: 2,948; makefile: 189; sh: 1
file content (274 lines) | stat: -rw-r--r-- 8,818 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
class c_geometry
{
public:
		
	/*! Add a wire to the geometry,

	All coordinates are in meters.

		\param tag_id The tag ID.
		\param segment_count The number of segments.
		
		\param xw1 The x coordinate of the wire starting point.
		\param yw1 The y coordinate of the wire starting point.
		\param zw1 The z coordinate of the wire starting point.
		
		\param xw2 The x coordinate of the wire ending point.
		\param yw2 The y coordinate of the wire ending point.
		\param zw2 The z coordinate of the wire ending point.
		
		\param rad The wire radius (meters)
		\param rdel For tapered wires, the. Otherwise set to 1.0
		\param rrad For tapered wires, the. Otherwise set to 1.0
	*/
	void wire( 	int tag_id, int segment_count,
			nec_float xw1, nec_float yw1, nec_float zw1,
			nec_float xw2, nec_float yw2, nec_float zw2,
			nec_float rad,
			nec_float rdel, nec_float rrad);
	
	
			
	/*! Add an arc to the geometry,

	All coordinates are in meters and angles are in degrees.

		\param tag_id The tag ID.
		\param segment_count The number of segments.
		
		\param rada The radius.
		\param ang1 The angle of the arc starting point.
		\param ang2 The angle of the arc end point.
		\param rad The wire radius.
	*/		
	void arc( int tag_id, int segment_count, nec_float rada,
			nec_float ang1, nec_float ang2, nec_float rad );
	
	
	
	/*! Add an helix to the geometry,

	\remark The helix is a versatile m_geometry->element. For example, to generate a spiral printed circuit antenna, use a helix of zero height.	

	All coordinates are in meters.
		
		\param tag_id The tag ID.
		\param segment_count The number of segments.
		\param s The turn spacing.
		\param h1 The total length of the helix (negative for a left-handed helix).
		
		\param a1 x-start radius.
		\param b1 y-start radius.
		
		\param a2 x-end radius.
		\param b2 y-end radius.
		
		\param rad The wire radius.
	*/		
	void helix( nec_float s, nec_float hl, nec_float a1, nec_float b1,
			nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id );
	
		
	
	/*! Scale all dimensions of a structure by a constant.
	
		\param xw1 All structure dimensions, including wire radius, are multiplied by xw1.
	*/
	void scale( nec_float xw1);
	
	
	%extend{
	
		/*! Move the structure with respect to its coordinate system or reproduces structure in new positions,
	
		All coordinates are in meters and angles are in degrees.
		
			\param rox_deg The angle in degrees through which the structure is rotated about the X-axis. A positive angle causes a right-hand rotation.  
			\param roy_deg The angle of rotation about Y-axis.
			\param roz_deg The angle of rotation about Z-axis.
			
			\param xs The x component of vector by which the structure is translated with respect to the coordinate system.
			\param ys The y component of vector by which the structure is translated.
			\param zs The z component of vector by which the structure is translated.
			
			\param its The tag number of the segments that will be moved. If its = 0 then the entire structure is moved.
			\param nrpt The number of new Structures to be generated.
			\param itgi The tag number increment. 
		*/	
		void move( nec_float rox_deg, nec_float roy_deg, nec_float roz_deg, nec_float xs,
			nec_float ys, nec_float zs, int its, int nrpt, int itgi )
		{
			nec_float rox_rad = degrees_to_rad(rox_deg);
			nec_float roy_rad = degrees_to_rad(roy_deg);
			nec_float roz_rad = degrees_to_rad(roz_deg);
			
			return self->move( rox_rad, roy_rad, roz_rad, xs, ys, zs, its, nrpt, itgi );
		}
			



		/*! Reflects partial structure along x,y, or z axes.
			
			\param ix If ix = 1 then the structure is reflected along X axis. 
			\param iy If iy = 1 then the structure is reflected along Y axis.
			\param iz If iz = 1 then the structure is reflected along Z axis.
			\param itx The tag number increment.	
		*/
		void reflect(int ix, int iy, int iz, int itx)
		{
			int nop = 100*ix + 10*iy + iz;
			return self->reflect(ix, iy, iz, itx, nop);
		}
		
		
		
		/*! Rotates structure along Z-axis to complete a symmetric structure.
		
			\param itx The tag number increment.
			\param nop The total number of times that the structure is to occur in the cylindrical array.  
		*/
		void generate_cylindrical_structure(int itx, int nop)
		{
			return self->reflect(-1, 0, 0, itx, nop);
		}
		
		
		
		/*! Add a arbitrary-shaped patch to the geometry
		
		All coordinates are in meters, angles are in degrees.
		
			\param ax1 The x-coordinate of patch center.
			\param ay1 The y-coordinate of patch center.
			\param az1 The z-coordinate of patch center.
			
			\param ax2_deg The elevation angle above the X-Y plane of outward normal vector.
			\param ay2_deg The azimuth angle from X-axis of outward normal vector.
			
			\param az2 The patch area if ny=1.			
		*/
		void arbitrary_shaped_patch( nec_float ax1, nec_float ay1, nec_float az1,
						nec_float ax2_deg, nec_float ay2_deg, nec_float az2 )
		{
			nec_float ax2_rad = degrees_to_rad(ax2_deg);
			nec_float ay2_rad = degrees_to_rad(ay2_deg);
			
			return self->patch( 0, 1, ax1, ay1, az1, ax2_rad, ay2_rad, az2, 0, 0, 0, 0, 0, 0 );
		}
		
		
		
		/*! Add a rectangular patch to the geometry
		
		All coordinates are in meters.		
			
			\param ax1 The x-coordinate of corner 1.
			\param ay1 The y-coordinate of corner 1.
			\param az1 The z-coordinate of corner 1.
			
			\param ax2 The x_coordinate of corner 2.
			\param ay2 The y_coordinate of corner 2.
			\param az2 The z-coordinate of corner 2.
			
			\param ax3 The x_coordinate of corner 3.
			\param ay3 The y_coordinate of corner 3.
			\param az3 The z_coordinate of corner 3.			
		*/
		void rectangular_patch( nec_float ax1, nec_float ay1, nec_float az1,
						nec_float ax2, nec_float ay2, nec_float az2,
						nec_float ax3, nec_float ay3, nec_float az3 )
		{
			return self->patch( 0, 2, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 );
		}
		
		
		
		/*! Add a triangular patch to the geometry
		
		All coordinates are in meters.		
			
			\param ax1 The x-coordinate of corner 1.
			\param ay1 The y-coordinate of corner 1.
			\param az1 The z-coordinate of corner 1.
			
			\param ax2 The x_coordinate of corner 2.
			\param ay2 The y_coordinate of corner 2.
			\param az2 The z-coordinate of corner 2.
			
			\param ax3 The x_coordinate of corner 3.
			\param ay3 The y_coordinate of corner 3.
			\param az3 The z_coordinate of corner 3.			
		*/
		void triangular_patch( nec_float ax1, nec_float ay1, nec_float az1,
						nec_float ax2, nec_float ay2, nec_float az2,
						nec_float ax3, nec_float ay3, nec_float az3 )
		{
			return self->patch( 0, 3, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 );
		}
		
		
		
		/*! Add a quadrilateral patch to the geometry
		
		All coordinates are in meters.		
			
			\param ax1 The x-coordinate of corner 1.
			\param ay1 The y-coordinate of corner 1.
			\param az1 The z-coordinate of corner 1.
			
			\param ax2 The x_coordinate of corner 2.
			\param ay2 The y_coordinate of corner 2.
			\param az2 The z-coordinate of corner 2.
			
			\param ax3 The x_coordinate of corner 3.
			\param ay3 The y_coordinate of corner 3.
			\param az3 The z_coordinate of corner 3.
			
			\param ax4 The x_coordinate of corner 4.
			\param ay4 The x_coordinate of corner 4.
			\param az4 The x_coordinate of corner 4.
		*/
		void quadrilateral_patch( nec_float ax1, nec_float ay1, nec_float az1,
						nec_float ax2, nec_float ay2, nec_float az2,
						nec_float ax3, nec_float ay3, nec_float az3,
						nec_float ax4, nec_float ay4, nec_float az4 )
		{
			return self->patch( 0, 4, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 );
		}
		
				
		
		/*! Add a multiple patch to the geometry.
		
		All coordinates are in meters.
		
			\param nx The rectangular surface is divided into nx patches from corner 1 to corner 2.
			\param ny The rectangular surface is divided into ny patches from corner 2 to corner 3.
			\param ax1 The x-coordinate of corner 1.
			\param ay1 The y-coordinate of corner 1.
			\param az1 The z-coordinate of corner 1.
			
			\param ax2 The x_coordinate of corner 2.
			\param ay2 The y_coordinate of corner 2.
			\param az2 The z-coordinate of corner 2.
			
			\param ax3 The x_coordinate of corner 3.
			\param ay3 The y_coordinate of corner 3.
			\param az3 The z_coordinate of corner 3.
			
			\param ax4 The x_coordinate of corner 4.
			\param ay4 The x_coordinate of corner 4.
			\param az4 The x_coordinate of corner 4.
		*/
		void multiple_patch( int nx, int ny,
			nec_float ax1, nec_float ay1, nec_float az1,
			nec_float ax2, nec_float ay2, nec_float az2,
			nec_float ax3, nec_float ay3, nec_float az3,
			nec_float ax4, nec_float ay4, nec_float az4 )
		{
			return self->patch( nx, ny, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 );
		}		
	}
				
};