The other function is adding object shapes to the ends of each curve. Wires usually have a head and a tail and both ends usually have some sort of connecting object. (Power Plug, jack, etc..) I would like this tool to be able to get those objects and snap them the ends of each wire.
In order to line the objects up perpendicularly, I am either using tangent constraint or using the pointInfoNote which will give me the tangent value for calculating the angle.
pointOnCurve:
infoNode1 = mc.pointOnCurve(eachCurve, constructionHistory=True, parameter = -0.1)
attaches a node that shows the tangent, normal, position info.
angleBetween:
rotA = mc.angleBetween(euler=True, v1=(x,y,z), v2=(x,y,z))
returns the rotation B required to be perpendicular to A. Calculation between Position B and Tangent A.
However this does not give me the correct position and rotation.
Futher Tests.


Trying TangentConstraint:
mc.tangentConstraint( curveshape1, object1)
This seems simple and straight forward, however it only work at one end of the Curve .

Seems Fine NOW but when I try again.The starting point is tilted for some curious reasons.

However Time Is REALLY running OUT!!!!! Time to Move On!!!!
I did some additional Attributes to my GUI to make it easier for Users to set those Attributes.
 |
 |
These additional Attributes are the main attributes to run the simulation. Other attributes can be tweak to get other variations and interesting results too.
At this stage I am coming to think that there may be a better way to generate this wires other than particles, but its a good learning process. |



StudioProject WIP. (Josh,Dorien,CheeLoong)
Above are two test that I rush out for submission. Compared to my 1st try on this tool which is in Mel and Python scripting 1, these ones seem to look more controlled.
Conclusion:
What have I done:
1. Solved my ID problem and now the tool is able to set a limited number of particles.
2. Took away a huge portion of hardcoded names in my script.
3. Added a Goal function but not fully fuctional yet.
4. Added a object to wire ends but not fully fuctional yet.
5. Changed my particles to nParticles which solved self collision issues. However, still need to figure a way to totally prevent particles to cross paths.
6. Added more functionalities to my GUI.
I have learned to be logical and neat in my creation process of a script. Moreover, through this quarter, neat and understandable scripting is also important as it really help me in future debugging or upgrades.
Lastest Version of the Script