- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
first of all thanks for you're repsonse.
1) What are you trying to calculate?
I try to calculate the angle between 2 points that intersect with an edge and a plane ( that moves back and forward)
2) What for?
For my thesis i have to make a postprocessor for a lasercladder and they want to be able to laserclad figures like a square on a round object but such a postprocessor costs a lot of money thus they want me to try and make one.
3) How are the points attached to the plane (or whatever the gray object is, sheet metal maybe?)?
the points are actually made by an intersection of that plane and i measure the distance of that point to the origin and thats my x-coordinate.
4) "X_Afstand_1_Ruit"... are the parameters the values come from, right?
Yes the values come from the paramter X_afstand_1_Ruit...
5) How are you triggering / running this rule?
i should be triggerd by a true or false paramete lik start = true and then the code runs. Thats my idea.
I made some changes do the code would read easier and is smaller like u said.
Wrote also my comments in english and changed some parameter names to englisch.
But i didn't understand what you ment whit:
'Wrong:
Afstand_tot_center_Ruit = 0.5
'Right
Dim dToCenter As Double = 0.5
SyntaxEditor Code Snippet
SyntaxEditor Code Snippet
If Start= True Then While Distance_to_center <5 'This is the distance that the plane can travel to so max 5mm 'So when ever this value changes the values in MyArrayList should change with it. 'To the values that belong to then new values of the new intersection Dim MyArrayList(3) As Double 'Here i define my values as double it accepts decimals. MyArrayList(0) = X_Afstand_1_Ruit MyArrayList(1) = X_Afstand_2_Ruit MyArrayList(2) = X_Afstand_3_Ruit MyArrayList(3) = X_Afstand_4_Ruit Array.Sort(MyArrayList) For Each Str As Double In MyArrayList Next MessageBox.Show(MyArrayList(1), "Co�rdinate left") MessageBox.Show(MyArrayList(2), "Co�rdinate right") B1 = Abs(MyArrayList(1)) 'X-Coordinate left side H1 = Abs(MyArrayList(2)) 'X-Coordinate right side 'I want to calculate the angle between MyArrayList(1)and MyArrayList(2) and i do that with triangulation.'Formula Sin(alpha)=MyArrayList(1)/((Diameter/2)+Layerthicknes) A1=((Diameter/2)+Layerthicknes) I1=B1/A1 J1=Asin(I1) K1=J1*180 L1=K1/3.1415 M1=H1/A1 N1=Asin(M1) O1=N1*180 P1=O1/3.1415 Q1=P1+L1 MessageBox.Show(Q1, "angle") Distance_to_center = Distance_to_center+0.5 'This should add 0.5mm to the planes distance.'My idea is when it adds 0.5mm to Distance_to_center the code would run again but with the new values of the new intersection'it made End While End If