Skip to content

Commit 5026c36

Browse files
committed
checking server/client count the polygns is correct
1 parent a33575b commit 5026c36

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,12 +2244,24 @@ public ArrayList<CSG> minkowskiHullShape(CSG travelingShape) {
22442244
}
22452245
}
22462246
ArrayList<CSG> bits = new ArrayList<>();
2247-
for (Polygon p : this.getPolygons()) {
2247+
List<Polygon> polygons2 = this.getPolygons();
2248+
int size3 = polygons2.size();
2249+
for (int i = 0; i < size3; i++) {
2250+
Polygon p = polygons2.get(i);
22482251
List<Vector3d> plist = new ArrayList<>();
2249-
for (Vertex v : p.getVertices()) {
2252+
List<Vertex> vertices = p.getVertices();
2253+
int size2 = vertices.size();
2254+
for (int j = 0; j < size2; j++) {
2255+
Vertex v = vertices.get(j);
22502256
CSG newSHape = travelingShape.move(v);
2251-
for (Polygon np : newSHape.getPolygons()) {
2252-
for (Vertex nv : np.getVertices()) {
2257+
List<Polygon> polygons3 = newSHape.getPolygons();
2258+
int size1 = polygons3.size();
2259+
for (int k = 0; k < size1; k++) {
2260+
Polygon np = polygons3.get(k);
2261+
List<Vertex> vertices2 = np.getVertices();
2262+
int size = vertices2.size();
2263+
for (int l = 0; l < size; l++) {
2264+
Vertex nv = vertices2.get(l);
22532265
plist.add(nv.pos);
22542266
}
22552267
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ private ArrayList<CSG> performOperation(List<CSG> csgList, CSGRemoteOperation op
160160
// Return results as ArrayList
161161
back=new ArrayList<CSG>();
162162
for(CSG c:response.getCsgList()) {
163+
CSG historySync = CSG.fromPolygons(c.getPolygons());
164+
back.add( historySync);
163165
for(CSG s:csgList) {
164-
back.add( CSG.fromPolygons(c.getPolygons()).historySync(s));
166+
historySync.historySync(s);
165167
}
166168
}
167169
} catch (Throwable t) {

src/test/java/eu/mihosoft/vrl/v3d/ServerClientTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public CSG prep(CSG incoming) {
5454
CSG c = new Cube(10, 10, 10).toCSG();
5555
c.getBounds();
5656

57+
int apoly1 = a.getPolygons().size();
58+
int bpoly1 =b.getPolygons().size();
59+
5760
CSG u1 = a.union( b,c);
5861
CSG d1 = a.difference(b);
5962
CSG t1 = d1.clone().triangulate(true);
@@ -65,7 +68,8 @@ public CSG prep(CSG incoming) {
6568
CSG.setMinPolygonsForOffloading(4);
6669
// Connect to server
6770
System.out.println("Client info: " + CSGClient.getClient().getServerInfo());
68-
71+
int apoly = a.getPolygons().size();
72+
int bpoly =b.getPolygons().size();
6973
CSG u =a.union( b,c);
7074
if(testPoly(u1,u))
7175
fail();

0 commit comments

Comments
 (0)