Skip to content

Commit

Permalink
setting the color of the base CSG and sync it through opperations
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Aug 27, 2024
1 parent 84c92a1 commit 363c3e0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/main/java/eu/mihosoft/vrl/v3d/CSG.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public CSG prepForManufacturing() {
if (ret == null)
return null;
ret.setName(getName());
//ret.setColor(getColor());
ret.color=color;
ret.slicePlanes = slicePlanes;
ret.mapOfparametrics = mapOfparametrics;
ret.exportFormats = exportFormats;
Expand Down Expand Up @@ -1206,12 +1206,13 @@ public CSG difference(CSG csg) {
* @return the csg
*/
private CSG _differenceCSGBoundsOpt(CSG csg) {
CSG a1 = this._differenceNoOpt(csg.getBounds().toCSG().setColor(csg.getColor()));
CSG a2 = this.intersect(csg.getBounds().toCSG().setColor(csg.getColor()));
CSG a1 = this._differenceNoOpt(csg.getBounds().toCSG());
CSG a2 = this.intersect(csg.getBounds().toCSG());
CSG result = a2._differenceNoOpt(csg)._unionIntersectOpt(a1).optimization(getOptType());
if (getName().length() != 0 && csg.getName().length() != 0) {
result.setName( name);
}
result.color=color;
return result;
}

Expand Down Expand Up @@ -2201,6 +2202,7 @@ public CSG historySync(CSG dyingCSG) {
}
if (getName().length() == 0)
setName(dyingCSG.getName());
color=dyingCSG.getColor();
return this;
}

Expand Down Expand Up @@ -2316,10 +2318,11 @@ public Set<String> getParameters() {

public CSG setParameterNewValue(String key, double newValue) {
IParametric function = getMapOfparametrics().get(key);
if (function != null)
return function.change(this, key, new Long((long) (newValue * 1000))).setManipulator(this.getManipulator())
//.setColor(this.getColor())
;
if (function != null) {
CSG setManipulator = function.change(this, key, new Long((long) (newValue * 1000))).setManipulator(this.getManipulator());
setManipulator.color=color;
return setManipulator;
}
return this;
}

Expand All @@ -2334,8 +2337,7 @@ public CSG regenerate() {
return this;
CSG regenerate2 = regenerate.regenerate(this);
if (regenerate2 != null)
return regenerate2.setManipulator(this.getManipulator())//.setColor(this.getColor())
;
return regenerate2.setManipulator(this.getManipulator()).historySync(this); ;
return this;
}

Expand Down

0 comments on commit 363c3e0

Please sign in to comment.