Skip to content

Commit dadf4f0

Browse files
committed
works with newest vvecmath library (TODO improve usage of stored/mutable vectors)
1 parent 3800f3d commit dadf4f0

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ dependencies {
6464

6565
compile group: 'eu.mihosoft.ext.org.fxyz', name: 'extfxyz', version: '0.4'
6666
compile group: 'eu.mihosoft.ext.org.fxyz', name: 'extfxyz', version: '0.4', classifier: 'sources'
67-
compile group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.3.3'
68-
compile group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.3.3', classifier: 'sources'
67+
compile group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.3.6'
68+
compile group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.3.6', classifier: 'sources'
6969
compile 'org.slf4j:slf4j-simple:1.6.1'
7070
}
7171

src/main/java/eu/mihosoft/jcsg/Cylinder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ public List<Polygon> toPolygons() {
150150
final Vector3d axisZ = ray.normalized();
151151
boolean isY = (Math.abs(axisZ.y()) > 0.5);
152152
final Vector3d axisX = Vector3d.xyz(isY ? 1 : 0, !isY ? 1 : 0, 0).
153-
cross(axisZ).normalized();
154-
final Vector3d axisY = axisX.cross(axisZ).normalized();
153+
crossed(axisZ).normalized();
154+
final Vector3d axisY = axisX.crossed(axisZ).normalized();
155155
Vertex startV = new Vertex(s, axisZ.negated());
156156
Vertex endV = new Vertex(e, axisZ.normalized());
157157
List<Polygon> polygons = new ArrayList<>();

src/main/java/eu/mihosoft/jcsg/Extrude.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public static boolean isCCW(Polygon polygon) {
205205
private static double normalizedX(Vector3d v1, Vector3d v2) {
206206
Vector3d v2MinusV1 = v2.minus(v1);
207207

208-
return v2MinusV1.dividedBy(v2MinusV1.magnitude()).times(Vector3d.X_ONE).x();
208+
return v2MinusV1.divided(v2MinusV1.magnitude()).times(Vector3d.X_ONE).x();
209209
}
210210

211211
// public static void main(String[] args) {

src/main/java/eu/mihosoft/jcsg/Plane.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public Plane(Vector3d normal, double dist) {
9494
* @return a plane
9595
*/
9696
public static Plane createFromPoints(Vector3d a, Vector3d b, Vector3d c) {
97-
Vector3d n = b.minus(a).cross(c.minus(a)).normalized();
97+
Vector3d n = b.minus(a).crossed(c.minus(a)).normalized();
9898
return new Plane(n, n.dot(a));
9999
}
100100

src/main/java/eu/mihosoft/jcsg/Polygon.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public Polygon translate(Vector3d v) {
279279
Vector3d c = this.vertices.get(2).pos;
280280

281281
// TODO plane update correct?
282-
this._csg_plane.normal = b.minus(a).cross(c.minus(a));
282+
this._csg_plane.normal = b.minus(a).crossed(c.minus(a));
283283

284284
this.plane = eu.mihosoft.vvecmath.Plane.
285285
fromPointAndNormal(centroid(), _csg_plane.normal);
@@ -322,7 +322,7 @@ public Polygon transform(Transform transform) {
322322
Vector3d b = this.vertices.get(1).pos;
323323
Vector3d c = this.vertices.get(2).pos;
324324

325-
this._csg_plane.normal = b.minus(a).cross(c.minus(a)).normalized();
325+
this._csg_plane.normal = b.minus(a).crossed(c.minus(a)).normalized();
326326
this._csg_plane.dist = this._csg_plane.normal.dot(a);
327327

328328
this.plane = eu.mihosoft.vvecmath.Plane.

src/main/java/eu/mihosoft/jcsg/samples/FractalStructure.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ public FractalStructure(Vector3d groundCenter, Vector3d topCenter,
148148
&& Math.abs(orthoVecToRotAxis2.dot(rotationAxis)) < orthoThreshhold) {
149149
this.orthoVecToRotAxis2 = orthoVecToRotAxis2.normalized();
150150
} else {
151-
this.orthoVecToRotAxis2 = rotationAxis.cross(this.orthoVecToRotAxis1).normalized();
151+
this.orthoVecToRotAxis2 = rotationAxis.crossed(this.orthoVecToRotAxis1).normalized();
152152
}
153153
} else {
154-
this.orthoVecToRotAxis2 = rotationAxis.cross(this.orthoVecToRotAxis1).normalized();
154+
this.orthoVecToRotAxis2 = rotationAxis.crossed(this.orthoVecToRotAxis1).normalized();
155155
}
156156

157157
// x, y, z
@@ -445,7 +445,7 @@ private ArrayList<FractalStructure> createSubStructures() {
445445
helpCenterPoint = connectionLineVectorNormalized.times(j).plus(connectionLineVectorNormalized.times(stepSizeOnConnectionLineHalf)).plus(centerGroundPoint).plus(correctionInRotationAxisDirection);
446446

447447
if (secondOrthoVec == null) {
448-
secondOrthoVec = connectionLineVectorNormalized.cross(helpCenterPoint.minus(helpEdgePoint));
448+
secondOrthoVec = connectionLineVectorNormalized.crossed(helpCenterPoint.minus(helpEdgePoint));
449449
}
450450

451451
// prevent that the last cross connactions from bottom left to top right has a to above end point in the top plane

0 commit comments

Comments
 (0)