• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 ellipse in motion program JayL Delta Tau Insider Posts: 53 Threads: 1 Joined: Jun 2010 08-14-2017, 04:33 PM (This post was last modified: 08-14-2017, 04:47 PM by JayL.) Hi Louv, the idea of previous post did not work out as I expected. I apologize for that. In order to do any 3D ellipse in 3D space, the idea is to stretch a 3D circle. So, you have to find the correct transformation matrix to stretch the circle. The idea is to find correct eigenvectors and eigenvalues, construct the transformation matrix, and then use the transformation. the example I made below is drawing a circle, start from [0, 0, 0], and the circle center is at [1, 1, 0] after drawing a circle, it is stretched in [-1, 1, 0] direction with scale of 2. the eigenvectors and eigenvalues I choose are: Lambda1 = 1, with V1=[-1/sqrt(2), -1/sqrt(2), 0], short-axis, from center to starting point Lambda2 = 2, with V2=[-1/sqrt(2), +1/sqrt(2), 0], long-axis, from center to long-axis vertex point Lambda3 = 1, with V3=[0, 0, 1], normal direction, NORMAL vector direction let V=[V1, V2, V3], D=3x3 matrix with diagonal elements Lambda1, 2, 3 M = V*D*V' with these, you can construct a transformation matrix: [ 1.5 -0.5 0] M = [ -0.5 1.5 0] [ 0 0 1] this is associated with XYZ axes. so, with the following program, an ellipse can be drawn: //========= &1 #1->1000X #2->1000Y #3->1000Z global Tdet = 0 open prog ellipse_test01 Tdet = tinit(1); Tdata[1].Diag[6] = 1.5; Tdata[1].Diag[7] = 1.5; Tdata[1].Diag[8] = 1; Tdata[1].xyz[0] = -0.5; Tdata[1].xyz[1] = 0; Tdata[1].xyz[2] = -0.5; Tdata[1].xyz[3] = 0; Tdata[1].xyz[4] = 0; Tdata[1].xyz[5] = 0; abs linear TA 0 TS 50 TD 0 F 5 X 0 Y 0 dwell 1000 normal K-1 abs dwell 0 Gather.Enable=2 dwell 0 tsel -1 circle1 I 1 J 1 dwell 0 tsel 1 circle1 I 1 J 1 tsel -1 dwell 0 Gather.Enable=0 dwell 0 close //========= Attached Files Image(s) « Next Oldest | Next Newest »

 Messages In This Thread ellipse in motion program - dholden - 12-12-2012, 09:33 PM RE: ellipse in motion program - tahoe brian - 12-13-2012, 10:24 AM RE: ellipse in motion program - JayL - 12-14-2012, 10:25 AM RE: ellipse in motion program - lovu - 08-08-2017, 05:12 PM RE: ellipse in motion program - Gregs - 08-09-2017, 10:36 AM RE: ellipse in motion program - lovu - 08-09-2017, 05:48 PM RE: ellipse in motion program - AAnikstein - 08-10-2017, 09:03 AM RE: ellipse in motion program - lovu - 08-11-2017, 02:17 AM RE: ellipse in motion program - JayL - 08-11-2017, 10:14 AM RE: ellipse in motion program - JayL - 08-14-2017, 01:15 PM RE: ellipse in motion program - JayL - 08-14-2017, 04:33 PM RE: ellipse in motion program - JayL - 08-15-2017, 10:30 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)