XYZ-Werte in LRA < Technik < Ingenieurwiss. < Vorhilfe
|
Ich habe diese Frage in keinem Forum auf anderen Internetseiten gestellt.
Hallo,
wie kann ich beim Rohrbiegen die XYZ-Koordinaten in Länge, Drehwinkel und Biegewinkel berechnen?
Die XYZ-Koordinaten, sowie den Biegeradius habe ich.
Beispiel: (Alle Radien 30)
X|Y|Z
0| 0 |0
100|0 |0
200|100|0
300|200|100
Ergibt:
L |R |A
87,574|0 |45°
119,46|-90°|35,26°
Ich habe ein Plugin für Mathlab gefunden, habe das Program aber nicht:
Formel von Mathlab:
function [Y,B,C] = xyz2ybc(Xc,Yc,Zc,R)
if( (length(Xc) ~= length(Yc)) | (length(Xc) ~= length(Zc)) )
error('X,Y,Z are not the same size');
end
if(nargin == 3)
% set the bend radius to zero for all bends.
R = zeros(1,length(Xc)-2);
elseif(length(R) == 1)
% set the bend radius to R for all bends.
R = ones(1,length(Xc)-2).*R;
elseif(length(R) ~= length(Xc)-2)
error('R size doesnt match the number of bends');
end
% number of bends is less than the number of XYZ points by 2.
for i = 1:length(Xc)-2
% calculate the 2 vectors BA and BC, representing an angle ABC.
V1 = [Xc(i)-Xc(i+1) ; Yc(i)-Yc(i+1) ; Zc(i)-Zc(i+1)];
V2 = [Xc(i+2)-Xc(i+1) ; Yc(i+2)-Yc(i+1) ; Zc(i+2)-Zc(i+1)];
% calculate the length of vectors BA and BC.
V1l = Vlength(V1);
V2l = Vlength(V2);
% calculate the angle between the 2 vectors BA and BC.
C(i) = pi - acos(dot(V1,V2) / (V1l*V2l));
% calculate the vector perpendicular to the plan ABC.
planeV(i,:) = cross(V1,V2)';
if(i>1)
% calculate the length of the straight by subtracting the tangent of
% the bend angle.
Y(i) = Y(i) - R(i)*tan(C(i)/2);
Y(i+1) = V2l - R(i)*tan(C(i)/2);
% calculate the length of vectors perpendicular to the plan ABC and
% the plan of the bend before it.
PV1l = Vlength(planeV(i-1,:));
PV2l = Vlength(planeV(i,:));
% calculate the rotation direction. negative if counter clockwise.
s=sign(V1 .* cross(planeV(i-1,:),planeV(i,:))');
% calculate the rotation angle and multiply by the rotation direction.
B(i) = acos(dot(planeV(i-1,:),planeV(i,:))/(PV1l*PV2l))*s(1);
else
% calculate the length of the straight by subtracting the tangent of
% the bend angle.
Y(i) = V1l - R(i)*tan(C(i)/2);
Y(i+1) = V2l - R(i)*tan(C(i)/2);
% rotation of the first bend is always zero.
B(i) = 0;
end
end
% calculate the length of a 3D vector.
function l=Vlength(V)
l = [mm] sqrt(V(1)^2 [/mm] + [mm] V(2)^2 [/mm] + [mm] V(3)^2);
[/mm]
Erst einmal Danke fürs durchlesen!
|
|
|
|
Status: |
(Mitteilung) Reaktion unnötig | Datum: | 11:20 Do 21.03.2013 | Autor: | matux |
$MATUXTEXT(ueberfaellige_frage)
|
|
|
|