mathematical functions for scripting in LDCad


RE: mathematical functions for scripting in LDCad
#5
(2018-03-14, 18:33)Roland Melkert Wrote: If all you need is matrix and vector math I did add support for that through the ldc module as LDraw is heavily depended on matrix math.

But the ldc matrix math is highly targeted on LDraw usage, so if you need more complicated things you might need to use something like:
https://github.com/anaef/lua-linear

Hi Roland

Yes, all I need is vector and matrix math. My problem is, I would like to rotate a part and I would like to know (or use it in the script) the new position of a specific point of this part. This would usually be a simple coordinate system rotation multiplying a vector with the rotation matrix. The most suitable command seems to be 'transform'. Only somehow it does not behave fully like this. It seems to flip my part by 180°.

Furthermore, is there any way to access the location of the parts center? I mean the rotation matrix always rotates a part around its center. If I like to rotate it around another center during a script I would have to rotate and translate it. This seems to be confusing.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: mathematical functions for scripting in LDCad - by Joscha - 2018-03-14, 22:15

Forum Jump:


Users browsing this thread: 1 Guest(s)