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 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
|
#c_geometry.py
#header generated by Swig
import _PyNEC
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
import types
try:
_object = types.ObjectType
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
del types
#end of the header genrated by Swig
import exceptions
#class "c_geometry"
class c_geometry(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, c_geometry, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, c_geometry, name)
def __repr__(self):
return "<%s.%s; proxy of C++ c_geometry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def wire(*args):
"""
Add a wire to the geometry,
All co-ordinates are in meters.
void wire(int tag_id, int segment_count,
double xw1, double yw1, double zw1,
double xw2, double yw2, double zw2,
double rad, double rdel, double rrad)
\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
"""
if args[10]>0 and args[11]>0 :
return _PyNEC.c_geometry_wire(*args)
else:
error_msg = 'The last two parameters must both be greater than zero.'
raise exceptions.RuntimeError(error_msg)
def arc(*args):
"""
Add an arc to the geometry,
All co-ordinates are in meters.
void arc( int tag_id, int segment_count, double rada,
double ang1, double ang2, double rad )
\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.
"""
return _PyNEC.c_geometry_arc(*args)
def helix(*args):
"""
Add an helix to the geometry,
\remark The helix is a versatile element. For example, to generate a spiral printed circuit antenna, use a helix of zero height.
All co-ordinates are in meters.
void helix(int tag_id, int segment_count, double s, double hl, double a1, double b1,
double a2, double b2, double rad)
\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.
"""
return _PyNEC.c_geometry_helix(*args)
def move(*args):
"""
Move the structure with respect to its coordinate system or reproduces structure in new positions,
All co-ordinates are in meters and angles are in degrees.
void move( double rox, double roy, double roz, double xs,
double ys, double zs, int its, int nrpt, int itgi )
\param rox The angle in degrees through which the structure is rotated about the X-axis. A positive angle causes a right-hand rotation.
\param roy The angle of rotation about Y-axis.
\param roz 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.
"""
return _PyNEC.c_geometry_move(*args)
def scale(*args):
"""
Scale all dimensions of a structure by a constant.
void scale( double xw1)
\param xw1 All structure dimensions, including wire radius, are multiplied by xw1.
"""
return _PyNEC.c_geometry_scale(*args)
def reflect(*args):
"""
Reflects partial structure along x,y, or z axes.
void reflect_along_axis(int ix, int iy, int iz, int itx)
\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.
"""
return _PyNEC.c_geometry_reflect(*args)
def generate_cylindrical_structure(*args):
"""
Rotates structure along Z-axis to complete a symmetric structure.
void generate_cylindrical_structure(int itx, int nop)
\param itx The tag number increment.
\param nop The total number of times that the structure is to occur in the cylindrical array.
"""
return _PyNEC.c_geometry_generate_cylindrical_structure(*args)
def arbitrary_shaped_patch(*args):
"""
Add a arbitrary-shaped patch to the geometry
All coordinates are in meters, angles are in radians.
void arbitrary_shaped_patch( nec_float ax1, nec_float ay1, nec_float az1,
nec_float ax2, nec_float ay2, nec_float az2 )
\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 The elevation angle above the X-Y plane of outward normal vector.
\param ay2 The azimuth angle from X-axis of outward normal vector.
\param az2 The patch area if ny=1.
"""
return _PyNEC.c_geometry_arbitrary_shaped_patch(*args)
def rectangular_patch(*args):
"""
Add a rectangular patch to the geometry
All coordinates are in meters.
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 )
\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.
"""
return _PyNEC.c_geometry_rectangular_patch(*args)
def triangular_patch(*args):
"""
Add a triangular patch to the geometry
All coordinates are in meters.
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 )
\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.
"""
return _PyNEC.c_geometry_triangular_patch(*args)
def quadrilateral_patch(*args):
"""
Add a quadrilateral patch to the geometry
All coordinates are in meters.
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 )
\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.
"""
return _PyNEC.c_geometry_quadrilateral_patch(*args)
def multiple_patch(*args):
"""
Add a multiple patch to the geometry.
All coordinates are in meters.
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 )
\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.
"""
if args[1]>0 and args[2]>0:
return _PyNEC.c_geometry_multiple_patch(*args)
else:
error_msg='The first two parameters should both be greater than zero.'
raise exceptions.RuntimeError(error_msg)
def __init__(self, *args):
_swig_setattr(self, c_geometry, 'this', _PyNEC.new_c_geometry(*args))
_swig_setattr(self, c_geometry, 'thisown', 1)
def __del__(self, destroy=_PyNEC.delete_c_geometry):
try:
if self.thisown: destroy(self)
except: pass
class c_geometryPtr(c_geometry):
def __init__(self, this):
_swig_setattr(self, c_geometry, 'this', this)
if not hasattr(self,"thisown"): _swig_setattr(self, c_geometry, 'thisown', 0)
_swig_setattr(self, c_geometry,self.__class__,c_geometry)
_PyNEC.c_geometry_swigregister(c_geometryPtr)
|