Skip to content

Commit

Permalink
Set the color of the extrusions based on the SVG color for the polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Jan 11, 2025
1 parent 7cb7701 commit 5cf631a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ repositories {

dependencies {

api 'com.neuronrobotics:JavaCad:2.1.1'
api 'com.neuronrobotics:JavaCad:2.2.0'
api project('java-bowler')
api project('GithubPasswordManager:GithubPasswordManager')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import eu.mihosoft.vrl.v3d.parametrics.LengthParameter;
import eu.mihosoft.vrl.v3d.parametrics.StringParameter;
import eu.mihosoft.vrl.v3d.svg.SVGLoad;
import javafx.scene.paint.Color;

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


private CSG processGiven( Polygon p, Bounds b, int j, String name) {
Color c=p.getColor();
if(c==null)
c=Color.ROSYBROWN;
boolean hole = p.isHole();
CSG csg = sweep(p,name,b);

Transform nrToCSG = TransformFactory.nrToCSG(getLocation());
String pathname;
try {
Expand All @@ -233,6 +239,8 @@ private CSG processGiven( Polygon p, Bounds b, int j, String name) {
.setParameter(angle)
.setParameter(z)
.setParameter(radius)
.setColor(c)
.setIsHole(hole)
.setRegenerate(previous -> {
try {
File file = getFile();
Expand Down

0 comments on commit 5cf631a

Please sign in to comment.