[Closed] Deleting overlaping meshes
So…have written an new script. It should work with arbitrary meshes…(Note: Should work…I did not test it at all. Just wrote it in a text editor. Let me know any error messages…;))
fn Test_Distance Small Big Dir --Test Function
(
Root = Small.pos
Test_Ray = Ray Root Dir --shoot a Ray from the Root to the given Direction
Dist_Small = try(length ((intersectRay Small Test_Ray).pos - Root)) catch() --tries to hit the small sphere and gives the lenght
Dist_Big = try(length ((intersectRay Big Test_Ray).pos - Root)) catch() --tries to hit the big spheres and gives the length
if Dist_Big != undefined and Dist_Small!= undefined do --tests if both distances are valid
(
if Dist_Big < Dist_Small do KillMesh = true --sets the Kill Variable True, if the distance to the big spheres is smaller than the distance to the small sphere
)
)
for o in $Sphere_Small_* do --loop through the small spheres
(
KillMesh = false --sets the Kill Variable False
for v in 1 to o.mesh.numverts while KillMesh == false do --loop through the Vertices
(
Vert_Pos = getVert o.mesh v --current Vertex' position
Vert_Dir = normalize (Vert_Pos - o.pos) --direction from the pivot to the vertex
Test_Distance o $Spheres_Big Vert_Dir --calls the Test Function and hands over the three operants
)
if KillMesh == True do delete o --deletes the sphere if the Kill Variable is true
)
It might be quite slow (Try/Catch does that to scripts…;))
You still need inverted normals for the small drops and two-sided geometry for the big drops.
Mate, that sounds fantastic!
I will do some test and get back to your scirpt!
Have you noticed, the other thread ” mass deleting objects” ?
Actually thats my situation, the only thing is that i got
A) very small drops
B) Mid Drops and
C) big drops
Anyways, i test your fantastic stuff and give you some feedback!
P.S – Why is it so slow to detach my drops? Okay 10000 drops are a big count
but i waiting right now more that 10 min for that operation… very lame though
NAIK
Yeah…I have seen it and I am just thinking about rewriting my last script for the other situation. Although it will definately have memory issues, since every single drop needs to be two-sided…