Grasshopper

algorithmic modeling for Rhino

Information

Acoustic Shoot

acoustic_shoot is a def that imitate acoustical raytracing

last Version 1.4 : february 9, 2012

Members: 134
Latest Activity: Sep 20, 2023

WIP V1.5 Acoustic Shoot

acoustic_shoot is a def that imitate acoustical raytracing. It used a VB def from Peter VanHage but differ in it's parameters and now using Ladybug raytracing. You can have the final points of a ray at a precise time (in ms). You can choose the numbers of rays, etc....

V1.5 WIP (23/11/2016)

acoustic_shoot_WIP_V1.5.gh

acoustic_shoot_V1.5.3dm

Change :

  • Use ladybug raytracing
  • basic fonction is working
  • many bugs to correct (attenuation/colorize/color)

V1.4 (02/09/2012)
acoustic_shoot_V1.4.3dm

acoustic_shoot_V1.4.ghx

Change :

  • you can add something like an attenuation coefficient to "walls"
  • print the number of rebound or a calculated value
  • colorize follow one of thoses values

nb : calculated values are not real physical values but a way to know what kind of attenuation a ray would have

nb : skip 1.2 version because it's a great improve (odd numbers are minor revisions)

nb : next version would be more optic oriented


V1.1(02/06/2012)

acoustic_shoot_V1.1.3dm

acoustic_shoot_V1.1.ghx

Change :

  • added a toggle to show (or not) wire
  • color changing
  • english text everywhere

V1.0(initial version-26/01/2012)

acoustic_shoot.3dm

acoustic_shoot.ghx

Discussion Forum

WIP 1.5 version is out

it's really a work in progress but the basic function is workingfeel free to helpContinue

Started by Guillaume Meunier Nov 23, 2016.

1.4 version is out 7 Replies

a major revision of this def is out, maybe the last one as "acoustic" shoot (next would be optic)try and share feedbacksContinue

Started by Guillaume Meunier. Last reply by Guillaume Meunier Mar 3, 2016.

Todo 4 Replies

what to do next? :add color changing while changing timeadd something like an alpha coef to wallsany idea?Continue

Started by Guillaume Meunier. Last reply by Guillaume Meunier Feb 9, 2012.

Changing name and function 2 Replies

hi everyone, as Seth Lamberton notice, this def can be used for optic reasons so maybe i should change the group and def name....(and make it less "acoustic") what everyone think?Continue

Started by Guillaume Meunier. Last reply by Guillaume Meunier Feb 2, 2012.

Comment Wall

Comment

You need to be a member of Acoustic Shoot to add comments!

Comment by bea franko on August 9, 2013 at 1:45am

hey im trying the 1.4 version with the latest release of grasshopper. got some problems... the  vb generating the ratio units ist null(X and y is empty). what has to be in there?

thank you!

Comment by Guillaume Meunier on October 2, 2012 at 3:07am

i've tried acoustic shoot under Rhino 5 (09/18/2012) and GH 0.9.0014 and it works fine although there are some warnings and old components that i will update soon

Comment by Guillaume Meunier on August 27, 2012 at 3:02am

just back from holidays....i'll look into it (i still need to switch to RH5)

Comment by phillip on August 7, 2012 at 6:27am

Hi,

just noticed AS doesn´t work in 0.9 anymore. Already changed the obvious, but I cant figure out how to make all the changes to the code.  Can you help me?

This is what I am using:

Private Sub RunScript(ByVal srf As Surface, ByVal startPT As Point3d, ByVal startVEC As Vector3d, ByVal intMAXbounces As Integer, ByVal coef As Double, ByRef reflectionPointList As Object, ByRef contactPlanes As Object, ByRef valuePointList As Object)
Dim originPt As Point3d = startPt
Dim dirVec As Vector3d = startVec
Dim surfaceNormal As New vector3d
Dim outputPts As New List(Of Point3d)
outputPts.Add(originPt)
'''Dim outputPlanes As New List(Of on3dvector)
'''Dim outputNormalPlanes As New List(Of On3dVector)
Dim n As Integer = 0
'''Dim blnSwitch As Boolean = False
While n < intMaxBounces
'''Dim bounce As New On3dRay
Dim shooter As New OnRayShooter
Dim hit As New OnX_EVENT
Dim plane As New OnPlane
hit.m_type = RMA.OpenNURBS.IOnX_EVENT.TYPE.csx_point
shooter.m_min_travel_distance = doc.AbsoluteTolerance()
shooter.Shoot(originPt, dirVec, srf.toArray(), hit)
Dim intIndex As Integer = getSrfIndex(srf, hit.m_pointA(0), hit.m_b(2), hit.m_b(3))
originPt = hit.m_pointA(0)
If originPt.CompareTo(onutil.On_origin) = 0 Then
'''print("exit")
Dim lastPoint As Point3d = outputPts.Item(outputPts.Count - 1)
Dim newPoint As New Point3d
newPoint.x = (dirVec.x * 100 * coef) + lastPoint.x
newPoint.y = (dirVec.y * 100 * coef) + lastPoint.y
newPoint.z = (dirVec.z * 100 * coef) + lastPoint.z
outputPts.Add(newPoint)
Exit While
End If
surfaceNormal = srf(intIndex).normalAt(hit.m_b(2), hit.m_b(3))
'''plane.CreateFromNormal(hit.m_pointA(0), surfaceNormal)
dirVec = reflectVector(dirVec, surfaceNormal)
'''outputNormalPlanes.Add(dirVec)
outputPts.Add(originPt)
'''outputPlanes.Add(dirVec.PerpendicularTo(dirVec))
n = n + 1
End While
If outputPts.Count > 1 Then
reflectionPointList = outputPts.ToArray()
'''contactPlanes = outputPlanes.ToArray()
'''normalPlanes = outputNormalPlanes.ToArray()
End If
End Sub

'<Custom additional code>
Function getSrfIndex(srf As list(Of Surface), testPt As point3d, u As Double, v As Double) As Integer
Dim intIndex As Integer
For i As Integer = 0 To srf.count - 1
Dim srfPoint As New point3d
srfPoint = srf(i).pointAt(u, v)
If srfPoint.distanceTo(testPt) < doc.AbsoluteTolerance Then intIndex = i
Next
Return intIndex
End Function

Function reflectVector(incomingDirection As vector3d, surfaceNormal As vector3d) As vector3d
Dim tempVec As New vector3d
tempVec = incomingDirection
tempVec.Reverse()
tempVec.Rotate(onUtil.On_PI, surfaceNormal)
Return tempVec
End Function

Thanks, 

Phillip

Comment by greg bethel on March 9, 2012 at 11:03am

Hi Guillaume.  Here is an example of trimmed surfaces not working. Set the brep in 'Geo 1 ceiling' sublayer to replace the untrimmed flat surface ceiling in the definition:  acoustic_shootV1.4_simple_test.zip

The error in the script is "Type conversion failed from Brep to OnSurface".

Sorry for posting here - the discussion threads aren't allowing me to attach files.

 

Members (134)

 
 
 

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service