Skip to content

Commit baf3d9a

Browse files
committed
adding geter and setter
1 parent 1404566 commit baf3d9a

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/main/java/eu/mihosoft/vrl/v3d/Parabola.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Parabola fromFocalLength(double Radius, double Focus) {
4848
public ArrayList<Vector3d> getpoints() {
4949
ArrayList<Vector3d> points = new ArrayList<>();
5050
points.add(new Vector3d(0, computeY(Radius)));
51-
for (double i = 0; i <= 1; i += (1.0 / numberOfPoints)) {
51+
for (double i = 0; i <= 1; i += (1.0 / getNumberOfPoints())) {
5252
double x = Radius * i;
5353
double y = computeY(x);
5454
points.add(new Vector3d(x, y));
@@ -62,7 +62,7 @@ public static CSG coneByEquation(double Radius, double a, double b) {
6262
// right
6363
// corner
6464
ArrayList<Vector3d> pointsOut = new ArrayList<>();
65-
for (double i = 0; i <= 360; i += (360.0 / numberOfPoints)) {
65+
for (double i = 0; i <= 360; i += (360.0 / getNumberOfPoints())) {
6666
Transform transform = new Transform().roty(i);
6767
for (Vector3d p : points)
6868
pointsOut.add(p.transformed(transform));
@@ -75,7 +75,7 @@ public static CSG cone(double Radius, double height) {
7575
return coneByHeight(Radius, height).rotx(90).toZMin();
7676
}
7777
public static CSG cone(double Radius, double height, double np) {
78-
numberOfPoints = np;
78+
setNumberOfPoints(np);
7979
return coneByHeight(Radius, height).rotx(90).toZMin();
8080
}
8181

@@ -86,7 +86,7 @@ public static CSG coneByHeight(double Radius, double height) {
8686
// right
8787
// corner
8888
ArrayList<Vector3d> pointsOut = new ArrayList<>();
89-
for (double i = 0; i <= 360; i += (360 / numberOfPoints)) {
89+
for (double i = 0; i <= 360; i += (360 / getNumberOfPoints())) {
9090
Transform transform = new Transform().roty(i);
9191
for (Vector3d p : points)
9292
pointsOut.add(p.transformed(transform));
@@ -101,7 +101,7 @@ public static CSG coneByFocalLength(double Radius, double FocalLength) {
101101
// corner
102102

103103
ArrayList<Vector3d> pointsOut = new ArrayList<>();
104-
for (double i = 0; i <= 360; i += 10) {
104+
for (double i = 0; i <= 360; i += (360 / getNumberOfPoints())) {
105105
Transform transform = new Transform().roty(i);
106106
for (Vector3d p : points)
107107
pointsOut.add(p.transformed(transform));
@@ -117,4 +117,12 @@ public static CSG extrudeByEquation(double Radius, double a, double b, double th
117117
);
118118
}
119119

120+
public static double getNumberOfPoints() {
121+
return numberOfPoints;
122+
}
123+
124+
public static void setNumberOfPoints(double numberOfPoints) {
125+
Parabola.numberOfPoints = numberOfPoints;
126+
}
127+
120128
}

0 commit comments

Comments
 (0)