algorithmic modeling for Rhino
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....
Change :
V1.4 (02/09/2012)
acoustic_shoot_V1.4.3dm
Change :
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)
Change :
V1.0(initial version-26/01/2012)
it's really a work in progress but the basic function is workingfeel free to helpContinue
Started by Guillaume Meunier Nov 23, 2016.
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.
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.
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
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!
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
just back from holidays....i'll look into it (i still need to switch to RH5)
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
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.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by
You need to be a member of Acoustic Shoot to add comments!