-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathLineSegment.java
More file actions
95 lines (90 loc) · 2.13 KB
/
LineSegment.java
File metadata and controls
95 lines (90 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import javax.vecmath.Point3f;
public class LineSegment {
private int layer;
private int toolhead = 0; //DEFAULT TOOLHEAD ASSUMED TO BE 0!
private float speed;
private Point3f first, second;
private boolean isExtruding;
public LineSegment (Point3f a,Point3f b, int layernum, float speedz)
{
first = a;
second = b;
layer = layernum;
speed = speedz;
}
public LineSegment (Point3f a,Point3f b, int layernum, float speedz, boolean extrudz)
{
first = a;
second = b;
layer = layernum;
speed = speedz;
isExtruding = extrudz;
}
public LineSegment(float x1, float y1, float z1, float x2, float y2, float z2, int layernum, float speedz)
{
first = new Point3f(x1, y1, z1);
second = new Point3f(x2, y2, z2);
layernum = layer;
speed = speedz;
}
public LineSegment (Point3f a,Point3f b, int layernum, float speedz, int toolheadz)
{
first = a;
second = b;
layer = layernum;
speed = speedz;
toolhead = toolheadz;
}
public LineSegment(float x1, float y1, float z1, float x2, float y2, float z2, int layernum, float speedz, int toolheadz)
{
first = new Point3f(x1, y1, z1);
second = new Point3f(x2, y2, z2);
layernum = layer;
speed = speedz;
toolhead = toolheadz;
}
public LineSegment (Point3f a,Point3f b, int layernum, float speedz, int toolheadz, boolean extrudz)
{
first = a;
second = b;
layer = layernum;
speed = speedz;
toolhead = toolheadz;
isExtruding = extrudz;
}
public LineSegment(float x1, float y1, float z1, float x2, float y2, float z2, int layernum, float speedz, int toolheadz, boolean extrudz)
{
first = new Point3f(x1, y1, z1);
second = new Point3f(x2, y2, z2);
layernum = layer;
speed = speedz;
toolhead = toolheadz;
isExtruding = extrudz;
}
public Point3f[] getPointArray()
{
Point3f[] pointarr = { first, second };
return pointarr;
}
public float[] getPoints()
{
float[] points = {first.x, first.y, first.z , second.x, second.y, second.z };
return points;
}
public int getToolhead()
{
return toolhead;
}
public float getSpeed()
{
return speed;
}
public int getLayer()
{
return layer;
}
public boolean getExtruding()
{
return isExtruding;
}
}