Commit ef5fbe2b authored by Ruben Undheim's avatar Ruben Undheim

Merge tag 'upstream/0.0.35+git20181226.b37cb00+dfsg.2'

parents 11fee16f 94cdcb90
......@@ -10,6 +10,8 @@ PROJECT(CSXCAD CXX C)
cmake_minimum_required(VERSION 2.8)
set (CMAKE_CXX_FLAGS -fPIC )
# default
set(LIB_VERSION_MAJOR 0)
set(LIB_VERSION_MINOR 6)
......@@ -114,18 +116,11 @@ find_package(Boost 1.46 COMPONENTS
date_time
serialization
chrono
REQUIRED
)
# vtk
if (WIN32)
find_package(VTK 6.1 REQUIRED)
else()
# prefer >=6.1, fallback to >=5.4
find_package(VTK 6.1 COMPONENTS vtkIOGeometry vtkIOPLY NO_MODULE)
IF (NOT ${VTK_FOUND})
find_package(VTK REQUIRED)
endif()
endif()
find_package(VTK REQUIRED COMPONENTS vtkIOGeometry vtkIOPLY NO_MODULE)
message(STATUS "Found package VTK. Using version " ${VTK_VERSION})
include(${VTK_USE_FILE})
......
......@@ -8,11 +8,15 @@ function CSX = AddDump(CSX, name, varargin)
% 1 for H-field time-domain dump
% 2 for electric current time-domain dump
% 3 for total current density (rot(H)) time-domain dump
% 4 for D-field (electric flux density) time-domain dump
% 5 for B-field (magnetic flux density) time-domain dump
%
% 10 for E-field frequency-domain dump
% 11 for H-field frequency-domain dump
% 12 for electric current frequency-domain dump
% 13 for total current density (rot(H)) frequency-domain dump
% 14 for D-field (electric flux density) frequency-domain dump
% 15 for B-field (magnetic flux density) frequency-domain dump
%
% 20 local SAR frequency-domain dump
% 21 1g averaging SAR frequency-domain dump
......
......@@ -44,7 +44,7 @@ lines = sort(unique(lines));
range = lines(end)-lines(1);
if (~isempty(find(diff(lines)<range*1e-6)))
warning('CSXCAD:AutoSmoothMeshLines','some lines found with very small distance which may cause smoothing failure!');
warning('CSXCAD:AutoSmoothMeshLines','some lines found with very small distance which may cause smoothing failure');
end
methods = {};
......@@ -138,7 +138,7 @@ end
if ((allowed_min_res>0) && (results.min_res<allowed_min_res))
if (silent==0)
warning('CSXCAD:AutoSmoothMeshLines','method failed to obey allowed min res!');
warning('CSXCAD:AutoSmoothMeshLines','method failed to obey allowed min res');
end
quality = -1;
return
......@@ -152,7 +152,7 @@ if (results.max_res>max_res*1.01)
end
if (results.max_ratio>ratio*1.01)
if (silent==0)
warning('CSXCAD:AutoSmoothMeshLines',['method failed to fulfill the max. ratio: ' num2str(results.max_ratio) ' > ' num2str(ratio)]');
warning('CSXCAD:AutoSmoothMeshLines',['method failed to fulfill the max. ratio: ' num2str(results.max_ratio) ' > ' num2str(ratio)]);
end
quality = quality*(ratio/results.max_ratio);
end
......
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from libcpp.string cimport string
from libcpp cimport bool
from ParameterObjects cimport _ParameterSet, ParameterSet
from CSProperties cimport _CSProperties, CSProperties
from CSTransform cimport _CSTransform, CSTransform
from CSRectGrid cimport CoordinateSystem
cdef extern from "CSXCAD/CSPrimitives.h":
cpdef enum PrimitiveType "CSPrimitives::PrimitiveType":
POINT "CSPrimitives::POINT"
BOX "CSPrimitives::BOX"
MULTIBOX "CSPrimitives::MULTIBOX"
SPHERE "CSPrimitives::SPHERE"
SPHERICALSHELL "CSPrimitives::SPHERICALSHELL"
CYLINDER "CSPrimitives::CYLINDER"
CYLINDRICALSHELL "CSPrimitives::CYLINDRICALSHELL"
POLYGON "CSPrimitives::POLYGON"
LINPOLY "CSPrimitives::LINPOLY"
ROTPOLY "CSPrimitives::ROTPOLY"
POLYHEDRON "CSPrimitives::POLYHEDRON"
CURVE "CSPrimitives::CURVE"
WIRE "CSPrimitives::WIRE"
USERDEFINED "CSPrimitives::USERDEFINED"
POLYHEDRONREADER "CSPrimitives::POLYHEDRONREADER"
cdef extern from "CSXCAD/CSPrimitives.h":
cdef cppclass _CSPrimitives "CSPrimitives":
_CSPrimitives(_ParameterSet*, _CSProperties*) except +
unsigned int GetID()
int GetType()
string GetTypeName()
_CSProperties* GetProperty()
void SetPriority(int val)
int GetPriority()
bool Update(string *ErrStr)
bool GetBoundBox(double dBoundBox[6])
int GetDimension()
bool IsInside(double* Coord, double tol)
bool GetPrimitiveUsed()
void SetPrimitiveUsed(bool val)
void SetCoordinateSystem(CoordinateSystem cs_type)
CoordinateSystem GetCoordinateSystem()
_CSTransform* GetTransform()
cdef class CSPrimitives:
cdef _CSPrimitives *thisptr
cdef readonly CSTransform __transform
cdef readonly CSProperties __prop
cdef __GetProperty(self)
###############################################################################
cdef extern from "CSXCAD/CSPrimPoint.h":
cdef cppclass _CSPrimPoint "CSPrimPoint" (_CSPrimitives):
_CSPrimPoint(_ParameterSet*, _CSProperties*) except +
void SetCoord(int idx, double val)
double GetCoord(int idx)
cdef class CSPrimPoint(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimBox.h":
cdef cppclass _CSPrimBox "CSPrimBox" (_CSPrimitives):
_CSPrimBox(_ParameterSet*, _CSProperties*) except +
void SetCoord(int idx, double val)
double GetCoord(int idx)
cdef class CSPrimBox(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimCylinder.h":
cdef cppclass _CSPrimCylinder "CSPrimCylinder" (_CSPrimitives):
_CSPrimCylinder(_ParameterSet*, _CSProperties*) except +
void SetCoord(int idx, double val)
double GetCoord(int idx)
void SetRadius(double val)
double GetRadius()
cdef class CSPrimCylinder(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimCylindricalShell.h":
cdef cppclass _CSPrimCylindricalShell "CSPrimCylindricalShell" (_CSPrimCylinder):
_CSPrimCylindricalShell(_ParameterSet*, _CSProperties*) except +
void SetShellWidth(double val)
double GetShellWidth()
cdef class CSPrimCylindricalShell(CSPrimCylinder):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimSphere.h":
cdef cppclass _CSPrimSphere "CSPrimSphere" (_CSPrimitives):
_CSPrimSphere(_ParameterSet*, _CSProperties*) except +
void SetCenter(double x1, double x2, double x3)
double GetCoord(int idx)
void SetRadius(double val)
double GetRadius()
cdef class CSPrimSphere(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimSphericalShell.h":
cdef cppclass _CSPrimSphericalShell "CSPrimSphericalShell" (_CSPrimSphere):
_CSPrimSphericalShell(_ParameterSet*, _CSProperties*) except +
void SetShellWidth(double val)
double GetShellWidth()
cdef class CSPrimSphericalShell(CSPrimSphere):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimPolygon.h":
cdef cppclass _CSPrimPolygon "CSPrimPolygon" (_CSPrimitives):
_CSPrimPolygon(_ParameterSet*, _CSProperties*) except +
void AddCoord(double val)
double GetCoord(int index)
void ClearCoords()
size_t GetQtyCoords()
void SetNormDir(int ny)
int GetNormDir()
void SetElevation(double val)
double GetElevation()
cdef class CSPrimPolygon(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimLinPoly.h":
cdef cppclass _CSPrimLinPoly "CSPrimLinPoly" (_CSPrimPolygon):
_CSPrimLinPoly(_ParameterSet*, _CSProperties*) except +
void SetLength(double val)
double GetLength()
cdef class CSPrimLinPoly(CSPrimPolygon):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimRotPoly.h":
cdef cppclass _CSPrimRotPoly "CSPrimRotPoly" (_CSPrimPolygon):
_CSPrimRotPoly(_ParameterSet*, _CSProperties*) except +
void SetRotAxisDir(int ny)
int GetRotAxisDir()
void SetAngle(int index, double val)
double GetAngle(int index)
cdef class CSPrimRotPoly(CSPrimPolygon):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimCurve.h":
cdef cppclass _CSPrimCurve "CSPrimCurve" (_CSPrimitives):
_CSPrimCurve(_ParameterSet*, _CSProperties*) except +
size_t AddPoint(double *coords)
size_t GetNumberOfPoints()
bool GetPoint(size_t point_index, double point[3])
void ClearPoints()
cdef class CSPrimCurve(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimWire.h":
cdef cppclass _CSPrimWire "CSPrimWire" (_CSPrimCurve):
_CSPrimWire(_ParameterSet*, _CSProperties*) except +
void SetWireRadius(double val)
double GetWireRadius()
cdef class CSPrimWire(CSPrimCurve):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimPolyhedron.h":
cdef cppclass _CSPrimPolyhedron "CSPrimPolyhedron" (_CSPrimitives):
_CSPrimPolyhedron(_ParameterSet*, _CSProperties*) except +
void Reset()
void AddVertex(float px, float py, float pz)
float* GetVertex(unsigned int n)
unsigned int GetNumVertices()
void AddFace(int numVertex, int* vertices)
int* GetFace(unsigned int n, unsigned int &numVertices)
unsigned int GetNumFaces()
cdef class CSPrimPolyhedron(CSPrimitives):
pass
###############################################################################
cdef extern from "CSXCAD/CSPrimPolyhedronReader.h":
ctypedef enum FileType "CSPrimPolyhedronReader::FileType":
UNKNOWN "CSPrimPolyhedronReader::UNKNOWN"
STL_FILE "CSPrimPolyhedronReader::STL_FILE"
PLY_FILE "CSPrimPolyhedronReader::PLY_FILE"
cdef cppclass _CSPrimPolyhedronReader "CSPrimPolyhedronReader" (_CSPrimPolyhedron):
_CSPrimPolyhedronReader(_ParameterSet*, _CSProperties*) except +
void SetFilename(string name)
string GetFilename()
void SetFileType(FileType ft)
FileType GetFileType()
bool ReadFile()
cdef class CSPrimPolyhedronReader(CSPrimPolyhedron):
pass
This diff is collapsed.
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from libcpp.string cimport string
from libcpp.vector cimport vector
from libcpp cimport bool
from ParameterObjects cimport _ParameterSet, ParameterSet
from CSPrimitives cimport _CSPrimitives, CSPrimitives
from CSXCAD cimport ContinuousStructure
cdef extern from "CSXCAD/CSProperties.h":
cpdef enum PropertyType "CSProperties::PropertyType":
ANY "CSProperties::ANY"
UNKNOWN "CSProperties::UNKNOWN"
MATERIAL "CSProperties::MATERIAL"
METAL "CSProperties::METAL"
EXCITATION "CSProperties::EXCITATION"
PROBEBOX "CSProperties::PROBEBOX"
RESBOX "CSProperties::RESBOX"
DUMPBOX "CSProperties::DUMPBOX"
DISPERSIVEMATERIAL "CSProperties::DISPERSIVEMATERIAL"
LORENTZMATERIAL "CSProperties::LORENTZMATERIAL"
DEBYEMATERIAL "CSProperties::DEBYEMATERIAL"
DISCRETE_MATERIAL "CSProperties::DISCRETE_MATERIAL"
LUMPED_ELEMENT "CSProperties::LUMPED_ELEMENT"
CONDUCTINGSHEET "CSProperties::CONDUCTINGSHEET"
cdef extern from "CSXCAD/CSProperties.h":
cdef cppclass _CSProperties "CSProperties":
_CSProperties(_ParameterSet*) except +
int GetType()
string GetTypeString()
_ParameterSet* GetParameterSet()
void SetName(string name)
string GetName()
int GetQtyPrimitives()
_CSPrimitives* GetPrimitive(size_t index)
bool ExistAttribute(string name)
string GetAttributeValue(string name)
void AddAttribute(string name, string value)
void SetFillColor(unsigned char R, unsigned char G, unsigned char B, unsigned char a)
void SetEdgeColor(unsigned char R, unsigned char G, unsigned char B, unsigned char a)
cdef class CSProperties:
cdef _CSProperties *thisptr
cdef __SetPtr(self, _CSProperties *ptr)
cdef __GetPrimitive(self, size_t index)
cdef readonly ContinuousStructure __CSX
cdef readonly ParameterSet __paraset
cdef readonly list __primitives
##############################################################################
cdef extern from "CSXCAD/CSPropMaterial.h":
cdef cppclass _CSPropMaterial "CSPropMaterial" (_CSProperties):
_CSPropMaterial(_ParameterSet*) except +
void SetEpsilon(double val, int ny)
double GetEpsilon(int ny)
int SetEpsilonWeightFunction(string fct, int ny)
string GetEpsilonWeightFunction(int ny)
void SetMue(double val, int ny)
double GetMue(int ny)
int SetMueWeightFunction(string fct, int ny)
string GetMueWeightFunction(int ny)
void SetKappa(double val, int ny)
double GetKappa(int ny)
int SetKappaWeightFunction(string fct, int ny)
string GetKappaWeightFunction(int ny)
void SetSigma(double val, int ny)
double GetSigma(int ny)
int SetSigmaWeightFunction(string fct, int ny)
string GetSigmaWeightFunction(int ny)
void SetDensity(double val)
double GetDensity()
int SetDensityWeightFunction(string fct)
string GetDensityWeightFunction()
void SetIsotropy(bool val)
bool GetIsotropy()
cdef class CSPropMaterial(CSProperties):
pass
##############################################################################
cdef extern from "CSXCAD/CSPropLumpedElement.h":
cdef cppclass _CSPropLumpedElement "CSPropLumpedElement" (_CSProperties):
_CSPropLumpedElement(_ParameterSet*) except +
void SetResistance(double val)
double GetResistance()
void SetCapacity(double val)
double GetCapacity()
void SetInductance(double val)
double GetInductance()
void SetDirection(int ny)
int GetDirection()
void SetCaps(bool val)
int GetCaps()
cdef class CSPropLumpedElement(CSProperties):
pass
##############################################################################
cdef extern from "CSXCAD/CSPropMetal.h":
cdef cppclass _CSPropMetal "CSPropMetal" (_CSProperties):
_CSPropMetal(_ParameterSet*) except +
cdef class CSPropMetal(CSProperties):
pass
##############################################################################
cdef extern from "CSXCAD/CSPropConductingSheet.h":
cdef cppclass _CSPropConductingSheet "CSPropConductingSheet" (_CSPropMetal):
_CSPropConductingSheet(_ParameterSet*) except +
void SetConductivity(double val)
double GetConductivity()
void SetThickness(double val)
double GetThickness()
cdef class CSPropConductingSheet(CSPropMetal):
pass
##############################################################################
cdef extern from "CSXCAD/CSPropExcitation.h":
cdef cppclass _CSPropExcitation "CSPropExcitation" (_CSProperties):
_CSPropExcitation(_ParameterSet*) except +
void SetExcitType(int val)
int GetExcitType()
void SetExcitation(double val, int Component)
double GetExcitation(int Component)
void SetPropagationDir(double val, int Component)
double GetPropagationDir(int Component)
int SetWeightFunction(string fct, int ny)
string GetWeightFunction(int ny)
void SetFrequency(double val)
double GetFrequency()
void SetDelay(double val)
double GetDelay()
cdef class CSPropExcitation(CSProperties):
pass
##############################################################################
cdef extern from "CSXCAD/CSPropProbeBox.h":
cdef cppclass _CSPropProbeBox "CSPropProbeBox" (_CSProperties):
_CSPropProbeBox(_ParameterSet*) except +
void SetProbeType(int type)
int GetProbeType()
void SetWeighting(double weight)
double GetWeighting()
void SetNormalDir(unsigned int ndir)
int GetNormalDir()
size_t CountFDSamples()
vector[double]* GetFDSamples()
void ClearFDSamples()
void AddFDSample(double freq)
cdef class CSPropProbeBox(CSProperties):
pass
##############################################################################
cdef extern from "CSXCAD/CSPropDumpBox.h":
cdef cppclass _CSPropDumpBox "CSPropDumpBox" (_CSPropProbeBox):
_CSPropDumpBox(_ParameterSet*) except +
void SetDumpType(int _type)
int GetDumpType()
void SetDumpMode(int mode)
int GetDumpMode()
void SetFileType(int ftype)
int GetFileType()
void SetOptResolution(int ny, double val)
double GetOptResolution(int ny)
void SetSubSampling(int ny, unsigned int val)
unsigned int GetSubSampling(int ny)
cdef class CSPropDumpBox(CSPropProbeBox):
pass
This diff is collapsed.
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from libcpp.string cimport string
from libcpp cimport bool
cdef extern from "CSXCAD/CSXCAD_Global.h":
cpdef enum CoordinateSystem "CoordinateSystem":
CARTESIAN "CARTESIAN"
CYLINDRICAL "CYLINDRICAL"
UNDEFINED_CS "UNDEFINED_CS"
cdef extern from "CSXCAD/CSRectGrid.h":
cdef cppclass _CSRectGrid "CSRectGrid":
_CSRectGrid() except +
void AddDiscLine(int direct, double val)
void clear()
void ClearLines(int direct)
void SetDeltaUnit(double val)
double GetDeltaUnit()
void Sort(int direct)
double* GetLines(int direct, double *array, unsigned int &qty, bool sorted)
size_t GetQtyLines(int direct)
double GetLine(int direct, size_t Index)
unsigned int Snap2LineNumber(int ny, double value, bool &inside)
int GetDimension()
void SetMeshType(CoordinateSystem cs_type)
CoordinateSystem GetMeshType()
void IncreaseResolution(int nu, int factor)
double* GetSimArea()
bool isValid()
cdef class CSRectGrid:
cdef _CSRectGrid *thisptr
cdef bool no_init
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Rectilinear Grid Class for CSXCAD
"""
import numpy as np
cimport CSRectGrid
from Utilities import CheckNyDir
from SmoothMeshLines import SmoothMeshLines
cdef class CSRectGrid:
"""
Rectilinear Grid Class for CSXCAD. The grid can be defined e.g. as a Cartesian
or cylindrical mesh and can hold mesh lines in the 3 fundamental directions.
E.g. x,y and z for the Cartesian and rho, a and z for the cylindrical mesh.
:param CoordSystem: define the coordinate system (default 0 : Cartesian)
"""
def __cinit__(self, *args, no_init=False, **kw):
self.no_init = no_init
if no_init==False:
self.thisptr = new _CSRectGrid()
if 'CoordSystem' in kw:
self.SetMeshType(kw['CoordSystem'])
del kw['CoordSystem']
elif 'cs_type' in kw:
self.SetMeshType(kw['cs_type'])
del kw['cs_type']
else:
self.thisptr = NULL
assert len(kw)==0, 'Unknown keyword arguments: "{}"'.format(kw)
def __dealloc__(self):
if not self.no_init:
del self.thisptr
def SetMeshType(self, cs_type):
""" SetMeshType(cs_type)
Set the coordinate system type (Cartesian or cylindrical) for this mesh.
:param cs_type: coordinate system (0 : Cartesian, 1 : Cylindrical)
"""
assert cs_type in [CARTESIAN, CYLINDRICAL], 'Unknown coordinate system: {}'.format(cs_type)
self.thisptr.SetMeshType(cs_type)
def GetMeshType(self):
return self.thisptr.GetMeshType()
def SetLines(self, ny, lines):
""" SetLines(ny, lines)
Set an array of lines. This will clear all previous defined lines in
the given direction.
:param ny: int or str -- direction definition
:param lines: array -- list of lines to be set in the given direction
"""
ny = CheckNyDir(ny)
assert len(lines)>0, 'SetLines: "lines" must be an array or list'
self.thisptr.ClearLines(ny)
for n in range(len(lines)):
self.thisptr.AddDiscLine(ny, lines[n])
def AddLine(self, ny, line):
""" AddLine(ny, lines)
Add an array of lines. This will *not* clear the previous defined lines in
the given direction.
:param ny: int or str -- direction definition
:param lines: array -- list of lines to be added in the given direction
"""
ny = CheckNyDir(ny)
if np.isscalar(line):
self.thisptr.AddDiscLine(ny, line)
return
assert len(line)>0, 'AddLine: "lines" must be a float, array or list'
for n in range(len(line)):
self.thisptr.AddDiscLine(ny, line[n])
def GetQtyLines(self, ny):
""" GetQtyLines(ny)
:param ny: int or str -- direction definition
"""
ny = CheckNyDir(ny)
return self.thisptr.GetQtyLines(ny)
def GetLine(self, ny, idx):
""" GetLine(ny, idx)
Get the line in a given direction `ny` and index
:param ny: int or str -- direction definition
:param idx: int -- line index
"""
ny = CheckNyDir(ny)
return self.thisptr.GetLine(ny, idx)
def GetLines(self, ny, do_sort=False):
""" GetLines(ny, do_sort=False)
Get all lines in a given direction `ny`.
:param ny: int or str -- direction definition
:param do_sort: bool -- sort lines
"""
ny = CheckNyDir(ny)
cdef unsigned int N = 0
cdef double* array = NULL
array = self.thisptr.GetLines(ny, array, N, do_sort)
lines = np.zeros(N)
for n in range(N):
lines[n] = array[n]
return lines
def ClearLines(self, ny):
""" ClearLines(ny)