|
Algorithm 2 Search for parallel straight edges |
-
1:
-
2:
if then
-
3:
Calculate distance for all from
-
4:
Sort by (ascending)
-
5:
for to do ▹ user-defined min/max
-
6:
for to do
-
7:
for to n do
-
8:
-
9:
if then
-
10:
Draw between
-
11:
Check
-
12:
Check
-
13:
if suitable then
-
14:
Break
-
15:
else
-
16:
-
17:
if no suitable pair then
-
18:
-
19:
if no suitable pair then
-
20:
▹ user-defined step
-
21:
if pair found then
-
22:
Optimize grasp position
-
23:
else
-
24:
Sort by length (descending)
-
25:
for to n do
-
26:
K = Project to other side of P
-
27:
Distance K to
-
28:
if suitable then
-
29:
Break
-
30:
else
-
31:
|