Your Products have been synced, click here to refresh
Sub Macro1() ' 'This script creates a text file with x,y,z,i,j,k values 'for an external sphere (1 hit/° around the axis) The sphere is centered on the origin, vector along zaxis. 'The text file can be used into a freeform scan. 'Hope it can be used by someone here [emoticon:C4563CD7D5574777A71C318021CBBCC8] Dim nbr, sph_rad, xx, yy, zz, ii, jj, kk Dim alpha, beta, pi, pas_alpha, pas_beta nbr = InputBox("enter number of rounds") sph_rad = InputBox("enter the sphere radius") pi = 4 * Atn(1) alpha = 0 beta = 0 pas_alpha = pi / 180 pas_beta = pi / (4 * 180 * nbr) Open "points_scan_sph.txt" For Output As #1 For i = 1 To ((nbr * 360) + 1) xx = sph_rad * Cos(alpha) * Cos(beta) yy = sph_rad * Sin(alpha) * Cos(beta) zz = sph_rad * Sin(beta) ii = Cos(alpha) * Cos(beta) jj = Sin(alpha) * Cos(beta) kk = Sin(beta) Write #1, xx, yy, zz, ii, jj, kk alpha = alpha + pas_alpha beta = beta + pas_beta Next i Close #1 ' End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |