Skip to content

Commit 5cf631a

Browse files
committed
Set the color of the extrusions based on the SVG color for the polygon
1 parent 7cb7701 commit 5cf631a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ repositories {
156156

157157
dependencies {
158158

159-
api 'com.neuronrobotics:JavaCad:2.1.1'
159+
api 'com.neuronrobotics:JavaCad:2.2.0'
160160
api project('java-bowler')
161161
api project('GithubPasswordManager:GithubPasswordManager')
162162

src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/Sweep.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import eu.mihosoft.vrl.v3d.parametrics.LengthParameter;
2929
import eu.mihosoft.vrl.v3d.parametrics.StringParameter;
3030
import eu.mihosoft.vrl.v3d.svg.SVGLoad;
31+
import javafx.scene.paint.Color;
3132

3233
public class Sweep extends AbstractAddFrom{
3334
@Expose(serialize = true, deserialize = true)
@@ -211,7 +212,12 @@ public File getFile() throws NoSuchFileException {
211212

212213

213214
private CSG processGiven( Polygon p, Bounds b, int j, String name) {
215+
Color c=p.getColor();
216+
if(c==null)
217+
c=Color.ROSYBROWN;
218+
boolean hole = p.isHole();
214219
CSG csg = sweep(p,name,b);
220+
215221
Transform nrToCSG = TransformFactory.nrToCSG(getLocation());
216222
String pathname;
217223
try {
@@ -233,6 +239,8 @@ private CSG processGiven( Polygon p, Bounds b, int j, String name) {
233239
.setParameter(angle)
234240
.setParameter(z)
235241
.setParameter(radius)
242+
.setColor(c)
243+
.setIsHole(hole)
236244
.setRegenerate(previous -> {
237245
try {
238246
File file = getFile();

0 commit comments

Comments
 (0)