Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • BuildingAcoustics
  • MCE_sens_device_list
  • combined_wave_and_ga_simulation
  • feature/propagation_models
  • iks_liebich
  • ita-fileformat-cleanup
  • ita_3da_dev
  • kia
  • master
  • nlms
  • raven-project-unix
  • release
  • subjectOrientationFeedback
  • va_2018_api_change
  • Last-SVN-Commit
  • documentationFix
16 results

Target

Select target project
  • karin.loh/toolbox
  • ita/toolbox
  • niklas1/toolbox
  • vitor.zago/toolbox
  • yuanfang/toolbox
5 results
Select Git revision
  • 35-output-measurement-chain-calibration
  • ahe
  • ahe_local
  • bugfix/midi
  • bugfix_plots
  • calibration_fix
  • changes-pc-rar2
  • develop
  • feature/changeItaCoordinatesElevationAndAzimuthFromDegreesToRadians
  • feature/iem_dynamic_auralization
  • feature/individualizeHRTFbyITD
  • feature/pigeon-udfa
  • feature/propagation_models
  • feature/update-cdisp
  • features/hoa-decoders
  • iks_liebich
  • ita-fileformat-cleanup
  • ita_3da_dev
  • jst
  • ma23-mika
  • master
  • nlms
  • outputvoltage
  • raven-project-unix
  • release
  • subjectOrientationFeedback
  • switchFromSerialToSerialport
  • updateOptitrackToNatNet3
  • va_2018_api_change
  • Last-SVN-Commit
  • documentationFix
  • paper_linking_atmospheric_urban_auralization
  • pynamic-v0.0.1
33 results
Show changes

Commits on Source 4

......@@ -27,7 +27,7 @@ classdef itaRavenProject < handle
%
%
% Author: Soenke Pelzer (spe@akustik.rwth-aachen.de)
% Lukas Aspck (las@akustik.rwth-aachen.de)
% Lukas Aspck (las@akustik.rwth-aachen.de)
% Version: 0.1
% First release: 01.11.10
% Last revision: 12.09.16
......@@ -153,8 +153,9 @@ classdef itaRavenProject < handle
properties (GetAccess = 'private', SetAccess = 'private')
ravenExe64 = '..\bin64\RavenConsole64.exe'
ravenExe32 = '..\bin32\RavenConsole.exe'
ravenExe64 = fullfile('..', 'bin64', 'RavenConsole64.exe');
ravenExe32 = fullfile('..', 'bin32', 'RavenConsole.exe');
ravenExeLinux = fullfile('..', 'bin64', 'RavenConsole');
rpf_ini
raven_ini
......@@ -216,6 +217,8 @@ classdef itaRavenProject < handle
obj.ravenExe = obj.ravenExe32;
elseif strcmp(computer('arch'), 'win64')
obj.ravenExe = obj.ravenExe64;
elseif strcmp(computer('arch'), 'glnxa64')
obj.ravenExe = obj.ravenExeLinux;
else
error('Only Windows OS are supported.');
end
......@@ -242,7 +245,11 @@ classdef itaRavenProject < handle
if isempty(locatedRavenExe)
disp('[itaRaven]: No raven binary was found! Please select path to RavenConsole.exe!');
if ~isunix
[ selectedRavenExe, selectedRavenPath] = uigetfile('*.exe',' No raven binary was found! Please select path to RavenConsole.exe');
else
[ selectedRavenExe, selectedRavenPath] = uigetfile('*',' No raven binary was found! Please select path to RavenConsole');
end
obj.ravenExe = [ selectedRavenPath selectedRavenExe];
else
obj.ravenExe = locatedRavenExe;
......@@ -302,8 +309,10 @@ classdef itaRavenProject < handle
%
% change relative to absolute path
if (~strcmp(filename(2),':'))
obj.ravenProjectFile = [pwd '\' filename];
% On Windows machines a absolute path will have a ':' as the second character,
% On UNIX machines an absolute path will either start with a '/' or '~/'
if ((~strcmp(filename(2),':') && ispc) || ((~strcmp(filename(1), filesep) && ~strcmp(filename(1), '~')) && isunix))
obj.ravenProjectFile = fullfile(pwd, filename);
else
obj.ravenProjectFile = filename;
end
......@@ -314,10 +323,10 @@ classdef itaRavenProject < handle
% [Global] %
obj.projectName = obj.rpf_ini.GetValues('Global', 'ProjectName', 'Matlab');
obj.projectTag = obj.projectName;
obj.pathResults = obj.rpf_ini.GetValues('Global', 'ProjectPath_Output', '..\RavenOutput');
obj.pathDirectivities = obj.rpf_ini.GetValues('Global', 'ProjectPath_DirectivityDB', '..\RavenDatabase\DirectivityDatabase');
obj.pathMaterials = obj.rpf_ini.GetValues('Global', 'ProjectPath_MaterialDB', '..\RavenDatabase\MaterialDatabase');
obj.fileHRTF = obj.rpf_ini.GetValues('Global', 'ProjectPath_HRTFDB', '..\RavenDatabase\HRTF\ITA-Kunstkopf_HRIR_AP11_Pressure_Equalized_3x3_256.daff');
obj.pathResults = obj.rpf_ini.GetValues('Global', 'ProjectPath_Output', fullfile('..', 'RavenOutput'));
obj.pathDirectivities = obj.rpf_ini.GetValues('Global', 'ProjectPath_DirectivityDB', fullfile('..', 'RavenDatabase', 'DirectivityDatabase'));
obj.pathMaterials = obj.rpf_ini.GetValues('Global', 'ProjectPath_MaterialDB', fullfile('..', 'RavenDatabase', 'MaterialDatabase'));
obj.fileHRTF = obj.rpf_ini.GetValues('Global', 'ProjectPath_HRTFDB', fullfile('..', 'RavenDatabase', 'HRTF', 'ITA-Kunstkopf_HRIR_AP11_Pressure_Equalized_3x3_256.daff'));
obj.fileSpeakers = obj.rpf_ini.GetValues('Global', 'SpeakerConfigFile', 'Speakers.ini');
obj.simulationTypeIS = obj.rpf_ini.GetValues('Global', 'simulationTypeIS', 1);
obj.simulationTypeRT = obj.rpf_ini.GetValues('Global', 'simulationTypeRT', 1);
......@@ -337,13 +346,16 @@ classdef itaRavenProject < handle
% change relative to absolute paths
if obj.ravenExe(2) == ':' % absolute path
% On Windows machines a absolute path will have a ':' as the second character,
% On UNIX machines an absolute path will either start with a '/' or '~/'
if ((~strcmp(obj.ravenExe(2),':') && ispc) || ...
((~strcmp(obj.ravenExe(1), filesep) || ~strcmp(obj.ravenExe(1), '~')) && isunix))
ravenBasePath = fileparts(fileparts(obj.ravenExe)); % base path of raven
if (strcmp(obj.pathResults(1:2),'..')), obj.pathResults = [ ravenBasePath obj.pathResults(3:end) ]; end
if (strcmp(obj.pathDirectivities(1:2),'..')), obj.pathDirectivities = [ ravenBasePath obj.pathDirectivities(3:end) ]; end
if (strcmp(obj.pathMaterials(1:2),'..')), obj.pathMaterials = [ ravenBasePath obj.pathMaterials(3:end) ]; end
if (strcmp(obj.fileHRTF(1:2),'..')), obj.fileHRTF = [ ravenBasePath obj.fileHRTF(3:end) ]; end
if (strcmp(obj.pathResults(1:2),'..')), obj.pathResults = fullfile(ravenBasePath, obj.pathResults(3:end)); end
if (strcmp(obj.pathDirectivities(1:2),'..')), obj.pathDirectivities = fullfile(ravenBasePath, obj.pathDirectivities(3:end)); end
if (strcmp(obj.pathMaterials(1:2),'..')), obj.pathMaterials = fullfile(ravenBasePath, obj.pathMaterials(3:end)); end
if (strcmp(obj.fileHRTF(1:2),'..')), obj.fileHRTF = fullfile(ravenBasePath, obj.fileHRTF(3:end)); end
end
......@@ -355,8 +367,12 @@ classdef itaRavenProject < handle
if numel(obj.modelFileList) == 1
obj.modelFileList = obj.modelFileList{1}; % de-cell if only 1 room given
if obj.ravenExe(2) == ':' % convert to absolute path
if (strcmp(obj.modelFileList(1:2),'..')), obj.modelFileList = [ ravenBasePath obj.modelFileList(3:end) ]; end
% change relative to absolute paths
% On Windows machines a absolute path will have a ':' as the second character,
% On UNIX machines an absolute path will either start with a '/' or '~/'
if ((~strcmp(obj.ravenExe(2),':') && ispc) || ...
((~strcmp(obj.ravenExe(1), filesep) || ~strcmp(obj.ravenExe(1), '~')) && isunix))
if (strcmp(obj.modelFileList(1:2),'..')), obj.modelFileList = fullfile(ravenBasePath, obj.modelFileList(3:end)); end
end
end
......@@ -366,11 +382,11 @@ classdef itaRavenProject < handle
% [PrimarySources] %
obj.sourceNameString = obj.rpf_ini.GetValues('PrimarySources', 'sourceNames', 'Sender');
obj.sourceNames = textscan(obj.sourceNameString, '%s', 'Delimiter', ',');
obj.sourceNames = obj.sourceNames{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.sourceNames = obj.sourceNames{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.sourceDirectivityString = obj.rpf_ini.GetValues('PrimarySources', 'sourceDirectivity', '');
if ~isempty(obj.sourceDirectivityString)
obj.sourceDirectivity = textscan(obj.sourceDirectivityString, '%s', 'Delimiter', ',');
obj.sourceDirectivity = obj.sourceDirectivity{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.sourceDirectivity = obj.sourceDirectivity{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
else
obj.sourceDirectivity = {};
end
......@@ -386,7 +402,7 @@ classdef itaRavenProject < handle
% [Receiver] %
obj.receiverNameString = obj.rpf_ini.GetValues('Receiver', 'receiverNames', 'Receiver');
obj.receiverNames = textscan(obj.receiverNameString, '%s', 'Delimiter', ',');
obj.receiverNames = obj.receiverNames{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.receiverNames = obj.receiverNames{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.receiverPositions = obj.rpf_ini.GetValues('Receiver', 'receiverPositions');
obj.receiverPositions = reshape(obj.receiverPositions, 3, numel(obj.receiverPositions)/3)';
obj.receiverViewVectors = obj.rpf_ini.GetValues('Receiver', 'receiverViewVectors', '1, 0 ,0');
......@@ -467,19 +483,25 @@ classdef itaRavenProject < handle
prevPath = pwd;
cd(fileparts(obj.ravenExe));
dos(['"' obj.ravenExe '"' ' "' obj.ravenProjectFile '"'],'-echo');
% add the path here in " ... " in case file or folder names
% contain spaces.
status = system(['"' obj.ravenExe '"' ' "' obj.ravenProjectFile '"'],'-echo');
cd(prevPath);
% restore the initial project name
obj.setProjectName(savedProjectName);
if status == 0
% gather results
disp('[R] Simulation seems to be finished. Getting results...');
obj.gatherResults();
disp('[R] Done.');
obj.simulationDone = true;
else
disp('[R] Simulation could not be finished due to an error in RAVEN.')
obj.simulationDone = false;
end
% delete results in raven folder structure -> they are copied now into this class
if (obj.keepOutputFiles == 0)
obj.deleteResultsInRavenFolder();
......@@ -762,8 +784,8 @@ classdef itaRavenProject < handle
currentMaterial.freqData = [ currentMaterial.freqData absorp' ];
currentSurfaceArea = obj.getSurfaceAreaOfMaterial(allMaterials{iMat});
allMaterials{iMat} = strrep(allMaterials{iMat},'_',' ');
allMaterials{iMat} = [ allMaterials{iMat} ' (S = ' num2str(currentSurfaceArea,'%5.2f') ' m ;'];
allMaterials{iMat} = [ allMaterials{iMat} ' A (Eyring, f=1000 Hz) = ' num2str(-currentSurfaceArea*log(1-currentMaterial.freqData(18,iMat)),'%5.2f') ' m )'];
allMaterials{iMat} = [ allMaterials{iMat} ' (S = ' num2str(currentSurfaceArea,'%5.2f') ' m^2 ;'];
allMaterials{iMat} = [ allMaterials{iMat} ' A (Eyring, f=1000 Hz) = ' num2str(-currentSurfaceArea*log(1-currentMaterial.freqData(18,iMat)),'%5.2f') ' m^2 )'];
end
currentMaterial.channelNames = allMaterials;
......@@ -822,7 +844,7 @@ classdef itaRavenProject < handle
currentMaterial.freqData = [ currentMaterial.freqData scatter' ];
currentSurfaceArea = obj.getSurfaceAreaOfMaterial(allMaterials{i});
allMaterials{i} = strrep(allMaterials{i},'_',' ');
allMaterials{i} = [ allMaterials{i} ' (S = ' num2str(currentSurfaceArea,'%5.2f') ' m )'];
allMaterials{i} = [ allMaterials{i} ' (S = ' num2str(currentSurfaceArea,'%5.2f') ' m^2 )'];
end
currentMaterial.channelNames = allMaterials;
......@@ -1034,7 +1056,7 @@ classdef itaRavenProject < handle
else
obj.sourceNameString = sourceNames;
obj.sourceNames = textscan(obj.sourceNameString, '%s', 'Delimiter', ',');
obj.sourceNames = obj.sourceNames{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.sourceNames = obj.sourceNames{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
end
obj.rpf_ini.SetValues('PrimarySources', 'sourceNames', obj.sourceNameString);
obj.rpf_ini.WriteFile(obj.ravenProjectFile);
......@@ -1047,7 +1069,7 @@ classdef itaRavenProject < handle
if ~isempty(readstring)
readstring = textscan(readstring, '%s', 'Delimiter', ',');
readstring = readstring{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
readstring = readstring{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
if nargin<2
directivityName=readstring;
else
......@@ -1063,7 +1085,7 @@ classdef itaRavenProject < handle
% directivityName = obj.sourceDirectivity{sourceID + 1};
% else
% obj.sourceDirectivity = textscan(obj.sourceDirectivityString, '%s', 'Delimiter', ',');
% obj.sourceDirectivity = obj.sourceDirectivity{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
% obj.sourceDirectivity = obj.sourceDirectivity{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
% directivityName = obj.sourceDirectivity{sourceID + 1};
% end
end
......@@ -1076,7 +1098,7 @@ classdef itaRavenProject < handle
else
obj.sourceDirectivityString = directivity;
obj.sourceDirectivity = textscan(obj.sourceDirectivityString, '%s', 'Delimiter', ',');
obj.sourceDirectivity = obj.sourceDirectivity{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.sourceDirectivity = obj.sourceDirectivity{1}; % textscan liefert cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
end
obj.rpf_ini.SetValues('PrimarySources', 'sourceDirectivity', obj.sourceDirectivityString);
obj.rpf_ini.WriteFile(obj.ravenProjectFile);
......@@ -1184,7 +1206,7 @@ classdef itaRavenProject < handle
else
obj.receiverNameString = rec_names;
obj.receiverNames = textscan(obj.receiverNameString, '%s', 'Delimiter', ',');
obj.receiverNames = obj.receiverNames{1}; % textscan liefer cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
obj.receiverNames = obj.receiverNames{1}; % textscan liefer cell array in nochmal einer zelle, diese doppelkapselung wird hier rckgngig gemacht
end
obj.rpf_ini.SetValues('Receiver', 'receiverNames', obj.receiverNameString);
obj.rpf_ini.WriteFile(obj.ravenProjectFile);
......@@ -2456,7 +2478,7 @@ classdef itaRavenProject < handle
histo{iSrc,iRec}.data(:, iBand) = airAbs' .* sum(bsxfun(@times, reshape(M, obj.numParticles_Sphere, numTimeSteps), obj.initialParticleEnergy{iSrc,iBand}));
% todo: mal ohne exp/log probieren... knnte schneller sein
% todo: mal ohne exp/log probieren... knnte schneller sein
% % loop all detections
......@@ -4868,9 +4890,9 @@ classdef itaRavenProject < handle
end
if obj.generateRIR
ir_files = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\RIR_Combined', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\RIR_IS', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\RIR_RT', 'PrimarySource', 'Receiver'}, '.wav');
ir_files = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'RIR_Combined', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'RIR_IS', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'RIR_RT', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.monauralIR = obj.loadWaveFile(ir_files);
......@@ -4882,9 +4904,9 @@ classdef itaRavenProject < handle
obj.monauralIR_RT = [];
end
if obj.generateBRIR
ir_files = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\BRIR_Combined', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\BRIR_IS', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\BRIR_RT', 'PrimarySource', 'Receiver'}, '.wav');
ir_files = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'BRIR_Combined', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'BRIR_IS', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'BRIR_RT', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.binauralIR = obj.loadWaveFile(ir_files);
......@@ -4896,14 +4918,14 @@ classdef itaRavenProject < handle
obj.binauralIR_RT = [];
end
if obj.generateISHOA
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\HOA_IS', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'HOA_IS', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.ambisonicsIR_IS = obj.loadWaveFile(ir_files_IS);
% check for combined results with ray tracing
if obj.generateRTHOA
ir_files_combined = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\HOA_Combined', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_combined = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'HOA_Combined', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.ambisonicsIR = obj.loadWaveFile(ir_files_combined);
......@@ -4914,7 +4936,7 @@ classdef itaRavenProject < handle
obj.ambisonicsIR_IS = [];
end
if obj.generateRTHOA
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\HOA_RT', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'HOA_RT', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.ambisonicsIR_RT = obj.loadWaveFile(ir_files_RT);
......@@ -4923,14 +4945,14 @@ classdef itaRavenProject < handle
end
if obj.generateISVBAP
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\VBAP_IS', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_IS = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'VBAP_IS', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.vbapIR_IS = obj.loadWaveFile(ir_files_IS);
% check for combined results with ray tracing
if obj.generateRTVBAP
ir_files_combined = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\VBAP_Combined', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_combined = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'VBAP_Combined', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.vbapIR = obj.loadWaveFile(ir_files_combined);
......@@ -4941,7 +4963,7 @@ classdef itaRavenProject < handle
obj.vbapIR_IS = [];
end
if obj.generateRTVBAP
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'\VBAP_RT', 'PrimarySource', 'Receiver'}, '.wav');
ir_files_RT = obj.scan_output_folder(fullfile(obj.pathResults, obj.projectTag), {'VBAP_RT', 'PrimarySource', 'Receiver'}, '.wav');
% read the wave files back from disk
obj.vbapIR_RT = obj.loadWaveFile(ir_files_RT);
......
......@@ -75,13 +75,13 @@ classdef load_ac3d
% Vertizes Koordinaten finden
% Es wird davon ausgegangen, dass bei jedem Objekt einmal der Begriff
% "numvert" auftaucht, die Lnge von vert_rows ist daher auch mit der
% "numvert" auftaucht, die Lnge von vert_rows ist daher auch mit der
% Anzahl der Objekte in der ac3d Datei identisch.
% Die find Funktion liefert dabei die Zeilennummer, in der "numvert" steht.
% In die vertex_cell werden fr jedes Objekt alle Koordinaten der Vertizes
% In die vertex_cell werden fr jedes Objekt alle Koordinaten der Vertizes
% geschrieben.
% Hierbei wird ber die ac3d Dateistruktur der Anfang und das Ende der
% Liste der Vertizes ber die jeweilige Anzahl der Vertizes pro Objekt
% Hierbei wird ber die ac3d Dateistruktur der Anfang und das Ende der
% Liste der Vertizes ber die jeweilige Anzahl der Vertizes pro Objekt
% angegeben.
% Orientierung der Koordinatenbasis
......@@ -93,7 +93,7 @@ classdef load_ac3d
for i = 1:length(vert_rows)
% Speichere alle Vertex Koordinaten in (nx3) numerical arrays.
% Jede Cell in vertex_cell enthlt die Knoten fr ein Objekt
% Jede Cell in vertex_cell enthlt die Knoten fr ein Objekt
vertex_cell{i} = str2double(ac3d((vert_rows(i)+1):(vert_rows(i)+numVertsInObj(i)),1:3));
if size(vert_rows,1) == size(loc_rows,1)
......@@ -103,7 +103,7 @@ classdef load_ac3d
end
end
%wird spter fr die richtige Zuordnung der Knoten Liste bentigt
%wird spter fr die richtige Zuordnung der Knoten Liste bentigt
globalNumOfFirstVertexInObj = ones(length(vertex_cell),1);
for i = 2:length(globalNumOfFirstVertexInObj)
globalNumOfFirstVertexInObj(i) = sum(numVertsInObj(1:(i-1))) + 1;
......@@ -120,11 +120,11 @@ classdef load_ac3d
% in matnum_rows_cell sind diese Zeilennummern den unterschiedlichen
% Materialien zugeordnet.
matnum_rows = find(strcmp(ac3d,'mat')==1); % alle Materialzuordnungen fr die einzelnen Polygone finden
matnum_rows = find(strcmp(ac3d,'mat')==1); % alle Materialzuordnungen fr die einzelnen Polygone finden
matnum_rows_cell = cell(1, length(MatNames));
for i = 1:length(MatNames) % speichert zeilen der unterschiedlichen mat NUMMER fr die unterschiedlichen Materialien ab
% jede cell in matnum_rows enthlt die Zeilenindizes aller Polygone,
% die zum Material mit der Nummer i gehren
for i = 1:length(MatNames) % speichert zeilen der unterschiedlichen mat NUMMER fr die unterschiedlichen Materialien ab
% jede cell in matnum_rows enthlt die Zeilenindizes aller Polygone,
% die zum Material mit der Nummer i gehren
matnum_rows_cell{i} = matnum_rows( strcmpi(ac3d(matnum_rows,2),num2str(i-1)) );
end
......@@ -145,7 +145,7 @@ classdef load_ac3d
end
% Bestimmung von Anfangs und Endzeilen der Objekte in der ac3d Datei ber numvert
% Bestimmung von Anfangs und Endzeilen der Objekte in der ac3d Datei ber numvert
object_start = vert_rows;
object_end = vert_rows;
......@@ -156,7 +156,7 @@ classdef load_ac3d
% Alle Daten der Datenstruktur zuordnen
% hier wird ber die objID sichergestellt, dass die richtigen Vertizes
% hier wird ber die objID sichergestellt, dass die richtigen Vertizes
% verwendet werden
globalIdx = 1;
for matID = 1:length(MatNames) %Materialien durchgehen
......@@ -176,10 +176,10 @@ classdef load_ac3d
end
% Dreiecksberechnung und Flchenberechnung
% Dreiecksberechnung und Flchenberechnung
% durch Triangulisieren und Satz des Heron
% Triangulisation: Polygon wird in Dreiecke unterteilt
% Satz des Heron: Flche eines Dreiecks A = 1/4 sqrt( (a+b+c)*(a+b-c)*(-a+b+c)*(a-b+c) )
% Satz des Heron: Flche eines Dreiecks A = 1/4 sqrt( (a+b+c)*(a+b-c)*(-a+b+c)*(a-b+c) )
triaID = 1;
for matID = 1:length(obj.bcGroups)
......@@ -193,14 +193,14 @@ classdef load_ac3d
% Dreieck nach Triangulation abspeichern
triangles{triaID} = [node1;node2;node3];
% Flchenberechnung fr Dreieck
% Flchenberechnung fr Dreieck
a = norm( node1 - node2 );
b = norm( node1 - node3 );
c = norm( node2 - node3 );
surfTriangles(triaID) = real( 1/4 * sqrt( (a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c) ) );
% Normalenberechnung fr Dreieck
if norm( cross( (node2-node1), (node3-node1) ) ) == 0 % Schutz gegen Krppel Linien Polygone
% Normalenberechnung fr Dreieck
if norm( cross( (node2-node1), (node3-node1) ) ) == 0 % Schutz gegen Krppel Linien Polygone
normals{triaID} = [0 0 0];
else
normals{triaID} = cross( (node2-node1), (node3-node1) ) / norm( cross( (node2-node1), (node3-node1) ) );
......@@ -333,7 +333,7 @@ classdef load_ac3d
function [A, S] = getEquivalentAbsorptionArea_sabine(obj, material_path, portal_surface_materials)
if nargin < 2
material_path = '..\RavenDatabase\MaterialDatabase';
material_path = fullfile('..', 'RavenDatabase', 'MaterialDatabase');
end
countPortals = 1;
......@@ -366,7 +366,7 @@ classdef load_ac3d
function [A, S] = getEquivalentAbsorptionArea_eyring(obj, material_path, portal_surface_materials)
if nargin < 2
material_path = '..\RavenDatabase\MaterialDatabase';
material_path = fullfile('..', 'RavenDatabase', 'MaterialDatabase');
end
countPortals = 1;
......@@ -412,7 +412,7 @@ classdef load_ac3d
sabine_or_eyring = 'eyring';
end
if nargin < 2
material_path = '..\RavenDatabase\MaterialDatabase';
material_path = fullfile('..', 'RavenDatabase', 'MaterialDatabase');
end
if nargin > 4
......@@ -454,12 +454,14 @@ classdef load_ac3d
function materialNames = getMaterialNames(obj)
% check if path model has absolute or relative path (if ':" is
% in path, path is absolute)
if ~isempty(strfind(obj.modelFilename, ':'))
pathToModel = obj.modelFilename;
else
% check if path model has absolute or relative path
% On Windows machines a absolute path will have a ':' as the second character,
% On UNIX machines an absolute path will either start with a '/' or '~/'
if ((~strcmp(obj.modelFilename(2),':') && ispc) || ...
((~strcmp(obj.modelFilename(1), filesep) && ~strcmp(obj.modelFilename(1), '~')) && isunix))
pathToModel = fullfile(pwd, obj.modelFilename);
else
pathToModel = obj.modelFilename;
end
if exist(pathToModel, 'file')
......@@ -487,12 +489,14 @@ classdef load_ac3d
end
function setMaterialNames(obj, materialNamesCell)
% check if path model has absolute or relative path (if ':" is
% in path, path is absolute)
if ~isempty(strfind(obj.modelFilename, ':'))
pathToModel = obj.modelFilename;
else
% check if path model has absolute or relative path
% On Windows machines a absolute path will have a ':' as the second character,
% On UNIX machines an absolute path will either start with a '/' or '~/'
if ((~strcmp(obj.modelFilename(2),':') && ispc) || ...
((~strcmp(obj.modelFilename(1), filesep) && ~strcmp(obj.modelFilename(1), '~')) && isunix))
pathToModel = fullfile(pwd, obj.modelFilename);
else
pathToModel = obj.modelFilename;
end
if exist(pathToModel, 'file')
......@@ -519,14 +523,6 @@ classdef load_ac3d
end
% WRITE FILE WITH CHANGES TO MATERIAL NAMES
% check if path model has absolute or relative path (if ':" is
% in path, path is absolute)
if ~isempty(strfind(obj.modelFilename, ':'))
pathToModel = obj.modelFilename;
else
pathToModel = fullfile(pwd, obj.modelFilename);
end
if exist(pathToModel, 'file')
ac3d_file = fopen(pathToModel, 'w');
else
......