|
50 | 50 | import java.util.zip.ZipEntry; |
51 | 51 | import java.util.zip.ZipOutputStream; |
52 | 52 |
|
| 53 | +import eu.mihosoft.vrl.v3d.CSG.OptType; |
53 | 54 | import eu.mihosoft.vrl.v3d.Slice.DefaultSliceImp; |
54 | 55 | import eu.mihosoft.vrl.v3d.ext.org.poly2tri.PolygonUtil; |
55 | 56 | import eu.mihosoft.vrl.v3d.ext.quickhull3d.HullUtil; |
@@ -1039,6 +1040,8 @@ public CSG scale(Number scaleValue) { |
1039 | 1040 | public CSG clone() { |
1040 | 1041 | CSG csg = cloneShallow(); |
1041 | 1042 | CSG historySync = csg.historySync(this); |
| 1043 | + historySync.volume = volume; |
| 1044 | + historySync.surfaceArea = surfaceArea; |
1042 | 1045 | return historySync; |
1043 | 1046 | } |
1044 | 1047 |
|
@@ -2595,8 +2598,16 @@ public CSG transformed(Transform transform) { |
2595 | 2598 | if (getName().length() != 0) { |
2596 | 2599 | csg.setName(name); |
2597 | 2600 | } |
2598 | | - |
2599 | | - return csg.historySync(this); |
| 2601 | + if (CSG.getDefaultOptionType() == OptType.Manifold3d) { |
| 2602 | + try { |
| 2603 | + csg = CSG.getManifold().calculateAreaAndSurfaceArea(csg); |
| 2604 | + } catch (Throwable e) { |
| 2605 | + // TODO Auto-generated catch block |
| 2606 | + e.printStackTrace(); |
| 2607 | + } |
| 2608 | + } |
| 2609 | + CSG historySync = csg.historySync(this); |
| 2610 | + return historySync; |
2600 | 2611 | } |
2601 | 2612 |
|
2602 | 2613 | /** |
@@ -3128,8 +3139,6 @@ public CSG historySync(CSG dyingCSG) { |
3128 | 3139 | setColor(dyingCSG.getColor()); |
3129 | 3140 | // str.syncProperties(dyingCSG.str); |
3130 | 3141 | syncCadoodleCatagories(dyingCSG); |
3131 | | - volume = dyingCSG.volume; |
3132 | | - surfaceArea = dyingCSG.surfaceArea; |
3133 | 3142 | return this; |
3134 | 3143 | } |
3135 | 3144 |
|
|
0 commit comments