Heliostat mirrors script
Folks,
I am building a model of a heliostat power plant which has a 200m high tower and 18000 ground mirrors reflecting the sun's rays onto it.
I am look for an easy way, or a script, to align the 18000 mirrors so that it would accurately reflect what occurs in reality. In other words, each mirror is aligned to the bisected angle of two points (the top of the heliostat tower, and the sun). Ideally, if I then animate these controlling points (i.e. the sun's movement over 24 hours) one could see exactly how the mirrors would change.
Any advice would be greatly appreciated.
(My Max skills I'd say are moderate)
Thanks
Eltharian
Comments
Bisector script solution
Hi Derek:
Try the attached script. This is a beta without any bells and whistles (nor a few important features for alignments yet), but I think it does what you need at its core. However, it has to create a unique Look-At Constraint for each object (since each mirror has a unique location, the Look-At cannot be Instanced) so be careful how you apply it. Likewise, the mirror objects cannot be instances. I've tested it on an array of 1000 objects and of course viewport redraw slows down quite a bit. On 18000... well once you get it set up, you may want to hide a bunch of them. Setting viewports to "Box" display style helps a lot (see the sample scene included), even with simple planes as test objects. I have an idea for a completely different solution that may work much better, but haven't gotten to it yet.
My recommendations for using the current script:
Obviously, test it out first on a few objects to see what it does (it's really basic, no instructions necessary).
In a perfect world, you would apply the script to a single object, set up your Look-At axis alignments and then duplicate it as needed. Applying to a bunch of objects after they are placed will also work, but it will use the upnode and axis alignment of a default Look At Constraint, which my not be what you want. My next iteration will feature controls for these after the fact.
Let me know how it goes.
David
mirror constraint script
Hey Derek:
I found a solution, but it will have to be put into a scripted controller like I thought. It's one of those quirky things about the look-at constraint I hadn't really noticed before and might not matter most of the time. Thanks for pointing it out. This is something I would like in my toolbox, as well as a few other folks I can think of. If I get this worked out (again, no promises), I'd like to post it for general use by the community. I'll put a nod to you in the "about" section of the script if you'd like. You can always drop me an email at: [email protected]. If you want to send me your address, I can keep you up to date a little easier via email. Thanks Derek!
David
almost what you need
Hi Derek:
Sorry it's taken me a few days to get back to you (it's tax time). Also sorry the script wasn't the quick fix we all hope for. I can see the behavior you're talking about, that the "Look-At" constraint is keeping the object pointed toward a center point between the 2 look-at targets. Therefore distance is affecting the orientation. Sorry I didn't see this at first. Could be that the problem will need a completely different solution, perhaps a scripted controller computing the vector between the two objects. I have a few ideas. I'll try to find some time to get you what you need but it may be a few days depending on my schedule. In the mean time, you probably shouldn't abandon your efforts to find an alternate solution. Do you have a deadline coming up?
David
Any help greatly appreciated
Hi David
I would hugely appreciate any time you could spare for this.
Unfortunately, this is one of those projects where the deadline was "on pause" with me just tinkering around, until the client suddenly loaded me with all the details and then wanted the finished project yesterday. We're looking at this week, maybe next week as the deadline.
Luckily, I didnt promise anything with regards to the mirrors orientation. Any accurate detail like this is actually a bonus. However, I would dearly like to achieve this though as I am a stickler for detail.
Regards
Derek
Almost what I need.
Hi David
Thanks very much for this. Your script is indeed very useful and very close to what I need.
However, I have found a snag. It bisects the angles correctly but ONLY if the two points are equal distances away. Your script seems to "weight" the bisected angle towards the furthest point. Do you think this can be remedied?
I can think of a few workarounds but they'll be clumsy, especially with my 18000 mirrors at unique positions around the tower. Fixing the script (I am hoping) would make life a lot easier.
Much Appreciated
Derek
mirror script
Hi Eltharian:
I came across your request by accident, but as it happens, I wrote a script for a friend last year that does this (see the attachment). It may not end up doing exactly what you need depending on how your mirrors are modeled, but it might help get you there. The script will keep a selection of objects oriented (using an instanced Look-At Constraint) between 2 different objects (sun and tower). You can adjust the Look-At Constraint parameters as necessary and all the objects will update. You might try it on a simple selection of objects first to see what it does. If it works, it may take a while to process the large number of objects that you have indicated.
Good Luck and let me know if it works out.
David