Closed parmodhattri closed 6 days ago
Hi @parmodhattri , the volume computation routine (and pyroomacoustics in general) assumes that the surface normals are all pointing outward from the room. Also there should be no holes in the mesh.
""" Hi @fakufaku thanks for the response. Yes, surface normals are pointing outwards but don't have any holes in the mesh. And when I create room with this mesh for ray tracing (as shown below), it computes -ve no of rays for ray tracing (in room.rt_args). Can you help me in solving this?
"""
from stl import mesh import pyroomacoustics as pra import numpy as np the_mesh = mesh.Mesh.from_file(filename="cube5m_reshuffled.stl") volume, COG, inertia_matrix=the_mesh.get_mass_properties()
walls = [] for w in range(ntriang): walls.append( pra.wall_factory( np.array(the_mesh.vectors[w].T / size_reduc_factor), material.energy_absorption["coeffs"], material.scattering["coeffs"], ) )
room = ( pra.Room( walls, fs=16000, max_order=1, ray_tracing=True, air_absorption=True) .add_source(np.array([2.5, 2.5, 2.5]).reshape(3,1),signal=signal) .add_microphonearray(np.c[np.array([2.2, 2.2, 2.5])]) )
room.rt_args
Can you please provide the STL file ?
Closed due to lack of activity.
from stl import mesh the_mesh = mesh.Mesh.from_file(filename="cube5m_reshuffled.stl") volume, COG, inertia_matrix=the_mesh.get_mass_properties() print('volume is', volume)