<html><head></head><body><div style="font-family:times new roman, new york, times, serif;font-size:16px;"><div style="font-family:times new roman, new york, times, serif;font-size:16px;"><div id="ydp24e1d54dyiv0827816647"><div><div style="font-family:times new roman, new york, times, serif;font-size:16px;"><div>Any comments on this?<br clear="none"><div><br clear="none"><div>Basically I applied the following transformations:<br clear="none"><div>1) Translate to one of the end points of the line<br clear="none"><div>2) RotateWXYZ( angle, vector)<br clear="none">3) Translate back to the same end point</div></div></div></div></div>
<div><br></div><div>If I have two lines, it rotates good around the first line bu<span style="background-color: rgb(253, 239, 43);">t produce unexpected results about line2.</span><br clear="none"></div><div><br clear="none"><div>Best Regards</div></div><div><br></div>
</div></div></div></div><div class="ydp9c5ff160yiv0827816647yqt8433498986" id="ydp9c5ff160yiv0827816647yqt50822"><div class="ydp9c5ff160yiv0827816647ydp3376be43yahoo_quoted" id="ydp9c5ff160yiv0827816647ydp3376be43yahoo_quoted_6422424325">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Sunday, May 6, 2018, 11:02:55 PM PDT, Koteswara Rao Ruvva <ruvva@yahoo.com> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="ydp9c5ff160yiv0827816647ydp3376be43yiv8266149947"><div><div style="font-family:times, serif;font-size:16px;"><div>Hello,</div><div><br clear="none"></div><div>I have the following routine to rotate an assembly about a line passing through two points pt1 and pt2. It works good for the rotation about the first line. <span style="background-color:rgb(253, 239, 43);">But when I rotate about another line it produce unexpected results</span>. Looks like I am missing something here.</div><div><br clear="none"></div><div><span></span><div> def RotateAboutAxis(assembly, pt1, pt2, degrees):</div><div><br clear="none"></div><div> vec = vtk.vtkVector3d(pt1[0]-pt2[0], pt1[1]-pt2[1], pt1[2]-pt2[2])</div><div><br clear="none"></div><div><span> transform = assembly.GetUserTransform()</span><br clear="none"></div><div> transform.Translate(pt1[0], pt1[1], pt1[2])</div><div> transform.RotateWXYZ(degrees, vec[0], vec[1], vec[2])</div><div> transform.Translate(-pt1[0], -pt1[1], -pt1[2])</div><div><br clear="none"></div></div><div><br clear="none"></div><div>Thanks</div><div>Rao</div></div></div></div></div>
</div>
</div></div></div></body></html>