1 package org.opentrafficsim.core.geometry;
2
3 import org.opentrafficsim.core.network.NetworkException;
4
5
6
7
8
9
10
11
12
13
14
15 public final class Test2
16 {
17
18
19 private Test2()
20 {
21
22 }
23
24
25
26
27
28
29 public static void main(final String[] args) throws NetworkException, OTSGeometryException
30 {
31 OTSLine3D reference = new OTSLine3D(new OTSPoint3D(5, -1, 1), new OTSPoint3D(5, -2, 1), new OTSPoint3D(4.9, -2.01, 1),
32 new OTSPoint3D(5.1, -2.03, 1), new OTSPoint3D(5, -2.04, 1), new OTSPoint3D(5, -6, 1),
33 new OTSPoint3D(4.9, -6.01, 1), new OTSPoint3D(5.1, -6.03, 1), new OTSPoint3D(5, -6.04, 1),
34 new OTSPoint3D(5, -7.04, 1));
35
36 System.out.println("#reference: " + reference.toString());
37 OTSLine3D right = OTSOffsetLinePK.offsetLine(reference, -2);
38 System.out.println("#right: " + right.toString());
39 OTSLine3D left = reference.offsetLine(2);
40 System.out.println("#left: " + left.toString());
41
42 reference = new OTSLine3D(new OTSPoint3D(10, 0.5, 0), new OTSPoint3D(10, -2, 0), new OTSPoint3D(9.9, -2.01, 0),
43 new OTSPoint3D(10.1, -2.03, 0), new OTSPoint3D(10, -2.04, 0), new OTSPoint3D(10, -6, 0),
44 new OTSPoint3D(9.9, -6.01, 0), new OTSPoint3D(10.1, -6.03, 0), new OTSPoint3D(10, -6.04, 0),
45 new OTSPoint3D(10, -8.54, 0));
46
47 System.out.println("#reference: " + reference.toString());
48 right = reference.offsetLine(-2);
49 System.out.println("#right: " + right.toString());
50 left = reference.offsetLine(2);
51 System.out.println("#left: " + left.toString());
52
53 }
54
55 }